Mike Loptien (mike.loptien@se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5878
-gerrit
commit cce42eccc2b5d0074e4313e728a2ad8ca4ba9bc8 Author: Mike Loptien mike.loptien@se-eng.com Date: Tue Jan 7 11:23:42 2014 -0700
Persimmon: Make MPTable setup use IOAPIC defines
The IOAPIC is setup before we start writing the system tables. This means that we can just read the IOAPIC registers to get its configuration instead of hardcoding values that may be wrong.
Bug 3022
Change-Id: I96ec046a2208eddf4b5e442214ff43d2a349ca4d Signed-off-by: Mike Loptien mike.loptien@se-eng.com Reviewed-on: http://gerrit/2947 Reviewed-by: Marc Jones marc.jones@se-eng.com Tested-by: Automated Builds automated.builds@se-eng.com --- src/mainboard/amd/persimmon/mptable.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/src/mainboard/amd/persimmon/mptable.c b/src/mainboard/amd/persimmon/mptable.c index aacf50a..a65b8e6 100644 --- a/src/mainboard/amd/persimmon/mptable.c +++ b/src/mainboard/amd/persimmon/mptable.c @@ -29,8 +29,8 @@ #include <SBPLATFORM.h> #include <southbridge/amd/cimx/cimx_util.h> #include <drivers/generic/ioapic/chip.h> +#include <arch/ioapic.h>
-#define IO_APIC_ID (CONFIG_MAX_CPUS + 1) extern u8 bus_sb800[6]; extern u32 apicid_sb800; extern u8 * intr_data_ptr; @@ -42,7 +42,8 @@ static void *smp_write_config_table(void *v) { struct mp_config_table *mc; int bus_isa; - u32 dword; + u32 apicver_sb800; + /* Intialize the MP_Table */ mc = (void *)(((char *)v) + SMP_FLOATING_TABLE_LEN);
@@ -69,16 +70,10 @@ static void *smp_write_config_table(void *v) * Type 2: I/O APICs: * APIC ID, Version, APIC Flags:EN, Address */ - dword = 0; - dword = pm_ioread(0x34) & 0xF0; - dword |= (pm_ioread(0x35) & 0xFF) << 8; - dword |= (pm_ioread(0x36) & 0xFF) << 16; - dword |= (pm_ioread(0x37) & 0xFF) << 24; - /* Set IO APIC ID onto IO_APIC_ID */ - write32 (dword, 0x00); - write32 (dword + 0x10, IO_APIC_ID << 24); - apicid_sb800 = IO_APIC_ID; - smp_write_ioapic(mc, apicid_sb800, 0x21, dword); + apicid_sb800 = (io_apic_read(IO_APIC_ADDR, 0x00) >> 24); /* Get IOAPIC ID */ + apicver_sb800 = (io_apic_read(IO_APIC_ADDR, 0x01) & 0xFF); /* Get IOAPIC version */ + + smp_write_ioapic(mc, apicid_sb800, apicver_sb800, IO_APIC_ADDR);
/* * Type 3: I/O Interrupt Table Entries: