psci-lib-integration-guide.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  1. PSCI Library Integration guide for Armv8-A AArch32 systems
  2. ==========================================================
  3. This document describes the PSCI library interface with a focus on how to
  4. integrate with a suitable Trusted OS for an Armv8-A AArch32 system. The PSCI
  5. Library implements the PSCI Standard as described in `PSCI`_ and is meant
  6. to be integrated with EL3 Runtime Software which invokes the PSCI Library
  7. interface appropriately. **EL3 Runtime Software** refers to software executing
  8. at the highest secure privileged mode, which is EL3 in AArch64 or Secure SVC/
  9. Monitor mode in AArch32, and provides runtime services to the non-secure world.
  10. The runtime service request is made via SMC (Secure Monitor Call) and the call
  11. must adhere to `SMCCC`_. In AArch32, EL3 Runtime Software may additionally
  12. include Trusted OS functionality. A minimal AArch32 Secure Payload, SP-MIN, is
  13. provided in Trusted Firmware-A (TF-A) to illustrate the usage and integration
  14. of the PSCI library. The description of PSCI library interface and its
  15. integration with EL3 Runtime Software in this document is targeted towards
  16. AArch32 systems.
  17. Generic call sequence for PSCI Library interface (AArch32)
  18. ----------------------------------------------------------
  19. The generic call sequence of PSCI Library interfaces (see
  20. `PSCI Library Interface`_) during cold boot in AArch32
  21. system is described below:
  22. #. After cold reset, the EL3 Runtime Software performs its cold boot
  23. initialization including the PSCI library pre-requisites mentioned in
  24. `PSCI Library Interface`_, and also the necessary platform
  25. setup.
  26. #. Call ``psci_setup()`` in Monitor mode.
  27. #. Optionally call ``psci_register_spd_pm_hook()`` to register callbacks to
  28. do bookkeeping for the EL3 Runtime Software during power management.
  29. #. Call ``psci_prepare_next_non_secure_ctx()`` to initialize the non-secure CPU
  30. context.
  31. #. Get the non-secure ``cpu_context_t`` for the current CPU by calling
  32. ``cm_get_context()`` , then programming the registers in the non-secure
  33. context and exiting to non-secure world. If the EL3 Runtime Software needs
  34. additional configuration to be set for non-secure context, like routing
  35. FIQs to the secure world, the values of the registers can be modified prior
  36. to programming. See `PSCI CPU context management`_ for more
  37. details on CPU context management.
  38. The generic call sequence of PSCI library interfaces during warm boot in
  39. AArch32 systems is described below:
  40. #. After warm reset, the EL3 Runtime Software performs the necessary warm
  41. boot initialization including the PSCI library pre-requisites mentioned in
  42. `PSCI Library Interface`_ (Note that the Data cache
  43. **must not** be enabled).
  44. #. Call ``psci_warmboot_entrypoint()`` in Monitor mode. This interface
  45. initializes/restores the non-secure CPU context as well.
  46. #. Do step 5 of the cold boot call sequence described above.
  47. The generic call sequence of PSCI library interfaces on receipt of a PSCI SMC
  48. on an AArch32 system is described below:
  49. #. On receipt of an SMC, save the register context as per `SMCCC`_.
  50. #. If the SMC function identifier corresponds to a SMC32 PSCI API, construct
  51. the appropriate arguments and call the ``psci_smc_handler()`` interface.
  52. The invocation may or may not return back to the caller depending on
  53. whether the PSCI API resulted in power down of the CPU.
  54. #. If ``psci_smc_handler()`` returns, populate the return value in R0 (AArch32)/
  55. X0 (AArch64) and restore other registers as per `SMCCC`_.
  56. PSCI CPU context management
  57. ---------------------------
  58. PSCI library is in charge of initializing/restoring the non-secure CPU system
  59. registers according to `PSCI`_ during cold/warm boot.
  60. This is referred to as ``PSCI CPU Context Management``. Registers that need to
  61. be preserved across CPU power down/power up cycles are maintained in
  62. ``cpu_context_t`` data structure. The initialization of other non-secure CPU
  63. system registers which do not require coordination with the EL3 Runtime
  64. Software is done directly by the PSCI library (see ``cm_prepare_el3_exit()``).
  65. The EL3 Runtime Software is responsible for managing register context
  66. during switch between Normal and Secure worlds. The register context to be
  67. saved and restored depends on the mechanism used to trigger the world switch.
  68. For example, if the world switch was triggered by an SMC call, then the
  69. registers need to be saved and restored according to `SMCCC`_. In AArch64,
  70. due to the tight integration with BL31, both BL31 and PSCI library
  71. use the same ``cpu_context_t`` data structure for PSCI CPU context management
  72. and register context management during world switch. This cannot be assumed
  73. for AArch32 EL3 Runtime Software since most AArch32 Trusted OSes already implement
  74. a mechanism for register context management during world switch. Hence, when
  75. the PSCI library is integrated with a AArch32 EL3 Runtime Software, the
  76. ``cpu_context_t`` is stripped down for just PSCI CPU context management.
  77. During cold/warm boot, after invoking appropriate PSCI library interfaces, it
  78. is expected that the EL3 Runtime Software will query the ``cpu_context_t`` and
  79. write appropriate values to the corresponding system registers. This mechanism
  80. resolves 2 additional problems for AArch32 EL3 Runtime Software:
  81. #. Values for certain system registers like SCR and SCTLR cannot be
  82. unilaterally determined by PSCI library and need inputs from the EL3
  83. Runtime Software. Using ``cpu_context_t`` as an intermediary data store
  84. allows EL3 Runtime Software to modify the register values appropriately
  85. before programming them.
  86. #. The PSCI library provides appropriate LR and SPSR values (entrypoint
  87. information) for exit into non-secure world. Using ``cpu_context_t`` as an
  88. intermediary data store allows the EL3 Runtime Software to store these
  89. values safely until it is ready for exit to non-secure world.
  90. Currently the ``cpu_context_t`` data structure for AArch32 stores the following
  91. registers: R0 - R3, LR (R14), SCR, SPSR, SCTLR.
  92. The EL3 Runtime Software must implement accessors to get/set pointers
  93. to CPU context ``cpu_context_t`` data and these are described in
  94. `CPU Context management API`_.
  95. PSCI Library Interface
  96. ----------------------
  97. The PSCI library implements the `PSCI`_. The interfaces to this library are
  98. declared in ``psci_lib.h`` and are as listed below:
  99. .. code:: c
  100. u_register_t psci_smc_handler(uint32_t smc_fid, u_register_t x1,
  101. u_register_t x2, u_register_t x3,
  102. u_register_t x4, void *cookie,
  103. void *handle, u_register_t flags);
  104. int psci_setup(const psci_lib_args_t *lib_args);
  105. void psci_warmboot_entrypoint(void);
  106. void psci_register_spd_pm_hook(const spd_pm_ops_t *pm);
  107. void psci_prepare_next_non_secure_ctx(entry_point_info_t *next_image_info);
  108. The CPU context data 'cpu_context_t' is programmed to the registers differently
  109. when PSCI is integrated with an AArch32 EL3 Runtime Software compared to
  110. when the PSCI is integrated with an AArch64 EL3 Runtime Software (BL31). For
  111. example, in the case of AArch64, there is no need to retrieve ``cpu_context_t``
  112. data and program the registers as it will done implicitly as part of
  113. ``el3_exit``. The description below of the PSCI interfaces is targeted at
  114. integration with an AArch32 EL3 Runtime Software.
  115. The PSCI library is responsible for initializing/restoring the non-secure world
  116. to an appropriate state after boot and may choose to directly program the
  117. non-secure system registers. The PSCI generic code takes care not to directly
  118. modify any of the system registers affecting the secure world and instead
  119. returns the values to be programmed to these registers via ``cpu_context_t``.
  120. The EL3 Runtime Software is responsible for programming those registers and
  121. can use the proposed values provided in the ``cpu_context_t``, modifying the
  122. values if required.
  123. PSCI library needs the flexibility to access both secure and non-secure
  124. copies of banked registers. Hence it needs to be invoked in Monitor mode
  125. for AArch32 and in EL3 for AArch64. The NS bit in SCR (in AArch32) or SCR_EL3
  126. (in AArch64) must be set to 0. Additional requirements for the PSCI library
  127. interfaces are:
  128. - Instruction cache must be enabled
  129. - Both IRQ and FIQ must be masked for the current CPU
  130. - The page tables must be setup and the MMU enabled
  131. - The C runtime environment must be setup and stack initialized
  132. - The Data cache must be enabled prior to invoking any of the PSCI library
  133. interfaces except for ``psci_warmboot_entrypoint()``. For
  134. ``psci_warmboot_entrypoint()``, if the build option ``HW_ASSISTED_COHERENCY``
  135. is enabled however, data caches are expected to be enabled.
  136. Further requirements for each interface can be found in the interface
  137. description.
  138. Interface : psci_setup()
  139. ~~~~~~~~~~~~~~~~~~~~~~~~
  140. ::
  141. Argument : const psci_lib_args_t *lib_args
  142. Return : void
  143. This function is to be called by the primary CPU during cold boot before
  144. any other interface to the PSCI library. It takes ``lib_args``, a const pointer
  145. to ``psci_lib_args_t``, as the argument. The ``psci_lib_args_t`` is a versioned
  146. structure and is declared in ``psci_lib.h`` header as follows:
  147. .. code:: c
  148. typedef struct psci_lib_args {
  149. /* The version information of PSCI Library Interface */
  150. param_header_t h;
  151. /* The warm boot entrypoint function */
  152. mailbox_entrypoint_t mailbox_ep;
  153. } psci_lib_args_t;
  154. The first field ``h``, of ``param_header_t`` type, provides the version
  155. information. The second field ``mailbox_ep`` is the warm boot entrypoint address
  156. and is used to configure the platform mailbox. Helper macros are provided in
  157. ``psci_lib.h`` to construct the ``lib_args`` argument statically or during
  158. runtime. Prior to calling the ``psci_setup()`` interface, the platform setup for
  159. cold boot must have completed. Major actions performed by this interface are:
  160. - Initializes architecture.
  161. - Initializes PSCI power domain and state coordination data structures.
  162. - Calls ``plat_setup_psci_ops()`` with warm boot entrypoint ``mailbox_ep`` as
  163. argument.
  164. - Calls ``cm_set_context_by_index()`` (see
  165. `CPU Context management API`_) for all the CPUs in the
  166. platform
  167. Interface : psci_prepare_next_non_secure_ctx()
  168. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  169. ::
  170. Argument : entry_point_info_t *next_image_info
  171. Return : void
  172. After ``psci_setup()`` and prior to exit to the non-secure world, this function
  173. must be called by the EL3 Runtime Software to initialize the non-secure world
  174. context. The non-secure world entrypoint information ``next_image_info`` (first
  175. argument) will be used to determine the non-secure context. After this function
  176. returns, the EL3 Runtime Software must retrieve the ``cpu_context_t`` (using
  177. cm_get_context()) for the current CPU and program the registers prior to exit
  178. to the non-secure world.
  179. Interface : psci_register_spd_pm_hook()
  180. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181. ::
  182. Argument : const spd_pm_ops_t *
  183. Return : void
  184. As explained in `Secure payload power management callback`_,
  185. the EL3 Runtime Software may want to perform some bookkeeping during power
  186. management operations. This function is used to register the ``spd_pm_ops_t``
  187. (first argument) callbacks with the PSCI library which will be called
  188. appropriately during power management. Calling this function is optional and
  189. need to be called by the primary CPU during the cold boot sequence after
  190. ``psci_setup()`` has completed.
  191. Interface : psci_smc_handler()
  192. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  193. ::
  194. Argument : uint32_t smc_fid, u_register_t x1,
  195. u_register_t x2, u_register_t x3,
  196. u_register_t x4, void *cookie,
  197. void *handle, u_register_t flags
  198. Return : u_register_t
  199. This function is the top level handler for SMCs which fall within the
  200. PSCI service range specified in `SMCCC`_. The function ID ``smc_fid`` (first
  201. argument) determines the PSCI API to be called. The ``x1`` to ``x4`` (2nd to 5th
  202. arguments), are the values of the registers r1 - r4 (in AArch32) or x1 - x4
  203. (in AArch64) when the SMC is received. These are the arguments to PSCI API as
  204. described in `PSCI`_. The 'flags' (8th argument) is a bit field parameter
  205. and is detailed in 'smccc.h' header. It includes whether the call is from the
  206. secure or non-secure world. The ``cookie`` (6th argument) and the ``handle``
  207. (7th argument) are not used and are reserved for future use.
  208. The return value from this interface is the return value from the underlying
  209. PSCI API corresponding to ``smc_fid``. This function may not return back to the
  210. caller if PSCI API causes power down of the CPU. In this case, when the CPU
  211. wakes up, it will start execution from the warm reset address.
  212. Interface : psci_warmboot_entrypoint()
  213. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  214. ::
  215. Argument : void
  216. Return : void
  217. This function performs the warm boot initialization/restoration as mandated by
  218. `PSCI`_. For AArch32, on wakeup from power down the CPU resets to secure SVC
  219. mode and the EL3 Runtime Software must perform the prerequisite initializations
  220. mentioned at top of this section. This function must be called with Data cache
  221. disabled (unless build option ``HW_ASSISTED_COHERENCY`` is enabled) but with MMU
  222. initialized and enabled. The major actions performed by this function are:
  223. - Invalidates the stack and enables the data cache.
  224. - Initializes architecture and PSCI state coordination.
  225. - Restores/Initializes the peripheral drivers to the required state via
  226. appropriate ``plat_psci_ops_t`` hooks
  227. - Restores the EL3 Runtime Software context via appropriate ``spd_pm_ops_t``
  228. callbacks.
  229. - Restores/Initializes the non-secure context and populates the
  230. ``cpu_context_t`` for the current CPU.
  231. Upon the return of this function, the EL3 Runtime Software must retrieve the
  232. non-secure ``cpu_context_t`` using ``cm_get_context()`` and program the registers
  233. prior to exit to the non-secure world.
  234. EL3 Runtime Software dependencies
  235. ---------------------------------
  236. The PSCI Library includes supporting frameworks like context management,
  237. cpu operations (cpu_ops) and per-cpu data framework. Other helper library
  238. functions like bakery locks and spin locks are also included in the library.
  239. The dependencies which must be fulfilled by the EL3 Runtime Software
  240. for integration with PSCI library are described below.
  241. General dependencies
  242. ~~~~~~~~~~~~~~~~~~~~
  243. The PSCI library being a Multiprocessor (MP) implementation, EL3 Runtime
  244. Software must provide an SMC handling framework capable of MP adhering to
  245. `SMCCC`_ specification.
  246. The EL3 Runtime Software must also export cache maintenance primitives
  247. and some helper utilities for assert, print and memory operations as listed
  248. below. The TF-A source tree provides implementations for all
  249. these functions but the EL3 Runtime Software may use its own implementation.
  250. **Functions : assert(), memcpy(), memset(), printf()**
  251. These must be implemented as described in ISO C Standard.
  252. **Function : flush_dcache_range()**
  253. ::
  254. Argument : uintptr_t addr, size_t size
  255. Return : void
  256. This function cleans and invalidates (flushes) the data cache for memory
  257. at address ``addr`` (first argument) address and of size ``size`` (second argument).
  258. **Function : inv_dcache_range()**
  259. ::
  260. Argument : uintptr_t addr, size_t size
  261. Return : void
  262. This function invalidates (flushes) the data cache for memory at address
  263. ``addr`` (first argument) address and of size ``size`` (second argument).
  264. CPU Context management API
  265. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  266. The CPU context management data memory is statically allocated by PSCI library
  267. in BSS section. The PSCI library requires the EL3 Runtime Software to implement
  268. APIs to store and retrieve pointers to this CPU context data. SP-MIN
  269. demonstrates how these APIs can be implemented but the EL3 Runtime Software can
  270. choose a more optimal implementation (like dedicating the secure TPIDRPRW
  271. system register (in AArch32) for storing these pointers).
  272. **Function : cm_set_context_by_index()**
  273. ::
  274. Argument : unsigned int cpu_idx, void *context, unsigned int security_state
  275. Return : void
  276. This function is called during cold boot when the ``psci_setup()`` PSCI library
  277. interface is called.
  278. This function must store the pointer to the CPU context data, ``context`` (2nd
  279. argument), for the specified ``security_state`` (3rd argument) and CPU identified
  280. by ``cpu_idx`` (first argument). The ``security_state`` will always be non-secure
  281. when called by PSCI library and this argument is retained for compatibility
  282. with BL31. The ``cpu_idx`` will correspond to the index returned by the
  283. ``plat_core_pos_by_mpidr()`` for ``mpidr`` of the CPU.
  284. The actual method of storing the ``context`` pointers is implementation specific.
  285. For example, SP-MIN stores the pointers in the array ``sp_min_cpu_ctx_ptr``
  286. declared in ``sp_min_main.c``.
  287. **Function : cm_get_context()**
  288. ::
  289. Argument : uint32_t security_state
  290. Return : void *
  291. This function must return the pointer to the ``cpu_context_t`` structure for
  292. the specified ``security_state`` (first argument) for the current CPU. The caller
  293. must ensure that ``cm_set_context_by_index`` is called first and the appropriate
  294. context pointers are stored prior to invoking this API. The ``security_state``
  295. will always be non-secure when called by PSCI library and this argument
  296. is retained for compatibility with BL31.
  297. **Function : cm_get_context_by_index()**
  298. ::
  299. Argument : unsigned int cpu_idx, unsigned int security_state
  300. Return : void *
  301. This function must return the pointer to the ``cpu_context_t`` structure for
  302. the specified ``security_state`` (second argument) for the CPU identified by
  303. ``cpu_idx`` (first argument). The caller must ensure that
  304. ``cm_set_context_by_index`` is called first and the appropriate context
  305. pointers are stored prior to invoking this API. The ``security_state`` will
  306. always be non-secure when called by PSCI library and this argument is
  307. retained for compatibility with BL31. The ``cpu_idx`` will correspond to the
  308. index returned by the ``plat_core_pos_by_mpidr()`` for ``mpidr`` of the CPU.
  309. Platform API
  310. ~~~~~~~~~~~~
  311. The platform layer abstracts the platform-specific details from the generic
  312. PSCI library. The following platform APIs/macros must be defined by the EL3
  313. Runtime Software for integration with the PSCI library.
  314. The mandatory platform APIs are:
  315. - plat_my_core_pos
  316. - plat_core_pos_by_mpidr
  317. - plat_get_syscnt_freq2
  318. - plat_get_power_domain_tree_desc
  319. - plat_setup_psci_ops
  320. - plat_reset_handler
  321. - plat_panic_handler
  322. - plat_get_my_stack
  323. The mandatory platform macros are:
  324. - PLATFORM_CORE_COUNT
  325. - PLAT_MAX_PWR_LVL
  326. - PLAT_NUM_PWR_DOMAINS
  327. - CACHE_WRITEBACK_GRANULE
  328. - PLAT_MAX_OFF_STATE
  329. - PLAT_MAX_RET_STATE
  330. - PLAT_MAX_PWR_LVL_STATES (optional)
  331. - PLAT_PCPU_DATA_SIZE (optional)
  332. The details of these APIs/macros can be found in the :ref:`Porting Guide`.
  333. All platform specific operations for power management are done via
  334. ``plat_psci_ops_t`` callbacks registered by the platform when
  335. ``plat_setup_psci_ops()`` API is called. The description of each of
  336. the callbacks in ``plat_psci_ops_t`` can be found in PSCI section of the
  337. :ref:`Porting Guide`. If any these callbacks are not registered, then the
  338. PSCI API associated with that callback will not be supported by PSCI
  339. library.
  340. Secure payload power management callback
  341. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  342. During PSCI power management operations, the EL3 Runtime Software may
  343. need to perform some bookkeeping, and PSCI library provides
  344. ``spd_pm_ops_t`` callbacks for this purpose. These hooks must be
  345. populated and registered by using ``psci_register_spd_pm_hook()`` PSCI
  346. library interface.
  347. Typical bookkeeping during PSCI power management calls include save/restore
  348. of the EL3 Runtime Software context. Also if the EL3 Runtime Software makes
  349. use of secure interrupts, then these interrupts must also be managed
  350. appropriately during CPU power down/power up. Any secure interrupt targeted
  351. to the current CPU must be disabled or re-targeted to other running CPU prior
  352. to power down of the current CPU. During power up, these interrupt can be
  353. enabled/re-targeted back to the current CPU.
  354. .. code:: c
  355. typedef struct spd_pm_ops {
  356. void (*svc_on)(u_register_t target_cpu);
  357. int32_t (*svc_off)(u_register_t __unused);
  358. void (*svc_suspend)(u_register_t max_off_pwrlvl);
  359. void (*svc_on_finish)(u_register_t __unused);
  360. void (*svc_suspend_finish)(u_register_t max_off_pwrlvl);
  361. int32_t (*svc_migrate)(u_register_t from_cpu, u_register_t to_cpu);
  362. int32_t (*svc_migrate_info)(u_register_t *resident_cpu);
  363. void (*svc_system_off)(void);
  364. void (*svc_system_reset)(void);
  365. } spd_pm_ops_t;
  366. A brief description of each callback is given below:
  367. - svc_on, svc_off, svc_on_finish
  368. The ``svc_on``, ``svc_off`` callbacks are called during PSCI_CPU_ON,
  369. PSCI_CPU_OFF APIs respectively. The ``svc_on_finish`` is called when the
  370. target CPU of PSCI_CPU_ON API powers up and executes the
  371. ``psci_warmboot_entrypoint()`` PSCI library interface.
  372. - svc_suspend, svc_suspend_finish
  373. The ``svc_suspend`` callback is called during power down bu either
  374. PSCI_SUSPEND or PSCI_SYSTEM_SUSPEND APIs. The ``svc_suspend_finish`` is
  375. called when the CPU wakes up from suspend and executes the
  376. ``psci_warmboot_entrypoint()`` PSCI library interface. The ``max_off_pwrlvl``
  377. (first parameter) denotes the highest power domain level being powered down
  378. to or woken up from suspend.
  379. - svc_system_off, svc_system_reset
  380. These callbacks are called during PSCI_SYSTEM_OFF and PSCI_SYSTEM_RESET
  381. PSCI APIs respectively.
  382. - svc_migrate_info
  383. This callback is called in response to PSCI_MIGRATE_INFO_TYPE or
  384. PSCI_MIGRATE_INFO_UP_CPU APIs. The return value of this callback must
  385. correspond to the return value of PSCI_MIGRATE_INFO_TYPE API as described
  386. in `PSCI`_. If the secure payload is a Uniprocessor (UP)
  387. implementation, then it must update the mpidr of the CPU it is resident in
  388. via ``resident_cpu`` (first argument). The updates to ``resident_cpu`` is
  389. ignored if the secure payload is a multiprocessor (MP) implementation.
  390. - svc_migrate
  391. This callback is only relevant if the secure payload in EL3 Runtime
  392. Software is a Uniprocessor (UP) implementation and supports migration from
  393. the current CPU ``from_cpu`` (first argument) to another CPU ``to_cpu``
  394. (second argument). This callback is called in response to PSCI_MIGRATE
  395. API. This callback is never called if the secure payload is a
  396. Multiprocessor (MP) implementation.
  397. CPU operations
  398. ~~~~~~~~~~~~~~
  399. The CPU operations (cpu_ops) framework implement power down sequence specific
  400. to the CPU and the details of which can be found at
  401. :ref:`firmware_design_cpu_ops_fwk`. The TF-A tree implements the ``cpu_ops``
  402. for various supported CPUs and the EL3 Runtime Software needs to include the
  403. required ``cpu_ops`` in its build. The start and end of the ``cpu_ops``
  404. descriptors must be exported by the EL3 Runtime Software via the
  405. ``__CPU_OPS_START__`` and ``__CPU_OPS_END__`` linker symbols.
  406. The ``cpu_ops`` descriptors also include reset sequences and may include errata
  407. workarounds for the CPU. The EL3 Runtime Software can choose to call this
  408. during cold/warm reset if it does not implement its own reset sequence/errata
  409. workarounds.
  410. --------------
  411. *Copyright (c) 2016-2023, Arm Limited and Contributors. All rights reserved.*
  412. .. _PSCI: https://developer.arm.com/documentation/den0022/latest/
  413. .. _SMCCC: https://developer.arm.com/docs/den0028/latest