blob: 06a70ff2af9c992e4259d00e1b6183e9c049b262 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Scott Wood095b7122012-09-20 19:02:18 -05002/*
3 * (C) Copyright 2006
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de
5 *
6 * Copyright 2009 Freescale Semiconductor, Inc.
Scott Wood095b7122012-09-20 19:02:18 -05007 */
8
Masahiro Yamadacd1b58e2014-04-28 10:17:10 +09009#include "config.h"
Scott Wood095b7122012-09-20 19:02:18 -050010
11OUTPUT_ARCH(powerpc)
Ying Zhang0d4f5442013-05-20 14:07:23 +080012#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
13PHDRS
14{
15 text PT_LOAD;
16 bss PT_LOAD;
17}
18#endif
Scott Wood095b7122012-09-20 19:02:18 -050019SECTIONS
20{
Pali Rohárd61e3c22022-04-05 15:12:35 +020021/* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
22#ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC
23 .bootpg IMAGE_TEXT_BASE - 0x1000 :
24 {
25 KEEP(*(.bootpg))
26 } :text = 0xffff
27#endif
Tom Rini2aaa27d2019-01-22 17:09:26 -050028 . = IMAGE_TEXT_BASE;
Scott Wood095b7122012-09-20 19:02:18 -050029 .text : {
30 *(.text*)
31 }
32 _etext = .;
33
34 .reloc : {
35 _GOT2_TABLE_ = .;
36 KEEP(*(.got2))
37 KEEP(*(.got))
Scott Wood095b7122012-09-20 19:02:18 -050038 _FIXUP_TABLE_ = .;
39 KEEP(*(.fixup))
40 }
41 __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
42 __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
43
44 . = ALIGN(8);
45 .data : {
46 *(.rodata*)
47 *(.data*)
48 *(.sdata*)
49 }
50 _edata = .;
51
Ying Zhang4393f952013-09-04 17:03:45 +080052 . = ALIGN(4);
Andrew Scull5a9095c2022-05-30 10:00:04 +000053 __u_boot_list : {
54 KEEP(*(SORT(__u_boot_list*)));
Ying Zhang4393f952013-09-04 17:03:45 +080055 }
56
Ying Zhang9ff70262013-08-16 15:16:11 +080057 . = .;
58 __start___ex_table = .;
59 __ex_table : { *(__ex_table) }
60 __stop___ex_table = .;
61
Scott Wood095b7122012-09-20 19:02:18 -050062 . = ALIGN(8);
63 __init_begin = .;
64 __init_end = .;
Jagdish Gediya910e1ae2018-09-03 21:35:05 +053065 _end = .;
Prabhakar Kushwaha6e2b9a32014-04-08 19:12:31 +053066#ifdef CONFIG_SPL_SKIP_RELOCATE
67 . = ALIGN(4);
68 __bss_start = .;
69 .bss : {
70 *(.sbss*)
71 *(.bss*)
72 }
73 . = ALIGN(4);
74 __bss_end = .;
75#endif
Po Liuf6facca2014-01-10 10:10:58 +080076
Pali Rohárd61e3c22022-04-05 15:12:35 +020077/* For nor and nand is needed the SPL with section .resetvec */
78#ifndef CONFIG_SYS_MPC85XX_NO_RESETVEC
Scott Wood095b7122012-09-20 19:02:18 -050079#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
Prabhakar Kushwahaa7eb72b2014-04-08 19:12:19 +053080#ifndef BOOT_PAGE_OFFSET
81#define BOOT_PAGE_OFFSET 0x1000
82#endif
Pali Rohárd61e3c22022-04-05 15:12:35 +020083 .bootpg IMAGE_TEXT_BASE + BOOT_PAGE_OFFSET :
Scott Wood095b7122012-09-20 19:02:18 -050084 {
Prabhakar Kushwahaab4ab012013-04-16 13:27:59 +053085 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Scott Wood095b7122012-09-20 19:02:18 -050086 }
Prabhakar Kushwahaa7eb72b2014-04-08 19:12:19 +053087#ifndef RESET_VECTOR_OFFSET
Scott Wood095b7122012-09-20 19:02:18 -050088#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
Prabhakar Kushwahaa7eb72b2014-04-08 19:12:19 +053089#endif
Scott Wood095b7122012-09-20 19:02:18 -050090#elif defined(CONFIG_FSL_ELBC)
91#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
92#else
93#error unknown NAND controller
94#endif
Pali Rohárd61e3c22022-04-05 15:12:35 +020095 .resetvec IMAGE_TEXT_BASE + RESET_VECTOR_OFFSET : {
Scott Wood095b7122012-09-20 19:02:18 -050096 KEEP(*(.resetvec))
97 } = 0xffff
Ying Zhang0d4f5442013-05-20 14:07:23 +080098#endif
Scott Wood095b7122012-09-20 19:02:18 -050099
Prabhakar Kushwaha6e2b9a32014-04-08 19:12:31 +0530100#ifndef CONFIG_SPL_SKIP_RELOCATE
Scott Wood095b7122012-09-20 19:02:18 -0500101 /*
102 * Make sure that the bss segment isn't linked at 0x0, otherwise its
103 * address won't be updated during relocation fixups.
104 */
105 . |= 0x10;
106
Ying Zhang5ca62f22013-06-07 17:25:16 +0800107 . = ALIGN(4);
Scott Wood095b7122012-09-20 19:02:18 -0500108 __bss_start = .;
109 .bss : {
110 *(.sbss*)
111 *(.bss*)
112 }
Ying Zhang5ca62f22013-06-07 17:25:16 +0800113 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +0000114 __bss_end = .;
Prabhakar Kushwaha6e2b9a32014-04-08 19:12:31 +0530115#endif
Scott Wood095b7122012-09-20 19:02:18 -0500116}