summaryrefslogtreecommitdiff
path: root/flash/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'flash/bootloader')
-rw-r--r--flash/bootloader/Makefile81
-rw-r--r--flash/bootloader/README4
-rw-r--r--flash/bootloader/bootloader.c467
-rw-r--r--flash/bootloader/bootloader.h109
-rw-r--r--flash/bootloader/bootloader.lds34
-rw-r--r--flash/bootloader/no_rom.lds62
6 files changed, 0 insertions, 757 deletions
diff --git a/flash/bootloader/Makefile b/flash/bootloader/Makefile
deleted file mode 100644
index edc32113c6..0000000000
--- a/flash/bootloader/Makefile
+++ /dev/null
@@ -1,81 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10CC = sh-elf-gcc
11LD = sh-elf-ld
12AR = sh-elf-ar
13AS = sh-elf-as
14OC = sh-elf-objcopy
15
16FIRMWARE := ../../firmware
17TOOLSDIR=../../tools
18
19TARGET = bootloader
20LDS := $(TARGET).lds
21
22
23ifndef PLATFORM
24not_configured:
25 @echo "No platform given."
26 @echo "Use make PLATFORM=PLAYER|RECORDER|FM|ONDIO {NO_ROM=1}"
27##else
28##configured:
29## @echo "Building bootloader for platform "$(PLATFORM)
30endif
31
32
33INCLUDES= -I$(FIRMWARE)/export -I. -I$(OBJDIR)
34DEFINES= -DPLATFORM_$(PLATFORM)
35
36OBJDIR := .
37
38CFLAGS = -Os -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES)
39AFLAGS += -small -relax
40
41
42ifdef DEBUG
43 DEFINES := -DDEBUG
44 CFLAGS += -g
45endif
46
47SRC := $(wildcard *.c)
48
49OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/sh_nrv2e_d8.o
50
51ifdef NO_ROM
52LINKFILE = $(OBJDIR)/no_rom.lds
53ORIGIN = 0
54DEFINES += -DNO_ROM
55else
56LINKFILE = $(OBJDIR)/$(TARGET).lds
57ORIGIN = FFFF500
58endif
59
60$(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf
61 $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin
62 $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o $(ORIGIN) > $(OBJDIR)/$(TARGET).asm
63ifndef NO_ROM
64 $(TOOLSDIR)/scramble $(OBJDIR)/$(TARGET).bin $(OBJDIR)/$(TARGET).ajz
65endif
66
67$(OBJDIR)/$(TARGET).elf : $(OBJS)
68 $(CC) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map
69
70# cross-reference, saves code duplication
71$(OBJDIR)/sh_nrv2e_d8.o : ../../firmware/decompressor/sh_nrv2e_d8.S
72 $(CC) $(CFLAGS) -c $< -o $@
73
74clean:
75 -rm -f \
76 $(OBJS) \
77 $(OBJDIR)/$(TARGET).asm \
78 $(OBJDIR)/$(TARGET).bin \
79 $(OBJDIR)/$(TARGET).ajz \
80 $(OBJDIR)/$(TARGET).elf \
81 $(OBJDIR)/$(TARGET).map
diff --git a/flash/bootloader/README b/flash/bootloader/README
deleted file mode 100644
index 47583da445..0000000000
--- a/flash/bootloader/README
+++ /dev/null
@@ -1,4 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3This is the source code for the flash bootloader.
4It give the dual boot feature, decompresses one of two software images.
diff --git a/flash/bootloader/bootloader.c b/flash/bootloader/bootloader.c
deleted file mode 100644
index 40c0dc5c54..0000000000
--- a/flash/bootloader/bootloader.c
+++ /dev/null
@@ -1,467 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 by Jörg Hohensohn
11 *
12 * Second-level bootloader, with dual-boot feature by holding F1/Menu
13 * This is the image being descrambled and executed by the boot ROM.
14 * It's task is to copy Rockbox from Flash to DRAM.
15 * The image(s) in flash may optionally be compressed with UCL 2e
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
21 *
22 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
23 * KIND, either express or implied.
24 *
25 ****************************************************************************/
26
27#include "sh7034.h"
28#include "bootloader.h"
29
30// prototypes
31static void PlatformInit(void);
32static void DecompressStart(tImage* pImage);
33#ifdef USE_ADC
34static int ReadADC(int channel);
35#endif
36static int ButtonPressed(void);
37static tImage* GetStartImage(int nPreferred);
38// test functions
39static void SetLed(BOOL bOn);
40static void UartInit(void);
41static UINT8 UartRead(void);
42static void UartWrite(UINT8 byte);
43static void MiniMon(void);
44
45
46#ifdef NO_ROM
47/* start with the vector table */
48UINT32 vectors[] __attribute__ ((section (".vectors"))) =
49{
50 (UINT32)_main, /* entry point, the copy routine */
51 (UINT32)(end_stack - 1), /* initial stack pointer */
52 FLASH_BASE + 0x200, /* source of image in flash */
53 (UINT32)total_size, /* size of image */
54 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
55 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
56 0x03020080 /* mask and version (just as a suggestion) */
57};
58#else
59/* our binary has to start with a vector to the entry point */
60tpMain start_vector[] __attribute__ ((section (".startvector"))) = {main};
61#endif
62
63#ifdef NO_ROM /* some code which is only needed for the romless variant */
64void _main(void)
65{
66 UINT32* pSrc;
67 UINT32* pDest;
68 UINT32* pEnd;
69/*
70 asm volatile ("ldc %0,sr" : : "r"(0xF0)); // disable interrupts
71 asm volatile ("mov.l @%0,r15" : : "r"(4)); // load stack
72 asm volatile ("ldc %0,vbr" : : "r"(0)); // load vector base
73*/
74 /* copy everything to IRAM and continue there */
75 pSrc = begin_iramcopy;
76 pDest = begin_text;
77 pEnd = pDest + (begin_stack - begin_text);
78
79 do
80 {
81 *pDest++ = *pSrc++;
82 }
83 while (pDest < pEnd);
84
85 main(); /* jump to the real main() */
86}
87
88
89static void BootInit(void)
90{
91 /* inits from the boot ROM, whether they make sense or not */
92 PBDR &= 0xFFBF; /* LED off (0x131E) */
93 PBCR2 = 0; /* all GPIO */
94 PBIOR |= 0x0040; /* LED output */
95 PBIOR &= 0xFFF1; /* LCD lines input */
96
97 /* init DRAM like the boot ROM does */
98 PACR2 &= 0xFFFB;
99 PACR2 |= 0x0008;
100 CASCR = 0xAF;
101 BCR |= 0x8000;
102 WCR1 &= 0xFDFD;
103 DCR = 0x0E00;
104 RCR = 0x5AB0;
105 RTCOR = 0x9605;
106 RTCSR = 0xA518;
107}
108#endif /* #ifdef NO_ROM */
109
110
111int main(void)
112{
113 int nButton;
114
115 PlatformInit(); /* model-specific inits */
116
117 nButton = ButtonPressed();
118
119 if (nButton == 3)
120 { /* F3 means start monitor */
121 MiniMon();
122 }
123 else
124 {
125 tImage* pImage;
126 pImage = GetStartImage(nButton); /* which image */
127 DecompressStart(pImage); /* move into place and start it */
128 }
129
130 return 0; /* I guess we won't return ;-) */
131}
132
133
134/* init code that is specific to certain platform */
135static void PlatformInit(void)
136{
137#ifdef NO_ROM
138 BootInit(); /* if not started by boot ROM, we need to init what it did */
139#endif
140
141#if defined PLATFORM_PLAYER
142 BRR1 = 0x19; /* 14400 Baud for monitor */
143 PBDRL |= 0x10; /* set PB4 to 1 to power the hd early (and prepare for
144 * probing in case the charger is connected) */
145 PBIORL |= 0x10; /* make PB4 an output */
146 PACR2 &= 0xFFFC; /* GPIO for PA0 (charger detection, input by default) */
147 if (!(PADRL & 0x01)) /* charger plugged? */
148 { /* we need to probe whether the box is able to control hd power */
149 int i;
150
151 PBIORL &= ~0x10; /* set PB4 to input */
152 /* wait whether it goes low, max. ~1 ms */
153 for (i = 0; (PBDRL & 0x10) && i < 1000; i++);
154
155 if (~(PBDRL & 0x10)) /* pulled low -> power controllable */
156 PBDRL &= 0x10; /* set PB4 low */
157 else /* still floating high -> not controllable */
158 PBDRL |= 0x10; /* set PB4 high */
159 PBIORL |= 0x10; /* ..and output again */
160 }
161#elif defined PLATFORM_RECORDER
162 BRR1 = 0x02; /* 115200 Baud for monitor */
163 if (ReadADC(7) > 0x100) /* charger plugged? */
164 { /* switch off the HD, else a flat battery may not start */
165 PACR2 &= 0xFBFF; /* GPIO for PA5 */
166 PAIOR |= 0x0020; /* make PA5 an output (low by default) */
167 }
168#elif defined PLATFORM_FM
169 BRR1 = 0x02; /* 115200 Baud for monitor */
170 PBDR |= 0x0020; /* set PB5 to keep power (fixes the ON-holding problem) */
171 PBIOR |= 0x0020; /* make PB5 an output */
172 if (ReadADC(0) < 0x1FF) /* charger plugged? */
173 { /* switch off the HD, else a flat battery may not start */
174 PACR2 &= 0xFBFF; /* GPIO for PA5 */
175 PAIOR |= 0x0020; /* make PA5 an output (low by default) */
176 }
177#elif defined PLATFORM_ONDIO
178 BRR1 = 0x19; /* 14400 Baud for monitor */
179 PBDR |= 0x0020; /* set PB5 to keep power (fixes the ON-holding problem) */
180 PBIOR |= 0x0020; /* make PB5 an output */
181#endif
182
183 /* platform-independent inits */
184 DCR |= 0x1000; /* enable burst mode on DRAM */
185 BCR |= 0x2000; /* activate Warp mode (simultaneous internal and external
186 * mem access) */
187}
188
189
190/* move the image into place and start it */
191static void DecompressStart(tImage* pImage)
192{
193 UINT32* pSrc;
194 UINT32* pDest;
195
196 pSrc = pImage->image;
197 pDest = pImage->pDestination;
198
199 if (pSrc != pDest) /* if not linked to that flash address */
200 {
201 if (pImage->flags & IF_UCL_2E)
202 { /* UCL compressed, algorithm 2e */
203 UINT32 dst_len; /* dummy */
204 ucl_nrv2e_decompress_8((UINT8*)pSrc, (UINT8*)pDest, &dst_len);
205 }
206 else
207 { /* uncompressed, copy it */
208 UINT32 size = pImage->size;
209 UINT32* pEnd;
210 size = (size + 3) / 4; /* round up to 32bit-words */
211 pEnd = pDest + size;
212
213 do
214 {
215 *pDest++ = *pSrc++;
216 }
217 while (pDest < pEnd);
218 }
219 }
220
221 pImage->pExecute();
222}
223
224#ifdef USE_ADC
225static int ReadADC(int channel)
226{
227 /* after channel 3, the ports wrap and get re-used */
228 volatile UINT16* pResult = (UINT16*)(ADDRAH_ADDR + 2 * (channel & 0x03));
229 int timeout = 266; /* conversion takes 266 clock cycles */
230
231 ADCSR = 0x20 | channel; /* start single conversion */
232 while (((ADCSR & 0x80) == 0) && (--timeout)); /* 6 instructions per round*/
233
234 return (timeout == 0) ? -1 : *pResult>>6;
235}
236#endif
237
238
239/* This function is platform-dependent,
240 * until I figure out how to distinguish at runtime. */
241static int ButtonPressed(void) /* return 1,2,3 for F1,F2,F3, 0 if none pressed */
242{
243#ifdef USE_ADC
244 int value = ReadADC(CHANNEL);
245
246 if (value >= F1_LOWER && value <= F1_UPPER) /* in range */
247 return 1;
248 else if (value >= F2_LOWER && value <= F2_UPPER) /* in range */
249 return 2;
250 else if (value >= F3_LOWER && value <= F3_UPPER) /* in range */
251 return 3;
252#else
253 int value = PCDR;
254
255 if (!(value & F1_MASK))
256 return 1;
257 else if (!(value & F2_MASK))
258 return 2;
259 else if (!(value & F3_MASK))
260 return 3;
261#endif
262
263 return 0;
264}
265
266
267/* Determine the image to be started */
268static tImage* GetStartImage(int nPreferred)
269{
270 tImage* pImage1;
271 tImage* pImage2 = NULL; /* default to not present */
272 UINT32 pos;
273 UINT32* pFlash = (UINT32*)FLASH_BASE;
274
275 /* determine the first image position */
276 pos = pFlash[2] + pFlash[3]; /* position + size of the bootloader
277 * = after it */
278 pos = (pos + 3) & ~3; /* be sure it's 32 bit aligned */
279
280 pImage1 = (tImage*)pos;
281
282 if (pImage1->size != 0)
283 { /* check for second image */
284 pos = (UINT32)(&pImage1->image) + pImage1->size;
285 pImage2 = (tImage*)pos;
286
287 /* does it make sense? (not in FF or 00 erazed space) */
288 if (pImage2->pDestination == (void*)0xFFFFFFFF
289 || pImage2->size == 0xFFFFFFFF
290 || pImage2->pExecute == (void*)0xFFFFFFFF
291 || pImage2->flags == 0xFFFFFFFF
292 || pImage2->pDestination == NULL)
293 /* size, execute and flags can legally be 0 */
294 {
295 pImage2 = NULL; /* invalidate */
296 }
297 }
298
299 if (pImage2 == NULL || nPreferred == 1)
300 { /* no second image or overridden: return the first */
301 return pImage1;
302 }
303
304 return pImage2; /* return second image */
305}
306
307/* diagnostic functions */
308
309static void SetLed(BOOL bOn)
310{
311 if (bOn)
312 PBDR |= 0x0040;
313 else
314 PBDR &= ~0x0040;
315}
316
317
318static void UartInit(void)
319{
320 PBIOR &= 0xFBFF; /* input: RXD1 remote pin */
321 PBCR1 |= 0x00A0; /* set PB11+PB10 to UART */
322 PBCR1 &= 0xFFAF; /* clear bits 6, 4 -> UART */
323 SMR1 = 0x00; /* async format 8N1, baud generator input is CPU clock */
324 SCR1 = 0x30; /* transmit+receive enable */
325 PBCR1 &= 0x00FF; /* set bit 12...15 as GPIO */
326 SSR1 &= 0xBF; /* clear bit 6 (RDRF, receive data register full) */
327}
328
329
330static UINT8 UartRead(void)
331{
332 UINT8 byte;
333 while (!(SSR1 & SCI_RDRF)); /* wait for char to be available */
334 byte = RDR1;
335 SSR1 &= ~SCI_RDRF;
336 return byte;
337}
338
339
340static void UartWrite(UINT8 byte)
341{
342 while (!(SSR1 & SCI_TDRE)); /* wait for transmit buffer empty */
343 TDR1 = byte;
344 SSR1 &= ~SCI_TDRE;
345}
346
347
348/* include the mini monitor as a rescue feature, started with F3 */
349static void MiniMon(void)
350{
351 UINT8 cmd;
352 UINT32 addr;
353 UINT32 size;
354 UINT32 content;
355 volatile UINT8* paddr = NULL;
356 volatile UINT8* pflash = NULL; /* flash base address */
357
358 UartInit();
359
360 while (1)
361 {
362 cmd = UartRead();
363 switch (cmd)
364 {
365 case BAUDRATE:
366 content = UartRead();
367 UartWrite(cmd); /* acknowledge by returning the command value */
368 while (!(SSR1 & SCI_TEND)); /* wait for empty shift register,
369 * before changing baudrate */
370 BRR1 = content;
371 break;
372
373 case ADDRESS:
374 addr = (UartRead() << 24) | (UartRead() << 16)
375 | (UartRead() << 8) | UartRead();
376 paddr = (UINT8*)addr;
377 pflash = (UINT8*)(addr & 0xFFF80000); /* round down to 512k align*/
378 UartWrite(cmd); /* acknowledge by returning the command value */
379 break;
380
381 case BYTE_READ:
382 content = *paddr++;
383 UartWrite(content); /* the content is the ack */
384 break;
385
386 case BYTE_WRITE:
387 content = UartRead();
388 *paddr++ = content;
389 UartWrite(cmd); /* acknowledge by returning the command value */
390 break;
391
392 case BYTE_READ16:
393 size = 16;
394 while (size--)
395 {
396 content = *paddr++;
397 UartWrite(content); /* the content is the ack */
398 }
399 break;
400
401 case BYTE_WRITE16:
402 size = 16;
403 while (size--)
404 {
405 content = UartRead();
406 *paddr++ = content;
407 }
408 UartWrite(cmd); /* acknowledge by returning the command value */
409 break;
410
411 case BYTE_FLASH:
412 content = UartRead();
413 pflash[0x5555] = 0xAA; /* set flash to command mode */
414 pflash[0x2AAA] = 0x55;
415 pflash[0x5555] = 0xA0; /* byte program command */
416 *paddr++ = content;
417 UartWrite(cmd); /* acknowledge by returning the command value */
418 break;
419
420 case BYTE_FLASH16:
421 size = 16;
422 while (size--)
423 {
424 content = UartRead();
425 pflash[0x5555] = 0xAA; /* set flash to command mode */
426 pflash[0x2AAA] = 0x55;
427 pflash[0x5555] = 0xA0; /* byte program command */
428 *paddr++ = content;
429 }
430 UartWrite(cmd); /* acknowledge by returning the command value */
431 break;
432
433 case HALFWORD_READ:
434 content = *(UINT16*)paddr;
435 paddr += 2;
436 UartWrite(content >> 8); /* highbyte */
437 UartWrite(content & 0xFF); /* lowbyte */
438 break;
439
440 case HALFWORD_WRITE:
441 content = UartRead() << 8 | UartRead();
442 *(UINT16*)paddr = content;
443 paddr += 2;
444 UartWrite(cmd); /* acknowledge by returning the command value */
445 break;
446
447 case EXECUTE:
448 {
449 tpFunc pFunc = (tpFunc)paddr;
450 pFunc();
451 UartWrite(cmd); /* acknowledge by returning the command value*/
452 }
453 break;
454
455 case VERSION:
456 UartWrite(1); /* return our version number */
457 break;
458
459 default:
460 {
461 SetLed(TRUE);
462 UartWrite(~cmd); /* error acknowledge */
463 }
464
465 } /* case */
466 } /* while (1) */
467}
diff --git a/flash/bootloader/bootloader.h b/flash/bootloader/bootloader.h
deleted file mode 100644
index 5811fd0aa4..0000000000
--- a/flash/bootloader/bootloader.h
+++ /dev/null
@@ -1,109 +0,0 @@
1#ifndef NULL
2#define NULL ((void*)0)
3#endif
4
5#define TRUE 1
6#define FALSE 0
7
8// scalar types
9typedef unsigned char UINT8;
10typedef unsigned short UINT16;
11typedef unsigned long UINT32;
12typedef int BOOL;
13
14typedef void(*tpFunc)(void); // type for execute
15typedef int(*tpMain)(void); // type for start vector to main()
16
17
18// structure of an image in the flash
19typedef struct
20{
21 UINT32* pDestination; // address to copy it to
22 UINT32 size; // how many bytes of payload (to the next header)
23 tpFunc pExecute; // entry point
24 UINT32 flags; // uncompressed or compressed
25 // end of header, now comes the payload
26 UINT32 image[]; // the binary image starts here
27 // after the payload, the next header may follow, all 0xFF if none
28} tImage;
29
30// flags valid for image header
31#define IF_NONE 0x00000000
32#define IF_UCL_2E 0x00000001 // image is compressed with UCL, algorithm 2e
33
34
35// resolve platform dependency of F1 button check
36#if defined PLATFORM_PLAYER
37#define F1_MASK 0x0001 // Player has no F1 button, so we use "-"
38#define F2_MASK 0x0008 // Player has no F2 button, so we use "Play"
39#define F3_MASK 0x0004 // Player has no F3 button, so we use "+"
40
41#elif defined PLATFORM_RECORDER
42#define USE_ADC
43#define CHANNEL 4
44#define F1_LOWER 250
45#define F1_UPPER 499
46#define F2_LOWER 500
47#define F2_UPPER 699
48#define F3_LOWER 900
49#define F3_UPPER 1023
50
51#elif defined PLATFORM_FM
52#define USE_ADC
53#define CHANNEL 4
54#define F1_LOWER 150
55#define F1_UPPER 384
56#define F2_LOWER 385
57#define F2_UPPER 544
58#define F3_LOWER 700
59#define F3_UPPER 1023
60
61#elif defined PLATFORM_ONDIO
62#define USE_ADC
63#define CHANNEL 4
64#define F1_LOWER 0x2EF // Ondio has no F1 button,
65#define F1_UPPER 0x3FF // so we use "Left".
66#define F2_LOWER 0x19D // Ondio has no F2 button,
67#define F2_UPPER 0x245 // so we use "Up".
68#define F3_LOWER 0x246 // Ondio has no F3 button,
69#define F3_UPPER 0x2EE // so we use "Right".
70
71#else
72#error ("No platform given!")
73#endif
74
75
76#define FLASH_BASE 0x02000000 // start of the flash memory
77#define FW_VERSION *(unsigned short*)(FLASH_BASE + 0xFE) // firmware version
78
79// prototypes
80int ucl_nrv2e_decompress_8(const UINT8 *src, UINT8 *dst, UINT32* dst_len);
81void _main(void) __attribute__ ((section (".startup")));
82int main(void);
83
84// minimon commands
85#define BAUDRATE 0x00 // followed by BRR value; response: command byte
86#define ADDRESS 0x01 // followed by 4 bytes address; response: command byte
87#define BYTE_READ 0x02 // response: 1 byte content
88#define BYTE_WRITE 0x03 // followed by 1 byte content; response: command byte
89#define BYTE_READ16 0x04 // response: 16 bytes content
90#define BYTE_WRITE16 0x05 // followed by 16 bytes; response: command byte
91#define BYTE_FLASH 0x06 // followed by 1 byte content; response: command byte
92#define BYTE_FLASH16 0x07 // followed by 16 bytes; response: command byte
93#define HALFWORD_READ 0x08 // response: 2 byte content
94#define HALFWORD_WRITE 0x09 // followed by 2 byte content; response: command byte
95#define EXECUTE 0x0A // response: command byte if call returns
96#define VERSION 0x0B // response: version
97
98
99// linker symbols
100extern UINT32 begin_text[];
101extern UINT32 end_text[];
102extern UINT32 begin_data[];
103extern UINT32 end_data[];
104extern UINT32 begin_bss[];
105extern UINT32 end_bss[];
106extern UINT32 begin_stack[];
107extern UINT32 end_stack[];
108extern UINT32 begin_iramcopy[];
109extern UINT32 total_size[];
diff --git a/flash/bootloader/bootloader.lds b/flash/bootloader/bootloader.lds
deleted file mode 100644
index ecc1268988..0000000000
--- a/flash/bootloader/bootloader.lds
+++ /dev/null
@@ -1,34 +0,0 @@
1OUTPUT_FORMAT(elf32-sh)
2
3MEMORY
4{
5 /* the boot ROM uses IRAM at 400-430, stay away and start at 500 */
6 IRAM : ORIGIN = 0x0FFFF500, LENGTH = 0xA00
7 /* and leave some room for stack at the end */
8}
9
10SECTIONS
11{
12 .startvector :
13 {
14 *(.startvector)
15 . = ALIGN(0x4);
16 } > IRAM
17
18 .text :
19 {
20 *(.text)
21 *(.icode)
22 . = ALIGN(0x4);
23 } > IRAM
24
25 .data :
26 {
27 *(.data)
28 } > IRAM
29
30 .bss :
31 {
32 *(.bss)
33 } > IRAM
34}
diff --git a/flash/bootloader/no_rom.lds b/flash/bootloader/no_rom.lds
deleted file mode 100644
index 9f6af52aef..0000000000
--- a/flash/bootloader/no_rom.lds
+++ /dev/null
@@ -1,62 +0,0 @@
1/* This is for the variant without boot ROM,
2 where the flash ROM is mirrored to address zero */
3
4OUTPUT_FORMAT(elf32-sh)
5
6MEMORY
7{
8 IRAM : ORIGIN = 0x0FFFF000, LENGTH = 0x1000
9 FLASH : ORIGIN = 0x00000000, LENGTH = 0x40000
10}
11
12SECTIONS
13{
14 .vectors :
15 {
16 KEEP(*(.vectors))
17 . = ALIGN(0x200);
18 } > FLASH
19
20 .startup :
21 {
22 *(.startup)
23 . = ALIGN(0x4);
24 _begin_iramcopy = .;
25 } > FLASH
26
27 .text : AT ( _begin_iramcopy )
28 {
29 _begin_text = .;
30 *(.text)
31 *(.icode)
32 . = ALIGN(0x4);
33 _end_text = .;
34 } > IRAM
35
36 .data : AT ( _end_text )
37 {
38 _begin_data = .;
39 *(.data)
40 . = ALIGN(0x4);
41 _end_data = .;
42 } > IRAM
43
44 .bss : AT ( _end_data )
45 {
46 _begin_bss = .;
47 *(.bss)
48 . = ALIGN(0x4);
49 _end_bss = .;
50 } > IRAM
51
52 .stack :
53 {
54 _begin_stack = .;
55 *(.stack)
56 . = ALIGN(0x1000);
57 _end_stack = .;
58 } > IRAM
59
60 /* size of the program (without vectors) */
61 _total_size = SIZEOF(.startup) + SIZEOF(.text) + SIZEOF(.data);
62}