Skip to content

Commit 6589cfd

Browse files
author
Wayne Ren
committed
board: emsdp: update the memory layout
update emsdp's memory layout definition according to latest requirement Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
1 parent 19af9fa commit 6589cfd

File tree

2 files changed

+108
-8
lines changed

2 files changed

+108
-8
lines changed

board/emsdp/rev1/configs/target_mem_config.h

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@
7373
#endif
7474
#endif
7575

76+
#ifndef EXT_ROM_START
77+
#define EXT_ROM_START 0x10000000
78+
#endif
79+
80+
#ifndef EXT_ROM_SIZE
81+
#define EXT_ROM_SIZE 0x1000000
82+
#endif
83+
7684
#ifndef EXT_RAM_START
7785
#define EXT_RAM_START 0x10000000
7886
#endif
@@ -81,19 +89,61 @@
8189
#define EXT_RAM_SIZE 0x1000000
8290
#endif
8391

92+
/**
93+
* The default regions assigned for application to use,
94+
by default, each region will use all the space
95+
of each memory device
96+
* User can config the start address and the size of
97+
the regions to limit the application using
98+
*/
99+
#ifndef REGION_ICCM_START
100+
#define REGION_ICCM_START ICCM_START
101+
#define REGION_ICCM_SIZE ICCM_SIZE
102+
#endif
103+
104+
#ifndef REGION_DCCM_START
105+
#define REGION_DCCM_START DCCM_START
106+
#define REGION_DCCM_SIZE DCCM_SIZE
107+
#endif
108+
109+
#ifndef REGION_EXT_RAM_START
110+
#define REGION_EXT_RAM_START EXT_RAM_START
111+
#define REGION_EXT_RAM_SIZE EXT_RAM_SIZE
112+
#endif
113+
114+
#ifdef LIB_MCUBOOT
115+
#error "EMSDP doesnot support MCUBOOT now"
116+
117+
#else /* !defined(LIB_MCUBOOT) */
118+
119+
#ifndef REGION_EXT_ROM_START
120+
#define REGION_EXT_ROM_START EXT_ROM_START
121+
#define REGION_EXT_ROM_SIZE EXT_ROM_SIZE
122+
#endif
123+
124+
#define IMAGE_HEAD_SIZE 0x0
125+
#endif /* LIB_MCUBOOT */
126+
127+
128+
/**
129+
* The default regions used to generate link script
130+
* User can select region by configuring REGION_ROM and REGION_RAM
131+
* For REGION_ROM, REGION_ICCM, REGION_EXT_ROM are available
132+
* For REGION_RAM, REGION_DCCM and REGION_EXT_RAM are available
133+
*/
84134
#ifndef REGION_ROM
85135
#ifdef ARC_FEATURE_ICACHE_PRESENT
86-
#define REGION_ROM EXT_RAM
136+
#define REGION_ROM REGION_EXT_ROM
87137
#else
88-
#define REGION_ROM ICCM
138+
#define REGION_ROM REGION_ICCM
89139
#endif
90140
#endif
91141

92142
#ifndef REGION_RAM
93143
#ifdef ARC_FEATURE_DCACHE_PRESENT
94-
#define REGION_RAM EXT_RAM
144+
#define REGION_RAM REGION_EXT_ROM
95145
#else
96-
#define REGION_RAM DCCM
146+
#define REGION_RAM REGION_DCCM
97147
#endif
98148
#endif
99149

board/emsdp/rev2/configs/target_mem_config.h

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@
7373
#endif
7474
#endif
7575

76+
#ifndef EXT_ROM_START
77+
#define EXT_ROM_START 0x10000000
78+
#endif
79+
80+
#ifndef EXT_ROM_SIZE
81+
#define EXT_ROM_SIZE 0x1000000
82+
#endif
83+
7684
#ifndef EXT_RAM_START
7785
#define EXT_RAM_START 0x10000000
7886
#endif
@@ -81,19 +89,61 @@
8189
#define EXT_RAM_SIZE 0x1000000
8290
#endif
8391

92+
/**
93+
* The default regions assigned for application to use,
94+
by default, each region will use all the space
95+
of each memory device
96+
* User can config the start address and the size of
97+
the regions to limit the application using
98+
*/
99+
#ifndef REGION_ICCM_START
100+
#define REGION_ICCM_START ICCM_START
101+
#define REGION_ICCM_SIZE ICCM_SIZE
102+
#endif
103+
104+
#ifndef REGION_DCCM_START
105+
#define REGION_DCCM_START DCCM_START
106+
#define REGION_DCCM_SIZE DCCM_SIZE
107+
#endif
108+
109+
#ifndef REGION_EXT_RAM_START
110+
#define REGION_EXT_RAM_START EXT_RAM_START
111+
#define REGION_EXT_RAM_SIZE EXT_RAM_SIZE
112+
#endif
113+
114+
#ifdef LIB_MCUBOOT
115+
#error "EMSDP doesnot support MCUBOOT now"
116+
117+
#else /* !defined(LIB_MCUBOOT) */
118+
119+
#ifndef REGION_EXT_ROM_START
120+
#define REGION_EXT_ROM_START EXT_ROM_START
121+
#define REGION_EXT_ROM_SIZE EXT_ROM_SIZE
122+
#endif
123+
124+
#define IMAGE_HEAD_SIZE 0x0
125+
#endif /* LIB_MCUBOOT */
126+
127+
128+
/**
129+
* The default regions used to generate link script
130+
* User can select region by configuring REGION_ROM and REGION_RAM
131+
* For REGION_ROM, REGION_ICCM, REGION_EXT_ROM are available
132+
* For REGION_RAM, REGION_DCCM and REGION_EXT_RAM are available
133+
*/
84134
#ifndef REGION_ROM
85135
#ifdef ARC_FEATURE_ICACHE_PRESENT
86-
#define REGION_ROM EXT_RAM
136+
#define REGION_ROM REGION_EXT_ROM
87137
#else
88-
#define REGION_ROM ICCM
138+
#define REGION_ROM REGION_ICCM
89139
#endif
90140
#endif
91141

92142
#ifndef REGION_RAM
93143
#ifdef ARC_FEATURE_DCACHE_PRESENT
94-
#define REGION_RAM EXT_RAM
144+
#define REGION_RAM REGION_EXT_ROM
95145
#else
96-
#define REGION_RAM DCCM
146+
#define REGION_RAM REGION_DCCM
97147
#endif
98148
#endif
99149

0 commit comments

Comments
 (0)