summaryrefslogtreecommitdiff
path: root/firmware/target/arm/at91sam/boot.lds
blob: c638511e4751480ba9a8c430f585c74e30141c22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(reset_handler)
STARTUP(target/arm/at91sam/lyre_proto1/crt0.o)

#define DRAMSIZE    (MEMORYSIZE * 0x100000)
#define DRAMORIG    0x20000000
#define IRAM0ORIG   0x200000
#define IRAM0SIZE   4K
#define IRAM1ORIG   0x300000
#define IRAM1SIZE   4K
#define STACKSIZE   2k

MEMORY
{
    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
    IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE
}

SECTIONS
{
    /* We will put Rockbox bootloader at the last 1MByte of the  SDRAM. */

    /* Example of a section:
    * .section VMA(Virtual Memory Address) : LMA(Load Memory Address).
    * VMA and LMA addresses can be verified by doing:
    * "arm-elf-objdump -h bootloader.elf". */

    .vectors 0 : AT (DRAMORIG + DRAMSIZE - 1M)
    {
        _start_vectors_section = .;
        *(.vectors)
        *(.glue_7)
        *(.glue_7t)
        . = ALIGN(4);
        _end_vectors_section = .;
    }

    .text (DRAMORIG + DRAMSIZE -1M + SIZEOF(.vectors)) : \
    AT (DRAMORIG + DRAMSIZE -1M + SIZEOF(.vectors))
    {
        *(.text)
        *(.text*)
        *(.icode)
        *(.icode*)
        *(.rodata)
        *(.rodata*)
        . = ALIGN(4);
    }

    /* Initialized variables are placed on SDRAM, right after .vectors section. */
    /* Data section: VMA is the same as the LMA, right after the end of .vector */
    .data . :
    {
        *(.data)
        *(.data*)
        . = ALIGN(4);
        _end_data_section = .;
    }

    /* Uninitialized variables are placed at SDRAM, right after .text section. */
    .bss (NOLOAD) :
    
    { 
        _start_bss_section = .;
        *(.bss) /* Bss section contains all uninitialized data generated by the compiler. */
        *(.bss*)
        *(COMMON)
        . = ALIGN(4);
        _end_bss_section = .;
    }

    /* Stack is placed at SDRAM, right after .bss section. */
    .stack . :
    {
       *(.stack)
       stackbegin = .;
       . += STACKSIZE;
       stackend = .;
    }
}