You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/porting/psa/spm.md
+36-3Lines changed: 36 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ SPM (Secure Partition Manager) is a part of the PSA Firmware Framework that is r
4
4
5
5
**This page gives guidelines for silicon partners wishing to have Secure Partition Manager capabilities**
6
6
7
+
7
8
## Linker Scripts
8
9
9
10
Silicon partners must edit the secure and non-secure linker scripts to define sections for RAM, FLASH and SHARED_RAM.
@@ -82,16 +83,48 @@ MEMORY
82
83
...
83
84
```
84
85
86
+
87
+
## Mailbox
88
+
89
+
Mailbox is the SPM mechanism in charge of Inter Processor Communication.
90
+
Therefore, it is relevant for multi-core systems only.
91
+
92
+
#### Concepts
93
+
The mailbox mechanism is based on message queues and dispatcher threads.
94
+
Each core has a single dispatcher thread, and a single message queue.
95
+
The dispatcher thread waits on a mailbox event. Once this event occurs, the dispatcher thread reads and runs "tasks" accumulated on its local message queue.
96
+
97
+
#### Requirements
98
+
The SPM mailbox mechanism requires that the platform should have the following capabilities:
99
+
* Inter Processor Communication capabilities - The ability to notify the peer processor about an event (usually implemented with interrupts)
100
+
* Ability to set a RAM section which is shared between the cores
101
+
102
+
#### Porting
103
+
These are the guidelines which should be followed by silicon partners with multi-core systems:
104
+
- For each core, initialize, configure and enable the a mailbox event (usually an interrupt) at SystemInit()
105
+
- For each core, implement the mailbox event handler (usually interrupt handler):
106
+
- This handler must call an ARM callback function. This is explained in more details in the [HAL Functions section](#hal-functions)
107
+
- It is the silicon partner's responsibility to clear the mailbox event. This can be done in the event handler.
108
+
- For each core, implement the HAL function which notifies the peer processor about a mailbox event occurrence. This is a part of the HAL, and explained in more details in the [HAL Functions section](#hal-functions)
109
+
110
+
85
111
## HAL Functions
86
112
87
113
Target specific code of silicon partners who wish to have SPM capabilities must:
88
114
- Implement a list of functions which are being called by SPM code
89
115
- Call other functions supplied by ARM
90
116
91
117
The HAL can be logically divided into 3 different fields:
92
-
-**Addresses:** This part of HAL allows the silicon partner to share the addresses set in the linker scripts with the SPM code. The SPM uses these addresses mostly to enforce access permissions.
93
-
-**Mailbox:** The mailbox is the mechanism for Inter Processor Communication. This part of HAL allows the silicon partner to implement specific parts of the mailbox mechanism according to the specification of the their specific platform.
94
-
-**Secure Partition Environment:** This part of HAL allows the silicon partner to apply their specific memory protection scheme.
118
+
119
+
#### Addresses
120
+
This part of HAL allows the silicon partner to share the addresses set in the linker scripts with the SPM code. The SPM uses these addresses mostly to enforce access permissions.
121
+
122
+
#### Mailbox
123
+
This part of HAL allows the silicon partner to implement a thin layer of the mailbox mechanism which is specific to their platform.
124
+
It must be implemented only by silicon partners with multi-core systems.
125
+
126
+
#### Secure Processing Environment
127
+
This part of HAL allows the silicon partner to apply their specific memory protection scheme.
95
128
96
129
A list of these functions can be found here [TODO: WHEN READY, ADD LINK TO DOXYGEN FILES OF HAL FUNCTIONS]
0 commit comments