TF-A Functions - 2023.1 English

Zynq UltraScale+ MPSoC Software Developer Guide (UG1137)

Document ID
UG1137
Release Date
2023-08-04
Version
2023.1 English

The following table lists the TF-A functions:

Note: bl31 is equivalent to the TF-A, which in this case is the secure monitor.
Table 1. TF-A Functions
TF-A Functions Description
bl31_arch_setup(); Generic architectural setup from EL3.
bl31_platform_setup(); Platform setup in BL1.
bl31_lib_init(); Simple function to initialize all BL31 helper libraries.
cm_init(); Context management library initialization routine.
dcsw_op_all(DCCSW); Cleans caches before re-entering the non-secure software world.
(*bl32_init)(); Function pointer to initialize the BL32 image.
runtime_svc_init(); Calls the initialization routine in the descriptor exported by a runtime service. After a descriptor is validated, its start and end owning entity numbers and the call type are combined to form a unique oen. The unique oen is an index into the rt_svc_descs_indices array. This index stores the index of the runtime service descriptor.
validate_rt_svc_desc(); Simple routine to sanity check a runtime service descriptor before it is used.
get_unique_oen(); Gets a unique oen.
bl31_prepare_next_image_entry(); Programs EL3 registers and performs other setup to enable entry into the next image after BL31 at the next ERET.
bl31_get_next_image_type(); Returns the next_image_type.
bl31_plat_get_next_image_ep_info (image_type); Returns a reference to the entry_point_info structure corresponding to the image that runs in the specified security state.
get_security_state () Gets the security state.
cm_init_context() Initializes a cpu_context for the first use by the current CPU, and sets the initial entry point state as specified by the entry_point_info structure.
get_scr_el3_from_routing_model() Returns the cached copy of the SCR_EL3 which contains the routing model (expressed through the IRQ and FIQ bits) for a security state that is stored through a previous call to set_routing_model().
cm_prepare_el3_exit() Prepares the CPU system registers for first entry into the secure or the non-secure software world.
  • If execution is requested to EL2 or hyp mode SCTLR_EL2 is initialized.
  • If execution is requested to the non-secure EL1 or svc mode, and the CPU supports EL2; then EL2 is disabled by configuring all necessary EL2 registers.

For all entries, the EL1 registers are initialized from the cpu_context.

cm_get_context(security_state); Gets the context of the security state.
el1_sysregs_context_restore Restores the context of the system registers.
cm_set_next_context Programs the context used for exception return. This initializes the SP_EL3 to a pointer to a cpu_context set for the required security state.
bl31_register_bl32_init Initializes the pointer to BL32 init function.
bl31_set_next_image_type Accessor function to help runtime services determine which image to execute after BL31.

For more information about TF-A, see Trusted Firmware-A documentation.