From 6cc1e9e81efe794eb4ef0d0586fa7b8351577aba Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Thu, 30 Apr 2020 19:13:47 -0700 Subject: [PATCH] acpi: Move ACPI table support out of arch/x86 (1/5) This change moves all ACPI table support in coreboot currently living under arch/x86 into common code to make it architecture independent. ACPI table generation is not really tied to any architecture and hence it makes sense to move this to its own directory. In order to make it easier to review, this change is being split into multiple CLs. This is change 1/5 which moves .c files from arch/x86 to acpi/. The only acpi files that are still retained under arch/x86 are: a. acpi_s3.c: This doesn't really deal with ACPI tables. Also, there are some assumptions in there about SMM which will have to be resolved if this file needs to be moved to common code. b. acpi_bert_storage.c/bert_storage.h: This file is currently written specifically with x86 in mind. So, not moving the file for now. Motivation for this change: Not all stages on Picasso SoC are targeted for the same architecture. For example, verstage (if runs before bootblock) will be targeted for non-x86. This makes it difficult to add device tree to verstage which would be required to get to SoC configs from the tree. This is because the device tree on x86 platforms currently contains a lot of devices that require ACPI related enums and structs (like acpi_gpio, acpi_pld, acpi_dp and so on). Hence, this change removes all ACPI table support out of arch/x86. BUG=b:155428745 Change-Id: Icc6b793c52c86483a8c52e0555619e36869a869e Signed-off-by: Furquan Shaikh Reviewed-on: https://review.coreboot.org/c/coreboot/+/40930 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/acpi/Makefile.inc | 13 ++++++++++++- src/{arch/x86 => acpi}/acpi.c | 0 src/{arch/x86 => acpi}/acpi_device.c | 0 src/{arch/x86 => acpi}/acpi_pld.c | 0 src/{arch/x86 => acpi}/acpigen.c | 0 src/{arch/x86 => acpi}/acpigen_dsm.c | 0 src/{arch/x86 => acpi}/acpigen_ps2_keybd.c | 0 src/arch/x86/Makefile.inc | 6 ------ 8 files changed, 12 insertions(+), 7 deletions(-) rename src/{arch/x86 => acpi}/acpi.c (100%) rename src/{arch/x86 => acpi}/acpi_device.c (100%) rename src/{arch/x86 => acpi}/acpi_pld.c (100%) rename src/{arch/x86 => acpi}/acpigen.c (100%) rename src/{arch/x86 => acpi}/acpigen_dsm.c (100%) rename src/{arch/x86 => acpi}/acpigen_ps2_keybd.c (100%) diff --git a/src/acpi/Makefile.inc b/src/acpi/Makefile.inc index e99110ec24..068c592db7 100644 --- a/src/acpi/Makefile.inc +++ b/src/acpi/Makefile.inc @@ -1,4 +1,15 @@ # SPDX-License-Identifier: GPL-2.0-only # This file is part of the coreboot project. -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += sata.c +ifeq ($(CONFIG_HAVE_ACPI_TABLES),y) + +ramstage-y += acpi.c +ramstage-y += acpi_device.c +ramstage-y += acpi_pld.c +ramstage-y += acpigen.c +ramstage-y += acpigen_dsm.c +ramstage-y += acpigen_ps2_keybd.c + +ramstage-y += sata.c + +endif # CONFIG_GENERATE_ACPI_TABLES diff --git a/src/arch/x86/acpi.c b/src/acpi/acpi.c similarity index 100% rename from src/arch/x86/acpi.c rename to src/acpi/acpi.c diff --git a/src/arch/x86/acpi_device.c b/src/acpi/acpi_device.c similarity index 100% rename from src/arch/x86/acpi_device.c rename to src/acpi/acpi_device.c diff --git a/src/arch/x86/acpi_pld.c b/src/acpi/acpi_pld.c similarity index 100% rename from src/arch/x86/acpi_pld.c rename to src/acpi/acpi_pld.c diff --git a/src/arch/x86/acpigen.c b/src/acpi/acpigen.c similarity index 100% rename from src/arch/x86/acpigen.c rename to src/acpi/acpigen.c diff --git a/src/arch/x86/acpigen_dsm.c b/src/acpi/acpigen_dsm.c similarity index 100% rename from src/arch/x86/acpigen_dsm.c rename to src/acpi/acpigen_dsm.c diff --git a/src/arch/x86/acpigen_ps2_keybd.c b/src/acpi/acpigen_ps2_keybd.c similarity index 100% rename from src/arch/x86/acpigen_ps2_keybd.c rename to src/acpi/acpigen_ps2_keybd.c diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc index 2d007094c7..aa1f5fef5f 100644 --- a/src/arch/x86/Makefile.inc +++ b/src/arch/x86/Makefile.inc @@ -230,12 +230,6 @@ $(CONFIG_CBFS_PREFIX)/postcar-compression := none ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32)$(CONFIG_ARCH_RAMSTAGE_X86_64),y) -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen_dsm.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi_device.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpi_pld.c -ramstage-$(CONFIG_HAVE_ACPI_TABLES) += acpigen_ps2_keybd.c ramstage-$(CONFIG_HAVE_ACPI_RESUME) += acpi_s3.c ramstage-$(CONFIG_ACPI_BERT) += acpi_bert_storage.c ramstage-y += c_start.S