-/***\r
- * LPC21xx RAM with <0x40000120;0x40000200) hole\r
- * used by ISP or CAN bootloader\r
- ***/\r
-\r
-STARTUP(crt0.o)\r
-INCLUDE board.ld /* Allow to INPUT board specific files */\r
-\r
-ENTRY(_start)\r
-STACK_SIZE = 0x400;\r
-\r
-/* Memory Definitions */\r
-MEMORY\r
-{\r
+/***
+ * LPC21xx internal 16KB RAM loadable by Philips ISP serial loader
+ * use internal RAM only,
+ * excluding 0x40000040..0x40000200 and >=0x40003ee0 during load
+ *
+ * by Marek Peca <mp@duch.cz> 2008/10, 2009/03
+ * for ON-TRACK, Ltd.
+ * and Dept. of Control Engineering http://dce.fel.cvut.cz/
+ ***/
+
+STARTUP(crt0.o)
+INCLUDE board.ld /* Allow to INPUT board specific files */
+
+ENTRY(_start)
+STACK_SIZE = 0x400;
+
+/* Memory Definitions */
+MEMORY
+{
/*
* RAM_LOAD size has been deduced from following Philips statement:
* ISP commands use on-chip RAM from 0x4000 0120 to 0x4000 01FF. The
*
* 0x200 + 256 + 32 + 0x3ce0 = 0x4000
*/
- RAML (rw) : ORIGIN = 0x40000000, LENGTH = 0x0120
- RAMH (rw) : ORIGIN = 0x40000200, LENGTH = 0x3ce0
-}\r
-\r
-/* Section Definitions */\r
-\r
-SECTIONS\r
-{\r
- .ivec :\r
- {\r
- *(.ivec) /* interrupt entry points */\r
- } > RAML\r
-\r
- /* first section is .text which is used for code */\r
- .text :\r
- {\r
- *crt0.o (.text) /* Startup code */\r
- *(.text) /* remaining code */\r
-\r
- *(.rodata) /* read-only data (constants) */\r
- *(.rodata*)\r
- *(.glue_7)\r
- *(.glue_7t)\r
- } > RAMH\r
-\r
- . = ALIGN(4);\r
- _etext = . ;\r
- PROVIDE (etext = .);\r
-\r
- /* .init_array - pointers to functions called before main */\r
- PROVIDE (__init_array_start = .);\r
- .init_array :\r
- {\r
- *(.init_array)\r
- } >RAMH =0\r
- PROVIDE (__init_array_end = .);\r
-\r
- . = ALIGN(4);\r
-\r
- /* .data section which is used for initialized data */\r
- .data :\r
- {\r
- _data = .;\r
- _datainit = .;\r
- *(.data)\r
- . = ALIGN(4);\r
- } > RAMH\r
-\r
- _edata = . ;\r
- PROVIDE (edata = .);\r
-\r
- /* .bss section which is used for uninitialized data */\r
- .bss (NOLOAD) :\r
- {\r
- __bss_start = . ;\r
- __bss_start__ = . ;\r
- *(.bss)\r
- *(COMMON)\r
- . = ALIGN(4);\r
- } > RAMH\r
-\r
- . = ALIGN(4);\r
- __bss_end__ = . ;\r
- PROVIDE (__bss_end = .);\r
-\r
- .stack ALIGN(256) :\r
- {\r
- . += STACK_SIZE;\r
- PROVIDE (_stack = .);\r
- } > RAMH\r
-\r
- _end = . ;\r
- PROVIDE (end = .);\r
-\r
- /* Stabs debugging sections. */\r
- .stab 0 : { *(.stab) }\r
- .stabstr 0 : { *(.stabstr) }\r
- .stab.excl 0 : { *(.stab.excl) }\r
- .stab.exclstr 0 : { *(.stab.exclstr) }\r
- .stab.index 0 : { *(.stab.index) }\r
- .stab.indexstr 0 : { *(.stab.indexstr) }\r
- .comment 0 : { *(.comment) }\r
- /* DWARF debug sections.\r
- Symbols in the DWARF debugging sections are relative to the beginning\r
- of the section so we begin them at 0. */\r
- /* DWARF 1 */\r
- .debug 0 : { *(.debug) }\r
- .line 0 : { *(.line) }\r
- /* GNU DWARF 1 extensions */\r
- .debug_srcinfo 0 : { *(.debug_srcinfo) }\r
- .debug_sfnames 0 : { *(.debug_sfnames) }\r
- /* DWARF 1.1 and DWARF 2 */\r
- .debug_aranges 0 : { *(.debug_aranges) }\r
- .debug_pubnames 0 : { *(.debug_pubnames) }\r
- /* DWARF 2 */\r
- .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }\r
- .debug_abbrev 0 : { *(.debug_abbrev) }\r
- .debug_line 0 : { *(.debug_line) }\r
- .debug_frame 0 : { *(.debug_frame) }\r
- .debug_str 0 : { *(.debug_str) }\r
- .debug_loc 0 : { *(.debug_loc) }\r
- .debug_macinfo 0 : { *(.debug_macinfo) }\r
- /* SGI/MIPS DWARF 2 extensions */\r
- .debug_weaknames 0 : { *(.debug_weaknames) }\r
- .debug_funcnames 0 : { *(.debug_funcnames) }\r
- .debug_typenames 0 : { *(.debug_typenames) }\r
- .debug_varnames 0 : { *(.debug_varnames) }\r
-}\r
+ RAM_IVEC (rw) : ORIGIN = 0x40000000, LENGTH = 0x0040
+ RAM_LOAD (rw) : ORIGIN = 0x40000200, LENGTH = 0x3ce0
+ RAM (rw) : ORIGIN = 0x40000000, LENGTH = 0x4000
+}
+
+/* Section Definitions */
+
+SECTIONS
+{
+ .ivec :
+ {
+ *(.ivec) /* interrupt entry points */
+ } > RAM_IVEC
+
+ /* first section is .text which is used for code */
+ .text :
+ {
+ *crt0.o (.text) /* Startup code */
+ *(.text) /* remaining code */
+ *(.rodata) /* read-only data (constants) */
+ *(.rodata*)
+ *(.glue_7)
+ *(.glue_7t)
+ . = ALIGN(4);
+ _etext = .;
+ } > RAM_LOAD
+
+
+ /* .init_array - pointers to functions called before main */
+ PROVIDE(__init_array_start = .);
+ .init_array :
+ {
+ *(.init_array)
+ . = ALIGN(4);
+ } > RAM_LOAD = 0
+ PROVIDE (__init_array_end = .);
+
+ /* .data section which is used for initialized data */
+ .data :
+ {
+ _data = .;
+ _datainit = .;
+ *(.data)
+ SORT(CONSTRUCTORS)
+ . = ALIGN(4);
+ _edata = .;
+ } > RAM_LOAD
+
+ /* .bss section which is used for uninitialized data */
+ .bss _edata (NOLOAD) :
+ {
+ __bss_start = .;
+ __bss_start__ = .;
+ *(.bss)
+ *(COMMON)
+ . = ALIGN(4);
+ __bss_end__ = .;
+ } > RAM
+
+ .stack :
+ {
+ . += STACK_SIZE;
+ PROVIDE (_stack = .);
+ } > RAM
+
+ _end = . ;
+ PROVIDE (end = .);
+
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the DWARF debugging sections are relative to the beginning
+ of the section so we begin them at 0. */
+ /* DWARF 1 */
+ .debug 0 : { *(.debug) }
+ .line 0 : { *(.line) }
+ /* GNU DWARF 1 extensions */
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ /* DWARF 1.1 and DWARF 2 */
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ /* DWARF 2 */
+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_str 0 : { *(.debug_str) }
+ .debug_loc 0 : { *(.debug_loc) }
+ .debug_macinfo 0 : { *(.debug_macinfo) }
+ /* SGI/MIPS DWARF 2 extensions */
+ .debug_weaknames 0 : { *(.debug_weaknames) }
+ .debug_funcnames 0 : { *(.debug_funcnames) }
+ .debug_typenames 0 : { *(.debug_typenames) }
+ .debug_varnames 0 : { *(.debug_varnames) }
+}