summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/boot.lds
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-09-13 23:38:08 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-09-13 23:38:08 +0000
commitd945c36677b98a796a6921c338302321ced69457 (patch)
tree15fad1a43a034643a8c1d5daea9fdd4015ca5c94 /firmware/target/arm/imx233/boot.lds
parentdad541a3913856083412b4ca64b1ec09e1a5bf92 (diff)
downloadrockbox-d945c36677b98a796a6921c338302321ced69457.tar.gz
rockbox-d945c36677b98a796a6921c338302321ced69457.tar.bz2
rockbox-d945c36677b98a796a6921c338302321ced69457.zip
imx233/fuze+: rework linker script to load the bootloader at ram start + 1Mb to leave a load for the firmware
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30521 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx233/boot.lds')
-rw-r--r--firmware/target/arm/imx233/boot.lds30
1 files changed, 20 insertions, 10 deletions
diff --git a/firmware/target/arm/imx233/boot.lds b/firmware/target/arm/imx233/boot.lds
index fb6ffdcf23..206e0bb99f 100644
--- a/firmware/target/arm/imx233/boot.lds
+++ b/firmware/target/arm/imx233/boot.lds
@@ -6,28 +6,35 @@ OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
STARTUP(target/arm/imx233/crt0.o)
+/* Leave a hole at the beginning of the RAM to load the firmware */
+#define RAM_HOLE 1024 * 1024
+
+/* Make a difference between virtual and physical address so that we can use
+ * the resulting elf file with the elftosb tools which loads at the *physical*
+ * address */
+
MEMORY
{
IRAM : ORIGIN = IRAM_ORIG, LENGTH = IRAM_SIZE
- DRAM : ORIGIN = CACHED_DRAM_ADDR, LENGTH = DRAM_SIZE - TTB_SIZE - FRAME_SIZE
- UNCACHED_DRAM : ORIGIN = UNCACHED_DRAM_ADDR, LENGTH = DRAM_SIZE - TTB_SIZE - FRAME_SIZE
+ DRAM : ORIGIN = CACHED_DRAM_ADDR + RAM_HOLE, LENGTH = DRAM_SIZE - TTB_SIZE - FRAME_SIZE - RAM_HOLE
+ UDRAM : ORIGIN = UNCACHED_DRAM_ADDR + RAM_HOLE, LENGTH = DRAM_SIZE - TTB_SIZE - FRAME_SIZE - RAM_HOLE
}
SECTIONS
{
+ loadaddress = UNCACHED_DRAM_ADDR;
+ _loadaddress = UNCACHED_DRAM_ADDR;
+ loadaddressend = UNCACHED_DRAM_ADDR + RAM_HOLE;
+ _loadaddressend = UNCACHED_DRAM_ADDR + RAM_HOLE;
+
.text :
{
*(.text*)
- } > DRAM
-
- .data :
- {
*(.data*)
*(.rodata*)
- _dataend = . ;
} > DRAM
- .iram :
+ .itext :
{
_iramstart = .; // always 0
*(.vectors)
@@ -39,7 +46,7 @@ SECTIONS
_iramend = .;
} > IRAM AT> DRAM
- _iramcopy = LOADADDR(.iram);
+ _iramcopy = LOADADDR(.itext);
.ibss (NOLOAD) :
{
@@ -58,6 +65,9 @@ SECTIONS
stackend = .;
} > DRAM
+ /* physical address of the stack */
+ stackend_phys = stackend - CACHED_DRAM_ADDR + UNCACHED_DRAM_ADDR;
+
/* treat .bss and .ncbss as a single section */
.bss (NOLOAD) :
{
@@ -73,7 +83,7 @@ SECTIONS
. = ALIGN(CACHEALIGN_SIZE);
} AT> DRAM
- .bssendadr . - UNCACHED_DRAM_ADDR + CACHED_DRAM_ADDR (NOLOAD) :
+ .bssendadr (NOLOAD) :
{
_end = .;
} > DRAM