summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/app.lds27
1 files changed, 20 insertions, 7 deletions
diff --git a/firmware/app.lds b/firmware/app.lds
index 5397910..aab8900 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -1,25 +1,38 @@
#include "config.h"
ENTRY(start)
+#if CONFIG_CPU == MCF5249
+OUTPUT_FORMAT(elf32-m68k)
+#else
OUTPUT_FORMAT(elf32-sh)
+#endif
INPUT(crt0.o)
#define PLUGINSIZE 0x8000
#ifdef DEBUG
-#define DRAMSIZE 0x1f0000 - PLUGINSIZE
-#define ORIGADDR 0x09010000
-
+#define STUBOFFSET 0x10000
#else
-#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
-#define ORIGADDR 0x09000000
+#define STUBOFFSET 0
#endif
+
+#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET
#define ENDADDR (ORIGADDR + DRAMSIZE)
+#ifdef IRIVER_H100
+#define DRAMORIG 0x20000000 + STUBOFFSET
+#define IRAMORIG 0x10000000
+#define IRAMSIZE 0x18000
+#else
+#define DRAMORIG 0x09000000 + STUBOFFSET
+#define IRAMORIG 0x0f000000
+#define IRAMSIZE 0x1000
+#endif
+
MEMORY
{
- DRAM : ORIGIN = ORIGADDR, LENGTH = DRAMSIZE
- IRAM : ORIGIN = 0x0f000000, LENGTH = 0x1000
+ DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
+ IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
}
SECTIONS