blob: 08188d75e5f12cf5a64f4f40aeae4066186311c6 [file] [log] [blame]
Scott Wood095b7122012-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 Denkd79de1d2013-07-08 09:37:19 +02007 * SPDX-License-Identifier: GPL-2.0+
Scott Wood095b7122012-09-20 19:02:18 -05008 */
9
10#include "config.h" /* CONFIG_BOARDDIR */
11
12OUTPUT_ARCH(powerpc)
Ying Zhang0d4f5442013-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 Wood095b7122012-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
47 . = ALIGN(8);
48 __init_begin = .;
49 __init_end = .;
50/* FIXME for non-NAND SPL */
51#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
52 .bootpg ADDR(.text) + 0x1000 :
53 {
Prabhakar Kushwahaab4ab012013-04-16 13:27:59 +053054 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Scott Wood095b7122012-09-20 19:02:18 -050055 }
56#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
57#elif defined(CONFIG_FSL_ELBC)
58#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
59#else
60#error unknown NAND controller
61#endif
Ying Zhang0d4f5442013-05-20 14:07:23 +080062#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
63 .bootpg ADDR(.text) - 0x1000 :
64 {
65 KEEP(*(.bootpg))
66 } :text = 0xffff
67#else
Scott Wood095b7122012-09-20 19:02:18 -050068 .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
69 KEEP(*(.resetvec))
70 } = 0xffff
Ying Zhang0d4f5442013-05-20 14:07:23 +080071#endif
Scott Wood095b7122012-09-20 19:02:18 -050072
73 /*
74 * Make sure that the bss segment isn't linked at 0x0, otherwise its
75 * address won't be updated during relocation fixups.
76 */
77 . |= 0x10;
78
Ying Zhang5ca62f22013-06-07 17:25:16 +080079 . = ALIGN(4);
Scott Wood095b7122012-09-20 19:02:18 -050080 __bss_start = .;
81 .bss : {
82 *(.sbss*)
83 *(.bss*)
84 }
Ying Zhang5ca62f22013-06-07 17:25:16 +080085 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +000086 __bss_end = .;
Scott Wood095b7122012-09-20 19:02:18 -050087}