summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2020-11-06 12:25:28 +0100
committerPhilipp Deppenwiese <zaolin.daisuki@gmail.com>2020-11-13 00:24:46 +0000
commitc7eebacbebcc6ba5cfaa321e7793e4e81f98415e (patch)
tree7ae6e44fad9826aa66a573455eac50aa7d412723 /src/soc
parent88c16f6ee78a26a2c6ffe2dd3ee1b7fa75283b39 (diff)
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>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/xeon_sp/acpi.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/acpi.c
index d33d1d0cea..5a77bf3b02 100644
--- a/src/soc/intel/xeon_sp/acpi.c
+++ b/src/soc/intel/xeon_sp/acpi.c
@@ -73,6 +73,16 @@ static unsigned long acpi_madt_irq_overrides(unsigned long current)
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 @@ unsigned long acpi_fill_madt(unsigned long current)
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 @@ unsigned long acpi_fill_madt(unsigned long current)
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;
}
}