summaryrefslogtreecommitdiff
path: root/firmware/target/arm/at91sam/boot.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/at91sam/boot.lds')
-rw-r--r--firmware/target/arm/at91sam/boot.lds81
1 files changed, 81 insertions, 0 deletions
diff --git a/firmware/target/arm/at91sam/boot.lds b/firmware/target/arm/at91sam/boot.lds
new file mode 100644
index 0000000000..c638511e47
--- /dev/null
+++ b/firmware/target/arm/at91sam/boot.lds
@@ -0,0 +1,81 @@
1OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
2OUTPUT_ARCH(arm)
3ENTRY(reset_handler)
4STARTUP(target/arm/at91sam/lyre_proto1/crt0.o)
5
6#define DRAMSIZE (MEMORYSIZE * 0x100000)
7#define DRAMORIG 0x20000000
8#define IRAM0ORIG 0x200000
9#define IRAM0SIZE 4K
10#define IRAM1ORIG 0x300000
11#define IRAM1SIZE 4K
12#define STACKSIZE 2k
13
14MEMORY
15{
16 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
17 IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE
18}
19
20SECTIONS
21{
22 /* We will put Rockbox bootloader at the last 1MByte of the SDRAM. */
23
24 /* Example of a section:
25 * .section VMA(Virtual Memory Address) : LMA(Load Memory Address).
26 * VMA and LMA addresses can be verified by doing:
27 * "arm-elf-objdump -h bootloader.elf". */
28
29 .vectors 0 : AT (DRAMORIG + DRAMSIZE - 1M)
30 {
31 _start_vectors_section = .;
32 *(.vectors)
33 *(.glue_7)
34 *(.glue_7t)
35 . = ALIGN(4);
36 _end_vectors_section = .;
37 }
38
39 .text (DRAMORIG + DRAMSIZE -1M + SIZEOF(.vectors)) : \
40 AT (DRAMORIG + DRAMSIZE -1M + SIZEOF(.vectors))
41 {
42 *(.text)
43 *(.text*)
44 *(.icode)
45 *(.icode*)
46 *(.rodata)
47 *(.rodata*)
48 . = ALIGN(4);
49 }
50
51 /* Initialized variables are placed on SDRAM, right after .vectors section. */
52 /* Data section: VMA is the same as the LMA, right after the end of .vector */
53 .data . :
54 {
55 *(.data)
56 *(.data*)
57 . = ALIGN(4);
58 _end_data_section = .;
59 }
60
61 /* Uninitialized variables are placed at SDRAM, right after .text section. */
62 .bss (NOLOAD) :
63
64 {
65 _start_bss_section = .;
66 *(.bss) /* Bss section contains all uninitialized data generated by the compiler. */
67 *(.bss*)
68 *(COMMON)
69 . = ALIGN(4);
70 _end_bss_section = .;
71 }
72
73 /* Stack is placed at SDRAM, right after .bss section. */
74 .stack . :
75 {
76 *(.stack)
77 stackbegin = .;
78 . += STACKSIZE;
79 stackend = .;
80 }
81}