summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_x1000/spl.lds
blob: f11fd2cf3b4c683c1107a8fc280a46ede74daa7c (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
#include "config.h"

OUTPUT_FORMAT("elf32-littlemips")
OUTPUT_ARCH(MIPS)
ENTRY(_start)
STARTUP(target/mips/ingenic_x1000/crt0.o)

#define DRAMORIG 0x80000000
#define DRAMSIZE (MEMORYSIZE * 0x100000)
#define USED_DRAM 16K

/* TCSM is 16 KiB and is mapped starting at address 0xf4000000.
 *
 * The SPL is loaded to TCSM + 0x1000. The area below that is stack space.
 * The first 2 KiB of SPL is just headers. The code begins at TCSM + 0x1800.
 * The maskrom will jump to that address (via jalr) after loading the SPL.
 */
MEMORY {
    TCSM : ORIGIN = 0xf4001800, LENGTH = 0x2800
    DRAM : ORIGIN = DRAMORIG + DRAMSIZE - USED_DRAM, LENGTH = USED_DRAM
}

SECTIONS
{
    .text :
    {
        *(.init.text);
        *(.text*);
        *(.icode*);
    } > TCSM

    . = ALIGN(4);
    .rodata :
    {
        *(.rodata*);
    } > TCSM

    . = ALIGN(4);
    .data :
    {
        *(.data*);
        *(.sdata*);
    } > TCSM

    . = ALIGN(4);
    .bss (NOLOAD) :
    {
        _bssbegin = .;
        *(.sbss*);
        *(.bss*);
        *(COMMON);
        *(.scommon*);
        _bssend = .;
    } > TCSM

    .sdram (NOLOAD) :
    {
        *(.sdram);
    } > DRAM
}