Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2006 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de |
| 5 | * |
| 6 | * Copyright 2009 Freescale Semiconductor, Inc. |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 7 | */ |
| 8 | |
Masahiro Yamada | cd1b58e | 2014-04-28 10:17:10 +0900 | [diff] [blame] | 9 | #include "config.h" |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 10 | |
| 11 | OUTPUT_ARCH(powerpc) |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 12 | |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 13 | SECTIONS |
| 14 | { |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 15 | . = IMAGE_TEXT_BASE; |
| 16 | .text : { |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 17 | /* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */ |
Tom Rini | 667dd4f | 2022-06-10 22:59:37 -0400 | [diff] [blame] | 18 | #if CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC) |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 19 | KEEP(*(.bootpg)) |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 20 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 21 | *(.text*) |
| 22 | } |
| 23 | _etext = .; |
| 24 | |
| 25 | .reloc : { |
| 26 | _GOT2_TABLE_ = .; |
| 27 | KEEP(*(.got2)) |
| 28 | KEEP(*(.got)) |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 29 | _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 Zhang | 4393f95 | 2013-09-04 17:03:45 +0800 | [diff] [blame] | 43 | . = ALIGN(4); |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 44 | __u_boot_list : { |
| 45 | KEEP(*(SORT(__u_boot_list*))); |
Ying Zhang | 4393f95 | 2013-09-04 17:03:45 +0800 | [diff] [blame] | 46 | } |
| 47 | |
Ying Zhang | 9ff7026 | 2013-08-16 15:16:11 +0800 | [diff] [blame] | 48 | . = .; |
| 49 | __start___ex_table = .; |
| 50 | __ex_table : { *(__ex_table) } |
| 51 | __stop___ex_table = .; |
| 52 | |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 53 | . = ALIGN(8); |
| 54 | __init_begin = .; |
| 55 | __init_end = .; |
Jagdish Gediya | 910e1ae | 2018-09-03 21:35:05 +0530 | [diff] [blame] | 56 | _end = .; |
Prabhakar Kushwaha | 6e2b9a3 | 2014-04-08 19:12:31 +0530 | [diff] [blame] | 57 | #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 Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 67 | |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 68 | /* For nor and nand is needed the SPL with section .resetvec */ |
Tom Rini | 667dd4f | 2022-06-10 22:59:37 -0400 | [diff] [blame] | 69 | #if !CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC) |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 70 | #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */ |
Prabhakar Kushwaha | a7eb72b | 2014-04-08 19:12:19 +0530 | [diff] [blame] | 71 | #ifndef BOOT_PAGE_OFFSET |
| 72 | #define BOOT_PAGE_OFFSET 0x1000 |
| 73 | #endif |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 74 | .bootpg IMAGE_TEXT_BASE + BOOT_PAGE_OFFSET : |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 75 | { |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 76 | arch/powerpc/cpu/mpc85xx/start.o (.bootpg) |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 77 | } |
Prabhakar Kushwaha | a7eb72b | 2014-04-08 19:12:19 +0530 | [diff] [blame] | 78 | #ifndef RESET_VECTOR_OFFSET |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 79 | #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */ |
Prabhakar Kushwaha | a7eb72b | 2014-04-08 19:12:19 +0530 | [diff] [blame] | 80 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 81 | #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ár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 86 | .resetvec IMAGE_TEXT_BASE + RESET_VECTOR_OFFSET : { |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 87 | KEEP(*(.resetvec)) |
| 88 | } = 0xffff |
Ying Zhang | 0d4f544 | 2013-05-20 14:07:23 +0800 | [diff] [blame] | 89 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 90 | |
Prabhakar Kushwaha | 6e2b9a3 | 2014-04-08 19:12:31 +0530 | [diff] [blame] | 91 | #ifndef CONFIG_SPL_SKIP_RELOCATE |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 92 | /* |
| 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 Zhang | 5ca62f2 | 2013-06-07 17:25:16 +0800 | [diff] [blame] | 98 | . = ALIGN(4); |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 99 | __bss_start = .; |
| 100 | .bss : { |
| 101 | *(.sbss*) |
| 102 | *(.bss*) |
| 103 | } |
Ying Zhang | 5ca62f2 | 2013-06-07 17:25:16 +0800 | [diff] [blame] | 104 | . = ALIGN(4); |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 105 | __bss_end = .; |
Prabhakar Kushwaha | 6e2b9a3 | 2014-04-08 19:12:31 +0530 | [diff] [blame] | 106 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 107 | } |