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) |
Ying Zhang | 0d4f544 | 2013-05-20 14:07:23 +0800 | [diff] [blame] | 12 | #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC |
| 13 | PHDRS |
| 14 | { |
| 15 | text PT_LOAD; |
| 16 | bss PT_LOAD; |
| 17 | } |
| 18 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 19 | SECTIONS |
| 20 | { |
| 21 | . = CONFIG_SPL_TEXT_BASE; |
| 22 | .text : { |
| 23 | *(.text*) |
| 24 | } |
| 25 | _etext = .; |
| 26 | |
| 27 | .reloc : { |
| 28 | _GOT2_TABLE_ = .; |
| 29 | KEEP(*(.got2)) |
| 30 | KEEP(*(.got)) |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 31 | _FIXUP_TABLE_ = .; |
| 32 | KEEP(*(.fixup)) |
| 33 | } |
| 34 | __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; |
| 35 | __fixup_entries = (. - _FIXUP_TABLE_) >> 2; |
| 36 | |
| 37 | . = ALIGN(8); |
| 38 | .data : { |
| 39 | *(.rodata*) |
| 40 | *(.data*) |
| 41 | *(.sdata*) |
| 42 | } |
| 43 | _edata = .; |
| 44 | |
Ying Zhang | 4393f95 | 2013-09-04 17:03:45 +0800 | [diff] [blame] | 45 | . = ALIGN(4); |
| 46 | .u_boot_list : { |
| 47 | KEEP(*(SORT(.u_boot_list*))); |
| 48 | } |
| 49 | |
Ying Zhang | 9ff7026 | 2013-08-16 15:16:11 +0800 | [diff] [blame] | 50 | . = .; |
| 51 | __start___ex_table = .; |
| 52 | __ex_table : { *(__ex_table) } |
| 53 | __stop___ex_table = .; |
| 54 | |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 55 | . = ALIGN(8); |
| 56 | __init_begin = .; |
| 57 | __init_end = .; |
Prabhakar Kushwaha | 6e2b9a3 | 2014-04-08 19:12:31 +0530 | [diff] [blame] | 58 | #ifdef CONFIG_SPL_SKIP_RELOCATE |
| 59 | . = ALIGN(4); |
| 60 | __bss_start = .; |
| 61 | .bss : { |
| 62 | *(.sbss*) |
| 63 | *(.bss*) |
| 64 | } |
| 65 | . = ALIGN(4); |
| 66 | __bss_end = .; |
| 67 | #endif |
Po Liu | f6facca | 2014-01-10 10:10:58 +0800 | [diff] [blame] | 68 | |
| 69 | /* For ifc, elbc, esdhc, espi, all need the SPL without section .resetvec */ |
| 70 | #ifdef CONFIG_SYS_MPC85XX_NO_RESETVEC |
| 71 | .bootpg ADDR(.text) - 0x1000 : |
| 72 | { |
| 73 | KEEP(*(.bootpg)) |
| 74 | } :text = 0xffff |
| 75 | #else |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 76 | #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */ |
Prabhakar Kushwaha | a7eb72b | 2014-04-08 19:12:19 +0530 | [diff] [blame] | 77 | #ifndef BOOT_PAGE_OFFSET |
| 78 | #define BOOT_PAGE_OFFSET 0x1000 |
| 79 | #endif |
| 80 | .bootpg ADDR(.text) + BOOT_PAGE_OFFSET : |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 81 | { |
Prabhakar Kushwaha | ab4ab01 | 2013-04-16 13:27:59 +0530 | [diff] [blame] | 82 | arch/powerpc/cpu/mpc85xx/start.o (.bootpg) |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 83 | } |
Prabhakar Kushwaha | a7eb72b | 2014-04-08 19:12:19 +0530 | [diff] [blame] | 84 | #ifndef RESET_VECTOR_OFFSET |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 85 | #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */ |
Prabhakar Kushwaha | a7eb72b | 2014-04-08 19:12:19 +0530 | [diff] [blame] | 86 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 87 | #elif defined(CONFIG_FSL_ELBC) |
| 88 | #define RESET_VECTOR_OFFSET 0xffc /* LBC has 4k sram */ |
| 89 | #else |
| 90 | #error unknown NAND controller |
| 91 | #endif |
| 92 | .resetvec ADDR(.text) + RESET_VECTOR_OFFSET : { |
| 93 | KEEP(*(.resetvec)) |
| 94 | } = 0xffff |
Ying Zhang | 0d4f544 | 2013-05-20 14:07:23 +0800 | [diff] [blame] | 95 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 96 | |
Prabhakar Kushwaha | 6e2b9a3 | 2014-04-08 19:12:31 +0530 | [diff] [blame] | 97 | #ifndef CONFIG_SPL_SKIP_RELOCATE |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 98 | /* |
| 99 | * Make sure that the bss segment isn't linked at 0x0, otherwise its |
| 100 | * address won't be updated during relocation fixups. |
| 101 | */ |
| 102 | . |= 0x10; |
| 103 | |
Ying Zhang | 5ca62f2 | 2013-06-07 17:25:16 +0800 | [diff] [blame] | 104 | . = ALIGN(4); |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 105 | __bss_start = .; |
| 106 | .bss : { |
| 107 | *(.sbss*) |
| 108 | *(.bss*) |
| 109 | } |
Ying Zhang | 5ca62f2 | 2013-06-07 17:25:16 +0800 | [diff] [blame] | 110 | . = ALIGN(4); |
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 111 | __bss_end = .; |
Prabhakar Kushwaha | 6e2b9a3 | 2014-04-08 19:12:31 +0530 | [diff] [blame] | 112 | #endif |
Scott Wood | 095b712 | 2012-09-20 19:02:18 -0500 | [diff] [blame] | 113 | } |