Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 1 | ############################### |
| 2 | Details for the platform folder |
| 3 | ############################### |
| 4 | |
Miklos Balint | c7b1b6c | 2019-04-24 12:38:36 +0200 | [diff] [blame] | 5 | ********************* |
| 6 | Interfacing with TF-M |
| 7 | ********************* |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 8 | |
Minos Galanakis | fc6804e | 2020-03-10 11:03:34 +0000 | [diff] [blame] | 9 | platform/ext/target/tfm_peripherals_def.h |
| 10 | ========================================= |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 11 | This file should enumerate the hardware peripherals that are available for TF-M |
| 12 | on the platform. The name of the peripheral used by a service is set in its |
| 13 | manifest file. The platform have to provide a macro for each of the provided |
| 14 | peripherals, that is substituted to a pointer to type |
Ken Liu | 172f1e3 | 2021-02-05 16:31:03 +0800 | [diff] [blame] | 15 | ``struct platform_data_t``. The memory that the pointer points |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 16 | to is allocated by the platform code. The pointer gets stored in the partitions |
| 17 | database in SPM, and it is provided to the SPM HAL functions. |
| 18 | |
| 19 | Peripherals currently used by the services in TF-M |
| 20 | -------------------------------------------------- |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 21 | - ``TFM_PERIPHERAL_UART1``- UART1 |
| 22 | |
| 23 | .. Note:: |
| 24 | |
| 25 | If a platform doesn't support a peripheral, that is used by a service, then |
| 26 | the service cannot be used on the given platform. Using a peripheral in |
| 27 | TF-M that is not supported by the platform results in compile error. |
| 28 | |
| 29 | platform/include/tfm_spm_hal.h |
| 30 | ============================== |
| 31 | This file contains the declarations of functions that a platform implementation |
Miklos Balint | c7b1b6c | 2019-04-24 12:38:36 +0200 | [diff] [blame] | 32 | has to provide for TF-M's SPM. For details see the comments in the file. |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 33 | |
Ken Liu | b8ed8ba | 2019-07-09 12:52:08 +0800 | [diff] [blame] | 34 | secure_fw/core/include/tfm_platform_core_api.h |
| 35 | ============================================== |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 36 | This file contains declarations of functions that can be or have to be called |
| 37 | from platform implementations. For details see the comments in the file. |
| 38 | |
Miklos Balint | c7b1b6c | 2019-04-24 12:38:36 +0200 | [diff] [blame] | 39 | platform/include/tfm_platform_system.h |
| 40 | ====================================== |
| 41 | This file contains the declarations of functions that a platform implementation |
| 42 | has to provide for TF-M's Platform Service. For details see |
| 43 | ``docs/user_guides/services/tfm_platform_integration_guide.rst`` |
| 44 | |
Jamie Fox | cdfb6cd | 2020-09-21 21:21:30 +0100 | [diff] [blame] | 45 | ************** |
| 46 | System Startup |
| 47 | ************** |
| 48 | |
| 49 | Before calling ``main()``, platform startup code should initialise all system |
| 50 | clocks, perform runtime initialisation and other steps such as setting the |
| 51 | vector table. Configuration of the following features is optional as TF-M |
| 52 | architecture code will check and initialise them: |
| 53 | |
| 54 | - The Security Extension. |
| 55 | - The Floating-point Extension. |
| 56 | |
Mate Toth-Pal | e50af97 | 2019-11-22 07:42:44 +0100 | [diff] [blame] | 57 | ***************************** |
| 58 | Debug authentication settings |
| 59 | ***************************** |
| 60 | |
| 61 | A platform may provide the option to configure debug authentication. TF-M core |
Kevin Peng | ab8fa29 | 2021-09-15 15:46:22 +0800 | [diff] [blame] | 62 | calls the HAL function ``enum tfm_hal_status_t tfm_hal_platform_init(void)`` |
| 63 | in which debug authentication is configured based on the following defines: |
Mate Toth-Pal | e50af97 | 2019-11-22 07:42:44 +0100 | [diff] [blame] | 64 | |
| 65 | - `DAUTH_NONE`: Debugging the system is not enabled. |
| 66 | - `DAUTH_NS_ONLY`: Invasive and non invasive debugging of non-secure code is |
| 67 | enabled. |
| 68 | - `DAUTH_FULL`: Invasive and non-invasive debugging of non-secure and secure |
| 69 | code is enabled. |
| 70 | - `DAUTH_CHIP_DEFAULT`: The debug authentication options are used that are set |
| 71 | by the chip vendor. |
| 72 | |
| 73 | The desired debug authentication configuration can be selected by setting one of |
| 74 | the options above to the cmake command with the |
| 75 | `-DDEBUG_AUTHENTICATION="<define>"` option. The default value of |
| 76 | `DEBUG_AUTHENTICATION` is `DAUTH_CHIP_DEFAULT`. |
| 77 | |
| 78 | .. Note:: |
Kevin Peng | ab8fa29 | 2021-09-15 15:46:22 +0800 | [diff] [blame] | 79 | ``enum tfm_hal_status_t tfm_hal_platform_init(void)`` is called during the |
Mate Toth-Pal | e50af97 | 2019-11-22 07:42:44 +0100 | [diff] [blame] | 80 | TF-M core initialisation phase, before initialising secure partition. This |
| 81 | means that BL2 runs with the chip default setting. |
| 82 | |
Gyorgy Szing | db9783c | 2019-04-17 21:08:48 +0200 | [diff] [blame] | 83 | *********** |
| 84 | Sub-folders |
| 85 | *********** |
| 86 | |
| 87 | include |
| 88 | ======= |
| 89 | This folder contains the interfaces that TF-M expects every target to provide. |
| 90 | The code in this folder is created as a part of the TF-M project therefore it |
| 91 | adheres to the BSD 3.0 license. |
| 92 | |
| 93 | ext |
| 94 | === |
| 95 | This folder contains code that has been imported from other projects so it may |
| 96 | have licenses other than the BSD 3.0 used by the TF-M project. |
| 97 | |
| 98 | Please see the :doc:`readme file the ext folder <ext/readme>` for details. |
| 99 | |
| 100 | -------------- |
| 101 | |
Mate Toth-Pal | e50af97 | 2019-11-22 07:42:44 +0100 | [diff] [blame] | 102 | *Copyright (c) 2017-2020, Arm Limited. All rights reserved.* |