diff options
-rw-r--r-- | firmware/app.lds | 77 | ||||
-rwxr-xr-x | tools/configure | 23 |
2 files changed, 98 insertions, 2 deletions
diff --git a/firmware/app.lds b/firmware/app.lds index cc2939238d..48ef36cbf1 100644 --- a/firmware/app.lds +++ b/firmware/app.lds | |||
@@ -10,6 +10,81 @@ OUTPUT_FORMAT(elf32-sh) | |||
10 | #endif | 10 | #endif |
11 | INPUT(crt0.o) | 11 | INPUT(crt0.o) |
12 | 12 | ||
13 | #if CONFIG_CPU == TCC730 | ||
14 | MEMORY | ||
15 | { | ||
16 | FIRMWARE : ORIGIN = LOADADDRESS, LENGTH = 256K | ||
17 | FLASH (RX) : ORIGIN = 0x000000, LENGTH = 1024K | ||
18 | ICMEM (RX) : ORIGIN = 0x3FC000, LENGTH = 32K | ||
19 | IMEM1 : ORIGIN = 0x200000, LENGTH = 32K | ||
20 | IMEM2 : ORIGIN = 0x210000, LENGTH = 32K | ||
21 | IMEM3 : ORIGIN = 0x220000, LENGTH = 16K | ||
22 | IMEM4 : ORIGIN = 0x230000, LENGTH = 16K | ||
23 | |||
24 | DRAM : ORIGIN = 0x000000, LENGTH = 0x3F0000 | ||
25 | } | ||
26 | |||
27 | SECTIONS | ||
28 | { | ||
29 | .text LOADADDRESS : { | ||
30 | *(.init.text) | ||
31 | *(.text) | ||
32 | *(.icode) /* We don't put it in ICMEM coz crt1 uses LCD (now)*/ | ||
33 | }> FLASH AT> FIRMWARE | ||
34 | |||
35 | .icode 0x3FC040: { | ||
36 | *(.vectors) | ||
37 | }> ICMEM AT> FIRMWARE | ||
38 | |||
39 | |||
40 | .data 0x2000: { | ||
41 | *(.data) | ||
42 | . = ALIGN(2); | ||
43 | *(.rodata) | ||
44 | . = ALIGN(2); | ||
45 | *(.rodata.str1.2) | ||
46 | . = ALIGN(2); | ||
47 | }> DRAM AT> FIRMWARE | ||
48 | |||
49 | .bss ALIGN(2) : { | ||
50 | *(.bss) | ||
51 | . = ALIGN(2); | ||
52 | }> DRAM | ||
53 | |||
54 | .stack ALIGN(2) : { | ||
55 | . = . + 0x2000; | ||
56 | }> DRAM | ||
57 | |||
58 | .idata 0x200000: { | ||
59 | *(.idata) | ||
60 | }> DRAM | ||
61 | |||
62 | |||
63 | _codesize = SIZEOF(.text); | ||
64 | |||
65 | _icodecopy = LOADADDR(.icode); | ||
66 | _icodestart = ADDR(.icode); | ||
67 | _icodesize = SIZEOF(.icode); | ||
68 | |||
69 | _datacopy = LOADADDR(.data); | ||
70 | _datastart = ADDR(.data); | ||
71 | _datasize = SIZEOF(.data); | ||
72 | |||
73 | |||
74 | _bssstart = ADDR(.bss); | ||
75 | _bsssize = (SIZEOF(.bss) + 1) & ~ 1; | ||
76 | |||
77 | _stackbegin = ADDR(.stack); | ||
78 | _stackend = ADDR(.stack) + SIZEOF(.stack); | ||
79 | |||
80 | _idatastart = ADDR(.idata); | ||
81 | |||
82 | } | ||
83 | |||
84 | #else | ||
85 | |||
86 | |||
87 | |||
13 | #define PLUGINSIZE 0x8000 | 88 | #define PLUGINSIZE 0x8000 |
14 | 89 | ||
15 | #ifdef DEBUG | 90 | #ifdef DEBUG |
@@ -123,3 +198,5 @@ SECTIONS | |||
123 | pluginbuf = .; | 198 | pluginbuf = .; |
124 | } | 199 | } |
125 | } | 200 | } |
201 | |||
202 | #endif | ||
diff --git a/tools/configure b/tools/configure index cc220cdcef..8ffc5f2c8a 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -35,7 +35,7 @@ calmrisccc () { | |||
35 | AR=calmrisc16-unknown-elf-ar | 35 | AR=calmrisc16-unknown-elf-ar |
36 | AS=calmrisc16-unknown-elf-as | 36 | AS=calmrisc16-unknown-elf-as |
37 | OC=calmrisc16-unknown-elf-objcopy | 37 | OC=calmrisc16-unknown-elf-objcopy |
38 | GCCOPTS="$CCOPTS" | 38 | GCCOPTS="-Wl\,--no-check-sections $CCOPTS" |
39 | GCCOPTIMIZE="-fomit-frame-pointer" | 39 | GCCOPTIMIZE="-fomit-frame-pointer" |
40 | } | 40 | } |
41 | 41 | ||
@@ -49,6 +49,22 @@ coldfirecc () { | |||
49 | GCCOPTIMIZE="-fomit-frame-pointer" | 49 | GCCOPTIMIZE="-fomit-frame-pointer" |
50 | } | 50 | } |
51 | 51 | ||
52 | whichaddr () { | ||
53 | case $archos in | ||
54 | gmini120) | ||
55 | echo "" | ||
56 | echo "Where do you want the firmware to be flashed?" | ||
57 | echo "WARNING: Do not answer this question lightly," | ||
58 | echo "unless you don't plan to flash your gmini." | ||
59 | echo "In this case, reply '0x10000' (no quotes) and " | ||
60 | echo "re-configure when you know better." | ||
61 | loadaddress=`input` | ||
62 | ;; | ||
63 | *) | ||
64 | ;; | ||
65 | esac | ||
66 | } | ||
67 | |||
52 | whichsim () { | 68 | whichsim () { |
53 | 69 | ||
54 | if [ -z "$simver" ]; then | 70 | if [ -z "$simver" ]; then |
@@ -315,7 +331,7 @@ if [ -z "$archos" ]; then | |||
315 | 331 | ||
316 | 5) | 332 | 5) |
317 | archos="gmini120" | 333 | archos="gmini120" |
318 | target="-DARCHOS_GMINI120" | 334 | target="-DARCHOS_GMINI120 -DLOADADDRESS=\$(LOADADDRESS)" |
319 | memory=16 # fixed size (16 is a guess, remove comment when checked) | 335 | memory=16 # fixed size (16 is a guess, remove comment when checked) |
320 | calmrisccc | 336 | calmrisccc |
321 | tool="$rootdir/tools/scramble" # not correct but... | 337 | tool="$rootdir/tools/scramble" # not correct but... |
@@ -439,6 +455,7 @@ if [ -z "$debug" ]; then | |||
439 | esac | 455 | esac |
440 | fi | 456 | fi |
441 | 457 | ||
458 | whichaddr | ||
442 | 459 | ||
443 | if [ -z "$language" ]; then | 460 | if [ -z "$language" ]; then |
444 | 461 | ||
@@ -480,6 +497,7 @@ sed > Makefile \ | |||
480 | -e "s,@FLASHFILE@,${flash},g" \ | 497 | -e "s,@FLASHFILE@,${flash},g" \ |
481 | -e "s,@PLUGINS@,${plugins},g" \ | 498 | -e "s,@PLUGINS@,${plugins},g" \ |
482 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ | 499 | -e "s,@GCCOPTS@,${GCCOPTS},g" \ |
500 | -e "s,@LOADADDRESS@,${loadaddress},g" \ | ||
483 | -e "s,@EXTRADEF@,${extradefines},g" \ | 501 | -e "s,@EXTRADEF@,${extradefines},g" \ |
484 | -e "s,@APPSDIR@,${appsdir},g" \ | 502 | -e "s,@APPSDIR@,${appsdir},g" \ |
485 | <<EOF | 503 | <<EOF |
@@ -510,6 +528,7 @@ export AR=@AR@ | |||
510 | export AS=@AS@ | 528 | export AS=@AS@ |
511 | export OC=@OC@ | 529 | export OC=@OC@ |
512 | export GCCOPTS=@GCCOPTS@ | 530 | export GCCOPTS=@GCCOPTS@ |
531 | export LOADADDRESS=@LOADADDRESS@ | ||
513 | 532 | ||
514 | .PHONY: all clean tags zip | 533 | .PHONY: all clean tags zip |
515 | 534 | ||