Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
[platform/kernel/u-boot.git] / arch / powerpc / cpu / mpc85xx / u-boot-spl.lds
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2006
4  * Wolfgang Denk, DENX Software Engineering, wd@denx.de
5  *
6  * Copyright 2009 Freescale Semiconductor, Inc.
7  */
8
9 #include "config.h"
10
11 OUTPUT_ARCH(powerpc)
12
13 SECTIONS
14 {
15         . = IMAGE_TEXT_BASE;
16         .text : {
17 /* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
18 #if CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC)
19                 KEEP(*(.bootpg))
20 #endif
21                 *(.text*)
22         }
23         _etext = .;
24
25         .reloc : {
26                 _GOT2_TABLE_ = .;
27                 KEEP(*(.got2))
28                 KEEP(*(.got))
29                 _FIXUP_TABLE_ = .;
30                 KEEP(*(.fixup))
31         }
32         __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
33         __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
34
35         . = ALIGN(8);
36         .data : {
37                 *(.rodata*)
38                 *(.data*)
39                 *(.sdata*)
40         }
41         _edata  =  .;
42
43         . = ALIGN(4);
44         __u_boot_list : {
45                 KEEP(*(SORT(__u_boot_list*)));
46         }
47
48         . = .;
49         __start___ex_table = .;
50         __ex_table : { *(__ex_table) }
51         __stop___ex_table = .;
52
53         . = ALIGN(8);
54         __init_begin = .;
55         __init_end = .;
56         _end = .;
57 #ifdef CONFIG_SPL_SKIP_RELOCATE
58         . = ALIGN(4);
59         __bss_start = .;
60         .bss : {
61                 *(.sbss*)
62                 *(.bss*)
63         }
64         . = ALIGN(4);
65         __bss_end = .;
66 #endif
67
68 /* For nor and nand is needed the SPL with section .resetvec */
69 #if !CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC)
70 #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
71 #ifndef BOOT_PAGE_OFFSET
72 #define BOOT_PAGE_OFFSET 0x1000
73 #endif
74         .bootpg IMAGE_TEXT_BASE + BOOT_PAGE_OFFSET :
75         {
76                 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
77         }
78 #ifndef RESET_VECTOR_OFFSET
79 #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
80 #endif
81 #elif defined(CONFIG_FSL_ELBC)
82 #define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
83 #else
84 #error unknown NAND controller
85 #endif
86         .resetvec IMAGE_TEXT_BASE + RESET_VECTOR_OFFSET : {
87                 KEEP(*(.resetvec))
88         } = 0xffff
89 #endif
90
91 #ifndef CONFIG_SPL_SKIP_RELOCATE
92         /*
93          * Make sure that the bss segment isn't linked at 0x0, otherwise its
94          * address won't be updated during relocation fixups.
95          */
96         . |= 0x10;
97
98         . = ALIGN(4);
99         __bss_start = .;
100         .bss : {
101                 *(.sbss*)
102                 *(.bss*)
103         }
104         . = ALIGN(4);
105         __bss_end = .;
106 #endif
107 }