Hello Jason Glenesk,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/46327
to review the following change.
Change subject: soc/amd/picasso: Override weak functions for ioapic_id. ......................................................................
soc/amd/picasso: Override weak functions for ioapic_id.
Override soc_get_fch_ioapic_id() and soc_get_gnb_ioapic_id() for picasso. Return CONFIG_PICASSO_FCH_IOAPIC_ID and CONFIG_PICASSO_GNB_IOAPIC_ID.
BUG=b:167421913 TEST=Boot morphius to shell. Confirm overrides return values by dumping MADT. BRANCH=Zork
Signed-off-by: Jason Glenesk jason.glenesk@amd.corp-partner.google.com Change-Id: I7f0403678d7b221e7f6e76c72b701a095f233c97 --- M src/soc/amd/common/block/smbus/sm.c M src/soc/amd/picasso/acpi.c M src/soc/amd/picasso/cpu.c 3 files changed, 16 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/46327/1
diff --git a/src/soc/amd/common/block/smbus/sm.c b/src/soc/amd/common/block/smbus/sm.c index c5c1ed8..d10167e 100644 --- a/src/soc/amd/common/block/smbus/sm.c +++ b/src/soc/amd/common/block/smbus/sm.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <amdblocks/acpimmio_map.h> +#include <amdblocks/cpu.h> #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> @@ -16,7 +17,7 @@
static void sm_init(struct device *dev) { - setup_ioapic(VIO_APIC_VADDR, CONFIG_MAX_CPUS); + setup_ioapic(VIO_APIC_VADDR, soc_get_fch_ioapic_id()); }
static u32 get_sm_mmio(struct device *dev) diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index 17940e9..645968f 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -19,6 +19,7 @@ #include <device/pci.h> #include <amdblocks/acpimmio.h> #include <amdblocks/acpi.h> +#include <amdblocks/cpu.h> #include <soc/acpi.h> #include <soc/pci_devs.h> #include <soc/cpu.h> @@ -52,10 +53,10 @@ current = acpi_create_madt_lapics(current);
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, - CONFIG_PICASSO_FCH_IOAPIC_ID, IO_APIC_ADDR, 0); + soc_get_fch_ioapic_id(), IO_APIC_ADDR, 0);
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, - CONFIG_PICASSO_GNB_IOAPIC_ID, GNB_IO_APIC_ADDR, IO_APIC_INTERRUPTS); + soc_get_gnb_ioapic_id(), GNB_IO_APIC_ADDR, IO_APIC_INTERRUPTS);
/* 0: mean bus 0--->ISA */ /* 0: PIC 0 */ diff --git a/src/soc/amd/picasso/cpu.c b/src/soc/amd/picasso/cpu.c index 4d6e98d..5e01e9e 100644 --- a/src/soc/amd/picasso/cpu.c +++ b/src/soc/amd/picasso/cpu.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */
+#include <amdblocks/cpu.h> #include <cpu/cpu.h> #include <cpu/x86/mp.h> #include <cpu/x86/mtrr.h> @@ -139,3 +140,13 @@ .ops = &cpu_dev_ops, .id_table = cpu_table, }; + +uint8_t soc_get_fch_ioapic_id(void) +{ + return CONFIG_PICASSO_FCH_IOAPIC_ID; +} + +uint8_t soc_get_gnb_ioapic_id(void) +{ + return CONFIG_PICASSO_GNB_IOAPIC_ID; +}