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
In order to achieve RAM and Flash partitioning start and size values must be added to target a configuration in `targets.json`.
31
+
The process of defining can be described in the following steps:
32
+
1. secure target must inherit from `SPE_Target` meta-target
33
+
2. non-secure target must inherit from `NSPE_Target`
34
+
3. both targets must override default configuration by specifying flash RAM and shared RAM regions.
35
+
36
+
```json
37
+
"FUTURE_SEQUANA_M0_PSA": {
38
+
"inherits": ["SPE_Target", "FUTURE_SEQUANA_M0"],
39
+
"extra_labels_add": ["PSOC6_PSA"],
40
+
"components_add": ["SPM_MAILBOX"],
41
+
"macros_add": ["PSOC6_DYNSRM_DISABLE=1"],
42
+
"deliver_to_target": "FUTURE_SEQUANA_PSA",
43
+
"overrides": {
44
+
"secure-rom-start": "0x10000000",
45
+
"secure-rom-size": "0x78000",
46
+
"non-secure-rom-start": "0x10080000",
47
+
"non-secure-rom-size": "0x78000",
48
+
"secure-ram-start": "0x08000000",
49
+
"secure-ram-size": "0x10000",
50
+
"non-secure-ram-start": "0x08011000",
51
+
"non-secure-ram-size": "0x36800",
52
+
"shared-ram-start": "0x08010000",
53
+
"shared-ram-size": "0x1000"
54
+
}
55
+
},
56
+
"FUTURE_SEQUANA_PSA": {
57
+
"inherits": ["NSPE_Target", "FUTURE_SEQUANA"],
58
+
"sub_target": "FUTURE_SEQUANA_M0_PSA",
59
+
"extra_labels_remove": ["CORDIO"],
60
+
"extra_labels_add": ["PSOC6_PSA"],
61
+
"components_add": ["SPM_MAILBOX"],
62
+
"macros_add": ["PSOC6_DYNSRM_DISABLE=1"],
63
+
"overrides": {
64
+
"secure-rom-start": "0x10000000",
65
+
"secure-rom-size": "0x78000",
66
+
"non-secure-rom-start": "0x10080000",
67
+
"non-secure-rom-size": "0x78000",
68
+
"secure-ram-start": "0x08000000",
69
+
"secure-ram-size": "0x10000",
70
+
"non-secure-ram-start": "0x08011000",
71
+
"non-secure-ram-size": "0x36800",
72
+
"shared-ram-start": "0x08010000",
73
+
"shared-ram-size": "0x1000"
74
+
}
75
+
}
76
+
```
13
77
14
-
Linker scripts guidelines:
15
-
-*__shared_memory_start* symbol is used in SPM code so it must be set with the start address of the shared memory
16
-
-*__shared_memory_start* must be 4 bytes aligned
17
-
-*__shared_memory_end* symbol is used in SPM code so it must be set with the end address of the shared memory
18
-
- SHARED_RAM must have Read/Write permissions from secure and non-secure cores
19
-
- SHARED_RAM address must be 4 bytes aligned
20
-
- SHARED_RAM must be given a minimum memory space of 256 bytes
21
-
- Secure RAM base address must be 4 bytes aligned and have Read/Write permissions only from secure core
22
-
- Secure FLASH base address must be 4 bytes aligned and have Read/Write/Execute permissions only from secure core
23
-
- Non-Secure RAM base address must be 4 bytes aligned and have Read/Write permissions from secure and non-secure cores
24
-
- Non-Secure FLASH base address must be 4 bytes aligned; must have Read permissions from secure and non-secure cores, and Execute permissions from non-secure core; May have Write permissions from secure and non-secure cores
78
+
> Note: shared memory region is required only for multi core architectures.
25
79
26
-
This is an example of the relevant parts inside the linker scripts:
80
+
## Linker Scripts
27
81
28
-
#### SECURE Core Linker Script
82
+
Linker scripts mast include `MBED_ROM_START`, `MBED_ROM_SIZE`, `MBED_RAM_START` and `MBED_RAM_START` macros for defining memory regions.
83
+
Shared memory region is defined by reserving RAM space for shared memory usage. Shared memory location is target specific and depends on the memory protection scheme applied.
84
+
Typically shared memory will be located before/after non-secure RAM, for saving MPU regions. Shared memory region is considered non-secure memory used by both cores.
29
85
86
+
### Linker Script example GCC_ARM
30
87
```
31
-
...
32
-
...
33
-
MEMORY
34
-
{
35
-
/* The ram and flash regions control RAM and flash memory allocation for the SECURE core.
36
-
* You can change the memory allocation by editing the 'ram' and 'flash' regions.
37
-
* Your changes must be aligned with the corresponding memory regions for the NON-SECURE core in the
define symbol __ICFEDIT_region_IRAM1_start__ = MBED_RAM_START;
173
+
define symbol __ICFEDIT_region_IRAM1_end__ = (MBED_RAM_START + MBED_RAM_SIZE);
174
+
175
+
/* Flash */
176
+
define symbol __ICFEDIT_region_IROM1_start__ = MBED_ROM_START;
177
+
define symbol __ICFEDIT_region_IROM1_end__ = (MBED_ROM_START + MBED_ROM_SIZE);
178
+
...
179
+
```
88
180
89
181
## Mailbox
90
182
@@ -115,10 +207,7 @@ Target specific code of silicon partners who wish to have SPM capabilities must:
115
207
- Implement a list of functions which are being called by SPM code
116
208
- Call other functions supplied by ARM
117
209
118
-
The HAL can be logically divided into 3 different fields:
119
-
120
-
#### Addresses
121
-
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.
210
+
The HAL can be logically divided into 2 different fields:
122
211
123
212
#### Mailbox
124
213
This part of HAL allows the silicon partner to implement a thin layer of the mailbox mechanism which is specific to their platform.
0 commit comments