1###############################
2Details for the platform folder
3###############################
4
5*********************
6Interfacing with TF-M
7*********************
8
9platform/ext/target/tfm_peripherals_def.h
10=========================================
11This file should enumerate the hardware peripherals that are available for TF-M
12on the platform. The name of the peripheral used by a service is set in its
13manifest file. The platform have to provide a macro for each of the provided
14peripherals, that is substituted to a pointer to type
15``struct platform_data_t``. The memory that the pointer points
16to is allocated by the platform code. The pointer gets stored in the partitions
17database in SPM, and it is provided to the SPM HAL functions.
18
19Peripherals currently used by the services in TF-M
20--------------------------------------------------
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
29platform/include/tfm_spm_hal.h
30==============================
31This file contains the declarations of functions that a platform implementation
32has to provide for TF-M's SPM. For details see the comments in the file.
33
34platform/include/tfm_platform_system.h
35======================================
36This file contains the declarations of functions that a platform implementation
37has to provide for TF-M's Platform Service. For details see
38``docs/user_guides/services/tfm_platform_integration_guide.rst``
39
40**************
41System Startup
42**************
43
44Before calling ``main()``, platform startup code should initialise all system
45clocks, perform runtime initialisation and other steps such as setting the
46vector table. Configuration of the following features is optional as TF-M
47architecture code will check and initialise them:
48
49  - The Security Extension.
50  - The Floating-point Extension.
51
52*****************************
53Debug authentication settings
54*****************************
55
56A platform may provide the option to configure debug authentication. TF-M core
57calls the HAL function ``enum tfm_hal_status_t tfm_hal_platform_init(void)``
58in which debug authentication is configured based on the following defines:
59
60  - `DAUTH_NONE`: Debugging the system is not enabled.
61  - `DAUTH_NS_ONLY`: Invasive and non invasive debugging of non-secure code is
62    enabled.
63  - `DAUTH_FULL`: Invasive and non-invasive debugging of non-secure and secure
64    code is enabled.
65  - `DAUTH_CHIP_DEFAULT`: The debug authentication options are used that are set
66    by the chip vendor.
67
68The desired debug authentication configuration can be selected by setting one of
69the options above to the cmake command with the
70`-DDEBUG_AUTHENTICATION="<define>"` option. The default value of
71`DEBUG_AUTHENTICATION` is `DAUTH_CHIP_DEFAULT`.
72
73.. Note::
74   ``enum tfm_hal_status_t tfm_hal_platform_init(void)`` is called during the
75   TF-M core initialisation phase, before initialising secure partition. This
76   means that BL2 runs with the chip default setting.
77
78***********
79Sub-folders
80***********
81
82include
83=======
84This folder contains the interfaces that TF-M expects every target to provide.
85The code in this folder is created as a part of the TF-M project therefore it
86adheres to the BSD 3.0 license.
87
88ext
89===
90This folder contains code that has been imported from other projects so it may
91have licenses other than the BSD 3.0 used by the TF-M project.
92
93Please see the :doc:`platform_ext_folder` for details.
94
95--------------
96
97*Copyright (c) 2017-2022, Arm Limited. All rights reserved.*
98