From 8f7f4bf87a238dd046a376804b9e53162092f601 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 3 Aug 2022 22:10:05 +0200 Subject: [PATCH] soc/amd/cezanne,common: factor out CPPC code to common AMD SoC code The Cezanne CPPC ACPI table generation code also applies to Sabrina, so move it to the common AMD SoC code directory so that it can be used for Sabrina too. Signed-off-by: Felix Held Change-Id: I5ce082a27429948f8af7f55944a1062ba03155da Reviewed-on: https://review.coreboot.org/c/coreboot/+/66400 Reviewed-by: Fred Reitberger Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel --- src/soc/amd/cezanne/Kconfig | 1 + src/soc/amd/cezanne/Makefile.inc | 1 - src/soc/amd/cezanne/acpi.c | 2 +- src/soc/amd/common/block/acpi/Kconfig | 3 +++ src/soc/amd/common/block/acpi/Makefile.inc | 1 + src/soc/amd/{cezanne => common/block/acpi}/cppc.c | 2 +- .../include/soc => common/block/include/amdblocks}/cppc.h | 0 7 files changed, 7 insertions(+), 3 deletions(-) rename src/soc/amd/{cezanne => common/block/acpi}/cppc.c (98%) rename src/soc/amd/{cezanne/include/soc => common/block/include/amdblocks}/cppc.h (100%) diff --git a/src/soc/amd/cezanne/Kconfig b/src/soc/amd/cezanne/Kconfig index 91129e921d..d40c37c757 100644 --- a/src/soc/amd/cezanne/Kconfig +++ b/src/soc/amd/cezanne/Kconfig @@ -39,6 +39,7 @@ config SOC_SPECIFIC_OPTIONS select SOC_AMD_COMMON_BLOCK_ACPI select SOC_AMD_COMMON_BLOCK_ACPIMMIO select SOC_AMD_COMMON_BLOCK_ACPI_ALIB + select SOC_AMD_COMMON_BLOCK_ACPI_CPPC select SOC_AMD_COMMON_BLOCK_ACPI_GPIO select SOC_AMD_COMMON_BLOCK_ACPI_IVRS select SOC_AMD_COMMON_BLOCK_AOAC diff --git a/src/soc/amd/cezanne/Makefile.inc b/src/soc/amd/cezanne/Makefile.inc index c46c577e89..8c7876a219 100644 --- a/src/soc/amd/cezanne/Makefile.inc +++ b/src/soc/amd/cezanne/Makefile.inc @@ -31,7 +31,6 @@ romstage-y += uart.c ramstage-y += acpi.c ramstage-y += agesa_acpi.c ramstage-y += chip.c -ramstage-y += cppc.c ramstage-y += cpu.c ramstage-y += data_fabric.c ramstage-y += fch.c diff --git a/src/soc/amd/cezanne/acpi.c b/src/soc/amd/cezanne/acpi.c index 47f05b4bb2..6ce041b850 100644 --- a/src/soc/amd/cezanne/acpi.c +++ b/src/soc/amd/cezanne/acpi.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include #include #include "chip.h" -#include unsigned long acpi_fill_madt(unsigned long current) { diff --git a/src/soc/amd/common/block/acpi/Kconfig b/src/soc/amd/common/block/acpi/Kconfig index b4dcec7f38..9c15f21765 100644 --- a/src/soc/amd/common/block/acpi/Kconfig +++ b/src/soc/amd/common/block/acpi/Kconfig @@ -8,6 +8,9 @@ config SOC_AMD_COMMON_BLOCK_ACPI config SOC_AMD_COMMON_BLOCK_ACPI_ALIB bool +config SOC_AMD_COMMON_BLOCK_ACPI_CPPC + bool + config SOC_AMD_COMMON_BLOCK_ACPI_GPIO bool diff --git a/src/soc/amd/common/block/acpi/Makefile.inc b/src/soc/amd/common/block/acpi/Makefile.inc index 862cf6de3b..f7dc107955 100644 --- a/src/soc/amd/common/block/acpi/Makefile.inc +++ b/src/soc/amd/common/block/acpi/Makefile.inc @@ -11,6 +11,7 @@ ramstage-y += pm_state.c ramstage-y += tables.c ramstage-$(CONFIG_ACPI_BERT) += bert.c ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_ALIB) += alib.c +ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_CPPC) += cppc.c ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_GPIO) += gpio.c ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI_IVRS) += ivrs.c diff --git a/src/soc/amd/cezanne/cppc.c b/src/soc/amd/common/block/acpi/cppc.c similarity index 98% rename from src/soc/amd/cezanne/cppc.c rename to src/soc/amd/common/block/acpi/cppc.c index da940afcd4..224034d159 100644 --- a/src/soc/amd/cezanne/cppc.c +++ b/src/soc/amd/common/block/acpi/cppc.c @@ -2,8 +2,8 @@ #include #include +#include #include -#include #include /* diff --git a/src/soc/amd/cezanne/include/soc/cppc.h b/src/soc/amd/common/block/include/amdblocks/cppc.h similarity index 100% rename from src/soc/amd/cezanne/include/soc/cppc.h rename to src/soc/amd/common/block/include/amdblocks/cppc.h