|
19 | 19 | #ifndef __PARTITION_M2354_MEM_H__ |
20 | 20 | #define __PARTITION_M2354_MEM_H__ |
21 | 21 |
|
22 | | -/* About partition_M2354_mem.h/partition_M2354_mem.icf.h |
23 | | - * |
24 | | - * 1. partition_M2354_mem.h is created for centralizing memory partition configuration. It will be |
25 | | - * included by C/C++ files and linker files (except IAR linker file). |
26 | | - * 2. IAR linker doesn't support preprocessor, so partition_M2354_mem.icf.h, duplicate of partition_M2354_mem.h |
27 | | - * is created for IAR linker file. |
28 | | - * 3. To continue above, we name partition_M2354_mem.icf.h instead of partition_M2354_mem.icf because: |
29 | | - * (1) Mbed OS build tool may mis-regard partition_M2354_mem.icf as the main linker configuration file. |
30 | | - * (2) *.icf files may not be present in search directories for "include" directive. Per observation, |
31 | | - * the search directories are inconsistent among normal example build and test code build. To address |
32 | | - * it, we name partition_M2354_mem.icf.h instead because *.h files are always present in these builds |
33 | | - * (already there or via copy). |
34 | | - */ |
35 | | - |
36 | 22 | #include "nu_tfm_import_define.h" |
37 | 23 | #include NU_TFM_S_REGION_DEFS_H_PATH |
38 | 24 | #include "nu_tfm_import_undefine.h" |
39 | 25 |
|
40 | | -/* Resolve MBED_ROM_START and friends |
| 26 | +/* Resolve MBED_ROM_BANK_NS_CODE_START and friends |
41 | 27 | * |
42 | | - * TF-M exported region_defs.h essentially resolves MBED_ROM_START and friends. |
43 | | - * target.mbed_rom_start and friends get unnecessary. |
| 28 | + * TF-M exported region_defs.h essentially resolves MBED_ROM_BANK_NS_CODE_START and friends. |
44 | 29 | */ |
45 | | -/* Resolve non-secure ROM start */ |
46 | | -#undef MBED_ROM_START |
47 | | -#define MBED_ROM_START NS_CODE_START |
48 | | - |
49 | | -/* Resolve non-secure ROM size */ |
50 | | -#undef MBED_ROM_SIZE |
51 | | -#define MBED_ROM_SIZE NS_CODE_SIZE |
52 | | - |
53 | | -/* Resolve non-secure RAM start */ |
54 | | -#undef MBED_RAM_START |
55 | | -#define MBED_RAM_START NS_DATA_START |
56 | | - |
57 | | -/* Resolve non-secure RAM size */ |
58 | | -#undef MBED_RAM_SIZE |
59 | | -#define MBED_RAM_SIZE NS_DATA_SIZE |
60 | | - |
61 | | -/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just |
62 | | - * MBED_APP_xxx macros to linker files even though they mean the same thing. |
63 | | - * Because this file is to include by both C/C++ files and linker files, we add |
64 | | - * these macros according to the others for consistency when they are missing |
65 | | - * in compile or link stage. */ |
66 | 30 |
|
67 | | -#ifndef APPLICATION_ADDR |
68 | | -#ifdef MBED_APP_START |
69 | | -#define APPLICATION_ADDR MBED_APP_START |
70 | | -#else |
71 | | -#define APPLICATION_ADDR MBED_ROM_START |
72 | | -#endif |
73 | | -#endif |
74 | | - |
75 | | -#ifndef APPLICATION_SIZE |
76 | | -#ifdef MBED_APP_SIZE |
77 | | -#define APPLICATION_SIZE MBED_APP_SIZE |
78 | | -#else |
79 | | -#define APPLICATION_SIZE MBED_ROM_SIZE |
80 | | -#endif |
| 31 | +/* Physical NS_CODE start/size */ |
| 32 | +#if !defined(MBED_ROM_BANK_NS_CODE_START) |
| 33 | +#define MBED_ROM_BANK_NS_CODE_START NS_CODE_START |
81 | 34 | #endif |
| 35 | +#if !defined(MBED_ROM_BANK_NS_CODE_SIZE) |
| 36 | +#define MBED_ROM_BANK_NS_CODE_SIZE NS_CODE_SIZE |
| 37 | +#endif |
82 | 38 |
|
83 | | -#ifndef APPLICATION_RAM_ADDR |
84 | | -#ifdef MBED_RAM_APP_START |
85 | | -#define APPLICATION_RAM_ADDR MBED_RAM_APP_START |
86 | | -#else |
87 | | -#define APPLICATION_RAM_ADDR MBED_RAM_START |
| 39 | +/* Physical NS_DATA start/size */ |
| 40 | +#if !defined(MBED_RAM_BANK_NS_DATA_START) |
| 41 | +#define MBED_RAM_BANK_NS_DATA_START NS_DATA_START |
88 | 42 | #endif |
| 43 | +#if !defined(MBED_RAM_BANK_NS_DATA_SIZE) |
| 44 | +#define MBED_RAM_BANK_NS_DATA_SIZE NS_DATA_SIZE |
89 | 45 | #endif |
90 | 46 |
|
91 | | -#ifndef APPLICATION_RAM_SIZE |
92 | | -#ifdef MBED_RAM_APP_SIZE |
93 | | -#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE |
94 | | -#else |
95 | | -#define APPLICATION_RAM_SIZE MBED_RAM_SIZE |
96 | | -#endif |
| 47 | +/* Configured NS_CODE start/size */ |
| 48 | +#if !defined(MBED_CONFIGURED_ROM_BANK_NS_CODE_START) |
| 49 | +#define MBED_CONFIGURED_ROM_BANK_NS_CODE_START MBED_ROM_BANK_NS_CODE_START |
97 | 50 | #endif |
| 51 | +#if !defined(MBED_CONFIGURED_ROM_BANK_NS_CODE_SIZE) |
| 52 | +#define MBED_CONFIGURED_ROM_BANK_NS_CODE_SIZE MBED_ROM_BANK_NS_CODE_SIZE |
| 53 | +#endif |
98 | 54 |
|
99 | | -#ifndef MBED_APP_START |
100 | | -#define MBED_APP_START APPLICATION_ADDR |
| 55 | +/* Configured NS_DATA start/size */ |
| 56 | +#if !defined(MBED_CONFIGURED_RAM_BANK_NS_DATA_START) |
| 57 | +#define MBED_CONFIGURED_RAM_BANK_NS_DATA_START MBED_RAM_BANK_NS_DATA_START |
101 | 58 | #endif |
102 | | - |
103 | | -#ifndef MBED_APP_SIZE |
104 | | -#define MBED_APP_SIZE APPLICATION_SIZE |
105 | | -#endif |
106 | | - |
107 | | -#ifndef MBED_RAM_APP_START |
108 | | -#define MBED_RAM_APP_START APPLICATION_RAM_ADDR |
109 | | -#endif |
110 | | - |
111 | | -#ifndef MBED_RAM_APP_SIZE |
112 | | -#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE |
113 | | -#endif |
114 | | - |
115 | | -#if (APPLICATION_ADDR != MBED_APP_START) |
116 | | -#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!") |
117 | | -#endif |
118 | | - |
119 | | -#if (APPLICATION_SIZE != MBED_APP_SIZE) |
120 | | -#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!") |
121 | | -#endif |
122 | | - |
123 | | -#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) |
124 | | -#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!") |
125 | | -#endif |
126 | | - |
127 | | -#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) |
128 | | -#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!") |
| 59 | +#if !defined(MBED_CONFIGURED_RAM_BANK_NS_DATA_SIZE) |
| 60 | +#define MBED_CONFIGURED_RAM_BANK_NS_DATA_SIZE MBED_RAM_BANK_NS_DATA_SIZE |
129 | 61 | #endif |
130 | 62 |
|
131 | 63 | #endif /* __PARTITION_M2354_MEM_H__ */ |
0 commit comments