From 8923dceaf7a78b1a5936033501328579a8ef80ce Mon Sep 17 00:00:00 2001 From: Nicolas Kochlowski Date: Thu, 19 Sep 2024 12:16:02 -0300 Subject: vc/amd/opensil: Move openSIL interface declarations to common header The declarations describing interface functions between SoCs and openSIL glue code are common for the stub and Genoa POC, and likely with future SoC openSIL implementations. Therefore, move these out of SoC-specific header files and into vc/amd/opensil/opensil.h. This change facilitates swapping out the stub for the actual openSIL glue code. Change-Id: Icc8783ddb868f9f0c4cd357245604313eadfe531 Signed-off-by: Nicolas Kochlowski Reviewed-on: https://review.coreboot.org/c/coreboot/+/84428 Reviewed-by: Felix Held Reviewed-by: Varshit Pandya Tested-by: build bot (Jenkins) --- src/soc/amd/genoa_poc/acpi.c | 2 +- src/soc/amd/genoa_poc/chip.c | 2 +- src/soc/amd/genoa_poc/domain.c | 2 +- src/soc/amd/phoenix/acpi.c | 2 +- src/soc/amd/phoenix/chip.c | 2 +- src/soc/amd/phoenix/memmap.c | 2 +- src/vendorcode/amd/opensil/genoa_poc/acpi.c | 2 +- src/vendorcode/amd/opensil/genoa_poc/memmap.c | 2 +- src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c | 2 +- src/vendorcode/amd/opensil/genoa_poc/opensil.h | 22 ---------------------- src/vendorcode/amd/opensil/genoa_poc/ramstage.c | 2 +- src/vendorcode/amd/opensil/opensil.h | 22 ++++++++++++++++++++++ src/vendorcode/amd/opensil/stub/opensil.h | 19 ------------------- src/vendorcode/amd/opensil/stub/ramstage.c | 2 +- 14 files changed, 33 insertions(+), 52 deletions(-) delete mode 100644 src/vendorcode/amd/opensil/genoa_poc/opensil.h create mode 100644 src/vendorcode/amd/opensil/opensil.h delete mode 100644 src/vendorcode/amd/opensil/stub/opensil.h diff --git a/src/soc/amd/genoa_poc/acpi.c b/src/soc/amd/genoa_poc/acpi.c index fc223047be..9b8011dcc6 100644 --- a/src/soc/amd/genoa_poc/acpi.c +++ b/src/soc/amd/genoa_poc/acpi.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include void acpi_fill_fadt(acpi_fadt_t *fadt) { diff --git a/src/soc/amd/genoa_poc/chip.c b/src/soc/amd/genoa_poc/chip.c index a763dab862..75f5bccb00 100644 --- a/src/soc/amd/genoa_poc/chip.c +++ b/src/soc/amd/genoa_poc/chip.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include static void soc_init(void *chip_info) { diff --git a/src/soc/amd/genoa_poc/domain.c b/src/soc/amd/genoa_poc/domain.c index b6369a47d0..65b13958cb 100644 --- a/src/soc/amd/genoa_poc/domain.c +++ b/src/soc/amd/genoa_poc/domain.c @@ -11,7 +11,7 @@ #include #include -#include +#include #define IOHC_IOAPIC_BASE_ADDR_LO 0x2f0 diff --git a/src/soc/amd/phoenix/acpi.c b/src/soc/amd/phoenix/acpi.c index c96d80c5fb..c6e06be0bb 100644 --- a/src/soc/amd/phoenix/acpi.c +++ b/src/soc/amd/phoenix/acpi.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "chip.h" /* diff --git a/src/soc/amd/phoenix/chip.c b/src/soc/amd/phoenix/chip.c index a88468b28d..68bc408d2b 100644 --- a/src/soc/amd/phoenix/chip.c +++ b/src/soc/amd/phoenix/chip.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include "chip.h" static const char *soc_acpi_name(const struct device *dev) diff --git a/src/soc/amd/phoenix/memmap.c b/src/soc/amd/phoenix/memmap.c index 9e740cbb9c..d29dcbee63 100644 --- a/src/soc/amd/phoenix/memmap.c +++ b/src/soc/amd/phoenix/memmap.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include /* * +--------------------------------+ diff --git a/src/vendorcode/amd/opensil/genoa_poc/acpi.c b/src/vendorcode/amd/opensil/genoa_poc/acpi.c index a0af4a3f3e..f539798d69 100644 --- a/src/vendorcode/amd/opensil/genoa_poc/acpi.c +++ b/src/vendorcode/amd/opensil/genoa_poc/acpi.c @@ -5,7 +5,7 @@ #include #include #include -#include "opensil.h" +#include "../opensil.h" void opensil_fill_fadt_io_ports(acpi_fadt_t *fadt) { diff --git a/src/vendorcode/amd/opensil/genoa_poc/memmap.c b/src/vendorcode/amd/opensil/genoa_poc/memmap.c index 6261ad0260..ece9877183 100644 --- a/src/vendorcode/amd/opensil/genoa_poc/memmap.c +++ b/src/vendorcode/amd/opensil/genoa_poc/memmap.c @@ -12,7 +12,7 @@ #include #include -#include "opensil.h" +#include "../opensil.h" static const char *hole_info_type(MEMORY_HOLE_TYPES type) { diff --git a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c index b3710341b7..cd7b9a1cba 100644 --- a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c +++ b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c @@ -7,7 +7,7 @@ #include #include #include "chip.h" -#include "../opensil.h" +#include "../../opensil.h" struct chip_operations vendorcode_amd_opensil_chip_mpio_ops = { .name = "AMD GENOA MPIO", diff --git a/src/vendorcode/amd/opensil/genoa_poc/opensil.h b/src/vendorcode/amd/opensil/genoa_poc/opensil.h deleted file mode 100644 index 1aa2f06423..0000000000 --- a/src/vendorcode/amd/opensil/genoa_poc/opensil.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef _OPENSIL_H_ -#define _OPENSIL_H_ - -#include -#include - -void SIL_STATUS_report(const char *function, const int status); -// Add the memory map to dev, starting at index idx, returns last use idx -void add_opensil_memmap(struct device *dev, unsigned long *idx); -// Fill in FADT from openSIL -void opensil_fill_fadt_io_ports(acpi_fadt_t *fadt); - -void configure_mpio(void); - -void setup_opensil(void); -void opensil_xSIM_timepoint_1(void); -void opensil_xSIM_timepoint_2(void); -void opensil_xSIM_timepoint_3(void); - -#endif diff --git a/src/vendorcode/amd/opensil/genoa_poc/ramstage.c b/src/vendorcode/amd/opensil/genoa_poc/ramstage.c index 843f073a36..b18ccc9836 100644 --- a/src/vendorcode/amd/opensil/genoa_poc/ramstage.c +++ b/src/vendorcode/amd/opensil/genoa_poc/ramstage.c @@ -12,7 +12,7 @@ #include #include #include "opensil_console.h" -#include "opensil.h" +#include "../opensil.h" void SIL_STATUS_report(const char *function, const int status) { diff --git a/src/vendorcode/amd/opensil/opensil.h b/src/vendorcode/amd/opensil/opensil.h new file mode 100644 index 0000000000..1aa2f06423 --- /dev/null +++ b/src/vendorcode/amd/opensil/opensil.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _OPENSIL_H_ +#define _OPENSIL_H_ + +#include +#include + +void SIL_STATUS_report(const char *function, const int status); +// Add the memory map to dev, starting at index idx, returns last use idx +void add_opensil_memmap(struct device *dev, unsigned long *idx); +// Fill in FADT from openSIL +void opensil_fill_fadt_io_ports(acpi_fadt_t *fadt); + +void configure_mpio(void); + +void setup_opensil(void); +void opensil_xSIM_timepoint_1(void); +void opensil_xSIM_timepoint_2(void); +void opensil_xSIM_timepoint_3(void); + +#endif diff --git a/src/vendorcode/amd/opensil/stub/opensil.h b/src/vendorcode/amd/opensil/stub/opensil.h deleted file mode 100644 index 9563403e6b..0000000000 --- a/src/vendorcode/amd/opensil/stub/opensil.h +++ /dev/null @@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef _OPENSIL_H_ -#define _OPENSIL_H_ - -#include -#include - -// Add the memory map to dev, starting at index idx, returns last use idx -void add_opensil_memmap(struct device *dev, unsigned long *idx); -// Fill in FADT from openSIL -void opensil_fill_fadt_io_ports(acpi_fadt_t *fadt); - -void setup_opensil(void); -void opensil_xSIM_timepoint_1(void); -void opensil_xSIM_timepoint_2(void); -void opensil_xSIM_timepoint_3(void); - -#endif diff --git a/src/vendorcode/amd/opensil/stub/ramstage.c b/src/vendorcode/amd/opensil/stub/ramstage.c index 76cbaf8441..0674140646 100644 --- a/src/vendorcode/amd/opensil/stub/ramstage.c +++ b/src/vendorcode/amd/opensil/stub/ramstage.c @@ -3,7 +3,7 @@ #include #include #include -#include "opensil.h" +#include "../opensil.h" void add_opensil_memmap(struct device *dev, unsigned long *idx) { -- cgit v1.2.3