Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 2 | /* |
Kumar Gala | e727a36 | 2011-01-12 02:48:53 -0600 | [diff] [blame] | 3 | * Copyright 2007-2009, 2011 Freescale Semiconductor, Inc. |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 4 | */ |
5 | |||||
Masahiro Yamada | cd1b58e | 2014-04-28 10:17:10 +0900 | [diff] [blame] | 6 | #include "config.h" |
Kumar Gala | e727a36 | 2011-01-12 02:48:53 -0600 | [diff] [blame] | 7 | |
Tom Rini | aac8149 | 2022-12-04 10:13:40 -0500 | [diff] [blame] | 8 | #ifdef CFG_RESET_VECTOR_ADDRESS |
9 | #define RESET_VECTOR_ADDRESS CFG_RESET_VECTOR_ADDRESS | ||||
Kumar Gala | e727a36 | 2011-01-12 02:48:53 -0600 | [diff] [blame] | 10 | #else |
Kumar Gala | 6472af8 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 11 | #define RESET_VECTOR_ADDRESS 0xfffffffc |
12 | #endif | ||||
13 | |||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 14 | OUTPUT_ARCH(powerpc) |
Pali Rohár | 3f9f1bd | 2022-04-03 00:05:09 +0200 | [diff] [blame] | 15 | ENTRY(_start) |
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 16 | |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 17 | SECTIONS |
18 | { | ||||
Pali Rohár | b930482 | 2022-05-11 20:57:31 +0200 | [diff] [blame] | 19 | /* Optional boot sector */ |
20 | #if defined(CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR) && !defined(CONFIG_SPL) | ||||
Simon Glass | 72cc538 | 2022-10-20 18:22:39 -0600 | [diff] [blame] | 21 | .bootsect CONFIG_TEXT_BASE - CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR_DATA * 512 : { |
Pali Rohár | b930482 | 2022-05-11 20:57:31 +0200 | [diff] [blame] | 22 | KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootsect)) |
23 | . = CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR_DATA * 512; | ||||
24 | } | ||||
25 | #endif | ||||
26 | |||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 27 | /* Read-only sections, merged into text segment: */ |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 28 | .text : |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 29 | { |
Tom Rini | 667dd4f | 2022-06-10 22:59:37 -0400 | [diff] [blame] | 30 | #if CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC) |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 31 | KEEP(arch/powerpc/cpu/mpc85xx/start.o (.bootpg)) |
Pali Rohár | d61e3c2 | 2022-04-05 15:12:35 +0200 | [diff] [blame] | 32 | #endif |
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 33 | *(.text*) |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 34 | } |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 35 | _etext = .; |
36 | PROVIDE (etext = .); | ||||
37 | .rodata : | ||||
38 | { | ||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 39 | *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 40 | } |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 41 | |
42 | /* Read-write section, merged into data segment: */ | ||||
43 | . = (. + 0x00FF) & 0xFFFFFF00; | ||||
44 | _erotext = .; | ||||
45 | PROVIDE (erotext = .); | ||||
46 | .reloc : | ||||
47 | { | ||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 48 | _GOT2_TABLE_ = .; |
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 49 | KEEP(*(.got2)) |
Joakim Tjernlund | 42126a6 | 2010-12-03 17:30:37 +0100 | [diff] [blame] | 50 | KEEP(*(.got)) |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 51 | _FIXUP_TABLE_ = .; |
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 52 | KEEP(*(.fixup)) |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 53 | } |
Joakim Tjernlund | 42126a6 | 2010-12-03 17:30:37 +0100 | [diff] [blame] | 54 | __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 55 | __fixup_entries = (. - _FIXUP_TABLE_) >> 2; |
56 | |||||
57 | .data : | ||||
58 | { | ||||
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 59 | *(.data*) |
60 | *(.sdata*) | ||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 61 | } |
62 | _edata = .; | ||||
63 | PROVIDE (edata = .); | ||||
64 | |||||
65 | . = .; | ||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 66 | |
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 67 | . = ALIGN(4); |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 68 | __u_boot_list : { |
69 | KEEP(*(SORT(__u_boot_list*))); | ||||
Marek Vasut | 607092a | 2012-10-12 10:27:03 +0000 | [diff] [blame] | 70 | } |
71 | |||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 72 | . = .; |
73 | __start___ex_table = .; | ||||
74 | __ex_table : { *(__ex_table) } | ||||
75 | __stop___ex_table = .; | ||||
76 | |||||
Pali Rohár | 0486cb6 | 2022-04-05 15:12:30 +0200 | [diff] [blame] | 77 | . = ALIGN(4); |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 78 | __init_begin = .; |
79 | .text.init : { *(.text.init) } | ||||
80 | .data.init : { *(.data.init) } | ||||
Pali Rohár | 0486cb6 | 2022-04-05 15:12:30 +0200 | [diff] [blame] | 81 | . = ALIGN(4); |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 82 | __init_end = .; |
Jagdish Gediya | 910e1ae | 2018-09-03 21:35:05 +0530 | [diff] [blame] | 83 | _end = .; |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 84 | |
Tom Rini | 667dd4f | 2022-06-10 22:59:37 -0400 | [diff] [blame] | 85 | #if !CONFIG_IS_ENABLED(SYS_MPC85XX_NO_RESETVEC) |
Kumar Gala | 6472af8 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 86 | .bootpg RESET_VECTOR_ADDRESS - 0xffc : |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 87 | { |
Stefan Roese | 88fbf93 | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 88 | arch/powerpc/cpu/mpc85xx/start.o (.bootpg) |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 89 | } = 0xffff |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 90 | |
Kumar Gala | 6472af8 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 91 | .resetvec RESET_VECTOR_ADDRESS : |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 92 | { |
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 93 | KEEP(*(.resetvec)) |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 94 | } = 0xffff |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 95 | |
Kumar Gala | 6472af8 | 2009-09-09 11:40:41 -0500 | [diff] [blame] | 96 | . = RESET_VECTOR_ADDRESS + 0x4; |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 97 | |
Peter Tyser | 430445f | 2009-10-07 11:45:00 -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. Note that | ||||
101 | * this is a temporary fix. Code to dynamically the fixup the bss | ||||
102 | * location will be added in the future. When the bss relocation | ||||
103 | * fixup code is present this workaround should be removed. | ||||
104 | */ | ||||
105 | #if (RESET_VECTOR_ADDRESS == 0xfffffffc) | ||||
106 | . |= 0x10; | ||||
107 | #endif | ||||
Ying Zhang | 0d4f544 | 2013-05-20 14:07:23 +0800 | [diff] [blame] | 108 | #endif |
Peter Tyser | 430445f | 2009-10-07 11:45:00 -0500 | [diff] [blame] | 109 | |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 110 | __bss_start = .; |
111 | .bss (NOLOAD) : | ||||
112 | { | ||||
Peter Tyser | 1047c16 | 2010-09-29 14:05:56 -0500 | [diff] [blame] | 113 | *(.sbss*) |
114 | *(.bss*) | ||||
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 115 | *(COMMON) |
Pali Rohár | 18209f7 | 2022-06-16 14:19:44 +0200 | [diff] [blame] | 116 | } |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 117 | |
118 | . = ALIGN(4); | ||||
Simon Glass | ed70c8f | 2013-03-14 06:54:53 +0000 | [diff] [blame] | 119 | __bss_end = . ; |
Srikanth Srinivasan | 949a2d5 | 2009-04-03 15:36:13 -0500 | [diff] [blame] | 120 | PROVIDE (end = .); |
121 | } |