Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47299 )
Change subject: soc/intel/xeon_sp: Tidy up adding MADT ioapic entries ......................................................................
soc/intel/xeon_sp: Tidy up adding MADT ioapic entries
Add a helper function to print out debug info and add the MADT entry.
Change-Id: I1a00f87c6edef530c5352929ee9279782be4b112 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/xeon_sp/acpi.c 1 file changed, 14 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/47299/1
diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/acpi.c index acf030b..b7e20d4 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/acpi.c @@ -72,6 +72,16 @@ return current; }
+static unsigned long add_madt_ioapic(unsigned long current, int stack, int ioapic_id, + uint32_t ioapic_base, int gsi_base) +{ + printk(BIOS_DEBUG, "Adding MADT IOAPIC for stack: %d, ioapic_id: 0x%x, " + "ioapic_base: 0x%x, gsi_base: 0x%x\n", + stack, ioapic_id, ioapic_base, gsi_base); + return acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, ioapic_id, + ioapic_base, gsi_base); +} + unsigned long acpi_fill_madt(unsigned long current) { int cur_index; @@ -99,12 +109,8 @@ assert(cur_index < ARRAY_SIZE(gsi_bases)); int ioapic_id = ioapic_ids[cur_index]; int gsi_base = gsi_bases[cur_index]; - printk(BIOS_DEBUG, "Adding MADT IOAPIC for stack: %d, ioapic_id: 0x%x, " - "ioapic_base: 0x%x, gsi_base: 0x%x\n", - stack, ioapic_id, ri->IoApicBase, gsi_base); - current += acpi_create_madt_ioapic( - (acpi_madt_ioapic_t *)current, - ioapic_id, ri->IoApicBase, gsi_base); + current += add_madt_ioapic(current, stack, ioapic_id, ri->IoApicBase, + gsi_base); ++cur_index;
/* @@ -116,13 +122,8 @@ assert(cur_index < ARRAY_SIZE(gsi_bases)); ioapic_id = ioapic_ids[cur_index]; gsi_base = gsi_bases[cur_index]; - printk(BIOS_DEBUG, "Adding MADT IOAPIC for stack: %d, ioapic_id: 0x%x, " - "ioapic_base: 0x%x, gsi_base: 0x%x\n", - stack, ioapic_id, - ri->IoApicBase + 0x1000, gsi_base); - current += acpi_create_madt_ioapic( - (acpi_madt_ioapic_t *)current, - ioapic_id, ri->IoApicBase + 0x1000, gsi_base); + current += add_madt_ioapic(current, stack, ioapic_id, + ri->IoApicBase + 0x1000, gsi_base); ++cur_index; } }
Marc Jones has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47299 )
Change subject: soc/intel/xeon_sp: Tidy up adding MADT ioapic entries ......................................................................
Patch Set 1: Code-Review+2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47299 )
Change subject: soc/intel/xeon_sp: Tidy up adding MADT ioapic entries ......................................................................
Patch Set 3: Code-Review+2
Philipp Deppenwiese has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47299 )
Change subject: soc/intel/xeon_sp: Tidy up adding MADT ioapic entries ......................................................................
soc/intel/xeon_sp: Tidy up adding MADT ioapic entries
Add a helper function to print out debug info and add the MADT entry.
Change-Id: I1a00f87c6edef530c5352929ee9279782be4b112 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/47299 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: Marc Jones marc@marcjonesconsulting.com --- M src/soc/intel/xeon_sp/acpi.c 1 file changed, 14 insertions(+), 13 deletions(-)
Approvals: build bot (Jenkins): Verified Marc Jones: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/acpi.c index d33d1d0..5a77bf3 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/acpi.c @@ -73,6 +73,16 @@ return current; }
+static unsigned long add_madt_ioapic(unsigned long current, int stack, int ioapic_id, + uint32_t ioapic_base, int gsi_base) +{ + printk(BIOS_DEBUG, "Adding MADT IOAPIC for stack: %d, ioapic_id: 0x%x, " + "ioapic_base: 0x%x, gsi_base: 0x%x\n", + stack, ioapic_id, ioapic_base, gsi_base); + return acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, ioapic_id, + ioapic_base, gsi_base); +} + unsigned long acpi_fill_madt(unsigned long current) { int cur_index; @@ -100,12 +110,8 @@ assert(cur_index < ARRAY_SIZE(gsi_bases)); int ioapic_id = ioapic_ids[cur_index]; int gsi_base = gsi_bases[cur_index]; - printk(BIOS_DEBUG, "Adding MADT IOAPIC for stack: %d, ioapic_id: 0x%x, " - "ioapic_base: 0x%x, gsi_base: 0x%x\n", - stack, ioapic_id, ri->IoApicBase, gsi_base); - current += acpi_create_madt_ioapic( - (acpi_madt_ioapic_t *)current, - ioapic_id, ri->IoApicBase, gsi_base); + current += add_madt_ioapic(current, stack, ioapic_id, ri->IoApicBase, + gsi_base); ++cur_index;
/* @@ -117,13 +123,8 @@ assert(cur_index < ARRAY_SIZE(gsi_bases)); ioapic_id = ioapic_ids[cur_index]; gsi_base = gsi_bases[cur_index]; - printk(BIOS_DEBUG, "Adding MADT IOAPIC for stack: %d, ioapic_id: 0x%x, " - "ioapic_base: 0x%x, gsi_base: 0x%x\n", - stack, ioapic_id, - ri->IoApicBase + 0x1000, gsi_base); - current += acpi_create_madt_ioapic( - (acpi_madt_ioapic_t *)current, - ioapic_id, ri->IoApicBase + 0x1000, gsi_base); + current += add_madt_ioapic(current, stack, ioapic_id, + ri->IoApicBase + 0x1000, gsi_base); ++cur_index; } }