added k60d100m project
[adk-bluetooth-test.git] / examples / build / cw10gcc / bt_app_twrk70f120m / intflash_sramdata.ld
blob8398fc19bc131714607d45605283e173579be299
1 ENTRY(__boot)\r
2 \r
3 \r
4 /* \r
5 _cfm - to keep vectors.c variables\r
6 __init_hardware - must be used from bsp.a, not from librt.a\r
7 */\r
8 EXTERN(_cfm __init_hardware)\r
9 \r
11 MEMORY\r
12 {\r
13     vectorrom   (RX): ORIGIN = 0x00000000, LENGTH = 0x00000400\r
14     cfmprotrom  (R): ORIGIN = 0x00000400, LENGTH = 0x00000020\r
15     rom         (RX): ORIGIN = 0x00000420, LENGTH = 0x000FFBE0  /* Code + Const data */\r
16     ram         (RW): ORIGIN = 0x1FFF0000, LENGTH = 0x00020000  /* SRAM - RW data */\r
17     \r
18     /* kernel space starts after RAM variables (Location of MQX Kernel data + MQX heap) */\r
19     end_of_kd   (RW): ORIGIN = 0x2000FFF0, LENGTH = 0x00000000\r
20     \r
21     /* Boot stack reused by MQX Kernel data */\r
22     bstack      (RW): ORIGIN = 0x2000FA00, LENGTH = 0x00000200  /* Boot stack */\r
23     end_bstack  (RW): ORIGIN = 0x2000FC00, LENGTH = 0x00000000\r
24 }\r
27 SECTIONS\r
28 {\r
29     __INTERNAL_SRAM_BASE  = 0x1FFF0000;\r
30     __INTERNAL_SRAM_SIZE  = 0x00020000;\r
31     /* This symbol is unused in SRAM target (runtime check ensure that  SRAM pool = Kernel pool), \r
32      it is defined here just to keep linker quiete */\r
33     __SRAM_POOL = 0x2000FFF0;\r
34     \r
35     __INTERNAL_FLASH_BASE = 0x00000000;\r
36     __INTERNAL_FLASH_SIZE = 0x00100000;\r
37     \r
38     __INTERNAL_FLEXNVM_BASE = 0;\r
39     __INTERNAL_FLEXNVM_SIZE = 0;\r
40    \r
41     __UNCACHED_DATA_END      = 0x2000FFF0;\r
42     \r
43     __EXTERNAL_MRAM_BASE  = 0x60000000;\r
44     __EXTERNAL_MRAM_SIZE  = 0x00080000;\r
45     __EXTERNAL_MRAM_ROM_BASE = 0x60000000;\r
46     __EXTERNAL_MRAM_ROM_SIZE = 0x00000000;\r
47     __EXTERNAL_MRAM_RAM_BASE = 0x60000000;\r
48     __EXTERNAL_MRAM_RAM_SIZE = 0x00080000;\r
49     \r
50     __EXTERNAL_DDR2_RAM_BASE = 0x70000000;\r
51     __EXTERNAL_DDR2_RAM_SIZE = 0x08000000;\r
52    \r
53     __EXTERNAL_LCD_BASE = 0x60000000;\r
54     __EXTERNAL_LCD_SIZE = 0x1FFFF;\r
55     __EXTERNAL_LCD_DC_BASE = 0x60010000;\r
56     \r
57     /* MQX link time configurations */\r
58     __DEFAULT_PROCESSOR_NUMBER = 1;\r
59     __DEFAULT_INTERRUPT_STACK_SIZE = 1024;\r
60     __KERNEL_DATA_VERIFY_ENABLE = 0;    /* Test SDRAM read/write */\r
61     \r
62     /* Flashx configurations */\r
63     __FLASHX_SECT_SIZE = 0x1000;\r
64     \r
65     .vectors :\r
66     {\r
67         __vector_table = .;\r
68         __VECTOR_TABLE_ROM_START = __vector_table;\r
69         KEEP(*(.vectors_rom))\r
70         . = ALIGN (0x4); \r
71     } > vectorrom\r
72     \r
73     .cfmprotect :\r
74     {\r
75         KEEP(*(.cfmconfig))\r
76         . = ALIGN (0x4);\r
77     } > cfmprotrom\r
78     \r
79     .text :\r
80     {\r
81         *(KERNEL)\r
82         *(S_BOOT)\r
83         *(IPSUM)\r
84         *(.text*)\r
85         *(.eh_frame)\r
86         \r
87         KEEP (*(.init))\r
88         KEEP (*(.fini))\r
90         . = ALIGN(0x4);\r
91         *(.rodata*)\r
92         . = ALIGN(0x4);\r
93         *(.rdata*)\r
94         . = ALIGN(0x4);\r
95         *(.exception)\r
96         . = ALIGN(0x4);\r
97         __exception_table_start__ = .;\r
98         __exception_table_end__ = .;\r
99         __sinit__ = .;\r
100     } > rom\r
101     \r
102     .ARM.extab   : { *(.ARM.extab* .gnu.linkonce.armextab.*) } > rom\r
103     .ARM : {\r
104         __exidx_start = .;\r
105         *(.ARM.exidx*)\r
106         __exidx_end = .;\r
107     } > rom\r
108     \r
109     .ctors :\r
110     {\r
111         __CTOR_LIST__ = .;\r
112         /* gcc uses crtbegin.o to find the start of\r
113         the constructors, so we make sure it is\r
114         first.  Because this is a wildcard, it\r
115         doesn't matter if the user does not\r
116         actually link against crtbegin.o; the\r
117         linker won't look for a file to match a\r
118         wildcard.  The wildcard also means that it\r
119         doesn't matter which directory crtbegin.o\r
120         is in.  */\r
121         KEEP (*crtbegin.o(.ctors))\r
122         /* We don't want to include the .ctor section from\r
123         from the crtend.o file until after the sorted ctors.\r
124         The .ctor section from the crtend file contains the\r
125         end of ctors marker and it must be last */\r
126         KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))\r
127         KEEP (*(SORT(.ctors.*)))\r
128         KEEP (*(.ctors))\r
129         __CTOR_END__ = .;\r
130     } > rom\r
131     \r
132     .dtors :\r
133     {\r
134         __DTOR_LIST__ = .;\r
135         KEEP (*crtbegin.o(.dtors))\r
136         KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))\r
137         KEEP (*(SORT(.dtors.*)))\r
138         KEEP (*(.dtors))\r
139         __DTOR_END__ = .;\r
140     } > rom\r
141     \r
142     .preinit_array :\r
143     {\r
144         PROVIDE_HIDDEN (__preinit_array_start = .);\r
145         KEEP (*(.preinit_array*))\r
146         PROVIDE_HIDDEN (__preinit_array_end = .);\r
147     } > rom\r
148     \r
149     .init_array :\r
150     {\r
151         PROVIDE_HIDDEN (__init_array_start = .);\r
152         KEEP (*(SORT(.init_array.*)))\r
153         KEEP (*(.init_array*))\r
154         PROVIDE_HIDDEN (__init_array_end = .);\r
155     } > rom\r
156     \r
157     .fini_array :\r
158     {\r
159         PROVIDE_HIDDEN (__fini_array_start = .);\r
160         KEEP (*(SORT(.fini_array.*)))\r
161         KEEP (*(.fini_array*))\r
162         PROVIDE_HIDDEN (__fini_array_end = .);\r
163         ___ROM_AT = .;\r
164     } > rom\r
166     /* create _etext symbol which keep \r
167     relocation(execution) address of "code" end */\r
168     _etext :\r
169     {\r
170         . = ALIGN(0x10);\r
171         _etext = .; \r
172     } > rom\r
173     \r
174     .data : AT(_etext)\r
175     {\r
176         . = ALIGN(128);\r
177         /* create _sdata symbol which keep \r
178         relocation(execution) address of data start */\r
179         _sdata = .;\r
180         __VECTOR_TABLE_RAM_START = .;\r
181         KEEP(*(.vectors_ram))\r
182         \r
183         . = ALIGN(512);\r
184         __BDT_BASE = .;\r
185         *(.usb_bdt)\r
186         __BDT_END = .;\r
187         \r
188         __START_DATA = .;\r
189         *(.data*)\r
190         __END_DATA = .;\r
192         . = ALIGN(0x4);\r
193         __START_SDATA = .;\r
194         *(.sdata*)\r
195         __END_SDATA = .;\r
197         . = ALIGN(0x4);\r
198         __SDA_BASE  = .;\r
199         __SDA_BASE_ = __SDA_BASE;\r
200         . = ALIGN(16);\r
201         \r
202         /* create _edata symbol which keep \r
203         relocation(execution) address of data end */\r
204         _edata = .;\r
205     } > ram\r
206     \r
207     /* move "location counter" to next relocated address */\r
208     . = ALIGN(0x10);\r
209     \r
210     .bss :\r
211     {\r
212         . = ALIGN(0x10);\r
213         __START_SBSS = .;\r
214         *(.sbss*)\r
215         *(SCOMMON)\r
216         __END_SBSS = .;\r
217         \r
218         __START_BSS = .;\r
219         __bss_start__ = __START_BSS;\r
220         *(.bss*)\r
221         *(COMMON)\r
222         __END_BSS = .;\r
223         __bss_end__ = __END_BSS;\r
224         \r
225         . = ALIGN(0x10);\r
226         __UNCACHED_DATA_START = .;\r
227     } > ram\r
228     \r
229     /* move "location counter" to next relocated address */\r
230     . = ALIGN(0x10);\r
231     \r
232    .kernel_data : \r
233     {\r
234         __KERNEL_DATA_START = ALIGN(0x10);\r
235     }\r
236     .end_of_kernel_data :\r
237     {\r
238         __KERNEL_DATA_END = .;\r
239         __KERNEL_AREA_END = .;\r
240     } > end_of_kd\r
241     \r
242     .boot_stack :\r
243     {\r
244         _stack_end = .;\r
245     } > bstack\r
246     \r
247     .end_of_boot_stack :\r
248     {\r
249         _stack_addr  = .;\r
250         _estack = _stack_addr;\r
251         __SP_INIT = _stack_addr;\r
252         __BOOT_STACK_ADDRESS = .;\r
253     } > end_bstack\r
254     \r
255     /* fill "__S_romp" table with memory region(s) to perform "rom to ram copy" */\r
256     _romp_at = _etext + SIZEOF(.data);\r
257     .romp : AT(_romp_at)\r
258     {\r
259         __S_romp = _romp_at;\r
260         LONG(_etext); /* source (rom) address */\r
261         LONG(_sdata); /* target (ram) address */\r
262         LONG(_edata - _sdata); /* size */\r
263         /* null terminated */\r
264         LONG(0);\r
265         LONG(0);\r
266         LONG(0);\r
267     }\r
268     \r
269     /* user flash area starts here */\r
270     _flashx_start = _etext + SIZEOF(.data) + SIZEOF(.romp);\r
271     \r
272     _flashx_start = __INTERNAL_FLASH_BASE + __FLASHX_SECT_SIZE;\r
273     /* flashx working area spans across the whole rest of Flash memory */\r
274     __FLASHX_START_ADDR = ((_flashx_start + __FLASHX_SECT_SIZE - 1) / __FLASHX_SECT_SIZE) * __FLASHX_SECT_SIZE;\r
275     __FLASHX_END_ADDR = __INTERNAL_FLASH_BASE + __INTERNAL_FLASH_SIZE;\r
276     \r
277     _end = .;\r