blob: 62c3c51dea263540b50bd3d431c25815a70f6950 [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)
Pali Rohár18209f72022-06-16 14:19:44 +020012
Scott Wood095b7122012-09-20 19:02:18 -050013SECTIONS
14{
Pali Rohár18209f72022-06-16 14:19:44 +020015 . = IMAGE_TEXT_BASE;
16 .text : {
Pali Rohárd61e3c22022-04-05 15:12:35 +020017/* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */
Tom Rini667dd4f2022-06-10 22:59:37 -040018#if CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC)
Pali Rohárd61e3c22022-04-05 15:12:35 +020019 KEEP(*(.bootpg))
Pali Rohárd61e3c22022-04-05 15:12:35 +020020#endif
Scott Wood095b7122012-09-20 19:02:18 -050021 *(.text*)
22 }
23 _etext = .;
24
25 .reloc : {
26 _GOT2_TABLE_ = .;
27 KEEP(*(.got2))
28 KEEP(*(.got))
Scott Wood095b7122012-09-20 19:02:18 -050029 _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
Ying Zhang4393f952013-09-04 17:03:45 +080043 . = ALIGN(4);
Andrew Scull5a9095c2022-05-30 10:00:04 +000044 __u_boot_list : {
45 KEEP(*(SORT(__u_boot_list*)));
Ying Zhang4393f952013-09-04 17:03:45 +080046 }
47
Ying Zhang9ff70262013-08-16 15:16:11 +080048 . = .;
49 __start___ex_table = .;
50 __ex_table : { *(__ex_table) }
51 __stop___ex_table = .;
52
Scott Wood095b7122012-09-20 19:02:18 -050053 . = ALIGN(8);
54 __init_begin = .;
55 __init_end = .;
Jagdish Gediya910e1ae2018-09-03 21:35:05 +053056 _end = .;
Prabhakar Kushwaha6e2b9a32014-04-08 19:12:31 +053057#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
Po Liuf6facca2014-01-10 10:10:58 +080067
Pali Rohárd61e3c22022-04-05 15:12:35 +020068/* For nor and nand is needed the SPL with section .resetvec */
Tom Rini667dd4f2022-06-10 22:59:37 -040069#if !CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC)
Scott Wood095b7122012-09-20 19:02:18 -050070#if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
Prabhakar Kushwahaa7eb72b2014-04-08 19:12:19 +053071#ifndef BOOT_PAGE_OFFSET
72#define BOOT_PAGE_OFFSET 0x1000
73#endif
Pali Rohárd61e3c22022-04-05 15:12:35 +020074 .bootpg IMAGE_TEXT_BASE + BOOT_PAGE_OFFSET :
Scott Wood095b7122012-09-20 19:02:18 -050075 {
Prabhakar Kushwahaab4ab012013-04-16 13:27:59 +053076 arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
Scott Wood095b7122012-09-20 19:02:18 -050077 }
Prabhakar Kushwahaa7eb72b2014-04-08 19:12:19 +053078#ifndef RESET_VECTOR_OFFSET
Scott Wood095b7122012-09-20 19:02:18 -050079#define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
Prabhakar Kushwahaa7eb72b2014-04-08 19:12:19 +053080#endif
Scott Wood095b7122012-09-20 19:02:18 -050081#elif defined(CONFIG_FSL_ELBC)
82#define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */
83#else
84#error unknown NAND controller
85#endif
Pali Rohárd61e3c22022-04-05 15:12:35 +020086 .resetvec IMAGE_TEXT_BASE + RESET_VECTOR_OFFSET : {
Scott Wood095b7122012-09-20 19:02:18 -050087 KEEP(*(.resetvec))
88 } = 0xffff
Ying Zhang0d4f5442013-05-20 14:07:23 +080089#endif
Scott Wood095b7122012-09-20 19:02:18 -050090
Prabhakar Kushwaha6e2b9a32014-04-08 19:12:31 +053091#ifndef CONFIG_SPL_SKIP_RELOCATE
Scott Wood095b7122012-09-20 19:02:18 -050092 /*
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
Ying Zhang5ca62f22013-06-07 17:25:16 +080098 . = ALIGN(4);
Scott Wood095b7122012-09-20 19:02:18 -050099 __bss_start = .;
100 .bss : {
101 *(.sbss*)
102 *(.bss*)
103 }
Ying Zhang5ca62f22013-06-07 17:25:16 +0800104 . = ALIGN(4);
Simon Glassed70c8f2013-03-14 06:54:53 +0000105 __bss_end = .;
Prabhakar Kushwaha6e2b9a32014-04-08 19:12:31 +0530106#endif
Scott Wood095b7122012-09-20 19:02:18 -0500107}