blob: b77377f1874aa2b6b3f4d2e57cfe75fc01814abd [file] [log] [blame] [view]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001ARM Trusted Firmware Porting Guide
2==================================
3
4Contents
5--------
6
Joakim Bech14a5b342014-11-25 10:55:26 +010071. [Introduction](#1--introduction)
82. [Common Modifications](#2--common-modifications)
9 * [Common mandatory modifications](#21-common-mandatory-modifications)
10 * [Handling reset](#22-handling-reset)
Soby Mathew58523c02015-06-08 12:32:50 +010011 * [Common mandatory modifications](#23-common-mandatory-modifications)
12 * [Common optional modifications](#24-common-optional-modifications)
Joakim Bech14a5b342014-11-25 10:55:26 +0100133. [Boot Loader stage specific modifications](#3--modifications-specific-to-a-boot-loader-stage)
14 * [Boot Loader stage 1 (BL1)](#31-boot-loader-stage-1-bl1)
15 * [Boot Loader stage 2 (BL2)](#32-boot-loader-stage-2-bl2)
16 * [Boot Loader stage 3-1 (BL3-1)](#32-boot-loader-stage-3-1-bl3-1)
17 * [PSCI implementation (in BL3-1)](#33-power-state-coordination-interface-in-bl3-1)
18 * [Interrupt Management framework (in BL3-1)](#34--interrupt-management-framework-in-bl3-1)
19 * [Crash Reporting mechanism (in BL3-1)](#35--crash-reporting-mechanism-in-bl3-1)
204. [Build flags](#4--build-flags)
215. [C Library](#5--c-library)
226. [Storage abstraction layer](#6--storage-abstraction-layer)
Achin Gupta4f6ad662013-10-25 09:08:21 +010023
24- - - - - - - - - - - - - - - - - -
25
261. Introduction
27----------------
28
Soby Mathew58523c02015-06-08 12:32:50 +010029Please note that this document has been updated for the new platform API
30as required by the PSCI v1.0 implementation. Please refer to the
31[Migration Guide] for the previous platform API.
32
Achin Gupta4f6ad662013-10-25 09:08:21 +010033Porting the ARM Trusted Firmware to a new platform involves making some
34mandatory and optional modifications for both the cold and warm boot paths.
35Modifications consist of:
36
37* Implementing a platform-specific function or variable,
38* Setting up the execution context in a certain way, or
39* Defining certain constants (for example #defines).
40
Dan Handley4a75b842015-03-19 19:24:43 +000041The platform-specific functions and variables are declared in
Dan Handleyb68954c2014-05-29 12:30:24 +010042[include/plat/common/platform.h]. The firmware provides a default implementation
43of variables and functions to fulfill the optional requirements. These
44implementations are all weakly defined; they are provided to ease the porting
45effort. Each platform port can override them with its own implementation if the
46default implementation is inadequate.
Achin Gupta4f6ad662013-10-25 09:08:21 +010047
Dan Handley4a75b842015-03-19 19:24:43 +000048Platform ports that want to be aligned with standard ARM platforms (for example
49FVP and Juno) may also use [include/plat/arm/common/plat_arm.h] and the
50corresponding source files in `plat/arm/common/`. These provide standard
51implementations for some of the required platform porting functions. However,
52using these functions requires the platform port to implement additional
53ARM standard platform porting functions. These additional functions are not
54documented here.
55
Achin Gupta4f6ad662013-10-25 09:08:21 +010056Some modifications are common to all Boot Loader (BL) stages. Section 2
57discusses these in detail. The subsequent sections discuss the remaining
58modifications for each BL stage in detail.
59
60This document should be read in conjunction with the ARM Trusted Firmware
61[User Guide].
62
63
642. Common modifications
65------------------------
66
67This section covers the modifications that should be made by the platform for
68each BL stage to correctly port the firmware stack. They are categorized as
69either mandatory or optional.
70
71
722.1 Common mandatory modifications
73----------------------------------
74A platform port must enable the Memory Management Unit (MMU) with identity
75mapped page tables, and enable both the instruction and data caches for each BL
Dan Handley4a75b842015-03-19 19:24:43 +000076stage. In ARM standard platforms, each BL stage configures the MMU in
77the platform-specific architecture setup function, `blX_plat_arch_setup()`.
Achin Gupta4f6ad662013-10-25 09:08:21 +010078
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +010079If the build option `USE_COHERENT_MEM` is enabled, each platform can allocate a
Soby Mathewab8707e2015-01-08 18:02:44 +000080block of identity mapped secure memory with Device-nGnRE attributes aligned to
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +010081page boundary (4K) for each BL stage. All sections which allocate coherent
82memory are grouped under `coherent_ram`. For ex: Bakery locks are placed in a
83section identified by name `bakery_lock` inside `coherent_ram` so that its
84possible for the firmware to place variables in it using the following C code
85directive:
Achin Gupta4f6ad662013-10-25 09:08:21 +010086
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +010087 __attribute__ ((section("bakery_lock")))
Achin Gupta4f6ad662013-10-25 09:08:21 +010088
89Or alternatively the following assembler code directive:
90
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +010091 .section bakery_lock
Achin Gupta4f6ad662013-10-25 09:08:21 +010092
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +010093The `coherent_ram` section is a sum of all sections like `bakery_lock` which are
94used to allocate any data structures that are accessed both when a CPU is
95executing with its MMU and caches enabled, and when it's running with its MMU
96and caches disabled. Examples are given below.
Achin Gupta4f6ad662013-10-25 09:08:21 +010097
98The following variables, functions and constants must be defined by the platform
99for the firmware to work correctly.
100
101
Dan Handleyb68954c2014-05-29 12:30:24 +0100102### File : platform_def.h [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100103
Dan Handleyb68954c2014-05-29 12:30:24 +0100104Each platform must ensure that a header file of this name is in the system
105include path with the following constants defined. This may require updating the
Dan Handley4a75b842015-03-19 19:24:43 +0000106list of `PLAT_INCLUDES` in the `platform.mk` file. In the ARM development
107platforms, this file is found in `plat/arm/board/<plat_name>/include/`.
108
109Platform ports may optionally use the file [include/plat/common/common_def.h],
110which provides typical values for some of the constants below. These values are
111likely to be suitable for all platform ports.
112
113Platform ports that want to be aligned with standard ARM platforms (for example
114FVP and Juno) may also use [include/plat/arm/common/arm_def.h], which provides
115standard values for some of the constants below. However, this requires the
116platform port to define additional platform porting constants in
117`platform_def.h`. These additional constants are not documented here.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100118
James Morrisseyba3155b2013-10-29 10:56:46 +0000119* **#define : PLATFORM_LINKER_FORMAT**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100120
121 Defines the linker format used by the platform, for example
Dan Handley4a75b842015-03-19 19:24:43 +0000122 `elf64-littleaarch64`.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100123
James Morrisseyba3155b2013-10-29 10:56:46 +0000124* **#define : PLATFORM_LINKER_ARCH**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100125
126 Defines the processor architecture for the linker by the platform, for
Dan Handley4a75b842015-03-19 19:24:43 +0000127 example `aarch64`.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100128
James Morrisseyba3155b2013-10-29 10:56:46 +0000129* **#define : PLATFORM_STACK_SIZE**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100130
131 Defines the normal stack memory available to each CPU. This constant is used
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000132 by [plat/common/aarch64/platform_mp_stack.S] and
133 [plat/common/aarch64/platform_up_stack.S].
134
Dan Handley4a75b842015-03-19 19:24:43 +0000135* **define : CACHE_WRITEBACK_GRANULE**
136
137 Defines the size in bits of the largest cache line across all the cache
138 levels in the platform.
139
James Morrisseyba3155b2013-10-29 10:56:46 +0000140* **#define : FIRMWARE_WELCOME_STR**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100141
142 Defines the character string printed by BL1 upon entry into the `bl1_main()`
143 function.
144
James Morrisseyba3155b2013-10-29 10:56:46 +0000145* **#define : PLATFORM_CORE_COUNT**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100146
147 Defines the total number of CPUs implemented by the platform across all
148 clusters in the system.
149
Soby Mathew58523c02015-06-08 12:32:50 +0100150* **#define : PLAT_NUM_PWR_DOMAINS**
Andrew Thoelke6c0b45d2014-06-20 00:36:14 +0100151
Soby Mathew58523c02015-06-08 12:32:50 +0100152 Defines the total number of nodes in the power domain topology
153 tree at all the power domain levels used by the platform.
154 This macro is used by the PSCI implementation to allocate
155 data structures to represent power domain topology.
Andrew Thoelke6c0b45d2014-06-20 00:36:14 +0100156
Soby Mathew58523c02015-06-08 12:32:50 +0100157* **#define : PLAT_MAX_PWR_LVL**
Soby Mathew8c32bc22015-02-12 14:45:02 +0000158
Soby Mathew58523c02015-06-08 12:32:50 +0100159 Defines the maximum power domain level that the power management operations
160 should apply to. More often, but not always, the power domain level
161 corresponds to affinity level. This macro allows the PSCI implementation
162 to know the highest power domain level that it should consider for power
163 management operations in the system that the platform implements. For
164 example, the Base AEM FVP implements two clusters with a configurable
165 number of CPUs and it reports the maximum power domain level as 1.
166
167* **#define : PLAT_MAX_OFF_STATE**
168
169 Defines the local power state corresponding to the deepest power down
170 possible at every power domain level in the platform. The local power
171 states for each level may be sparsely allocated between 0 and this value
172 with 0 being reserved for the RUN state. The PSCI implementation uses this
173 value to initialize the local power states of the power domain nodes and
174 to specify the requested power state for a PSCI_CPU_OFF call.
175
176* **#define : PLAT_MAX_RET_STATE**
177
178 Defines the local power state corresponding to the deepest retention state
179 possible at every power domain level in the platform. This macro should be
180 a value less than PLAT_MAX_OFF_STATE and greater than 0. It is used by the
181 PSCI implementation to distuiguish between retention and power down local
182 power states within PSCI_CPU_SUSPEND call.
Soby Mathew8c32bc22015-02-12 14:45:02 +0000183
Sandrine Bailleux638363e2014-05-21 17:08:26 +0100184* **#define : BL1_RO_BASE**
185
186 Defines the base address in secure ROM where BL1 originally lives. Must be
187 aligned on a page-size boundary.
188
189* **#define : BL1_RO_LIMIT**
190
191 Defines the maximum address in secure ROM that BL1's actual content (i.e.
192 excluding any data section allocated at runtime) can occupy.
193
194* **#define : BL1_RW_BASE**
195
196 Defines the base address in secure RAM where BL1's read-write data will live
197 at runtime. Must be aligned on a page-size boundary.
198
199* **#define : BL1_RW_LIMIT**
200
201 Defines the maximum address in secure RAM that BL1's read-write data can
202 occupy at runtime.
203
James Morrisseyba3155b2013-10-29 10:56:46 +0000204* **#define : BL2_BASE**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100205
206 Defines the base address in secure RAM where BL1 loads the BL2 binary image.
Sandrine Bailleuxcd29b0a2013-11-27 10:32:17 +0000207 Must be aligned on a page-size boundary.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100208
Sandrine Bailleux638363e2014-05-21 17:08:26 +0100209* **#define : BL2_LIMIT**
210
211 Defines the maximum address in secure RAM that the BL2 image can occupy.
212
James Morrisseyba3155b2013-10-29 10:56:46 +0000213* **#define : BL31_BASE**
Achin Gupta4f6ad662013-10-25 09:08:21 +0100214
215 Defines the base address in secure RAM where BL2 loads the BL3-1 binary
Sandrine Bailleuxcd29b0a2013-11-27 10:32:17 +0000216 image. Must be aligned on a page-size boundary.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100217
Sandrine Bailleux638363e2014-05-21 17:08:26 +0100218* **#define : BL31_LIMIT**
219
220 Defines the maximum address in secure RAM that the BL3-1 image can occupy.
221
Harry Liebeld265bd72014-01-31 19:04:10 +0000222* **#define : NS_IMAGE_OFFSET**
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100223
Harry Liebeld265bd72014-01-31 19:04:10 +0000224 Defines the base address in non-secure DRAM where BL2 loads the BL3-3 binary
225 image. Must be aligned on a page-size boundary.
226
Juan Castillo16948ae2015-04-13 17:36:19 +0100227For every image, the platform must define individual identifiers that will be
228used by BL1 or BL2 to load the corresponding image into memory from non-volatile
229storage. For the sake of performance, integer numbers will be used as
230identifiers. The platform will use those identifiers to return the relevant
231information about the image to be loaded (file handler, load address,
232authentication information, etc.). The following image identifiers are
233mandatory:
234
235* **#define : BL2_IMAGE_ID**
236
237 BL2 image identifier, used by BL1 to load BL2.
238
239* **#define : BL31_IMAGE_ID**
240
241 BL3-1 image identifier, used by BL2 to load BL3-1.
242
243* **#define : BL33_IMAGE_ID**
244
245 BL3-3 image identifier, used by BL2 to load BL3-3.
246
247If Trusted Board Boot is enabled, the following certificate identifiers must
248also be defined:
249
Juan Castillo516beb52015-12-03 10:19:21 +0000250* **#define : TRUSTED_BOOT_FW_CERT_ID**
Juan Castillo16948ae2015-04-13 17:36:19 +0100251
252 BL2 content certificate identifier, used by BL1 to load the BL2 content
253 certificate.
254
255* **#define : TRUSTED_KEY_CERT_ID**
256
257 Trusted key certificate identifier, used by BL2 to load the trusted key
258 certificate.
259
Juan Castillo516beb52015-12-03 10:19:21 +0000260* **#define : SOC_FW_KEY_CERT_ID**
Juan Castillo16948ae2015-04-13 17:36:19 +0100261
262 BL3-1 key certificate identifier, used by BL2 to load the BL3-1 key
263 certificate.
264
Juan Castillo516beb52015-12-03 10:19:21 +0000265* **#define : SOC_FW_CONTENT_CERT_ID**
Juan Castillo16948ae2015-04-13 17:36:19 +0100266
267 BL3-1 content certificate identifier, used by BL2 to load the BL3-1 content
268 certificate.
269
Juan Castillo516beb52015-12-03 10:19:21 +0000270* **#define : NON_TRUSTED_FW_KEY_CERT_ID**
Juan Castillo16948ae2015-04-13 17:36:19 +0100271
272 BL3-3 key certificate identifier, used by BL2 to load the BL3-3 key
273 certificate.
274
Juan Castillo516beb52015-12-03 10:19:21 +0000275* **#define : NON_TRUSTED_FW_CONTENT_CERT_ID**
Juan Castillo16948ae2015-04-13 17:36:19 +0100276
277 BL3-3 content certificate identifier, used by BL2 to load the BL3-3 content
278 certificate.
279
Achin Gupta8d35f612015-01-25 22:44:23 +0000280If a BL3-0 image is supported by the platform, the following constants must
281also be defined:
282
Juan Castillo16948ae2015-04-13 17:36:19 +0100283* **#define : BL30_IMAGE_ID**
Achin Gupta8d35f612015-01-25 22:44:23 +0000284
Juan Castillo16948ae2015-04-13 17:36:19 +0100285 BL3-0 image identifier, used by BL2 to load BL3-0 into secure memory from
286 platform storage before being transfered to the SCP.
Achin Gupta8d35f612015-01-25 22:44:23 +0000287
Juan Castillo516beb52015-12-03 10:19:21 +0000288* **#define : SCP_FW_KEY_CERT_ID**
Achin Gupta8d35f612015-01-25 22:44:23 +0000289
Juan Castillo16948ae2015-04-13 17:36:19 +0100290 BL3-0 key certificate identifier, used by BL2 to load the BL3-0 key
291 certificate (mandatory when Trusted Board Boot is enabled).
Achin Gupta8d35f612015-01-25 22:44:23 +0000292
Juan Castillo516beb52015-12-03 10:19:21 +0000293* **#define : SCP_FW_CONTENT_CERT_ID**
Achin Gupta8d35f612015-01-25 22:44:23 +0000294
Juan Castillo16948ae2015-04-13 17:36:19 +0100295 BL3-0 content certificate identifier, used by BL2 to load the BL3-0 content
296 certificate (mandatory when Trusted Board Boot is enabled).
Achin Gupta8d35f612015-01-25 22:44:23 +0000297
Dan Handley5a06bb72014-08-04 11:41:20 +0100298If a BL3-2 image is supported by the platform, the following constants must
299also be defined:
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100300
Juan Castillo16948ae2015-04-13 17:36:19 +0100301* **#define : BL32_IMAGE_ID**
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100302
Juan Castillo16948ae2015-04-13 17:36:19 +0100303 BL3-2 image identifier, used by BL2 to load BL3-2.
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100304
Juan Castillo516beb52015-12-03 10:19:21 +0000305* **#define : TRUSTED_OS_FW_KEY_CERT_ID**
Achin Gupta8d35f612015-01-25 22:44:23 +0000306
Juan Castillo16948ae2015-04-13 17:36:19 +0100307 BL3-2 key certificate identifier, used by BL2 to load the BL3-2 key
308 certificate (mandatory when Trusted Board Boot is enabled).
Achin Gupta8d35f612015-01-25 22:44:23 +0000309
Juan Castillo516beb52015-12-03 10:19:21 +0000310* **#define : TRUSTED_OS_FW_CONTENT_CERT_ID**
Achin Gupta8d35f612015-01-25 22:44:23 +0000311
Juan Castillo16948ae2015-04-13 17:36:19 +0100312 BL3-2 content certificate identifier, used by BL2 to load the BL3-2 content
313 certificate (mandatory when Trusted Board Boot is enabled).
Achin Gupta8d35f612015-01-25 22:44:23 +0000314
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100315* **#define : BL32_BASE**
316
317 Defines the base address in secure memory where BL2 loads the BL3-2 binary
Dan Handley5a06bb72014-08-04 11:41:20 +0100318 image. Must be aligned on a page-size boundary.
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100319
320* **#define : BL32_LIMIT**
321
Dan Handley5a06bb72014-08-04 11:41:20 +0100322 Defines the maximum address that the BL3-2 image can occupy.
323
324If the Test Secure-EL1 Payload (TSP) instantiation of BL3-2 is supported by the
325platform, the following constants must also be defined:
326
327* **#define : TSP_SEC_MEM_BASE**
328
329 Defines the base address of the secure memory used by the TSP image on the
330 platform. This must be at the same address or below `BL32_BASE`.
331
332* **#define : TSP_SEC_MEM_SIZE**
333
334 Defines the size of the secure memory used by the BL3-2 image on the
335 platform. `TSP_SEC_MEM_BASE` and `TSP_SEC_MEM_SIZE` must fully accomodate
336 the memory required by the BL3-2 image, defined by `BL32_BASE` and
337 `BL32_LIMIT`.
338
339* **#define : TSP_IRQ_SEC_PHY_TIMER**
340
341 Defines the ID of the secure physical generic timer interrupt used by the
342 TSP's interrupt handling code.
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100343
Dan Handley4a75b842015-03-19 19:24:43 +0000344If the platform port uses the translation table library code, the following
345constant must also be defined:
346
347* **#define : MAX_XLAT_TABLES**
348
349 Defines the maximum number of translation tables that are allocated by the
350 translation table library code. To minimize the amount of runtime memory
351 used, choose the smallest value needed to map the required virtual addresses
352 for each BL stage.
353
Dan Handley6d16ce02014-08-04 18:31:43 +0100354If the platform port uses the IO storage framework, the following constants
355must also be defined:
356
357* **#define : MAX_IO_DEVICES**
358
359 Defines the maximum number of registered IO devices. Attempting to register
360 more devices than this value using `io_register_device()` will fail with
Juan Castillo7e26fe12015-10-01 17:55:11 +0100361 -ENOMEM.
Dan Handley6d16ce02014-08-04 18:31:43 +0100362
363* **#define : MAX_IO_HANDLES**
364
365 Defines the maximum number of open IO handles. Attempting to open more IO
Juan Castillo7e26fe12015-10-01 17:55:11 +0100366 entities than this value using `io_open()` will fail with -ENOMEM.
Dan Handley6d16ce02014-08-04 18:31:43 +0100367
Soby Mathewab8707e2015-01-08 18:02:44 +0000368If the platform needs to allocate data within the per-cpu data framework in
369BL3-1, it should define the following macro. Currently this is only required if
370the platform decides not to use the coherent memory section by undefining the
371USE_COHERENT_MEM build flag. In this case, the framework allocates the required
372memory within the the per-cpu data to minimize wastage.
373
374* **#define : PLAT_PCPU_DATA_SIZE**
375
376 Defines the memory (in bytes) to be reserved within the per-cpu data
377 structure for use by the platform layer.
378
Sandrine Bailleux46d49f632014-06-23 17:00:23 +0100379The following constants are optional. They should be defined when the platform
Dan Handley4a75b842015-03-19 19:24:43 +0000380memory layout implies some image overlaying like in ARM standard platforms.
Sandrine Bailleux46d49f632014-06-23 17:00:23 +0100381
382* **#define : BL31_PROGBITS_LIMIT**
383
384 Defines the maximum address in secure RAM that the BL3-1's progbits sections
385 can occupy.
386
Dan Handley5a06bb72014-08-04 11:41:20 +0100387* **#define : TSP_PROGBITS_LIMIT**
Sandrine Bailleux46d49f632014-06-23 17:00:23 +0100388
389 Defines the maximum address that the TSP's progbits sections can occupy.
Sandrine Bailleux2467f702014-05-20 17:22:24 +0100390
Dan Handleyb68954c2014-05-29 12:30:24 +0100391### File : plat_macros.S [mandatory]
Soby Mathewa43d4312014-04-07 15:28:55 +0100392
Dan Handleyb68954c2014-05-29 12:30:24 +0100393Each platform must ensure a file of this name is in the system include path with
Dan Handley4a75b842015-03-19 19:24:43 +0000394the following macro defined. In the ARM development platforms, this file is
395found in `plat/arm/board/<plat_name>/include/plat_macros.S`.
Soby Mathewa43d4312014-04-07 15:28:55 +0100396
397* **Macro : plat_print_gic_regs**
398
399 This macro allows the crash reporting routine to print GIC registers
Soby Mathew8c106902014-07-16 09:23:52 +0100400 in case of an unhandled exception in BL3-1. This aids in debugging and
Soby Mathewa43d4312014-04-07 15:28:55 +0100401 this macro can be defined to be empty in case GIC register reporting is
402 not desired.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100403
Soby Mathew8c106902014-07-16 09:23:52 +0100404* **Macro : plat_print_interconnect_regs**
405
Dan Handley4a75b842015-03-19 19:24:43 +0000406 This macro allows the crash reporting routine to print interconnect
407 registers in case of an unhandled exception in BL3-1. This aids in debugging
408 and this macro can be defined to be empty in case interconnect register
409 reporting is not desired. In ARM standard platforms, the CCI snoop
410 control registers are reported.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100411
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000412
Vikram Kanigirie452cd82014-05-23 15:56:12 +01004132.2 Handling Reset
414------------------
415
416BL1 by default implements the reset vector where execution starts from a cold
417or warm boot. BL3-1 can be optionally set as a reset vector using the
418RESET_TO_BL31 make variable.
419
420For each CPU, the reset vector code is responsible for the following tasks:
421
4221. Distinguishing between a cold boot and a warm boot.
423
4242. In the case of a cold boot and the CPU being a secondary CPU, ensuring that
425 the CPU is placed in a platform-specific state until the primary CPU
426 performs the necessary steps to remove it from this state.
427
4283. In the case of a warm boot, ensuring that the CPU jumps to a platform-
429 specific address in the BL3-1 image in the same processor mode as it was
430 when released from reset.
431
432The following functions need to be implemented by the platform port to enable
433reset vector code to perform the above tasks.
434
435
Soby Mathew58523c02015-06-08 12:32:50 +0100436### Function : plat_get_my_entrypoint() [mandatory when PROGRAMMABLE_RESET_ADDRESS == 0]
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100437
Soby Mathew58523c02015-06-08 12:32:50 +0100438 Argument : void
439 Return : unsigned long
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100440
Soby Mathew58523c02015-06-08 12:32:50 +0100441This function is called with the called with the MMU and caches disabled
442(`SCTLR_EL3.M` = 0 and `SCTLR_EL3.C` = 0). The function is responsible for
443distinguishing between a warm and cold reset for the current CPU using
444platform-specific means. If it's a warm reset, then it returns the warm
445reset entrypoint point provided to `plat_setup_psci_ops()` during
446BL3-1 initialization. If it's a cold reset then this function must return zero.
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100447
448This function does not follow the Procedure Call Standard used by the
449Application Binary Interface for the ARM 64-bit architecture. The caller should
450not assume that callee saved registers are preserved across a call to this
451function.
452
453This function fulfills requirement 1 and 3 listed above.
454
Soby Mathew58523c02015-06-08 12:32:50 +0100455Note that for platforms that support programming the reset address, it is
456expected that a CPU will start executing code directly at the right address,
457both on a cold and warm reset. In this case, there is no need to identify the
458type of reset nor to query the warm reset entrypoint. Therefore, implementing
459this function is not required on such platforms.
460
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100461
Sandrine Bailleuxa9bec672015-10-30 15:05:17 +0000462### Function : plat_secondary_cold_boot_setup() [mandatory when COLD_BOOT_SINGLE_CPU == 0]
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100463
464 Argument : void
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100465
466This function is called with the MMU and data caches disabled. It is responsible
467for placing the executing secondary CPU in a platform-specific state until the
468primary CPU performs the necessary actions to bring it out of that state and
Sandrine Bailleux52010cc2015-05-19 11:54:45 +0100469allow entry into the OS. This function must not return.
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100470
Sandrine Bailleuxcdf14082015-10-02 14:35:25 +0100471In the ARM FVP port, when using the normal boot flow, each secondary CPU powers
472itself off. The primary CPU is responsible for powering up the secondary CPUs
473when normal world software requires them. When booting an EL3 payload instead,
474they stay powered on and are put in a holding pen until their mailbox gets
475populated.
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100476
477This function fulfills requirement 2 above.
478
Sandrine Bailleuxa9bec672015-10-30 15:05:17 +0000479Note that for platforms that can't release secondary CPUs out of reset, only the
480primary CPU will execute the cold boot code. Therefore, implementing this
481function is not required on such platforms.
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100482
Sandrine Bailleuxa9bec672015-10-30 15:05:17 +0000483
484### Function : plat_is_my_cpu_primary() [mandatory when COLD_BOOT_SINGLE_CPU == 0]
Juan Castillo53fdceb2014-07-16 15:53:43 +0100485
Soby Mathew58523c02015-06-08 12:32:50 +0100486 Argument : void
Juan Castillo53fdceb2014-07-16 15:53:43 +0100487 Return : unsigned int
488
Soby Mathew58523c02015-06-08 12:32:50 +0100489This function identifies whether the current CPU is the primary CPU or a
490secondary CPU. A return value of zero indicates that the CPU is not the
491primary CPU, while a non-zero return value indicates that the CPU is the
492primary CPU.
Juan Castillo53fdceb2014-07-16 15:53:43 +0100493
Sandrine Bailleuxa9bec672015-10-30 15:05:17 +0000494Note that for platforms that can't release secondary CPUs out of reset, only the
495primary CPU will execute the cold boot code. Therefore, there is no need to
496distinguish between primary and secondary CPUs and implementing this function is
497not required.
498
Juan Castillo53fdceb2014-07-16 15:53:43 +0100499
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100500### Function : platform_mem_init() [mandatory]
501
502 Argument : void
503 Return : void
504
505This function is called before any access to data is made by the firmware, in
506order to carry out any essential memory initialization.
507
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100508
Juan Castillo95cfd4a2015-04-14 12:49:03 +0100509### Function: plat_get_rotpk_info()
510
511 Argument : void *, void **, unsigned int *, unsigned int *
512 Return : int
513
514This function is mandatory when Trusted Board Boot is enabled. It returns a
515pointer to the ROTPK stored in the platform (or a hash of it) and its length.
516The ROTPK must be encoded in DER format according to the following ASN.1
517structure:
518
519 AlgorithmIdentifier ::= SEQUENCE {
520 algorithm OBJECT IDENTIFIER,
521 parameters ANY DEFINED BY algorithm OPTIONAL
522 }
523
524 SubjectPublicKeyInfo ::= SEQUENCE {
525 algorithm AlgorithmIdentifier,
526 subjectPublicKey BIT STRING
527 }
528
529In case the function returns a hash of the key:
530
531 DigestInfo ::= SEQUENCE {
532 digestAlgorithm AlgorithmIdentifier,
533 digest OCTET STRING
534 }
535
536The function returns 0 on success. Any other value means the ROTPK could not be
537retrieved from the platform. The function also reports extra information related
538to the ROTPK in the flags parameter.
539
540
Soby Mathew58523c02015-06-08 12:32:50 +01005412.3 Common mandatory modifications
542---------------------------------
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100543
Soby Mathew58523c02015-06-08 12:32:50 +0100544The following functions are mandatory functions which need to be implemented
545by the platform port.
546
547### Function : plat_my_core_pos()
548
549 Argument : void
550 Return : unsigned int
551
552This funtion returns the index of the calling CPU which is used as a
553CPU-specific linear index into blocks of memory (for example while allocating
554per-CPU stacks). This function will be invoked very early in the
555initialization sequence which mandates that this function should be
556implemented in assembly and should not rely on the avalability of a C
557runtime environment.
558
559This function plays a crucial role in the power domain topology framework in
560PSCI and details of this can be found in [Power Domain Topology Design].
561
562### Function : plat_core_pos_by_mpidr()
563
564 Argument : u_register_t
565 Return : int
566
567This function validates the `MPIDR` of a CPU and converts it to an index,
568which can be used as a CPU-specific linear index into blocks of memory. In
569case the `MPIDR` is invalid, this function returns -1. This function will only
570be invoked by BL3-1 after the power domain topology is initialized and can
571utilize the C runtime environment. For further details about how ARM Trusted
572Firmware represents the power domain topology and how this relates to the
573linear CPU index, please refer [Power Domain Topology Design].
574
575
576
5772.4 Common optional modifications
Achin Gupta4f6ad662013-10-25 09:08:21 +0100578---------------------------------
579
580The following are helper functions implemented by the firmware that perform
581common platform-specific tasks. A platform may choose to override these
582definitions.
583
Soby Mathew58523c02015-06-08 12:32:50 +0100584### Function : plat_set_my_stack()
Achin Gupta4f6ad662013-10-25 09:08:21 +0100585
Soby Mathew58523c02015-06-08 12:32:50 +0100586 Argument : void
Achin Gupta4f6ad662013-10-25 09:08:21 +0100587 Return : void
588
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000589This function sets the current stack pointer to the normal memory stack that
Soby Mathew58523c02015-06-08 12:32:50 +0100590has been allocated for the current CPU. For BL images that only require a
591stack for the primary CPU, the UP version of the function is used. The size
592of the stack allocated to each CPU is specified by the platform defined
593constant `PLATFORM_STACK_SIZE`.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100594
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000595Common implementations of this function for the UP and MP BL images are
596provided in [plat/common/aarch64/platform_up_stack.S] and
597[plat/common/aarch64/platform_mp_stack.S]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100598
599
Soby Mathew58523c02015-06-08 12:32:50 +0100600### Function : plat_get_my_stack()
Achin Guptac8afc782013-11-25 18:45:02 +0000601
Soby Mathew58523c02015-06-08 12:32:50 +0100602 Argument : void
Achin Guptac8afc782013-11-25 18:45:02 +0000603 Return : unsigned long
604
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000605This function returns the base address of the normal memory stack that
Soby Mathew58523c02015-06-08 12:32:50 +0100606has been allocated for the current CPU. For BL images that only require a
607stack for the primary CPU, the UP version of the function is used. The size
608of the stack allocated to each CPU is specified by the platform defined
609constant `PLATFORM_STACK_SIZE`.
Achin Guptac8afc782013-11-25 18:45:02 +0000610
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000611Common implementations of this function for the UP and MP BL images are
612provided in [plat/common/aarch64/platform_up_stack.S] and
613[plat/common/aarch64/platform_mp_stack.S]
Achin Guptac8afc782013-11-25 18:45:02 +0000614
615
Achin Gupta4f6ad662013-10-25 09:08:21 +0100616### Function : plat_report_exception()
617
618 Argument : unsigned int
619 Return : void
620
621A platform may need to report various information about its status when an
622exception is taken, for example the current exception level, the CPU security
623state (secure/non-secure), the exception type, and so on. This function is
624called in the following circumstances:
625
626* In BL1, whenever an exception is taken.
627* In BL2, whenever an exception is taken.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100628
629The default implementation doesn't do anything, to avoid making assumptions
630about the way the platform displays its status information.
631
632This function receives the exception type as its argument. Possible values for
Andrew Thoelke2bf28e62014-03-20 10:48:23 +0000633exceptions types are listed in the [include/runtime_svc.h] header file. Note
Achin Gupta4f6ad662013-10-25 09:08:21 +0100634that these constants are not related to any architectural exception code; they
635are just an ARM Trusted Firmware convention.
636
637
Soby Mathew24fb8382014-08-14 12:22:32 +0100638### Function : plat_reset_handler()
639
640 Argument : void
641 Return : void
642
643A platform may need to do additional initialization after reset. This function
644allows the platform to do the platform specific intializations. Platform
645specific errata workarounds could also be implemented here. The api should
Soby Mathew683f7882015-01-29 12:00:58 +0000646preserve the values of callee saved registers x19 to x29.
Soby Mathew24fb8382014-08-14 12:22:32 +0100647
Yatharth Kochar79a97b22014-11-20 18:09:41 +0000648The default implementation doesn't do anything. If a platform needs to override
Dan Handley4a75b842015-03-19 19:24:43 +0000649the default implementation, refer to the [Firmware Design] for general
Sandrine Bailleux452b7fa2015-05-27 17:14:22 +0100650guidelines.
Soby Mathew24fb8382014-08-14 12:22:32 +0100651
Soby Mathewadd40352014-08-14 12:49:05 +0100652### Function : plat_disable_acp()
653
654 Argument : void
655 Return : void
656
657This api allows a platform to disable the Accelerator Coherency Port (if
658present) during a cluster power down sequence. The default weak implementation
659doesn't do anything. Since this api is called during the power down sequence,
660it has restrictions for stack usage and it can use the registers x0 - x17 as
661scratch registers. It should preserve the value in x18 register as it is used
662by the caller to store the return address.
663
Juan Castillo40fc6cd2015-09-25 15:41:14 +0100664### Function : plat_error_handler()
665
666 Argument : int
667 Return : void
668
669This API is called when the generic code encounters an error situation from
670which it cannot continue. It allows the platform to perform error reporting or
671recovery actions (for example, reset the system). This function must not return.
672
673The parameter indicates the type of error using standard codes from `errno.h`.
674Possible errors reported by the generic code are:
675
676* `-EAUTH`: a certificate or image could not be authenticated (when Trusted
677 Board Boot is enabled)
678* `-ENOENT`: the requested image or certificate could not be found or an IO
679 error was detected
680* `-ENOMEM`: resources exhausted. Trusted Firmware does not use dynamic
681 memory, so this error is usually an indication of an incorrect array size
682
683The default implementation simply spins.
684
Soby Mathew24fb8382014-08-14 12:22:32 +0100685
Achin Gupta4f6ad662013-10-25 09:08:21 +01006863. Modifications specific to a Boot Loader stage
687-------------------------------------------------
688
6893.1 Boot Loader Stage 1 (BL1)
690-----------------------------
691
692BL1 implements the reset vector where execution starts from after a cold or
693warm boot. For each CPU, BL1 is responsible for the following tasks:
694
Vikram Kanigirie452cd82014-05-23 15:56:12 +01006951. Handling the reset as described in section 2.2
Achin Gupta4f6ad662013-10-25 09:08:21 +0100696
6972. In the case of a cold boot and the CPU being the primary CPU, ensuring that
698 only this CPU executes the remaining BL1 code, including loading and passing
699 control to the BL2 stage.
700
Vikram Kanigirie452cd82014-05-23 15:56:12 +01007013. Loading the BL2 image from non-volatile storage into secure memory at the
Achin Gupta4f6ad662013-10-25 09:08:21 +0100702 address specified by the platform defined constant `BL2_BASE`.
703
Vikram Kanigirie452cd82014-05-23 15:56:12 +01007044. Populating a `meminfo` structure with the following information in memory,
Achin Gupta4f6ad662013-10-25 09:08:21 +0100705 accessible by BL2 immediately upon entry.
706
707 meminfo.total_base = Base address of secure RAM visible to BL2
708 meminfo.total_size = Size of secure RAM visible to BL2
709 meminfo.free_base = Base address of secure RAM available for
710 allocation to BL2
711 meminfo.free_size = Size of secure RAM available for allocation to BL2
712
713 BL1 places this `meminfo` structure at the beginning of the free memory
714 available for its use. Since BL1 cannot allocate memory dynamically at the
715 moment, its free memory will be available for BL2's use as-is. However, this
716 means that BL2 must read the `meminfo` structure before it starts using its
717 free memory (this is discussed in Section 3.2).
718
719 In future releases of the ARM Trusted Firmware it will be possible for
720 the platform to decide where it wants to place the `meminfo` structure for
721 BL2.
722
Sandrine Bailleux8f55dfb2014-06-24 14:02:34 +0100723 BL1 implements the `bl1_init_bl2_mem_layout()` function to populate the
Achin Gupta4f6ad662013-10-25 09:08:21 +0100724 BL2 `meminfo` structure. The platform may override this implementation, for
725 example if the platform wants to restrict the amount of memory visible to
726 BL2. Details of how to do this are given below.
727
728The following functions need to be implemented by the platform port to enable
729BL1 to perform the above tasks.
730
731
Dan Handley4a75b842015-03-19 19:24:43 +0000732### Function : bl1_early_platform_setup() [mandatory]
733
734 Argument : void
735 Return : void
736
737This function executes with the MMU and data caches disabled. It is only called
738by the primary CPU.
739
740In ARM standard platforms, this function initializes the console and enables
741snoop requests into the primary CPU's cluster.
742
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100743### Function : bl1_plat_arch_setup() [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100744
745 Argument : void
746 Return : void
747
Achin Gupta4f6ad662013-10-25 09:08:21 +0100748This function performs any platform-specific and architectural setup that the
Dan Handley4a75b842015-03-19 19:24:43 +0000749platform requires. Platform-specific setup might include configuration of
750memory controllers and the interconnect.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100751
Dan Handley4a75b842015-03-19 19:24:43 +0000752In ARM standard platforms, this function enables the MMU.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100753
754This function helps fulfill requirement 2 above.
755
756
757### Function : bl1_platform_setup() [mandatory]
758
759 Argument : void
760 Return : void
761
762This function executes with the MMU and data caches enabled. It is responsible
763for performing any remaining platform-specific setup that can occur after the
764MMU and data cache have been enabled.
765
Dan Handley4a75b842015-03-19 19:24:43 +0000766In ARM standard platforms, this function initializes the storage abstraction
767layer used to load the next bootloader image.
Harry Liebeld265bd72014-01-31 19:04:10 +0000768
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100769This function helps fulfill requirement 3 above.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100770
771
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000772### Function : bl1_plat_sec_mem_layout() [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100773
774 Argument : void
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000775 Return : meminfo *
Achin Gupta4f6ad662013-10-25 09:08:21 +0100776
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000777This function should only be called on the cold boot path. It executes with the
778MMU and data caches enabled. The pointer returned by this function must point to
779a `meminfo` structure containing the extents and availability of secure RAM for
780the BL1 stage.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100781
782 meminfo.total_base = Base address of secure RAM visible to BL1
783 meminfo.total_size = Size of secure RAM visible to BL1
784 meminfo.free_base = Base address of secure RAM available for allocation
785 to BL1
786 meminfo.free_size = Size of secure RAM available for allocation to BL1
787
788This information is used by BL1 to load the BL2 image in secure RAM. BL1 also
789populates a similar structure to tell BL2 the extents of memory available for
790its own use.
791
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100792This function helps fulfill requirement 3 above.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100793
794
Sandrine Bailleux8f55dfb2014-06-24 14:02:34 +0100795### Function : bl1_init_bl2_mem_layout() [optional]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100796
797 Argument : meminfo *, meminfo *, unsigned int, unsigned long
798 Return : void
799
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100800BL1 needs to tell the next stage the amount of secure RAM available
801for it to use. This information is populated in a `meminfo`
Achin Gupta4f6ad662013-10-25 09:08:21 +0100802structure.
803
804Depending upon where BL2 has been loaded in secure RAM (determined by
805`BL2_BASE`), BL1 calculates the amount of free memory available for BL2 to use.
806BL1 also ensures that its data sections resident in secure RAM are not visible
Dan Handley4a75b842015-03-19 19:24:43 +0000807to BL2. An illustration of how this is done in ARM standard platforms is given
808in the **Memory layout on ARM development platforms** section in the
809[Firmware Design].
Achin Gupta4f6ad662013-10-25 09:08:21 +0100810
811
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100812### Function : bl1_plat_set_bl2_ep_info() [mandatory]
813
814 Argument : image_info *, entry_point_info *
815 Return : void
816
817This function is called after loading BL2 image and it can be used to overwrite
818the entry point set by loader and also set the security state and SPSR which
819represents the entry point system state for BL2.
820
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100821
Juan Castilloe3f67122015-10-05 16:59:38 +0100822### Function : bl1_plat_prepare_exit() [optional]
823
Sandrine Bailleux862b5dc2015-11-10 15:01:57 +0000824 Argument : entry_point_info_t *
Juan Castilloe3f67122015-10-05 16:59:38 +0100825 Return : void
826
Sandrine Bailleux862b5dc2015-11-10 15:01:57 +0000827This function is called prior to exiting BL1 in response to the `RUN_IMAGE` SMC
Juan Castilloe3f67122015-10-05 16:59:38 +0100828request raised by BL2. It should be used to perform platform specific clean up
Sandrine Bailleux862b5dc2015-11-10 15:01:57 +0000829or bookkeeping operations before transferring control to the next image. It
830receives the address of the `entry_point_info_t` structure passed from BL2.
831This function runs with MMU disabled.
Juan Castilloe3f67122015-10-05 16:59:38 +0100832
833
Achin Gupta4f6ad662013-10-25 09:08:21 +01008343.2 Boot Loader Stage 2 (BL2)
835-----------------------------
836
837The BL2 stage is executed only by the primary CPU, which is determined in BL1
838using the `platform_is_primary_cpu()` function. BL1 passed control to BL2 at
839`BL2_BASE`. BL2 executes in Secure EL1 and is responsible for:
840
Sandrine Bailleux93d81d62014-06-24 14:19:36 +01008411. (Optional) Loading the BL3-0 binary image (if present) from platform
842 provided non-volatile storage. To load the BL3-0 image, BL2 makes use of
843 the `meminfo` returned by the `bl2_plat_get_bl30_meminfo()` function.
844 The platform also defines the address in memory where BL3-0 is loaded
845 through the optional constant `BL30_BASE`. BL2 uses this information
846 to determine if there is enough memory to load the BL3-0 image.
847 Subsequent handling of the BL3-0 image is platform-specific and is
848 implemented in the `bl2_plat_handle_bl30()` function.
849 If `BL30_BASE` is not defined then this step is not performed.
850
8512. Loading the BL3-1 binary image into secure RAM from non-volatile storage. To
Harry Liebeld265bd72014-01-31 19:04:10 +0000852 load the BL3-1 image, BL2 makes use of the `meminfo` structure passed to it
853 by BL1. This structure allows BL2 to calculate how much secure RAM is
854 available for its use. The platform also defines the address in secure RAM
855 where BL3-1 is loaded through the constant `BL31_BASE`. BL2 uses this
856 information to determine if there is enough memory to load the BL3-1 image.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100857
Sandrine Bailleux93d81d62014-06-24 14:19:36 +01008583. (Optional) Loading the BL3-2 binary image (if present) from platform
Dan Handley1151c822014-04-15 11:38:38 +0100859 provided non-volatile storage. To load the BL3-2 image, BL2 makes use of
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100860 the `meminfo` returned by the `bl2_plat_get_bl32_meminfo()` function.
861 The platform also defines the address in memory where BL3-2 is loaded
862 through the optional constant `BL32_BASE`. BL2 uses this information
863 to determine if there is enough memory to load the BL3-2 image.
864 If `BL32_BASE` is not defined then this and the next step is not performed.
Achin Guptaa3050ed2014-02-19 17:52:35 +0000865
Sandrine Bailleux93d81d62014-06-24 14:19:36 +01008664. (Optional) Arranging to pass control to the BL3-2 image (if present) that
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100867 has been pre-loaded at `BL32_BASE`. BL2 populates an `entry_point_info`
Dan Handley1151c822014-04-15 11:38:38 +0100868 structure in memory provided by the platform with information about how
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100869 BL3-1 should pass control to the BL3-2 image.
Achin Guptaa3050ed2014-02-19 17:52:35 +0000870
Sandrine Bailleux93d81d62014-06-24 14:19:36 +01008715. Loading the normal world BL3-3 binary image into non-secure DRAM from
872 platform storage and arranging for BL3-1 to pass control to this image. This
873 address is determined using the `plat_get_ns_image_entrypoint()` function
874 described below.
875
8766. BL2 populates an `entry_point_info` structure in memory provided by the
877 platform with information about how BL3-1 should pass control to the
878 other BL images.
879
Achin Gupta4f6ad662013-10-25 09:08:21 +0100880The following functions must be implemented by the platform port to enable BL2
881to perform the above tasks.
882
883
884### Function : bl2_early_platform_setup() [mandatory]
885
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100886 Argument : meminfo *
Achin Gupta4f6ad662013-10-25 09:08:21 +0100887 Return : void
888
889This function executes with the MMU and data caches disabled. It is only called
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100890by the primary CPU. The arguments to this function is the address of the
891`meminfo` structure populated by BL1.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100892
893The platform must copy the contents of the `meminfo` structure into a private
894variable as the original memory may be subsequently overwritten by BL2. The
895copied structure is made available to all BL2 code through the
Achin Guptae4d084e2014-02-19 17:18:23 +0000896`bl2_plat_sec_mem_layout()` function.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100897
Dan Handley4a75b842015-03-19 19:24:43 +0000898In ARM standard platforms, this function also initializes the storage
899abstraction layer used to load further bootloader images. It is necessary to do
900this early on platforms with a BL3-0 image, since the later `bl2_platform_setup`
901must be done after BL3-0 is loaded.
902
Achin Gupta4f6ad662013-10-25 09:08:21 +0100903
904### Function : bl2_plat_arch_setup() [mandatory]
905
906 Argument : void
907 Return : void
908
909This function executes with the MMU and data caches disabled. It is only called
910by the primary CPU.
911
912The purpose of this function is to perform any architectural initialization
913that varies across platforms, for example enabling the MMU (since the memory
914map differs across platforms).
915
916
917### Function : bl2_platform_setup() [mandatory]
918
919 Argument : void
920 Return : void
921
922This function may execute with the MMU and data caches enabled if the platform
923port does the necessary initialization in `bl2_plat_arch_setup()`. It is only
924called by the primary CPU.
925
Achin Guptae4d084e2014-02-19 17:18:23 +0000926The purpose of this function is to perform any platform initialization
Dan Handley4a75b842015-03-19 19:24:43 +0000927specific to BL2.
Harry Liebelce19cf12014-04-01 19:28:07 +0100928
Dan Handley4a75b842015-03-19 19:24:43 +0000929In ARM standard platforms, this function performs security setup, including
930configuration of the TrustZone controller to allow non-secure masters access
931to most of DRAM. Part of DRAM is reserved for secure world use.
Harry Liebeld265bd72014-01-31 19:04:10 +0000932
Achin Gupta4f6ad662013-10-25 09:08:21 +0100933
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000934### Function : bl2_plat_sec_mem_layout() [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100935
936 Argument : void
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000937 Return : meminfo *
Achin Gupta4f6ad662013-10-25 09:08:21 +0100938
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000939This function should only be called on the cold boot path. It may execute with
940the MMU and data caches enabled if the platform port does the necessary
941initialization in `bl2_plat_arch_setup()`. It is only called by the primary CPU.
Achin Gupta4f6ad662013-10-25 09:08:21 +0100942
Sandrine Bailleuxee12f6f2013-11-28 14:55:58 +0000943The purpose of this function is to return a pointer to a `meminfo` structure
944populated with the extents of secure RAM available for BL2 to use. See
Achin Gupta4f6ad662013-10-25 09:08:21 +0100945`bl2_early_platform_setup()` above.
946
947
Sandrine Bailleux93d81d62014-06-24 14:19:36 +0100948### Function : bl2_plat_get_bl30_meminfo() [mandatory]
949
950 Argument : meminfo *
951 Return : void
952
953This function is used to get the memory limits where BL2 can load the
954BL3-0 image. The meminfo provided by this is used by load_image() to
955validate whether the BL3-0 image can be loaded within the given
956memory from the given base.
957
958
959### Function : bl2_plat_handle_bl30() [mandatory]
960
961 Argument : image_info *
962 Return : int
963
964This function is called after loading BL3-0 image and it is used to perform any
965platform-specific actions required to handle the SCP firmware. Typically it
966transfers the image into SCP memory using a platform-specific protocol and waits
967until SCP executes it and signals to the Application Processor (AP) for BL2
968execution to continue.
969
970This function returns 0 on success, a negative error code otherwise.
971
972
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100973### Function : bl2_plat_get_bl31_params() [mandatory]
Harry Liebeld265bd72014-01-31 19:04:10 +0000974
975 Argument : void
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100976 Return : bl31_params *
Harry Liebeld265bd72014-01-31 19:04:10 +0000977
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100978BL2 platform code needs to return a pointer to a `bl31_params` structure it
979will use for passing information to BL3-1. The `bl31_params` structure carries
980the following information.
981 - Header describing the version information for interpreting the bl31_param
982 structure
983 - Information about executing the BL3-3 image in the `bl33_ep_info` field
984 - Information about executing the BL3-2 image in the `bl32_ep_info` field
985 - Information about the type and extents of BL3-1 image in the
986 `bl31_image_info` field
987 - Information about the type and extents of BL3-2 image in the
988 `bl32_image_info` field
989 - Information about the type and extents of BL3-3 image in the
990 `bl33_image_info` field
991
992The memory pointed by this structure and its sub-structures should be
993accessible from BL3-1 initialisation code. BL3-1 might choose to copy the
994necessary content, or maintain the structures until BL3-3 is initialised.
Harry Liebeld265bd72014-01-31 19:04:10 +0000995
996
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100997### Funtion : bl2_plat_get_bl31_ep_info() [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +0100998
Vikram Kanigirie452cd82014-05-23 15:56:12 +0100999 Argument : void
1000 Return : entry_point_info *
1001
1002BL2 platform code returns a pointer which is used to populate the entry point
1003information for BL3-1 entry point. The location pointed by it should be
1004accessible from BL1 while processing the synchronous exception to run to BL3-1.
1005
Dan Handley4a75b842015-03-19 19:24:43 +00001006In ARM standard platforms this is allocated inside a bl2_to_bl31_params_mem
1007structure in BL2 memory.
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001008
1009
1010### Function : bl2_plat_set_bl31_ep_info() [mandatory]
1011
1012 Argument : image_info *, entry_point_info *
Achin Gupta4f6ad662013-10-25 09:08:21 +01001013 Return : void
1014
Sandrine Bailleux4c117f62015-11-26 16:31:34 +00001015In the normal boot flow, this function is called after loading BL3-1 image and
1016it can be used to overwrite the entry point set by loader and also set the
1017security state and SPSR which represents the entry point system state for BL3-1.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001018
Sandrine Bailleux4c117f62015-11-26 16:31:34 +00001019When booting an EL3 payload instead, this function is called after populating
1020its entry point address and can be used for the same purpose for the payload
1021image. It receives a null pointer as its first argument in this case.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001022
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001023### Function : bl2_plat_set_bl32_ep_info() [mandatory]
1024
1025 Argument : image_info *, entry_point_info *
1026 Return : void
1027
1028This function is called after loading BL3-2 image and it can be used to
1029overwrite the entry point set by loader and also set the security state
1030and SPSR which represents the entry point system state for BL3-2.
1031
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001032
1033### Function : bl2_plat_set_bl33_ep_info() [mandatory]
1034
1035 Argument : image_info *, entry_point_info *
1036 Return : void
1037
1038This function is called after loading BL3-3 image and it can be used to
1039overwrite the entry point set by loader and also set the security state
1040and SPSR which represents the entry point system state for BL3-3.
1041
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001042
1043### Function : bl2_plat_get_bl32_meminfo() [mandatory]
1044
1045 Argument : meminfo *
1046 Return : void
1047
1048This function is used to get the memory limits where BL2 can load the
1049BL3-2 image. The meminfo provided by this is used by load_image() to
1050validate whether the BL3-2 image can be loaded with in the given
1051memory from the given base.
1052
1053### Function : bl2_plat_get_bl33_meminfo() [mandatory]
1054
1055 Argument : meminfo *
1056 Return : void
1057
1058This function is used to get the memory limits where BL2 can load the
1059BL3-3 image. The meminfo provided by this is used by load_image() to
1060validate whether the BL3-3 image can be loaded with in the given
1061memory from the given base.
1062
1063### Function : bl2_plat_flush_bl31_params() [mandatory]
1064
1065 Argument : void
1066 Return : void
1067
1068Once BL2 has populated all the structures that needs to be read by BL1
1069and BL3-1 including the bl31_params structures and its sub-structures,
1070the bl31_ep_info structure and any platform specific data. It flushes
1071all these data to the main memory so that it is available when we jump to
1072later Bootloader stages with MMU off
Achin Gupta4f6ad662013-10-25 09:08:21 +01001073
1074### Function : plat_get_ns_image_entrypoint() [mandatory]
1075
1076 Argument : void
1077 Return : unsigned long
1078
1079As previously described, BL2 is responsible for arranging for control to be
1080passed to a normal world BL image through BL3-1. This function returns the
1081entrypoint of that image, which BL3-1 uses to jump to it.
1082
Harry Liebeld265bd72014-01-31 19:04:10 +00001083BL2 is responsible for loading the normal world BL3-3 image (e.g. UEFI).
Achin Gupta4f6ad662013-10-25 09:08:21 +01001084
1085
10863.2 Boot Loader Stage 3-1 (BL3-1)
1087---------------------------------
1088
1089During cold boot, the BL3-1 stage is executed only by the primary CPU. This is
1090determined in BL1 using the `platform_is_primary_cpu()` function. BL1 passes
1091control to BL3-1 at `BL31_BASE`. During warm boot, BL3-1 is executed by all
1092CPUs. BL3-1 executes at EL3 and is responsible for:
1093
10941. Re-initializing all architectural and platform state. Although BL1 performs
1095 some of this initialization, BL3-1 remains resident in EL3 and must ensure
1096 that EL3 architectural and platform state is completely initialized. It
1097 should make no assumptions about the system state when it receives control.
1098
10992. Passing control to a normal world BL image, pre-loaded at a platform-
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001100 specific address by BL2. BL3-1 uses the `entry_point_info` structure that BL2
Achin Gupta4f6ad662013-10-25 09:08:21 +01001101 populated in memory to do this.
1102
11033. Providing runtime firmware services. Currently, BL3-1 only implements a
1104 subset of the Power State Coordination Interface (PSCI) API as a runtime
1105 service. See Section 3.3 below for details of porting the PSCI
1106 implementation.
1107
Achin Gupta35ca3512014-02-19 17:58:33 +000011084. Optionally passing control to the BL3-2 image, pre-loaded at a platform-
1109 specific address by BL2. BL3-1 exports a set of apis that allow runtime
1110 services to specify the security state in which the next image should be
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001111 executed and run the corresponding image. BL3-1 uses the `entry_point_info`
1112 structure populated by BL2 to do this.
1113
1114If BL3-1 is a reset vector, It also needs to handle the reset as specified in
1115section 2.2 before the tasks described above.
Achin Gupta35ca3512014-02-19 17:58:33 +00001116
Achin Gupta4f6ad662013-10-25 09:08:21 +01001117The following functions must be implemented by the platform port to enable BL3-1
1118to perform the above tasks.
1119
1120
1121### Function : bl31_early_platform_setup() [mandatory]
1122
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001123 Argument : bl31_params *, void *
Achin Gupta4f6ad662013-10-25 09:08:21 +01001124 Return : void
1125
1126This function executes with the MMU and data caches disabled. It is only called
1127by the primary CPU. The arguments to this function are:
1128
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001129* The address of the `bl31_params` structure populated by BL2.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001130* An opaque pointer that the platform may use as needed.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001131
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001132The platform can copy the contents of the `bl31_params` structure and its
1133sub-structures into private variables if the original memory may be
1134subsequently overwritten by BL3-1 and similarly the `void *` pointing
1135to the platform data also needs to be saved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001136
Dan Handley4a75b842015-03-19 19:24:43 +00001137In ARM standard platforms, BL2 passes a pointer to a `bl31_params` structure
1138in BL2 memory. BL3-1 copies the information in this pointer to internal data
1139structures.
1140
Achin Gupta4f6ad662013-10-25 09:08:21 +01001141
1142### Function : bl31_plat_arch_setup() [mandatory]
1143
1144 Argument : void
1145 Return : void
1146
1147This function executes with the MMU and data caches disabled. It is only called
1148by the primary CPU.
1149
1150The purpose of this function is to perform any architectural initialization
1151that varies across platforms, for example enabling the MMU (since the memory
1152map differs across platforms).
1153
1154
1155### Function : bl31_platform_setup() [mandatory]
1156
1157 Argument : void
1158 Return : void
1159
1160This function may execute with the MMU and data caches enabled if the platform
1161port does the necessary initialization in `bl31_plat_arch_setup()`. It is only
1162called by the primary CPU.
1163
1164The purpose of this function is to complete platform initialization so that both
1165BL3-1 runtime services and normal world software can function correctly.
1166
Dan Handley4a75b842015-03-19 19:24:43 +00001167In ARM standard platforms, this function does the following:
Achin Gupta4f6ad662013-10-25 09:08:21 +01001168* Initializes the generic interrupt controller.
Sandrine Bailleux9e864902014-03-31 11:25:18 +01001169* Enables system-level implementation of the generic timer counter.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001170* Grants access to the system counter timer module
Dan Handley4a75b842015-03-19 19:24:43 +00001171* Initializes the power controller device
Achin Gupta4f6ad662013-10-25 09:08:21 +01001172* Detects the system topology.
1173
1174
Soby Mathew78e61612015-12-09 11:28:43 +00001175### Function : bl31_plat_runtime_setup() [optional]
1176
1177 Argument : void
1178 Return : void
1179
1180The purpose of this function is allow the platform to perform any BL31 runtime
1181setup just prior to BL31 exit during cold boot. The default weak
1182implementation of this function will invoke `console_uninit()` which will
1183suppress any BL31 runtime logs.
1184
Soby Mathew080225d2015-12-09 11:38:43 +00001185In ARM Standard platforms, this function will initialize the BL31 runtime
1186console which will cause all further BL31 logs to be output to the
1187runtime console.
1188
Soby Mathew78e61612015-12-09 11:28:43 +00001189
Achin Gupta4f6ad662013-10-25 09:08:21 +01001190### Function : bl31_get_next_image_info() [mandatory]
1191
Achin Gupta35ca3512014-02-19 17:58:33 +00001192 Argument : unsigned int
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001193 Return : entry_point_info *
Achin Gupta4f6ad662013-10-25 09:08:21 +01001194
1195This function may execute with the MMU and data caches enabled if the platform
1196port does the necessary initializations in `bl31_plat_arch_setup()`.
1197
1198This function is called by `bl31_main()` to retrieve information provided by
Achin Gupta35ca3512014-02-19 17:58:33 +00001199BL2 for the next image in the security state specified by the argument. BL3-1
1200uses this information to pass control to that image in the specified security
Vikram Kanigirie452cd82014-05-23 15:56:12 +01001201state. This function must return a pointer to the `entry_point_info` structure
Achin Gupta35ca3512014-02-19 17:58:33 +00001202(that was copied during `bl31_early_platform_setup()`) if the image exists. It
1203should return NULL otherwise.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001204
Dan Handley4a75b842015-03-19 19:24:43 +00001205### Function : plat_get_syscnt_freq() [mandatory]
1206
1207 Argument : void
1208 Return : uint64_t
1209
1210This function is used by the architecture setup code to retrieve the counter
1211frequency for the CPU's generic timer. This value will be programmed into the
1212`CNTFRQ_EL0` register. In ARM standard platforms, it returns the base frequency
1213of the system counter, which is retrieved from the first entry in the frequency
1214modes table.
1215
Achin Gupta4f6ad662013-10-25 09:08:21 +01001216
Vikram Kanigiri7173f5f2015-09-24 15:45:43 +01001217### #define : PLAT_PERCPU_BAKERY_LOCK_SIZE [optional]
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +01001218
Vikram Kanigiri7173f5f2015-09-24 15:45:43 +01001219 When `USE_COHERENT_MEM = 0`, this constant defines the total memory (in
1220 bytes) aligned to the cache line boundary that should be allocated per-cpu to
1221 accommodate all the bakery locks.
1222
1223 If this constant is not defined when `USE_COHERENT_MEM = 0`, the linker
1224 calculates the size of the `bakery_lock` input section, aligns it to the
1225 nearest `CACHE_WRITEBACK_GRANULE`, multiplies it with `PLATFORM_CORE_COUNT`
1226 and stores the result in a linker symbol. This constant prevents a platform
1227 from relying on the linker and provide a more efficient mechanism for
1228 accessing per-cpu bakery lock information.
1229
1230 If this constant is defined and its value is not equal to the value
1231 calculated by the linker then a link time assertion is raised. A compile time
1232 assertion is raised if the value of the constant is not aligned to the cache
1233 line boundary.
Andrew Thoelkeee7b35c2015-09-10 11:39:36 +01001234
Achin Gupta4f6ad662013-10-25 09:08:21 +010012353.3 Power State Coordination Interface (in BL3-1)
1236------------------------------------------------
1237
1238The ARM Trusted Firmware's implementation of the PSCI API is based around the
Soby Mathew58523c02015-06-08 12:32:50 +01001239concept of a _power domain_. A _power domain_ is a CPU or a logical group of
1240CPUs which share some state on which power management operations can be
1241performed as specified by [PSCI]. Each CPU in the system is assigned a cpu
1242index which is a unique number between `0` and `PLATFORM_CORE_COUNT - 1`.
1243The _power domains_ are arranged in a hierarchial tree structure and
1244each _power domain_ can be identified in a system by the cpu index of any CPU
1245that is part of that domain and a _power domain level_. A processing element
1246(for example, a CPU) is at level 0. If the _power domain_ node above a CPU is
1247a logical grouping of CPUs that share some state, then level 1 is that group
1248of CPUs (for example, a cluster), and level 2 is a group of clusters
1249(for example, the system). More details on the power domain topology and its
1250organization can be found in [Power Domain Topology Design].
Achin Gupta4f6ad662013-10-25 09:08:21 +01001251
1252BL3-1's platform initialization code exports a pointer to the platform-specific
1253power management operations required for the PSCI implementation to function
Soby Mathew58523c02015-06-08 12:32:50 +01001254correctly. This information is populated in the `plat_psci_ops` structure. The
1255PSCI implementation calls members of the `plat_psci_ops` structure for performing
1256power management operations on the power domains. For example, the target
1257CPU is specified by its `MPIDR` in a PSCI `CPU_ON` call. The `pwr_domain_on()`
1258handler (if present) is called for the CPU power domain.
1259
1260The `power-state` parameter of a PSCI `CPU_SUSPEND` call can be used to
1261describe composite power states specific to a platform. The PSCI implementation
1262defines a generic representation of the power-state parameter viz which is an
1263array of local power states where each index corresponds to a power domain
1264level. Each entry contains the local power state the power domain at that power
1265level could enter. It depends on the `validate_power_state()` handler to
1266convert the power-state parameter (possibly encoding a composite power state)
1267passed in a PSCI `CPU_SUSPEND` call to this representation.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001268
1269The following functions must be implemented to initialize PSCI functionality in
1270the ARM Trusted Firmware.
1271
1272
Soby Mathew58523c02015-06-08 12:32:50 +01001273### Function : plat_get_target_pwr_state() [optional]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001274
Soby Mathew58523c02015-06-08 12:32:50 +01001275 Argument : unsigned int, const plat_local_state_t *, unsigned int
1276 Return : plat_local_state_t
Achin Gupta4f6ad662013-10-25 09:08:21 +01001277
Soby Mathew58523c02015-06-08 12:32:50 +01001278The PSCI generic code uses this function to let the platform participate in
1279state coordination during a power management operation. The function is passed
1280a pointer to an array of platform specific local power state `states` (second
1281argument) which contains the requested power state for each CPU at a particular
1282power domain level `lvl` (first argument) within the power domain. The function
1283is expected to traverse this array of upto `ncpus` (third argument) and return
1284a coordinated target power state by the comparing all the requested power
1285states. The target power state should not be deeper than any of the requested
1286power states.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001287
Soby Mathew58523c02015-06-08 12:32:50 +01001288A weak definition of this API is provided by default wherein it assumes
1289that the platform assigns a local state value in order of increasing depth
1290of the power state i.e. for two power states X & Y, if X < Y
1291then X represents a shallower power state than Y. As a result, the
1292coordinated target local power state for a power domain will be the minimum
1293of the requested local power state values.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001294
1295
Soby Mathew58523c02015-06-08 12:32:50 +01001296### Function : plat_get_power_domain_tree_desc() [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001297
Soby Mathew58523c02015-06-08 12:32:50 +01001298 Argument : void
1299 Return : const unsigned char *
Achin Gupta4f6ad662013-10-25 09:08:21 +01001300
Soby Mathew58523c02015-06-08 12:32:50 +01001301This function returns a pointer to the byte array containing the power domain
1302topology tree description. The format and method to construct this array are
1303described in [Power Domain Topology Design]. The BL3-1 PSCI initilization code
1304requires this array to be described by the platform, either statically or
1305dynamically, to initialize the power domain topology tree. In case the array
1306is populated dynamically, then plat_core_pos_by_mpidr() and
1307plat_my_core_pos() should also be implemented suitably so that the topology
1308tree description matches the CPU indices returned by these APIs. These APIs
1309together form the platform interface for the PSCI topology framework.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001310
1311
Soby Mathew58523c02015-06-08 12:32:50 +01001312## Function : plat_setup_psci_ops() [mandatory]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001313
Soby Mathew58523c02015-06-08 12:32:50 +01001314 Argument : uintptr_t, const plat_psci_ops **
Achin Gupta4f6ad662013-10-25 09:08:21 +01001315 Return : int
1316
1317This function may execute with the MMU and data caches enabled if the platform
1318port does the necessary initializations in `bl31_plat_arch_setup()`. It is only
1319called by the primary CPU.
1320
Soby Mathew58523c02015-06-08 12:32:50 +01001321This function is called by PSCI initialization code. Its purpose is to let
1322the platform layer know about the warm boot entrypoint through the
1323`sec_entrypoint` (first argument) and to export handler routines for
1324platform-specific psci power management actions by populating the passed
1325pointer with a pointer to BL3-1's private `plat_psci_ops` structure.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001326
1327A description of each member of this structure is given below. Please refer to
Dan Handley4a75b842015-03-19 19:24:43 +00001328the ARM FVP specific implementation of these handlers in
Soby Mathew58523c02015-06-08 12:32:50 +01001329[plat/arm/board/fvp/fvp_pm.c] as an example. For each PSCI function that the
1330platform wants to support, the associated operation or operations in this
1331structure must be provided and implemented (Refer section 4 of
1332[Firmware Design] for the PSCI API supported in Trusted Firmware). To disable
1333a PSCI function in a platform port, the operation should be removed from this
1334structure instead of providing an empty implementation.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001335
Soby Mathew58523c02015-06-08 12:32:50 +01001336#### plat_psci_ops.cpu_standby()
Achin Gupta4f6ad662013-10-25 09:08:21 +01001337
Soby Mathew58523c02015-06-08 12:32:50 +01001338Perform the platform-specific actions to enter the standby state for a cpu
1339indicated by the passed argument. This provides a fast path for CPU standby
1340wherein overheads of PSCI state management and lock acquistion is avoided.
1341For this handler to be invoked by the PSCI `CPU_SUSPEND` API implementation,
1342the suspend state type specified in the `power-state` parameter should be
1343STANDBY and the target power domain level specified should be the CPU. The
1344handler should put the CPU into a low power retention state (usually by
1345issuing a wfi instruction) and ensure that it can be woken up from that
1346state by a normal interrupt. The generic code expects the handler to succeed.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001347
Soby Mathew58523c02015-06-08 12:32:50 +01001348#### plat_psci_ops.pwr_domain_on()
Achin Gupta4f6ad662013-10-25 09:08:21 +01001349
Soby Mathew58523c02015-06-08 12:32:50 +01001350Perform the platform specific actions to power on a CPU, specified
1351by the `MPIDR` (first argument). The generic code expects the platform to
1352return PSCI_E_SUCCESS on success or PSCI_E_INTERN_FAIL for any failure.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001353
Soby Mathew58523c02015-06-08 12:32:50 +01001354#### plat_psci_ops.pwr_domain_off()
Achin Gupta4f6ad662013-10-25 09:08:21 +01001355
Soby Mathew58523c02015-06-08 12:32:50 +01001356Perform the platform specific actions to prepare to power off the calling CPU
1357and its higher parent power domain levels as indicated by the `target_state`
1358(first argument). It is called by the PSCI `CPU_OFF` API implementation.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001359
Soby Mathew58523c02015-06-08 12:32:50 +01001360The `target_state` encodes the platform coordinated target local power states
1361for the CPU power domain and its parent power domain levels. The handler
1362needs to perform power management operation corresponding to the local state
1363at each power level.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001364
Soby Mathew58523c02015-06-08 12:32:50 +01001365For this handler, the local power state for the CPU power domain will be a
1366power down state where as it could be either power down, retention or run state
1367for the higher power domain levels depending on the result of state
1368coordination. The generic code expects the handler to succeed.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001369
Soby Mathew58523c02015-06-08 12:32:50 +01001370#### plat_psci_ops.pwr_domain_suspend()
Achin Gupta4f6ad662013-10-25 09:08:21 +01001371
Soby Mathew58523c02015-06-08 12:32:50 +01001372Perform the platform specific actions to prepare to suspend the calling
1373CPU and its higher parent power domain levels as indicated by the
1374`target_state` (first argument). It is called by the PSCI `CPU_SUSPEND`
1375API implementation.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001376
Soby Mathew58523c02015-06-08 12:32:50 +01001377The `target_state` has a similar meaning as described in
1378the `pwr_domain_off()` operation. It encodes the platform coordinated
1379target local power states for the CPU power domain and its parent
1380power domain levels. The handler needs to perform power management operation
1381corresponding to the local state at each power level. The generic code
1382expects the handler to succeed.
1383
1384The difference between turning a power domain off versus suspending it
1385is that in the former case, the power domain is expected to re-initialize
1386its state when it is next powered on (see `pwr_domain_on_finish()`). In the
1387latter case, the power domain is expected to save enough state so that it can
Achin Gupta4f6ad662013-10-25 09:08:21 +01001388resume execution by restoring this state when its powered on (see
Soby Mathew58523c02015-06-08 12:32:50 +01001389`pwr_domain_suspend_finish()`).
Achin Gupta4f6ad662013-10-25 09:08:21 +01001390
Soby Mathew58523c02015-06-08 12:32:50 +01001391#### plat_psci_ops.pwr_domain_on_finish()
Achin Gupta4f6ad662013-10-25 09:08:21 +01001392
1393This function is called by the PSCI implementation after the calling CPU is
1394powered on and released from reset in response to an earlier PSCI `CPU_ON` call.
1395It performs the platform-specific setup required to initialize enough state for
1396this CPU to enter the normal world and also provide secure runtime firmware
1397services.
1398
Soby Mathew58523c02015-06-08 12:32:50 +01001399The `target_state` (first argument) is the prior state of the power domains
1400immediately before the CPU was turned on. It indicates which power domains
1401above the CPU might require initialization due to having previously been in
1402low power states. The generic code expects the handler to succeed.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001403
Soby Mathew58523c02015-06-08 12:32:50 +01001404#### plat_psci_ops.pwr_domain_suspend_finish()
Achin Gupta4f6ad662013-10-25 09:08:21 +01001405
1406This function is called by the PSCI implementation after the calling CPU is
1407powered on and released from reset in response to an asynchronous wakeup
1408event, for example a timer interrupt that was programmed by the CPU during the
Soby Mathewc0aff0e2014-12-17 14:47:57 +00001409`CPU_SUSPEND` call or `SYSTEM_SUSPEND` call. It performs the platform-specific
1410setup required to restore the saved state for this CPU to resume execution
1411in the normal world and also provide secure runtime firmware services.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001412
Soby Mathew58523c02015-06-08 12:32:50 +01001413The `target_state` (first argument) has a similar meaning as described in
1414the `pwr_domain_on_finish()` operation. The generic code expects the platform
1415to succeed.
Soby Mathew539dced2014-10-02 16:56:51 +01001416
Soby Mathew58523c02015-06-08 12:32:50 +01001417#### plat_psci_ops.validate_power_state()
Soby Mathew539dced2014-10-02 16:56:51 +01001418
1419This function is called by the PSCI implementation during the `CPU_SUSPEND`
Soby Mathew58523c02015-06-08 12:32:50 +01001420call to validate the `power_state` parameter of the PSCI API and if valid,
1421populate it in `req_state` (second argument) array as power domain level
1422specific local states. If the `power_state` is invalid, the platform must
1423return PSCI_E_INVALID_PARAMS as error, which is propagated back to the
1424normal world PSCI client.
Soby Mathew539dced2014-10-02 16:56:51 +01001425
Soby Mathew58523c02015-06-08 12:32:50 +01001426#### plat_psci_ops.validate_ns_entrypoint()
Soby Mathew539dced2014-10-02 16:56:51 +01001427
Soby Mathewc0aff0e2014-12-17 14:47:57 +00001428This function is called by the PSCI implementation during the `CPU_SUSPEND`,
1429`SYSTEM_SUSPEND` and `CPU_ON` calls to validate the non-secure `entry_point`
Soby Mathew58523c02015-06-08 12:32:50 +01001430parameter passed by the normal world. If the `entry_point` is invalid,
1431the platform must return PSCI_E_INVALID_ADDRESS as error, which is
Soby Mathewc0aff0e2014-12-17 14:47:57 +00001432propagated back to the normal world PSCI client.
1433
Soby Mathew58523c02015-06-08 12:32:50 +01001434#### plat_psci_ops.get_sys_suspend_power_state()
Soby Mathewc0aff0e2014-12-17 14:47:57 +00001435
1436This function is called by the PSCI implementation during the `SYSTEM_SUSPEND`
Soby Mathew58523c02015-06-08 12:32:50 +01001437call to get the `req_state` parameter from platform which encodes the power
1438domain level specific local states to suspend to system affinity level. The
1439`req_state` will be utilized to do the PSCI state coordination and
1440`pwr_domain_suspend()` will be invoked with the coordinated target state to
1441enter system suspend.
Achin Gupta4f6ad662013-10-25 09:08:21 +01001442
Achin Gupta4f6ad662013-10-25 09:08:21 +01001443
Achin Guptaa4fa3cb2014-06-02 22:27:36 +010014443.4 Interrupt Management framework (in BL3-1)
1445----------------------------------------------
1446BL3-1 implements an Interrupt Management Framework (IMF) to manage interrupts
1447generated in either security state and targeted to EL1 or EL2 in the non-secure
1448state or EL3/S-EL1 in the secure state. The design of this framework is
1449described in the [IMF Design Guide]
1450
1451A platform should export the following APIs to support the IMF. The following
Dan Handley4a75b842015-03-19 19:24:43 +00001452text briefly describes each api and its implementation in ARM standard
1453platforms. The API implementation depends upon the type of interrupt controller
1454present in the platform. ARM standard platforms implements an ARM Generic
1455Interrupt Controller (ARM GIC) as per the version 2.0 of the
1456[ARM GIC Architecture Specification].
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001457
1458### Function : plat_interrupt_type_to_line() [mandatory]
1459
1460 Argument : uint32_t, uint32_t
1461 Return : uint32_t
1462
1463The ARM processor signals an interrupt exception either through the IRQ or FIQ
1464interrupt line. The specific line that is signaled depends on how the interrupt
1465controller (IC) reports different interrupt types from an execution context in
1466either security state. The IMF uses this API to determine which interrupt line
1467the platform IC uses to signal each type of interrupt supported by the framework
1468from a given security state.
1469
1470The first parameter will be one of the `INTR_TYPE_*` values (see [IMF Design
1471Guide]) indicating the target type of the interrupt, the second parameter is the
1472security state of the originating execution context. The return result is the
1473bit position in the `SCR_EL3` register of the respective interrupt trap: IRQ=1,
1474FIQ=2.
1475
Dan Handley4a75b842015-03-19 19:24:43 +00001476ARM standard platforms configure the ARM GIC to signal S-EL1 interrupts
1477as FIQs and Non-secure interrupts as IRQs from either security state.
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001478
1479
1480### Function : plat_ic_get_pending_interrupt_type() [mandatory]
1481
1482 Argument : void
1483 Return : uint32_t
1484
1485This API returns the type of the highest priority pending interrupt at the
1486platform IC. The IMF uses the interrupt type to retrieve the corresponding
1487handler function. `INTR_TYPE_INVAL` is returned when there is no interrupt
1488pending. The valid interrupt types that can be returned are `INTR_TYPE_EL3`,
1489`INTR_TYPE_S_EL1` and `INTR_TYPE_NS`.
1490
Dan Handley4a75b842015-03-19 19:24:43 +00001491ARM standard platforms read the _Highest Priority Pending Interrupt
1492Register_ (`GICC_HPPIR`) to determine the id of the pending interrupt. The type
1493of interrupt depends upon the id value as follows.
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001494
14951. id < 1022 is reported as a S-EL1 interrupt
14962. id = 1022 is reported as a Non-secure interrupt.
14973. id = 1023 is reported as an invalid interrupt type.
1498
1499
1500### Function : plat_ic_get_pending_interrupt_id() [mandatory]
1501
1502 Argument : void
1503 Return : uint32_t
1504
1505This API returns the id of the highest priority pending interrupt at the
Soby Mathew54718412015-10-27 10:01:06 +00001506platform IC. INTR_ID_UNAVAILABLE is returned when there is no interrupt
1507pending.
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001508
Dan Handley4a75b842015-03-19 19:24:43 +00001509ARM standard platforms read the _Highest Priority Pending Interrupt
1510Register_ (`GICC_HPPIR`) to determine the id of the pending interrupt. The id
1511that is returned by API depends upon the value of the id read from the interrupt
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001512controller as follows.
1513
15141. id < 1022. id is returned as is.
15152. id = 1022. The _Aliased Highest Priority Pending Interrupt Register_
1516 (`GICC_AHPPIR`) is read to determine the id of the non-secure interrupt. This
1517 id is returned by the API.
15183. id = 1023. `INTR_ID_UNAVAILABLE` is returned.
1519
1520
1521### Function : plat_ic_acknowledge_interrupt() [mandatory]
1522
1523 Argument : void
1524 Return : uint32_t
1525
1526This API is used by the CPU to indicate to the platform IC that processing of
1527the highest pending interrupt has begun. It should return the id of the
1528interrupt which is being processed.
1529
Dan Handley4a75b842015-03-19 19:24:43 +00001530This function in ARM standard platforms reads the _Interrupt Acknowledge
1531Register_ (`GICC_IAR`). This changes the state of the highest priority pending
1532interrupt from pending to active in the interrupt controller. It returns the
1533value read from the `GICC_IAR`. This value is the id of the interrupt whose
1534state has been changed.
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001535
1536The TSP uses this API to start processing of the secure physical timer
1537interrupt.
1538
1539
1540### Function : plat_ic_end_of_interrupt() [mandatory]
1541
1542 Argument : uint32_t
1543 Return : void
1544
1545This API is used by the CPU to indicate to the platform IC that processing of
1546the interrupt corresponding to the id (passed as the parameter) has
1547finished. The id should be the same as the id returned by the
1548`plat_ic_acknowledge_interrupt()` API.
1549
Dan Handley4a75b842015-03-19 19:24:43 +00001550ARM standard platforms write the id to the _End of Interrupt Register_
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001551(`GICC_EOIR`). This deactivates the corresponding interrupt in the interrupt
1552controller.
1553
1554The TSP uses this API to finish processing of the secure physical timer
1555interrupt.
1556
1557
1558### Function : plat_ic_get_interrupt_type() [mandatory]
1559
1560 Argument : uint32_t
1561 Return : uint32_t
1562
1563This API returns the type of the interrupt id passed as the parameter.
1564`INTR_TYPE_INVAL` is returned if the id is invalid. If the id is valid, a valid
1565interrupt type (one of `INTR_TYPE_EL3`, `INTR_TYPE_S_EL1` and `INTR_TYPE_NS`) is
1566returned depending upon how the interrupt has been configured by the platform
1567IC.
1568
Dan Handley4a75b842015-03-19 19:24:43 +00001569This function in ARM standard platforms configures S-EL1 interrupts
1570as Group0 interrupts and Non-secure interrupts as Group1 interrupts. It reads
1571the group value corresponding to the interrupt id from the relevant _Interrupt
1572Group Register_ (`GICD_IGROUPRn`). It uses the group value to determine the
1573type of interrupt.
1574
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001575
Soby Mathewc67b09b2014-07-14 16:57:23 +010015763.5 Crash Reporting mechanism (in BL3-1)
1577----------------------------------------------
1578BL3-1 implements a crash reporting mechanism which prints the various registers
Sandrine Bailleux44804252014-08-06 11:27:23 +01001579of the CPU to enable quick crash analysis and debugging. It requires that a
1580console is designated as the crash console by the platform which will be used to
1581print the register dump.
Soby Mathewc67b09b2014-07-14 16:57:23 +01001582
Sandrine Bailleux44804252014-08-06 11:27:23 +01001583The following functions must be implemented by the platform if it wants crash
1584reporting mechanism in BL3-1. The functions are implemented in assembly so that
1585they can be invoked without a C Runtime stack.
Soby Mathewc67b09b2014-07-14 16:57:23 +01001586
1587### Function : plat_crash_console_init
1588
1589 Argument : void
1590 Return : int
1591
Sandrine Bailleux44804252014-08-06 11:27:23 +01001592This API is used by the crash reporting mechanism to initialize the crash
1593console. It should only use the general purpose registers x0 to x2 to do the
1594initialization and returns 1 on success.
Soby Mathewc67b09b2014-07-14 16:57:23 +01001595
Soby Mathewc67b09b2014-07-14 16:57:23 +01001596### Function : plat_crash_console_putc
1597
1598 Argument : int
1599 Return : int
1600
1601This API is used by the crash reporting mechanism to print a character on the
1602designated crash console. It should only use general purpose registers x1 and
1603x2 to do its work. The parameter and the return value are in general purpose
1604register x0.
1605
Soby Mathew27713fb2014-09-08 17:51:01 +010016064. Build flags
1607---------------
1608
Soby Mathew58523c02015-06-08 12:32:50 +01001609* **ENABLE_PLAT_COMPAT**
1610 All the platforms ports conforming to this API specification should define
1611 the build flag `ENABLE_PLAT_COMPAT` to 0 as the compatibility layer should
1612 be disabled. For more details on compatibility layer, refer
1613 [Migration Guide].
1614
Soby Mathew27713fb2014-09-08 17:51:01 +01001615There are some build flags which can be defined by the platform to control
1616inclusion or exclusion of certain BL stages from the FIP image. These flags
1617need to be defined in the platform makefile which will get included by the
1618build system.
1619
Soby Mathew27713fb2014-09-08 17:51:01 +01001620* **NEED_BL33**
1621 By default, this flag is defined `yes` by the build system and `BL33`
1622 build option should be supplied as a build option. The platform has the option
1623 of excluding the BL3-3 image in the `fip` image by defining this flag to
1624 `no`.
1625
16265. C Library
Harry Liebela960f282013-12-12 16:03:44 +00001627-------------
1628
1629To avoid subtle toolchain behavioral dependencies, the header files provided
1630by the compiler are not used. The software is built with the `-nostdinc` flag
1631to ensure no headers are included from the toolchain inadvertently. Instead the
1632required headers are included in the ARM Trusted Firmware source tree. The
1633library only contains those C library definitions required by the local
1634implementation. If more functionality is required, the needed library functions
1635will need to be added to the local implementation.
1636
1637Versions of [FreeBSD] headers can be found in `include/stdlib`. Some of these
1638headers have been cut down in order to simplify the implementation. In order to
1639minimize changes to the header files, the [FreeBSD] layout has been maintained.
1640The generic C library definitions can be found in `include/stdlib` with more
1641system and machine specific declarations in `include/stdlib/sys` and
1642`include/stdlib/machine`.
1643
1644The local C library implementations can be found in `lib/stdlib`. In order to
1645extend the C library these files may need to be modified. It is recommended to
1646use a release version of [FreeBSD] as a starting point.
1647
1648The C library header files in the [FreeBSD] source tree are located in the
1649`include` and `sys/sys` directories. [FreeBSD] machine specific definitions
1650can be found in the `sys/<machine-type>` directories. These files define things
1651like 'the size of a pointer' and 'the range of an integer'. Since an AArch64
1652port for [FreeBSD] does not yet exist, the machine specific definitions are
1653based on existing machine types with similar properties (for example SPARC64).
1654
1655Where possible, C library function implementations were taken from [FreeBSD]
1656as found in the `lib/libc` directory.
1657
1658A copy of the [FreeBSD] sources can be downloaded with `git`.
1659
1660 git clone git://github.com/freebsd/freebsd.git -b origin/release/9.2.0
1661
1662
Soby Mathew27713fb2014-09-08 17:51:01 +010016636. Storage abstraction layer
Harry Liebeld265bd72014-01-31 19:04:10 +00001664-----------------------------
1665
1666In order to improve platform independence and portability an storage abstraction
1667layer is used to load data from non-volatile platform storage.
1668
1669Each platform should register devices and their drivers via the Storage layer.
1670These drivers then need to be initialized by bootloader phases as
1671required in their respective `blx_platform_setup()` functions. Currently
1672storage access is only required by BL1 and BL2 phases. The `load_image()`
1673function uses the storage layer to access non-volatile platform storage.
1674
Dan Handley4a75b842015-03-19 19:24:43 +00001675It is mandatory to implement at least one storage driver. For the ARM
1676development platforms the Firmware Image Package (FIP) driver is provided as
1677the default means to load data from storage (see the "Firmware Image Package"
1678section in the [User Guide]). The storage layer is described in the header file
1679`include/drivers/io/io_storage.h`. The implementation of the common library
Sandrine Bailleux121f2ae2015-01-28 10:11:48 +00001680is in `drivers/io/io_storage.c` and the driver files are located in
1681`drivers/io/`.
Harry Liebeld265bd72014-01-31 19:04:10 +00001682
1683Each IO driver must provide `io_dev_*` structures, as described in
1684`drivers/io/io_driver.h`. These are returned via a mandatory registration
1685function that is called on platform initialization. The semi-hosting driver
1686implementation in `io_semihosting.c` can be used as an example.
1687
1688The Storage layer provides mechanisms to initialize storage devices before
1689IO operations are called. The basic operations supported by the layer
1690include `open()`, `close()`, `read()`, `write()`, `size()` and `seek()`.
1691Drivers do not have to implement all operations, but each platform must
1692provide at least one driver for a device capable of supporting generic
1693operations such as loading a bootloader image.
1694
1695The current implementation only allows for known images to be loaded by the
Juan Castillo16948ae2015-04-13 17:36:19 +01001696firmware. These images are specified by using their identifiers, as defined in
1697[include/plat/common/platform_def.h] (or a separate header file included from
1698there). The platform layer (`plat_get_image_source()`) then returns a reference
1699to a device and a driver-specific `spec` which will be understood by the driver
1700to allow access to the image data.
Harry Liebeld265bd72014-01-31 19:04:10 +00001701
1702The layer is designed in such a way that is it possible to chain drivers with
1703other drivers. For example, file-system drivers may be implemented on top of
1704physical block devices, both represented by IO devices with corresponding
1705drivers. In such a case, the file-system "binding" with the block device may
1706be deferred until the file-system device is initialised.
1707
1708The abstraction currently depends on structures being statically allocated
1709by the drivers and callers, as the system does not yet provide a means of
1710dynamically allocating memory. This may also have the affect of limiting the
1711amount of open resources per driver.
1712
1713
Achin Gupta4f6ad662013-10-25 09:08:21 +01001714- - - - - - - - - - - - - - - - - - - - - - - - - -
1715
Dan Handley4a75b842015-03-19 19:24:43 +00001716_Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved._
Achin Gupta4f6ad662013-10-25 09:08:21 +01001717
1718
Achin Guptaa4fa3cb2014-06-02 22:27:36 +01001719[ARM GIC Architecture Specification]: http://arminfo.emea.arm.com/help/topic/com.arm.doc.ihi0048b/IHI0048B_gic_architecture_specification.pdf
1720[IMF Design Guide]: interrupt-framework-design.md
1721[User Guide]: user-guide.md
1722[FreeBSD]: http://www.freebsd.org
Dan Handley4a75b842015-03-19 19:24:43 +00001723[Firmware Design]: firmware-design.md
Soby Mathew58523c02015-06-08 12:32:50 +01001724[Power Domain Topology Design]: psci-pd-tree.md
1725[PSCI]: http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf
1726[Migration Guide]: platform-migration-guide.md
Achin Gupta4f6ad662013-10-25 09:08:21 +01001727
Andrew Thoelke2bf28e62014-03-20 10:48:23 +00001728[plat/common/aarch64/platform_mp_stack.S]: ../plat/common/aarch64/platform_mp_stack.S
1729[plat/common/aarch64/platform_up_stack.S]: ../plat/common/aarch64/platform_up_stack.S
Dan Handley4a75b842015-03-19 19:24:43 +00001730[plat/arm/board/fvp/fvp_pm.c]: ../plat/arm/board/fvp/fvp_pm.c
Andrew Thoelke2bf28e62014-03-20 10:48:23 +00001731[include/runtime_svc.h]: ../include/runtime_svc.h
Dan Handley4a75b842015-03-19 19:24:43 +00001732[include/plat/arm/common/arm_def.h]: ../include/plat/arm/common/arm_def.h
1733[include/plat/common/common_def.h]: ../include/plat/common/common_def.h
Dan Handleyb68954c2014-05-29 12:30:24 +01001734[include/plat/common/platform.h]: ../include/plat/common/platform.h
Dan Handley4a75b842015-03-19 19:24:43 +00001735[include/plat/arm/common/plat_arm.h]: ../include/plat/arm/common/plat_arm.h]