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