blob: 4fad68b40c5262ba6ca25bd1a75af3af8965b343 [file] [log] [blame]
Scott Woodc97cd1b2012-09-20 19:02:18 -05001/*
2 * (C) Copyright 2006
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de
4 *
5 * Copyright 2009 Freescale Semiconductor, Inc.
6 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Scott Woodc97cd1b2012-09-20 19:02:18 -05008 */
9
10#include "config.h" /* CONFIG_BOARDDIR */
11
12OUTPUT_ARCH(powerpc)
Ying Zhang5df572f2013-05-20 14:07:23 +080013#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
14PHDRS
15{
16 text PT_LOAD;
17 bss PT_LOAD;
18}
19#endif
Scott Woodc97cd1b2012-09-20 19:02:18 -050020SECTIONS
21{
22 . = CONFIG_SPL_TEXT_BASE;
23 .text : {
24 *(.text*)
25 }
26 _etext = .;
27
28 .reloc : {
29 _GOT2_TABLE_ = .;
30 KEEP(*(.got2))
31 KEEP(*(.got))
32 PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
33 _FIXUP_TABLE_ = .;
34 KEEP(*(.fixup))
35 }
36 __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
37 __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
38
39 . = ALIGN(8);
40 .data : {
41 *(.rodata*)
42 *(.data*)
43 *(.sdata*)
44 }
45 _edata = .;
46
Ying Zhang81b867a2013-09-04 17:03:45 +080047 . = ALIGN(4);
48 .u_boot_list : {
49 KEEP(*(SORT(.u_boot_list*)));
50 }
51
Ying Zhangbb0dc102013-08-16 15:16:11 +080052 . = .;
53 __start___ex_table = .;
54 __ex_table : { *(__ex_table) }
55 __stop___ex_table = .;
56
Scott Woodc97cd1b2012-09-20 19:02:18 -050057 . = ALIGN(8);
58 __init_begin = .;
59 __init_end = .;
Po Liu66099162014-01-10 10:10:58 +080060
61/* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
62#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
63 .bootpg ADDR(.text) - 0x1000 :
64 {
65 KEEP(*(.bootpg))
66 } :text = 0xffff
67#else
Scott Woodc97cd1b2012-09-20 19:02:18 -050068#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
Prabhakar Kushwaha49efe85b2014-04-08 19:12:19 +053069#ifndef BOOT_PAGE_OFFSET
70#define BOOT_PAGE_OFFSET 0x1000
71#endif
72 .bootpg ADDR(.text) + BOOT_PAGE_OFFSET :
Scott Woodc97cd1b2012-09-20 19:02:18 -050073 {
Prabhakar Kushwaha3a881792013-04-16 13:27:59 +053074 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Scott Woodc97cd1b2012-09-20 19:02:18 -050075 }
Prabhakar Kushwaha49efe85b2014-04-08 19:12:19 +053076#ifndef RESET_VECTOR_OFFSET
Scott Woodc97cd1b2012-09-20 19:02:18 -050077#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
Prabhakar Kushwaha49efe85b2014-04-08 19:12:19 +053078#endif
Scott Woodc97cd1b2012-09-20 19:02:18 -050079#elif defined(CONFIG_FSL_ELBC)
80#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
81#else
82#error unknown NAND controller
83#endif
84 .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
85 KEEP(*(.resetvec))
86 } = 0xffff
Ying Zhang5df572f2013-05-20 14:07:23 +080087#endif
Scott Woodc97cd1b2012-09-20 19:02:18 -050088
89 /*
90 * Make sure that the bss segment isn't linked at 0x0, otherwise its
91 * address won't be updated during relocation fixups.
92 */
93 . |= 0x10;
94
Ying Zhang67ad0d52013-06-07 17:25:16 +080095 . = ALIGN(4);
Scott Woodc97cd1b2012-09-20 19:02:18 -050096 __bss_start = .;
97 .bss : {
98 *(.sbss*)
99 *(.bss*)
100 }
Ying Zhang67ad0d52013-06-07 17:25:16 +0800101 . = ALIGN(4);
Simon Glass3929fb02013-03-14 06:54:53 +0000102 __bss_end = .;
Scott Woodc97cd1b2012-09-20 19:02:18 -0500103}