configs: ast2600: Move SPL bss section to DRAM space
[platform/kernel/u-boot.git] / arch / arm / mach-aspeed / ast2600 / u-boot-spl.lds
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2004-2008 Texas Instruments
4  *
5  * (C) Copyright 2002
6  * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
7  *
8  * (C) Copyright 2022
9  * Chia-Wei Wang <chiawei_wang@aspeedtech.com>
10  */
11
12 MEMORY { .nor : ORIGIN = CONFIG_SPL_TEXT_BASE,
13                 LENGTH = CONFIG_SPL_SIZE_LIMIT }
14 MEMORY { .bss : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
15                 LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
16
17 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
18 OUTPUT_ARCH(arm)
19 ENTRY(_start)
20 SECTIONS
21 {
22         . = 0x00000000;
23
24         . = ALIGN(4);
25         .text :
26         {
27                 __image_copy_start = .;
28                 *(.vectors)
29                 CPUDIR/start.o (.text*)
30                 *(.text*)
31                 *(.glue*)
32         } > .nor
33
34         . = ALIGN(4);
35         .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } > .nor
36
37         . = ALIGN(4);
38         .data : {
39                 *(.data*)
40         } > .nor
41
42         . = ALIGN(4);
43         .u_boot_list : {
44                 KEEP(*(SORT(.u_boot_list*)));
45         } > .nor
46
47         . = ALIGN(4);
48         .binman_sym_table : {
49                 __binman_sym_start = .;
50                 KEEP(*(SORT(.binman_sym*)));
51                 __binman_sym_end = .;
52         } > .nor
53
54         . = ALIGN(4);
55
56         __image_copy_end = .;
57
58         .rel.dyn : {
59                 __rel_dyn_start = .;
60                 *(.rel*)
61                 __rel_dyn_end = .;
62         } > .nor
63
64         .end :
65         {
66                 *(.__end)
67         } > .nor
68
69         _image_binary_end = .;
70
71         .bss : {
72                 __bss_start = .;
73                 *(.bss*)
74                  . = ALIGN(4);
75                 __bss_end = .;
76         } > .bss
77
78         __bss_size = __bss_end - __bss_start;
79 }
80
81 #if defined(IMAGE_MAX_SIZE)
82 ASSERT(__image_copy_end - __image_copy_start <= (IMAGE_MAX_SIZE), \
83         "SPL image too big");
84 #endif
85
86 #if defined(CONFIG_SPL_BSS_MAX_SIZE)
87 ASSERT(__bss_end - __bss_start <= (CONFIG_SPL_BSS_MAX_SIZE), \
88         "SPL image BSS too big");
89 #endif
90
91 #if defined(CONFIG_SPL_MAX_FOOTPRINT)
92 ASSERT(__bss_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \
93         "SPL image plus BSS too big");
94 #endif