Altera HWLIB  16.0
The Altera HW Manager API Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Interrupt Controller CPU Interface [Secure]

Description

This group of APIs provide access, configuration, and control of the individual CPU interfaces.

Functions

ALT_STATUS_CODE alt_int_cpu_init (void)
 
ALT_STATUS_CODE alt_int_cpu_uninit (void)
 
ALT_STATUS_CODE alt_int_cpu_enable (void)
 
ALT_STATUS_CODE alt_int_cpu_disable (void)
 
ALT_STATUS_CODE alt_int_cpu_enable_ns (void)
 
ALT_STATUS_CODE alt_int_cpu_disable_ns (void)
 
ALT_STATUS_CODE alt_int_cpu_enable_all (void)
 
ALT_STATUS_CODE alt_int_cpu_disable_all (void)
 
ALT_STATUS_CODE alt_int_cpu_config_get (bool *use_secure_binary_point, bool *use_FIQ_for_secure_interrupts, bool *allow_secure_ack_all_interrupts)
 
ALT_STATUS_CODE alt_int_cpu_config_set (bool use_secure_binary_point, bool use_FIQ_for_secure_interrupts, bool allow_secure_ack_all_interrupts)
 
uint32_t alt_int_cpu_priority_mask_get (void)
 
ALT_STATUS_CODE alt_int_cpu_priority_mask_set (uint32_t priority_mask)
 
uint32_t alt_int_cpu_binary_point_get (void)
 
ALT_STATUS_CODE alt_int_cpu_binary_point_set (uint32_t binary_point)
 
uint32_t alt_int_cpu_binary_point_get_ns (void)
 
ALT_STATUS_CODE alt_int_cpu_binary_point_set_ns (uint32_t binary_point)
 

Function Documentation

ALT_STATUS_CODE alt_int_cpu_init ( void  )

Performs the initialization steps needed by the interrupt controller CPU interface. This should be the first CPU API call made when using the CPU interface.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_uninit ( void  )

Performs the uninitialization steps needed by the interrupt controller CPU interface.

ALT_STATUS_CODE alt_int_cpu_enable ( void  )

Enables all secure interrupt forwarding from the interrupt controller to the target CPU.

The CPU interrupt monitors all secure interrupt signals and forwards pending interrupts to the processors.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_disable ( void  )

Disables all secure interrupt forwarding from the interrupt controller to the target CPU.

The CPU interface ignores all secure interrupt signals and does not forward pending interrupts to the processors.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_enable_ns ( void  )

Enables all non-secure interrupt forwarding from the interrupt controller to the target CPU using the secure interface.

The CPU interrupt monitors all non-secure interrupt signals and forwards pending interrupts to the processors.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_disable_ns ( void  )

Disables all non-secure interrupt forwarding from the interrupt controller to the target CPU using the secure interface.

The CPU interface ignores all non-secure interrupt signals and does not forward pending interrupts to the processors.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_enable_all ( void  )

Enables all secure and non-secure interrupt forwarding from the interrupt controller to the target CPU.

The CPU interrupt monitors all secure and non-secure interrupt signals and forwards pending interrupts to the processors.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_disable_all ( void  )

Disables all secure and non-secure interrupt forwarding from the interrupt controller to the target CPU.

The CPU interface ignores all secure and non-secure interrupt signals and does not forward pending interrupts to the processors.

Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_config_get ( bool *  use_secure_binary_point,
bool *  use_FIQ_for_secure_interrupts,
bool *  allow_secure_ack_all_interrupts 
)

Gets the configuration of the signaling interface between the GIC and the CPU.

Secure Binary Point for Preemption

The binary point is point at which the priority value fields split into two parts, the group priority field and the subpriority field. The group priority field is used to determine interrupt preemption.

On systems where secure and non-secure interrupts coexist, preemption can be determined by using secure binary point for secure interrupts and non-secure binary point for non-secure interrupts, or by using the secure binary point for both secure and non-secure interrupts.

FIQ for Secure Interrupts

FIQ or Fast Interrupt reQuest is a special interrupt signal specific to ARM CPUs. The CPU supports two interrupt signals for interrupts, the IRQ and FIQ. The FIQ is a separate interrupt signal which has lower latency and different preemption characteristics than regular interrupts.

Secure acknowledgement for all interrupts

When in the secure mode, modifying the non-secure states can be seen as undesireable. One area which this may be problematic is the secure read of the Interrupt Controller CPU Interrupt Acknowledgement Register (ICCIAR) when the next pending interrupt is a non-secure. To prevent this scenario, the CPU can be configured to return a special interrupt ID (1022) and leave the non-secure interrupt in the pending state.

Parameters
use_secure_binary_point[out] Pointer to an output parameter that contains whether the Secure Binary Point Register is used for both secure and non-secure interrupts. If true then use the Secure Binary Point Register for both Secure and Non-secure interrupts. If false then use Secure Binary Point Register for secure interrupts and non-secure Binary Point Register for non-secure interrupts.
use_FIQ_for_secure_interrupts[out] Pointer to an output parameter that contains whether Secure interrupts use the FIQ signal or not. If true then signal Secure interrupts using the FIQ signal. If false then signal Secure interrupts using the IRQ signal.
allow_secure_ack_all_interrupts[out] Pointer to an output parameter that contains whether Secure acknowledgement of a Non-Secure interrupt is completed or not. If true then a Secure acknowledgement of the interrupt is not completed and the Interrupt ID of the Non-secure interrupt is returned. If false then a Secure acknowledgement of the interrupt is not completed and the Interrupt ID of 1022 is returned.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_STATUS_CODE alt_int_cpu_config_set ( bool  use_secure_binary_point,
bool  use_FIQ_for_secure_interrupts,
bool  allow_secure_ack_all_interrupts 
)

Sets the configuration of the signaling interface between the GIC and the CPU.

Secure Binary Point for Preemption

The binary point is point at which the priority value fields split into two parts, the group priority field and the subpriority field. The group priority field is used to determine interrupt preemption.

On systems where secure and non-secure interrupts coexist, preemption can be determined by using secure binary point for secure interrupts and non-secure binary point for non-secure interrupts, or by using the secure binary point for both secure and non-secure interrupts.

FIQ for Secure Interrupts

FIQ or Fast Interrupt reQuest is a special interrupt signal specific to ARM CPUs. The CPU supports two interrupt signals for interrupts, the IRQ and FIQ. The FIQ is a separate interrupt signal which has lower latency and different preemption characteristics than regular interrupts.

Secure acknowledgement for all interrupts

When in the secure mode, modifying the non-secure states can be seen as undesireable. One area which this may be problematic is the secure read of the Interrupt Controller CPU Interrupt Acknowledgement Register (ICCIAR) when the next pending interrupt is a non-secure. To prevent this scenario, the CPU can be configured to return a special interrupt ID (1022) and leave the non-secure interrupt in the pending state.

Parameters
use_secure_binary_pointIf true then use the Secure Binary Point Register for both secure and non-secure interrupts. If false then use Secure Binary Point Register for secure interrupts and non-secure Binary Point Register for non-secure interrupts.
use_FIQ_for_secure_interruptsIf true then signal secure interrupts using the FIQ signal. If false then signal secure interrupts using the IRQ signal.
allow_secure_ack_all_interruptsControls whether a secure acknowledgement of an interrupt, when the highest priority pending interrupt is non-secure, causes the CPU interface to acknowledge the interrupt. If true then a secure acknowledgement of the interrupt is not completed and the Interrupt ID of the Non-secure interrupt is returned. If false then a secure acknowledgement of the interrupt is not completed and the Interrupt ID of 1022 is returned.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
uint32_t alt_int_cpu_priority_mask_get ( void  )

Gets the secure interrupt priority mask for the current CPU. Only interrupts with a higher priority than the priority mask can be forwarded to the CPU.

Returns
The interrupt priority mask used to determine interrupt preemption.
ALT_STATUS_CODE alt_int_cpu_priority_mask_set ( uint32_t  priority_mask)

Sets the secure interrupt priority mask for the current CPU. Only interrupts with a higher priority than the priority mask can be forwarded to the CPU.

Parameters
priority_maskThe interrupt priority mask is the group priority needed to instruct the GIC to preempt lower priority interrupt. The valid range for this value is 0 - 255.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given priority mask is invalid.
uint32_t alt_int_cpu_binary_point_get ( void  )

Gets the binary point value for the current CPU.

The binary point is point at which the priority value fields split into two parts, the group priority field and the subpriority field. The group priority field is used to determine interrupt preemption.

Returns
The configured binary point value.
ALT_STATUS_CODE alt_int_cpu_binary_point_set ( uint32_t  binary_point)

Sets the binary point value for the current CPU.

The binary point is point at which the priority value fields split into two parts, the group priority field and the subpriority field. The group priority field is used to determine interrupt preemption.

Parameters
binary_pointThe binary point to use. The valid range for the value is 0 - 7.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given binary point value is invalid.
uint32_t alt_int_cpu_binary_point_get_ns ( void  )

Gets the non-secure binary point value for the current CPU using the secure interface.

The binary point is point at which the priority value fields split into two parts, the group priority field and the subpriority field. The group priority field is used to determine interrupt preemption.

Returns
The configured binary point value.
ALT_STATUS_CODE alt_int_cpu_binary_point_set_ns ( uint32_t  binary_point)

Sets the non-secure binary point value for the current CPU using the secure interface.

The binary point is point at which the priority value fields split into two parts, the group priority field and the subpriority field. The group priority field is used to determine interrupt preemption.

Parameters
binary_pointThe binary point to use. The valid range for the value is 0 - 7.
Return values
ALT_E_SUCCESSThe operation was successful.
ALT_E_ERRORThe operation failed.
ALT_E_BAD_ARGThe given binary point value is invalid.