From cfe526dce2b76cce3b4d1009bad676e2ec21afab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 21 Apr 2020 10:29:17 +0300 Subject: [PATCH] arch/x86: Combine bootblock linker scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Packing bootblock sections is somewhat easier to understand when these all appear in one .ld file. Change-Id: Ie8629a89fa47a28db63ecc33c631b29ac5a77448 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/47597 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- .../entry16.ld => arch/x86/bootblock.ld} | 22 +++++++++++++++++++ src/arch/x86/id.ld | 8 ------- src/arch/x86/memlayout.ld | 8 +------ src/cpu/intel/fit/fit.ld | 8 ------- src/cpu/x86/16bit/reset16.ld | 18 --------------- 5 files changed, 23 insertions(+), 41 deletions(-) rename src/{cpu/x86/16bit/entry16.ld => arch/x86/bootblock.ld} (50%) delete mode 100644 src/arch/x86/id.ld delete mode 100644 src/cpu/intel/fit/fit.ld delete mode 100644 src/cpu/x86/16bit/reset16.ld diff --git a/src/cpu/x86/16bit/entry16.ld b/src/arch/x86/bootblock.ld similarity index 50% rename from src/cpu/x86/16bit/entry16.ld rename to src/arch/x86/bootblock.ld index bc456e7cb0..12f932c2dc 100644 --- a/src/cpu/x86/16bit/entry16.ld +++ b/src/arch/x86/bootblock.ld @@ -10,3 +10,25 @@ nullidt_offset = nullidt & 0xffff; _bogus = ASSERT((_start16bit & 0xfff) == 0, "Symbol _start16bit is not at 4 KiB boundary"); ap_sipi_vector_in_rom = (_start16bit >> 12) & 0xff; #endif + +SECTIONS { + /* Trigger an error if I have an unusable start address */ + _bogus = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report."); + + . = (0xffffffff - CONFIG_ID_SECTION_OFFSET) - (__id_end - __id_start) + 1; + .id (.): { + KEEP(*(.id)); + } + + . = 0xffffffc0; + .fit_pointer (.): { + KEEP(*(.fit_pointer)); + } + + . = 0xfffffff0; + .reset . : { + *(.reset); + . = 15; + BYTE(0x00); + } +} diff --git a/src/arch/x86/id.ld b/src/arch/x86/id.ld deleted file mode 100644 index b69a8dc1a5..0000000000 --- a/src/arch/x86/id.ld +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -SECTIONS { - . = (0xffffffff - CONFIG_ID_SECTION_OFFSET) - (__id_end - __id_start) + 1; - .id (.): { - KEEP(*(.id)) - } -} diff --git a/src/arch/x86/memlayout.ld b/src/arch/x86/memlayout.ld index cbf887cc1c..52694fa360 100644 --- a/src/arch/x86/memlayout.ld +++ b/src/arch/x86/memlayout.ld @@ -39,11 +39,5 @@ SECTIONS } #if ENV_BOOTBLOCK -/* Bootblock specific scripts which provide more SECTION directives. */ -#include -#include -#include -#if CONFIG(CPU_INTEL_FIRMWARE_INTERFACE_TABLE) -#include -#endif +#include #endif /* ENV_BOOTBLOCK */ diff --git a/src/cpu/intel/fit/fit.ld b/src/cpu/intel/fit/fit.ld deleted file mode 100644 index 2e8749bb12..0000000000 --- a/src/cpu/intel/fit/fit.ld +++ /dev/null @@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -SECTIONS { - . = 0xffffffc0; - .fit_pointer (.): { - KEEP(*(.fit_pointer)) - } -} diff --git a/src/cpu/x86/16bit/reset16.ld b/src/cpu/x86/16bit/reset16.ld deleted file mode 100644 index e00e0b41f8..0000000000 --- a/src/cpu/x86/16bit/reset16.ld +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -/* - * _ROMTOP : The top of the ROM used where we - * need to put the reset vector. - */ - -SECTIONS { - /* Trigger an error if I have an unuseable start address */ - _bogus = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report."); - _ROMTOP = 0xfffffff0; - . = _ROMTOP; - .reset . : { - *(.reset); - . = 15; - BYTE(0x00); - } -}