diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/as3525.h | 18 | ||||
-rw-r--r-- | firmware/target/arm/as3525/app.lds | 40 | ||||
-rw-r--r-- | firmware/target/arm/as3525/boot.lds | 10 |
3 files changed, 42 insertions, 26 deletions
diff --git a/firmware/export/as3525.h b/firmware/export/as3525.h index 388df2a925..326a7610bb 100644 --- a/firmware/export/as3525.h +++ b/firmware/export/as3525.h | |||
@@ -22,10 +22,28 @@ | |||
22 | 22 | ||
23 | #define UART_CHANNELS 1 | 23 | #define UART_CHANNELS 1 |
24 | 24 | ||
25 | |||
26 | #if MEMORYSIZE <= 2 | ||
27 | /* we put the codec buffer in IRAM */ | ||
28 | #define AMS_LOWMEM | ||
29 | #endif | ||
30 | /* these addresses are valid after mapping through the MMU */ | ||
31 | #define DRAM_ORIG 0x30000000 | ||
32 | #define IRAM_ORIG 0x0 | ||
33 | |||
34 | #define DRAM_SIZE (MEMORYSIZE * 0x100000) | ||
35 | #define IRAM_SIZE 0x50000 | ||
36 | |||
37 | |||
25 | /* AS352X only supports 512 Byte HW ECC */ | 38 | /* AS352X only supports 512 Byte HW ECC */ |
26 | #define ECCSIZE 512 | 39 | #define ECCSIZE 512 |
27 | #define ECCBYTES 3 | 40 | #define ECCBYTES 3 |
28 | 41 | ||
42 | /* AS352X MMU Page Table Entries */ | ||
43 | /* to be implemented */ | ||
44 | #define TTB_SIZE 0x0 /* Mimics OF */ | ||
45 | #define TTB_BASE_ADDR (DRAM_ORIG + DRAM_SIZE - TTB_SIZE) | ||
46 | |||
29 | 47 | ||
30 | /* AS352X device base addresses */ | 48 | /* AS352X device base addresses */ |
31 | 49 | ||
diff --git a/firmware/target/arm/as3525/app.lds b/firmware/target/arm/as3525/app.lds index 7f37cc5d7c..45ae30f9f3 100644 --- a/firmware/target/arm/as3525/app.lds +++ b/firmware/target/arm/as3525/app.lds | |||
@@ -1,4 +1,5 @@ | |||
1 | #include "config.h" | 1 | #include "config.h" |
2 | #include "cpu.h" | ||
2 | 3 | ||
3 | ENTRY(start) | 4 | ENTRY(start) |
4 | 5 | ||
@@ -6,11 +7,6 @@ OUTPUT_FORMAT(elf32-littlearm) | |||
6 | OUTPUT_ARCH(arm) | 7 | OUTPUT_ARCH(arm) |
7 | STARTUP(target/arm/crt0.o) | 8 | STARTUP(target/arm/crt0.o) |
8 | 9 | ||
9 | #if MEMORYSIZE <= 2 | ||
10 | /* we put the codec buffer in IRAM */ | ||
11 | #define LOWMEM | ||
12 | #endif | ||
13 | |||
14 | #define PLUGINSIZE PLUGIN_BUFFER_SIZE | 10 | #define PLUGINSIZE PLUGIN_BUFFER_SIZE |
15 | #define CODECSIZE CODEC_SIZE | 11 | #define CODECSIZE CODEC_SIZE |
16 | 12 | ||
@@ -20,26 +16,27 @@ STARTUP(target/arm/crt0.o) | |||
20 | #define STUBOFFSET 0 | 16 | #define STUBOFFSET 0 |
21 | #endif | 17 | #endif |
22 | 18 | ||
23 | #include "cpu.h" | ||
24 | 19 | ||
25 | #ifdef LOWMEM | 20 | #define IRAMORIG IRAM_ORIG |
26 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE | 21 | #define DRAMORIG (DRAM_ORIG + STUBOFFSET) |
27 | #define CODECORIG (IRAMORIG + 0x50000 - CODEC_SIZE) | 22 | |
28 | #define IRAMSIZE (0x50000 - CODEC_SIZE) | 23 | /* End of the audio buffer, where the codec buffer starts */ |
24 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) | ||
25 | |||
26 | |||
27 | #ifdef AMS_LOWMEM | ||
28 | #define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE) | ||
29 | #define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE)) | ||
30 | #define IRAMSIZE (IRAM_SIZE - CODEC_SIZE) | ||
29 | #else | 31 | #else |
30 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE | 32 | #define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE - TTB_SIZE) |
31 | #define CODECORIG (ENDAUDIOADDR) | 33 | #define CODECORIG (ENDAUDIOADDR) |
32 | #define IRAMSIZE (0x20000) | 34 | #define IRAMSIZE (0x20000) |
33 | #endif | 35 | #endif |
34 | 36 | ||
35 | #define IRAMORIG 0x0 | ||
36 | #define DRAMORIG 0x30000000 + STUBOFFSET | ||
37 | |||
38 | /* End of the audio buffer, where the codec buffer starts */ | ||
39 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) | ||
40 | 37 | ||
41 | /* Where the codec buffer ends, and the plugin buffer starts */ | 38 | /* Where the codec buffer ends, and the plugin buffer starts */ |
42 | #ifdef LOWMEM | 39 | #ifdef AMS_LOWMEM |
43 | #define ENDADDR (ENDAUDIOADDR) | 40 | #define ENDADDR (ENDAUDIOADDR) |
44 | #else | 41 | #else |
45 | #define ENDADDR (ENDAUDIOADDR + CODECSIZE) | 42 | #define ENDADDR (ENDAUDIOADDR + CODECSIZE) |
@@ -47,7 +44,7 @@ STARTUP(target/arm/crt0.o) | |||
47 | 44 | ||
48 | MEMORY | 45 | MEMORY |
49 | { | 46 | { |
50 | #ifdef LOWMEM | 47 | #ifdef AMS_LOWMEM |
51 | CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE | 48 | CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE |
52 | #endif | 49 | #endif |
53 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | 50 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE |
@@ -56,7 +53,7 @@ MEMORY | |||
56 | 53 | ||
57 | SECTIONS | 54 | SECTIONS |
58 | { | 55 | { |
59 | loadaddress = 0x30000000; | 56 | loadaddress = DRAM_ORIG; |
60 | 57 | ||
61 | .text : | 58 | .text : |
62 | { | 59 | { |
@@ -71,10 +68,7 @@ SECTIONS | |||
71 | 68 | ||
72 | .rodata : | 69 | .rodata : |
73 | { | 70 | { |
74 | *(.rodata) /* problems without this, dunno why */ | ||
75 | *(.rodata*) | 71 | *(.rodata*) |
76 | *(.rodata.str1.1) | ||
77 | *(.rodata.str1.4) | ||
78 | . = ALIGN(0x4); | 72 | . = ALIGN(0x4); |
79 | } > DRAM | 73 | } > DRAM |
80 | 74 | ||
@@ -152,7 +146,7 @@ SECTIONS | |||
152 | { | 146 | { |
153 | codecbuf = .; | 147 | codecbuf = .; |
154 | _codecbuf = .; | 148 | _codecbuf = .; |
155 | #ifdef LOWMEM | 149 | #ifdef AMS_LOWMEM |
156 | } > CODEC_IRAM | 150 | } > CODEC_IRAM |
157 | #else | 151 | #else |
158 | } > DRAM | 152 | } > DRAM |
diff --git a/firmware/target/arm/as3525/boot.lds b/firmware/target/arm/as3525/boot.lds index 7a13d67a43..a98763e8f6 100644 --- a/firmware/target/arm/as3525/boot.lds +++ b/firmware/target/arm/as3525/boot.lds | |||
@@ -1,18 +1,22 @@ | |||
1 | #include "config.h" | 1 | #include "config.h" |
2 | #include "cpu.h" | ||
2 | 3 | ||
3 | ENTRY(start) | 4 | ENTRY(start) |
4 | OUTPUT_FORMAT(elf32-littlearm) | 5 | OUTPUT_FORMAT(elf32-littlearm) |
5 | OUTPUT_ARCH(arm) | 6 | OUTPUT_ARCH(arm) |
6 | STARTUP(target/arm/crt0.o) | 7 | STARTUP(target/arm/crt0.o) |
7 | 8 | ||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | 9 | /* |
10 | No need for DRAM in our bootloader | ||
11 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - TTB_SIZE | ||
9 | #define DRAMORIG 0x30000000 | 12 | #define DRAMORIG 0x30000000 |
10 | #define IRAMORIG 0 | 13 | */ |
14 | #define IRAMORIG 0x81000000 | ||
11 | #define IRAMSIZE 0x50000 | 15 | #define IRAMSIZE 0x50000 |
12 | 16 | ||
13 | MEMORY | 17 | MEMORY |
14 | { | 18 | { |
15 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | 19 | /*DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE*/ |
16 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | 20 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE |
17 | } | 21 | } |
18 | 22 | ||