xref: /openbmc/u-boot/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds (revision 2f41ade79e5969ebea03a7dcadbeae8e03787d7e)
183d290c5STom Rini/* SPDX-License-Identifier: GPL-2.0+ */
2c97cd1baSScott Wood/*
3c97cd1baSScott Wood * (C) Copyright 2006
4c97cd1baSScott Wood * Wolfgang Denk, DENX Software Engineering, wd@denx.de
5c97cd1baSScott Wood *
6c97cd1baSScott Wood * Copyright 2009 Freescale Semiconductor, Inc.
7c97cd1baSScott Wood */
8c97cd1baSScott Wood
96f2ed0e9SMasahiro Yamada#include "config.h"
10c97cd1baSScott Wood
11c97cd1baSScott WoodOUTPUT_ARCH(powerpc)
125df572f0SYing Zhang#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
135df572f0SYing ZhangPHDRS
145df572f0SYing Zhang{
155df572f0SYing Zhang	text PT_LOAD;
165df572f0SYing Zhang	bss PT_LOAD;
175df572f0SYing Zhang}
185df572f0SYing Zhang#endif
19c97cd1baSScott WoodSECTIONS
20c97cd1baSScott Wood{
21*2f41ade7STom Rini	. = IMAGE_TEXT_BASE;
22c97cd1baSScott Wood	.text : {
23c97cd1baSScott Wood		*(.text*)
24c97cd1baSScott Wood	}
25c97cd1baSScott Wood	_etext = .;
26c97cd1baSScott Wood
27c97cd1baSScott Wood	.reloc : {
28c97cd1baSScott Wood		_GOT2_TABLE_ = .;
29c97cd1baSScott Wood		KEEP(*(.got2))
30c97cd1baSScott Wood		KEEP(*(.got))
31c97cd1baSScott Wood		_FIXUP_TABLE_ = .;
32c97cd1baSScott Wood		KEEP(*(.fixup))
33c97cd1baSScott Wood	}
34c97cd1baSScott Wood	__got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
35c97cd1baSScott Wood	__fixup_entries = (. - _FIXUP_TABLE_) >> 2;
36c97cd1baSScott Wood
37c97cd1baSScott Wood	. = ALIGN(8);
38c97cd1baSScott Wood	.data : {
39c97cd1baSScott Wood		*(.rodata*)
40c97cd1baSScott Wood		*(.data*)
41c97cd1baSScott Wood		*(.sdata*)
42c97cd1baSScott Wood	}
43c97cd1baSScott Wood	_edata  =  .;
44c97cd1baSScott Wood
4581b867aaSYing Zhang	. = ALIGN(4);
4681b867aaSYing Zhang	.u_boot_list : {
4781b867aaSYing Zhang		KEEP(*(SORT(.u_boot_list*)));
4881b867aaSYing Zhang	}
4981b867aaSYing Zhang
50bb0dc108SYing Zhang	. = .;
51bb0dc108SYing Zhang	__start___ex_table = .;
52bb0dc108SYing Zhang	__ex_table : { *(__ex_table) }
53bb0dc108SYing Zhang	__stop___ex_table = .;
54bb0dc108SYing Zhang
55c97cd1baSScott Wood	. = ALIGN(8);
56c97cd1baSScott Wood	__init_begin = .;
57c97cd1baSScott Wood	__init_end = .;
584d3294b1SJagdish Gediya	_end = .;
59651fcf60SPrabhakar Kushwaha#ifdef CONFIG_SPL_SKIP_RELOCATE
60651fcf60SPrabhakar Kushwaha	. = ALIGN(4);
61651fcf60SPrabhakar Kushwaha	__bss_start = .;
62651fcf60SPrabhakar Kushwaha	.bss : {
63651fcf60SPrabhakar Kushwaha		*(.sbss*)
64651fcf60SPrabhakar Kushwaha		*(.bss*)
65651fcf60SPrabhakar Kushwaha	}
66651fcf60SPrabhakar Kushwaha	. = ALIGN(4);
67651fcf60SPrabhakar Kushwaha	__bss_end = .;
68651fcf60SPrabhakar Kushwaha#endif
696609916eSPo Liu
706609916eSPo Liu/* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
716609916eSPo Liu#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
726609916eSPo Liu	.bootpg ADDR(.text) - 0x1000 :
736609916eSPo Liu	{
746609916eSPo Liu		KEEP(*(.bootpg))
756609916eSPo Liu	} :text = 0xffff
766609916eSPo Liu#else
77c97cd1baSScott Wood#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
7849efe85bSPrabhakar Kushwaha#ifndef BOOT_PAGE_OFFSET
7949efe85bSPrabhakar Kushwaha#define BOOT_PAGE_OFFSET 0x1000
8049efe85bSPrabhakar Kushwaha#endif
8149efe85bSPrabhakar Kushwaha	.bootpg ADDR(.text) + BOOT_PAGE_OFFSET :
82c97cd1baSScott Wood	{
833a88179dSPrabhakar Kushwaha		arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
84c97cd1baSScott Wood	}
8549efe85bSPrabhakar Kushwaha#ifndef RESET_VECTOR_OFFSET
86c97cd1baSScott Wood#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
8749efe85bSPrabhakar Kushwaha#endif
88c97cd1baSScott Wood#elif defined(CONFIG_FSL_ELBC)
89c97cd1baSScott Wood#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
90c97cd1baSScott Wood#else
91c97cd1baSScott Wood#error unknown NAND controller
92c97cd1baSScott Wood#endif
93c97cd1baSScott Wood	.resetvec ADDR(.text) + RESET_VECTOR_OFFSET : {
94c97cd1baSScott Wood		KEEP(*(.resetvec))
95c97cd1baSScott Wood	} = 0xffff
965df572f0SYing Zhang#endif
97c97cd1baSScott Wood
98651fcf60SPrabhakar Kushwaha#ifndef CONFIG_SPL_SKIP_RELOCATE
99c97cd1baSScott Wood	/*
100c97cd1baSScott Wood	 * Make sure that the bss segment isn't linked at 0x0, otherwise its
101c97cd1baSScott Wood	 * address won't be updated during relocation fixups.
102c97cd1baSScott Wood	 */
103c97cd1baSScott Wood	. |= 0x10;
104c97cd1baSScott Wood
10567ad0d52SYing Zhang	. = ALIGN(4);
106c97cd1baSScott Wood	__bss_start = .;
107c97cd1baSScott Wood	.bss : {
108c97cd1baSScott Wood		*(.sbss*)
109c97cd1baSScott Wood		*(.bss*)
110c97cd1baSScott Wood	}
11167ad0d52SYing Zhang	. = ALIGN(4);
1123929fb0aSSimon Glass	__bss_end = .;
113651fcf60SPrabhakar Kushwaha#endif
114c97cd1baSScott Wood}
115