Skip to content

Commit dbf05ce

Browse files
authored
Merge pull request #12735 from Patater/musca-tfm
Make MUSCA B1 and MUSCA A1 TF-M ready
2 parents ddf06fc + 6f6a92c commit dbf05ce

File tree

16 files changed

+578
-340
lines changed

16 files changed

+578
-340
lines changed

components/TARGET_PSA/services/attestation/COMPONENT_PSA_SRV_IMPL/attest_boot_status_loader.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include "attestation.h"
2222
#include "attestation_bootloader_data.h"
2323
#include "tfm_impl/tfm_boot_status.h"
24+
#ifdef TARGET_TFM
25+
#include "region_defs.h"
26+
#endif
2427

2528
/*!
2629
* \def SHARED_DATA_INITIALZED and SHARED_DATA_UNNITIALZED

platform/mbed_lib.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@
156156
}
157157
},
158158
"target_overrides": {
159-
"ARM_MUSCA_A1_NS": {
160-
"stdio-baud-rate": 115200
161-
},
162-
"ARM_MUSCA_A1_S": {
163-
"stdio-baud-rate": 115200
164-
},
165-
"ARM_MUSCA_B1_NS": {
166-
"stdio-baud-rate": 115200
167-
},
168-
"ARM_MUSCA_B1_S": {
169-
"stdio-baud-rate": 115200
170-
},
171159
"EFM32": {
172160
"stdio-baud-rate": 115200
173161
},

targets/TARGET_ARM_SSG/TARGET_MUSCA_A1/device/TOOLCHAIN_GCC_ARM/musca_ns.ld

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
MEMORY
3434
{
35-
CODE_RAM (rx) : ORIGIN = NS_CODE_START, LENGTH = ((TOTAL_CODE_SRAM_SIZE / 2) - BL2_HEADER_SIZE)
35+
FLASH (rx) : ORIGIN = NS_CODE_START, LENGTH = NS_CODE_SIZE
3636
/* Vector table is copied to RAM, so RAM address needs to be adjusted */
3737
RAM (rwx) : ORIGIN = NVIC_RAM_VECTOR_LIMIT, LENGTH = (NS_DATA_SIZE - NVIC_RAM_VECTOR_SIZE)
3838
}
@@ -46,37 +46,20 @@ ENTRY(Reset_Handler)
4646

4747
SECTIONS
4848
{
49-
/* Startup section is loaded to Flash and runs from Flash */
50-
.startup :
49+
.text :
5150
{
5251
KEEP(*(.vectors))
5352
__Vectors_End = .;
5453
__Vectors_Size = __Vectors_End - __Vectors;
5554
__end__ = .;
5655

56+
*(.text*)
5757
KEEP(*(.init))
5858
KEEP(*(.fini))
5959

60-
} > CODE_RAM
6160

62-
.ARM.extab :
63-
{
64-
*(.ARM.extab* .gnu.linkonce.armextab.*)
65-
} > CODE_RAM
6661

67-
__exidx_start = .;
68-
.ARM.exidx :
69-
{
70-
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
71-
} > CODE_RAM
72-
__exidx_end = .;
7362

74-
/* The text section is loaded into Flash but runs from SRAM
75-
* The load address is aligned to 8 bytes
76-
*/
77-
.text : ALIGN(8)
78-
{
79-
*(.text*)
8063

8164
/* .ctors */
8265
*crtbegin.o(.ctors)
@@ -95,25 +78,26 @@ SECTIONS
9578
*(.rodata*)
9679

9780
KEEP(*(.eh_frame*))
98-
} >CODE_RAM
99-
. = ALIGN(8); /* This alignment is needed to make the section size 8 bytes aligned */
100-
101-
/* Create same symbols that armclang does so that in the c files
102-
* we do not have to deal with the compiler type
103-
*/
104-
Image$$ER_CODE_SRAM$$Base = ADDR(.text);
105-
Image$$ER_CODE_SRAM$$Limit = .;
106-
Image$$ER_CODE_SRAM$$Length = Image$$ER_CODE_SRAM$$Limit - Image$$ER_CODE_SRAM$$Base;
107-
Load$$ER_CODE_SRAM$$Base = LOADADDR(.text);
108-
Load$$ER_CODE_SRAM$$Length = Image$$ER_CODE_SRAM$$Length;
109-
Load$$ER_CODE_SRAM$$Limit = Load$$ER_CODE_SRAM$$Base + Load$$ER_CODE_SRAM$$Length;
81+
} > FLASH
82+
83+
.ARM.extab :
84+
{
85+
*(.ARM.extab* .gnu.linkonce.armextab.*)
86+
} > FLASH
87+
88+
__exidx_start = .;
89+
.ARM.exidx :
90+
{
91+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
92+
} > FLASH
93+
__exidx_end = .;
11094

11195
/* To copy multiple ROM to RAM sections,
11296
* define etext2/data2_start/data2_end and
11397
* define __STARTUP_COPY_MULTIPLE in startup_cmsdk_musca_ns.S */
11498
.copy.table :
11599
{
116-
. = ALIGN(8);
100+
. = ALIGN(4);
117101
__copy_table_start__ = .;
118102
LONG (__etext)
119103
LONG (__data_start__)
@@ -122,64 +106,65 @@ SECTIONS
122106
LONG (DEFINED(__data2_start__) ? __data2_start__ : 0)
123107
LONG (DEFINED(__data2_start__) ? __data2_end__ - __data2_start__ : 0)
124108
__copy_table_end__ = .;
125-
} > CODE_RAM
109+
} > FLASH
126110

127111
/* To clear multiple BSS sections,
112+
* uncomment .zero.table section and,
128113
* define __STARTUP_CLEAR_BSS_MULTIPLE in startup_cmsdk_musca_ns.S */
129114
.zero.table :
130115
{
131-
. = ALIGN(8);
116+
. = ALIGN(4);
132117
__zero_table_start__ = .;
133118
LONG (__bss_start__)
134119
LONG (__bss_end__ - __bss_start__)
135120
LONG (DEFINED(__bss2_start__) ? __bss2_start__ : 0)
136121
LONG (DEFINED(__bss2_start__) ? __bss2_end__ - __bss2_start__ : 0)
137122
__zero_table_end__ = .;
138-
} > CODE_RAM
123+
} > FLASH
139124

140125
__etext = .;
141126

142-
.data : ALIGN(8)
127+
.data : AT (__etext)
143128
{
144129
__data_start__ = .;
145130
*(vtable)
146131
*(.data*)
147132

148-
. = ALIGN(8);
133+
. = ALIGN(4);
149134
/* preinit data */
150135
PROVIDE_HIDDEN (__preinit_array_start = .);
151136
KEEP(*(.preinit_array))
152137
PROVIDE_HIDDEN (__preinit_array_end = .);
153138

154-
. = ALIGN(8);
139+
. = ALIGN(4);
155140
/* init data */
156141
PROVIDE_HIDDEN (__init_array_start = .);
157142
KEEP(*(SORT(.init_array.*)))
158143
KEEP(*(.init_array))
159144
PROVIDE_HIDDEN (__init_array_end = .);
160145

161146

162-
. = ALIGN(8);
147+
. = ALIGN(4);
163148
/* finit data */
164149
PROVIDE_HIDDEN (__fini_array_start = .);
165150
KEEP(*(SORT(.fini_array.*)))
166151
KEEP(*(.fini_array))
167152
PROVIDE_HIDDEN (__fini_array_end = .);
168153

169154
KEEP(*(.jcr*))
170-
. = ALIGN(8);
155+
. = ALIGN(4);
171156
/* All data end */
172157
__data_end__ = .;
173158

174-
} > RAM AT>CODE_RAM
159+
} > RAM
175160

176161
.bss :
177162
{
178-
. = ALIGN(8);
163+
. = ALIGN(4);
179164
__bss_start__ = .;
180165
*(.bss*)
181166
*(COMMON)
182-
. = ALIGN(8);
167+
. = ALIGN(4);
183168
__bss_end__ = .;
184169
} > RAM
185170

targets/TARGET_ARM_SSG/TARGET_MUSCA_A1/device/device_cfg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@
8080
#define USEC_REPORTED_FREQ_HZ (TIMER_FREQ_HZ >> USEC_REPORTED_SHIFT)
8181
#define USEC_REPORTED_BITS (32 - USEC_REPORTED_SHIFT)
8282

83-
#define UART_DEFAULT_BAUD_RATE 9600U
83+
#define DEFAULT_UART_BAUDRATE 9600U
8484

8585
#endif /* __ARM_LTD_DEVICE_CFG_H__ */

0 commit comments

Comments
 (0)