diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/config-tpj1022.h | 9 | ||||
-rw-r--r-- | firmware/target/arm/tatung/app.lds | 198 | ||||
-rw-r--r-- | firmware/target/arm/tatung/boot.lds | 64 | ||||
-rw-r--r-- | firmware/target/arm/usb-fw-pp502x.c | 6 |
4 files changed, 276 insertions, 1 deletions
diff --git a/firmware/export/config-tpj1022.h b/firmware/export/config-tpj1022.h index c0df0a34d8..d5f348132a 100644 --- a/firmware/export/config-tpj1022.h +++ b/firmware/export/config-tpj1022.h | |||
@@ -83,7 +83,7 @@ | |||
83 | #define BATTERY_TYPES_COUNT 1 /* only one type */ | 83 | #define BATTERY_TYPES_COUNT 1 /* only one type */ |
84 | 84 | ||
85 | /* Hardware controlled charging? FIXME */ | 85 | /* Hardware controlled charging? FIXME */ |
86 | //#define CONFIG_CHARGING CHARGING_SIMPLE | 86 | #define CONFIG_CHARGING CHARGING_SIMPLE |
87 | 87 | ||
88 | /* define this if the unit can be powered or charged via USB */ | 88 | /* define this if the unit can be powered or charged via USB */ |
89 | /*#define HAVE_USB_POWER*/ | 89 | /*#define HAVE_USB_POWER*/ |
@@ -124,6 +124,13 @@ | |||
124 | /* USB On-the-go */ | 124 | /* USB On-the-go */ |
125 | #define CONFIG_USBOTG USBOTG_ARC | 125 | #define CONFIG_USBOTG USBOTG_ARC |
126 | 126 | ||
127 | /* define this if the unit can be powered or charged via USB */ | ||
128 | #define HAVE_USB_POWER | ||
129 | |||
130 | /* enable these for the experimental usb stack ROOLKU */ | ||
131 | #define HAVE_USBSTACK | ||
132 | #define USB_VENDOR_ID 0x07B4 | ||
133 | #define USB_PRODUCT_ID 0x0280 | ||
127 | /* Virtual LED (icon) */ | 134 | /* Virtual LED (icon) */ |
128 | #define CONFIG_LED LED_VIRTUAL | 135 | #define CONFIG_LED LED_VIRTUAL |
129 | 136 | ||
diff --git a/firmware/target/arm/tatung/app.lds b/firmware/target/arm/tatung/app.lds new file mode 100644 index 0000000000..d7159e8e1e --- /dev/null +++ b/firmware/target/arm/tatung/app.lds | |||
@@ -0,0 +1,198 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | |||
5 | OUTPUT_FORMAT(elf32-littlearm) | ||
6 | OUTPUT_ARCH(arm) | ||
7 | STARTUP(target/arm/crt0-pp.o) | ||
8 | |||
9 | #define PLUGINSIZE PLUGIN_BUFFER_SIZE | ||
10 | #define CODECSIZE CODEC_SIZE | ||
11 | |||
12 | #ifdef DEBUG | ||
13 | #define STUBOFFSET 0x10000 | ||
14 | #else | ||
15 | #define STUBOFFSET 0 | ||
16 | #endif | ||
17 | |||
18 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE | ||
19 | |||
20 | #define DRAMORIG 0x00000000 + STUBOFFSET | ||
21 | #define IRAMORIG 0x40000000 | ||
22 | #define IRAMSIZE 0xc000 | ||
23 | |||
24 | #ifdef CPU_PP502x | ||
25 | #define NOCACHE_BASE 0x10000000 | ||
26 | #else | ||
27 | #define NOCACHE_BASE 0x28000000 | ||
28 | #endif | ||
29 | |||
30 | #define CACHEALIGN_SIZE 16 | ||
31 | |||
32 | /* End of the audio buffer, where the codec buffer starts */ | ||
33 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) | ||
34 | |||
35 | /* Where the codec buffer ends, and the plugin buffer starts */ | ||
36 | #define ENDADDR (ENDAUDIOADDR + CODECSIZE) | ||
37 | |||
38 | MEMORY | ||
39 | { | ||
40 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
41 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
42 | } | ||
43 | |||
44 | SECTIONS | ||
45 | { | ||
46 | .text : | ||
47 | { | ||
48 | loadaddress = .; | ||
49 | _loadaddress = .; | ||
50 | . = ALIGN(0x200); | ||
51 | *(.init.text) | ||
52 | *(.text*) | ||
53 | *(.glue_7) | ||
54 | *(.glue_7t) | ||
55 | . = ALIGN(0x4); | ||
56 | } > DRAM | ||
57 | |||
58 | .rodata : | ||
59 | { | ||
60 | *(.rodata) /* problems without this, dunno why */ | ||
61 | *(.rodata*) | ||
62 | *(.rodata.str1.1) | ||
63 | *(.rodata.str1.4) | ||
64 | . = ALIGN(0x4); | ||
65 | |||
66 | /* Pseudo-allocate the copies of the data sections */ | ||
67 | _datacopy = .; | ||
68 | } > DRAM | ||
69 | |||
70 | /* TRICK ALERT! For RAM execution, we put the .data section at the | ||
71 | same load address as the copy. Thus, we don't waste extra RAM | ||
72 | when we don't actually need the copy. */ | ||
73 | .data : AT ( _datacopy ) | ||
74 | { | ||
75 | _datastart = .; | ||
76 | *(.data*) | ||
77 | . = ALIGN(0x4); | ||
78 | _dataend = .; | ||
79 | } > DRAM | ||
80 | |||
81 | #if NOCACHE_BASE != 0 | ||
82 | /* .ncdata section is placed at uncached physical alias address and is | ||
83 | * loaded at the proper cached virtual address - no copying is | ||
84 | * performed in the init code */ | ||
85 | .ncdata . + NOCACHE_BASE : | ||
86 | { | ||
87 | . = ALIGN(CACHEALIGN_SIZE); | ||
88 | *(.ncdata*) | ||
89 | . = ALIGN(CACHEALIGN_SIZE); | ||
90 | } AT> DRAM | ||
91 | #endif | ||
92 | |||
93 | /DISCARD/ : | ||
94 | { | ||
95 | *(.eh_frame) | ||
96 | } | ||
97 | |||
98 | .vectors 0x0 : | ||
99 | { | ||
100 | _vectorsstart = .; | ||
101 | *(.vectors); | ||
102 | _vectorsend = .; | ||
103 | } AT> DRAM | ||
104 | |||
105 | _vectorscopy = LOADADDR(.vectors); | ||
106 | |||
107 | .ibss IRAMORIG (NOLOAD) : | ||
108 | { | ||
109 | _iedata = .; | ||
110 | *(.qharray) | ||
111 | *(.ibss) | ||
112 | . = ALIGN(0x4); | ||
113 | _iend = .; | ||
114 | } > IRAM | ||
115 | |||
116 | .iram _iend : | ||
117 | { | ||
118 | _iramstart = .; | ||
119 | *(.icode) | ||
120 | *(.irodata) | ||
121 | *(.idata) | ||
122 | . = ALIGN(0x4); | ||
123 | _iramend = .; | ||
124 | } > IRAM AT> DRAM | ||
125 | |||
126 | _iramcopy = LOADADDR(.iram); | ||
127 | |||
128 | .idle_stacks (NOLOAD) : | ||
129 | { | ||
130 | *(.idle_stacks) | ||
131 | #if NUM_CORES > 1 | ||
132 | cpu_idlestackbegin = .; | ||
133 | . += IDLE_STACK_SIZE; | ||
134 | cpu_idlestackend = .; | ||
135 | #endif | ||
136 | cop_idlestackbegin = .; | ||
137 | . += IDLE_STACK_SIZE; | ||
138 | cop_idlestackend = .; | ||
139 | } > IRAM | ||
140 | |||
141 | .stack (NOLOAD) : | ||
142 | { | ||
143 | *(.stack) | ||
144 | stackbegin = .; | ||
145 | . += 0x2000; | ||
146 | stackend = .; | ||
147 | } > IRAM | ||
148 | |||
149 | /* .bss and .ncbss are treated as a single section to use one init loop to | ||
150 | * zero it - note "_edata" and "_end" */ | ||
151 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.ncdata) +\ | ||
152 | SIZEOF(.iram) + SIZEOF(.vectors) (NOLOAD) : | ||
153 | { | ||
154 | _edata = .; | ||
155 | *(.bss*) | ||
156 | *(COMMON) | ||
157 | . = ALIGN(0x4); | ||
158 | } > DRAM | ||
159 | |||
160 | #if NOCACHE_BASE != 0 | ||
161 | .ncbss . + NOCACHE_BASE (NOLOAD): | ||
162 | { | ||
163 | . = ALIGN(CACHEALIGN_SIZE); | ||
164 | *(.ncbss*) | ||
165 | . = ALIGN(CACHEALIGN_SIZE); | ||
166 | } AT> DRAM | ||
167 | #endif | ||
168 | |||
169 | /* This will be aligned by preceding alignments */ | ||
170 | .endaddr . - NOCACHE_BASE (NOLOAD) : | ||
171 | { | ||
172 | _end = .; | ||
173 | } > DRAM | ||
174 | |||
175 | .audiobuf (NOLOAD) : | ||
176 | { | ||
177 | _audiobuffer = .; | ||
178 | audiobuffer = .; | ||
179 | } > DRAM | ||
180 | |||
181 | .audiobufend ENDAUDIOADDR (NOLOAD) : | ||
182 | { | ||
183 | audiobufend = .; | ||
184 | _audiobufend = .; | ||
185 | } > DRAM | ||
186 | |||
187 | .codec ENDAUDIOADDR (NOLOAD) : | ||
188 | { | ||
189 | codecbuf = .; | ||
190 | _codecbuf = .; | ||
191 | } | ||
192 | |||
193 | .plugin ENDADDR (NOLOAD) : | ||
194 | { | ||
195 | _pluginbuf = .; | ||
196 | pluginbuf = .; | ||
197 | } | ||
198 | } | ||
diff --git a/firmware/target/arm/tatung/boot.lds b/firmware/target/arm/tatung/boot.lds new file mode 100644 index 0000000000..d59f117e39 --- /dev/null +++ b/firmware/target/arm/tatung/boot.lds | |||
@@ -0,0 +1,64 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | STARTUP(target/arm/crt0-pp-bl.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x10000000 | ||
11 | #define IRAMORIG 0x40000000 | ||
12 | #define IRAMSIZE 0x18000 | ||
13 | #define FLASHORIG 0x001f0000 | ||
14 | #define FLASHSIZE 2M | ||
15 | |||
16 | MEMORY | ||
17 | { | ||
18 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
19 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
20 | } | ||
21 | |||
22 | SECTIONS | ||
23 | { | ||
24 | . = IRAMORIG; | ||
25 | |||
26 | .text : { | ||
27 | *(.init.text) | ||
28 | *(.text*) | ||
29 | *(.glue_7) | ||
30 | *(.glue_7t) | ||
31 | } > IRAM | ||
32 | |||
33 | .data : { | ||
34 | *(.icode) | ||
35 | *(.irodata) | ||
36 | *(.idata) | ||
37 | *(.data*) | ||
38 | *(.ncdata*) | ||
39 | *(.rodata*) | ||
40 | _dataend = . ; | ||
41 | } > IRAM | ||
42 | |||
43 | .stack : { | ||
44 | *(.stack) | ||
45 | _stackbegin = .; | ||
46 | stackbegin = .; | ||
47 | . += 0x2000; | ||
48 | _stackend = .; | ||
49 | stackend = .; | ||
50 | } > IRAM | ||
51 | |||
52 | /* The bss section is too large for IRAM - we just move it 16MB into the | ||
53 | DRAM */ | ||
54 | |||
55 | . = DRAMORIG; | ||
56 | .bss . + (16*1024*1024): { | ||
57 | _edata = .; | ||
58 | *(.bss*); | ||
59 | *(.ibss); | ||
60 | *(COMMON) | ||
61 | *(.ncbss*); | ||
62 | _end = .; | ||
63 | } > DRAM | ||
64 | } | ||
diff --git a/firmware/target/arm/usb-fw-pp502x.c b/firmware/target/arm/usb-fw-pp502x.c index 5317bc40e8..0dbb965eaa 100644 --- a/firmware/target/arm/usb-fw-pp502x.c +++ b/firmware/target/arm/usb-fw-pp502x.c | |||
@@ -82,6 +82,12 @@ | |||
82 | #define USB_GPIO_MASK 0x10 | 82 | #define USB_GPIO_MASK 0x10 |
83 | #define USB_GPIO_VAL 0x10 | 83 | #define USB_GPIO_VAL 0x10 |
84 | 84 | ||
85 | #elif defined(ELIO_TPJ1022) | ||
86 | /* GPIO ? bit ? is usb detect (dummy value)*/ | ||
87 | #define USB_GPIO GPIOD | ||
88 | #define USB_GPIO_MASK 0x10 | ||
89 | #define USB_GPIO_VAL 0x10 | ||
90 | |||
85 | #else | 91 | #else |
86 | #error No USB GPIO config specified | 92 | #error No USB GPIO config specified |
87 | #endif | 93 | #endif |