Skip to content

Commit 3783ec1

Browse files
authored
Update spm.md
- New section: New target configuration - Memory layout section moved to be a sub-section under New target configuration
1 parent 333c7c9 commit 3783ec1

File tree

1 file changed

+34
-29
lines changed

1 file changed

+34
-29
lines changed

docs/porting/psa/spm.md

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,24 @@ For more information about SPM, please refer to [the SPM overview page](/docs/de
66

77
**This page gives guidelines for silicon partners wishing to have Secure Partition Manager capabilities**
88

9-
### Memory layout
9+
### New target configuration
1010

11-
Typically, PSA platforms share the same RAM and flash between secure and nonsecure cores. To provide PSA isolation level 1 or higher, you need to partition both RAM and flash in a way the following image describes:
12-
13-
```text
14-
RAM
15-
+-----------+-------------+--------------------------------------------------+
16-
| Secure | Shared | Non-Secure |
17-
| RAM | RAM | RAM |
18-
+-----------+-------------+--------------------------------------------------+
19-
20-
Flash
21-
+-----------------------+----------------------------------------------------+
22-
| Secure | Non-Secure |
23-
| Flash | Flash |
24-
+-----------------------+----------------------------------------------------+
25-
26-
```
27-
28-
To achieve RAM and flash partitioning, you must add start and size values to a target configuration in `targets.json`. You can do this with the following steps:
11+
When adding a new target, a new root target node should be added to mbed-os/targets/targets.json file.
12+
For PSA support, specific PSA related fields should be defined for this target:
2913

3014
1. Secure target must inherit from `SPE_Target` meta-target.
3115
2. Nonsecure target must inherit from `NSPE_Target`.
32-
3. Both targets must override the default configuration by specifying flash RAM and shared RAM regions.
16+
3. Only for multicore architectures:
17+
- Both targets must add "SPM_MAILBOX" component. Mailbox mechanism is explained in [Mailbox section](#mailbox)
18+
- Both targets must override the default configuration by specifying flash RAM and shared RAM regions. This is explained in more details in [Memory layout section](#memory-layout)
19+
- Secure target must declare which is its corresponding nonsecure target using the "deliver_to_target" field.
20+
21+
These is demonstrated in the example below:
3322

3423
```json
3524
"FUTURE_SEQUANA_M0_PSA": {
36-
"inherits": ["SPE_Target", "FUTURE_SEQUANA_M0"],
37-
"extra_labels_add": ["PSOC6_PSA"],
25+
"inherits": ["SPE_Target"],
3826
"components_add": ["SPM_MAILBOX"],
39-
"macros_add": ["PSOC6_DYNSRM_DISABLE=1"],
4027
"deliver_to_target": "FUTURE_SEQUANA_PSA",
4128
"overrides": {
4229
"secure-rom-start": "0x10000000",
@@ -50,14 +37,11 @@ To achieve RAM and flash partitioning, you must add start and size values to a t
5037
"shared-ram-start": "0x08010000",
5138
"shared-ram-size": "0x1000"
5239
}
40+
...
5341
},
5442
"FUTURE_SEQUANA_PSA": {
55-
"inherits": ["NSPE_Target", "FUTURE_SEQUANA"],
56-
"sub_target": "FUTURE_SEQUANA_M0_PSA",
57-
"extra_labels_remove": ["CORDIO"],
58-
"extra_labels_add": ["PSOC6_PSA"],
43+
"inherits": ["NSPE_Target"],
5944
"components_add": ["SPM_MAILBOX"],
60-
"macros_add": ["PSOC6_DYNSRM_DISABLE=1"],
6145
"overrides": {
6246
"secure-rom-start": "0x10000000",
6347
"secure-rom-size": "0x78000",
@@ -70,10 +54,30 @@ To achieve RAM and flash partitioning, you must add start and size values to a t
7054
"shared-ram-start": "0x08010000",
7155
"shared-ram-size": "0x1000"
7256
}
57+
...
7358
}
7459
```
7560

76-
<span class="notes">**Note:** Only multicore architectures require a shared memory region.</span>
61+
#### Memory layout
62+
63+
Typically, PSA platforms share the same RAM and flash between secure and nonsecure cores. To provide PSA isolation level 1 or higher, you need to partition both RAM and flash in a way the following image describes:
64+
65+
```text
66+
RAM
67+
+-----------+-------------+--------------------------------------------------+
68+
| Secure | Shared | Non-Secure |
69+
| RAM | RAM | RAM |
70+
+-----------+-------------+--------------------------------------------------+
71+
72+
Flash
73+
+-----------------------+----------------------------------------------------+
74+
| Secure | Non-Secure |
75+
| Flash | Flash |
76+
+-----------------------+----------------------------------------------------+
77+
78+
```
79+
80+
To achieve RAM and flash partitioning, you must add start and size values to a target configuration in `targets.json` as in the example above.
7781

7882
### Linker scripts
7983

@@ -207,6 +211,7 @@ These are the guidelines you should follow if you have multicore systems:
207211
- This handler must call an Arm callback function. The [HAL functions section](#hal-functions) explains this in more detail.
208212
- It is your responsibility to clear the mailbox event. You can do this in the event handler.
209213
- For each core, implement the HAL function that notifies the peer processor about a mailbox event occurrence. This is a part of the HAL, and the section below explains this in more detail.
214+
- For each core, add the "SPM_MAILBOX" component field for its target node in mbed-os/targets/targets.json file.
210215

211216
### HAL functions
212217

0 commit comments

Comments
 (0)