We define IO_APIC_ADDR in <arch/ioapic.h>, let's use it.

As both ioapic.h and acpi.h define a macro named "NMI", rename one
of them (NMI -> NMIType in acpi.h).

Abuild-tested.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Peter Stuge <peter@stuge.se>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5943 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/mainboard/amd/dbm690t/acpi_tables.c b/src/mainboard/amd/dbm690t/acpi_tables.c
index 907240b..dcccdf0 100644
--- a/src/mainboard/amd/dbm690t/acpi_tables.c
+++ b/src/mainboard/amd/dbm690t/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -59,8 +60,6 @@
 
 extern const unsigned char AmlCode[];
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/amd/mahogany/acpi_tables.c b/src/mainboard/amd/mahogany/acpi_tables.c
index 79c9799..c348f44 100644
--- a/src/mainboard/amd/mahogany/acpi_tables.c
+++ b/src/mainboard/amd/mahogany/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -66,8 +67,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/amd/mahogany_fam10/acpi_tables.c b/src/mainboard/amd/mahogany_fam10/acpi_tables.c
index 2e09a23..5ccfa11 100644
--- a/src/mainboard/amd/mahogany_fam10/acpi_tables.c
+++ b/src/mainboard/amd/mahogany_fam10/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -56,8 +57,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/amd/pistachio/acpi_tables.c b/src/mainboard/amd/pistachio/acpi_tables.c
index 05c2670..4a6d3c2 100644
--- a/src/mainboard/amd/pistachio/acpi_tables.c
+++ b/src/mainboard/amd/pistachio/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -59,8 +60,6 @@
 
 extern const unsigned char AmlCode[];
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
index 1b5197e..fd8416f 100644
--- a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
+++ b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
@@ -11,13 +11,13 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
 #include <cpu/amd/mtrr.h>
 #include <cpu/amd/amdk8_sysconf.h>
 #include "northbridge/amd/amdk8/amdk8_acpi.h"
-
 #include "mb_sysconf.h"
 
 #define DUMP_ACPI_TABLES 0
@@ -45,8 +45,6 @@
 extern const unsigned char AmlCode_ssdt4[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/amd/serengeti_cheetah/mptable.c b/src/mainboard/amd/serengeti_cheetah/mptable.c
index 8541ff4..855d267 100644
--- a/src/mainboard/amd/serengeti_cheetah/mptable.c
+++ b/src/mainboard/amd/serengeti_cheetah/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -54,7 +55,7 @@
         smp_write_bus(mc, m->bus_isa, "ISA   ");
 
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, m->apicid_8111, 0x11, 0xfec00000); //8111
+	smp_write_ioapic(mc, m->apicid_8111, 0x11, IO_APIC_ADDR); //8111
         {
                 device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
index 8686491..9796c72 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -56,8 +57,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/mptable.c b/src/mainboard/amd/serengeti_cheetah_fam10/mptable.c
index c0a4d8a..93c6bcc 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/mptable.c
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/mptable.c
@@ -19,6 +19,7 @@
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -74,7 +75,7 @@
 	smp_write_bus(mc, m->bus_isa, "ISA   ");
 
 	/*I/O APICs:	APIC ID	Version	State	Address*/
-	smp_write_ioapic(mc, m->apicid_8111, 0x11, 0xfec00000); //8111
+	smp_write_ioapic(mc, m->apicid_8111, 0x11, IO_APIC_ADDR); //8111
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/amd/tilapia_fam10/acpi_tables.c b/src/mainboard/amd/tilapia_fam10/acpi_tables.c
index 2e09a23..5ccfa11 100644
--- a/src/mainboard/amd/tilapia_fam10/acpi_tables.c
+++ b/src/mainboard/amd/tilapia_fam10/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -56,8 +57,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/arima/hdama/mptable.c b/src/mainboard/arima/hdama/mptable.c
index 8760d7b..55c4440 100644
--- a/src/mainboard/arima/hdama/mptable.c
+++ b/src/mainboard/arima/hdama/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -201,7 +202,7 @@
 	smp_write_bus(mc, bus_isa, "ISA	  ");
 
 	/* IOAPIC handling */
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/asrock/939a785gmh/acpi_tables.c b/src/mainboard/asrock/939a785gmh/acpi_tables.c
index 79c9799..c348f44 100644
--- a/src/mainboard/asrock/939a785gmh/acpi_tables.c
+++ b/src/mainboard/asrock/939a785gmh/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -66,8 +67,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/asus/a8v-e_se/acpi_tables.c b/src/mainboard/asus/a8v-e_se/acpi_tables.c
index 1119fd8..fe8d475 100644
--- a/src/mainboard/asus/a8v-e_se/acpi_tables.c
+++ b/src/mainboard/asus/a8v-e_se/acpi_tables.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <arch/acpi.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/device.h>
 #include <device/pci_ids.h>
 #include "southbridge/via/vt8237r/vt8237r.h"
@@ -59,7 +60,7 @@
 
 	/* Write SB IOAPIC. */
 	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
-				VT8237R_APIC_ID, VT8237R_APIC_BASE, 0);
+				VT8237R_APIC_ID, IO_APIC_ADDR, 0);
 
 	/* Write NB IOAPIC. */
 	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
diff --git a/src/mainboard/asus/a8v-e_se/mptable.c b/src/mainboard/asus/a8v-e_se/mptable.c
index d2529db..4260713 100644
--- a/src/mainboard/asus/a8v-e_se/mptable.c
+++ b/src/mainboard/asus/a8v-e_se/mptable.c
@@ -20,6 +20,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include "southbridge/via/vt8237r/vt8237r.h"
 #include "southbridge/via/k8t890/k8t890.h"
 
@@ -62,7 +63,7 @@
 	smp_write_bus(mc, bus_isa, "ISA   ");
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
-	smp_write_ioapic(mc, VT8237R_APIC_ID, 0x20, VT8237R_APIC_BASE);
+	smp_write_ioapic(mc, VT8237R_APIC_ID, 0x20, IO_APIC_ADDR);
 	smp_write_ioapic(mc, K8T890_APIC_ID, 0x20, K8T890_APIC_BASE);
 
 	mptable_add_isa_interrupts(mc, bus_isa, VT8237R_APIC_ID, 0);
diff --git a/src/mainboard/asus/m2v-mx_se/acpi_tables.c b/src/mainboard/asus/m2v-mx_se/acpi_tables.c
index 5858e3f..43cd329 100644
--- a/src/mainboard/asus/m2v-mx_se/acpi_tables.c
+++ b/src/mainboard/asus/m2v-mx_se/acpi_tables.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <arch/acpi.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/device.h>
 #include <device/pci_ids.h>
 #include "southbridge/via/vt8237r/vt8237r.h"
@@ -61,7 +62,7 @@
 
 	/* Write SB IOAPIC. */
 	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
-				VT8237R_APIC_ID, VT8237R_APIC_BASE, 0);
+				VT8237R_APIC_ID, IO_APIC_ADDR, 0);
 
 	/* Write NB IOAPIC. */
 	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
diff --git a/src/mainboard/asus/m4a785-m/acpi_tables.c b/src/mainboard/asus/m4a785-m/acpi_tables.c
index 2e09a23..aeac68e 100644
--- a/src/mainboard/asus/m4a785-m/acpi_tables.c
+++ b/src/mainboard/asus/m4a785-m/acpi_tables.c
@@ -20,12 +20,12 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
 #include <cpu/amd/mtrr.h>
 #include <cpu/amd/amdfam10_sysconf.h>
-
 #include "mb_sysconf.h"
 
 #define DUMP_ACPI_TABLES 0
@@ -56,8 +56,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/asus/p2b-d/mptable.c b/src/mainboard/asus/p2b-d/mptable.c
index cc77415..6d3e4cc 100644
--- a/src/mainboard/asus/p2b-d/mptable.c
+++ b/src/mainboard/asus/p2b-d/mptable.c
@@ -20,6 +20,7 @@
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -56,7 +57,7 @@
 	smp_write_bus(mc, 2, "ISA   ");
 
 	/* I/O APICs: APIC ID  Version  State  Address */
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/asus/p2b-ds/mptable.c b/src/mainboard/asus/p2b-ds/mptable.c
index 42f6fa4..4650c59 100644
--- a/src/mainboard/asus/p2b-ds/mptable.c
+++ b/src/mainboard/asus/p2b-ds/mptable.c
@@ -20,6 +20,7 @@
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -55,7 +56,7 @@
 	smp_write_bus(mc, 1, "ISA   ");
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/dell/s1850/mptable.c b/src/mainboard/dell/s1850/mptable.c
index b6250b2..48d2a21 100644
--- a/src/mainboard/dell/s1850/mptable.c
+++ b/src/mainboard/dell/s1850/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -109,7 +110,7 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	{
 		struct resource *res;
 		device_t dev;
diff --git a/src/mainboard/emulation/qemu-x86/northbridge.c b/src/mainboard/emulation/qemu-x86/northbridge.c
index cca5620..7a73ecf 100644
--- a/src/mainboard/emulation/qemu-x86/northbridge.c
+++ b/src/mainboard/emulation/qemu-x86/northbridge.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/io.h>
+#include <arch/ioapic.h>
 #include <stdint.h>
 #include <device/device.h>
 #include <device/pci.h>
@@ -64,7 +65,7 @@
 	/* Reserve space for the IOAPIC.  This should be in the Southbridge,
 	 * but I couldn't tell which device to put it in. */
 	res = new_resource(dev, 2);
-	res->base = 0xfec00000UL;
+	res->base = IO_APIC_ADDR;
 	res->size = 0x100000UL;
 	res->limit = 0xffffffffUL;
 	res->flags = IORESOURCE_MEM | IORESOURCE_FIXED | IORESOURCE_STORED |
diff --git a/src/mainboard/getac/p470/acpi_tables.c b/src/mainboard/getac/p470/acpi_tables.c
index 8dbdbfd..490a182 100644
--- a/src/mainboard/getac/p470/acpi_tables.c
+++ b/src/mainboard/getac/p470/acpi_tables.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <arch/acpigen.h>
 #include <arch/smp/mpspec.h>
 #include <device/device.h>
@@ -131,8 +132,6 @@
 	return header->length;
 }
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
 	/* Local APICs */
diff --git a/src/mainboard/getac/p470/mptable.c b/src/mainboard/getac/p470/mptable.c
index 547b598..014965b 100644
--- a/src/mainboard/getac/p470/mptable.c
+++ b/src/mainboard/getac/p470/mptable.c
@@ -19,11 +19,11 @@
  * MA 02110-1301 USA
  */
 
-
 #include <device/device.h>
 #include <device/pci.h>
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <string.h>
 #include <stdint.h>
 
@@ -67,7 +67,7 @@
 	smp_write_bus(mc, isa_bus, "ISA   ");
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 
 	/* Legacy Interrupts */
 	mptable_add_isa_interrupts(mc, isa_bus, 0x2, 0);
diff --git a/src/mainboard/gigabyte/ma785gmt/acpi_tables.c b/src/mainboard/gigabyte/ma785gmt/acpi_tables.c
index 8d51dc3..29b00e5 100644
--- a/src/mainboard/gigabyte/ma785gmt/acpi_tables.c
+++ b/src/mainboard/gigabyte/ma785gmt/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -54,8 +55,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/gigabyte/ma78gm/acpi_tables.c b/src/mainboard/gigabyte/ma78gm/acpi_tables.c
index 2a418f6..29b00e5 100644
--- a/src/mainboard/gigabyte/ma78gm/acpi_tables.c
+++ b/src/mainboard/gigabyte/ma78gm/acpi_tables.c
@@ -20,13 +20,13 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
 #include <cpu/amd/mtrr.h>
 #include <cpu/amd/amdfam10_sysconf.h>
 
-
 #define DUMP_ACPI_TABLES 0
 
 #if DUMP_ACPI_TABLES == 1
@@ -55,8 +55,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/hp/dl145_g1/mptable.c b/src/mainboard/hp/dl145_g1/mptable.c
index 8e76057..72c7c62 100644
--- a/src/mainboard/hp/dl145_g1/mptable.c
+++ b/src/mainboard/hp/dl145_g1/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -60,7 +61,7 @@
 
 
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, apicid_8111, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x20, IO_APIC_ADDR);
         {
                 device_t dev;
                 struct resource *res;
diff --git a/src/mainboard/ibase/mb899/acpi_tables.c b/src/mainboard/ibase/mb899/acpi_tables.c
index 063127b..f8009c3 100644
--- a/src/mainboard/ibase/mb899/acpi_tables.c
+++ b/src/mainboard/ibase/mb899/acpi_tables.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <arch/acpigen.h>
 #include <arch/smp/mpspec.h>
 #include <device/device.h>
@@ -86,8 +87,6 @@
 	    acpi_checksum((void *) hpet, sizeof(acpi_hpet_t));
 }
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
 	/* Local APICs */
diff --git a/src/mainboard/ibase/mb899/mptable.c b/src/mainboard/ibase/mb899/mptable.c
index d582ec6..4c6e9e4 100644
--- a/src/mainboard/ibase/mb899/mptable.c
+++ b/src/mainboard/ibase/mb899/mptable.c
@@ -17,11 +17,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-
 #include <device/device.h>
 #include <device/pci.h>
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <string.h>
 #include <stdint.h>
 
@@ -86,7 +86,7 @@
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
 	ioapic_id = 2;
-	smp_write_ioapic(mc, ioapic_id, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, ioapic_id, 0x20, IO_APIC_ADDR);
 
 	/* Legacy Interrupts */
 
diff --git a/src/mainboard/ibm/e325/mptable.c b/src/mainboard/ibm/e325/mptable.c
index 945ad9f..7a6de7e 100644
--- a/src/mainboard/ibm/e325/mptable.c
+++ b/src/mainboard/ibm/e325/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -81,7 +82,7 @@
 	smp_write_bus(mc, bus_isa, "ISA	  ");
 
 	/* Legacy IOAPIC #2 */
-	smp_write_ioapic(mc, 2, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/ibm/e326/mptable.c b/src/mainboard/ibm/e326/mptable.c
index 66876e7..1452c99 100644
--- a/src/mainboard/ibm/e326/mptable.c
+++ b/src/mainboard/ibm/e326/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -80,7 +81,7 @@
 	smp_write_bus(mc, bus_isa, "ISA	  ");
 
 	/* Legacy IOAPIC #2 */
-	smp_write_ioapic(mc, 2, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/iei/kino-780am2-fam10/acpi_tables.c b/src/mainboard/iei/kino-780am2-fam10/acpi_tables.c
index 2e09a23..5ccfa11 100644
--- a/src/mainboard/iei/kino-780am2-fam10/acpi_tables.c
+++ b/src/mainboard/iei/kino-780am2-fam10/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -56,8 +57,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/intel/d945gclf/acpi_tables.c b/src/mainboard/intel/d945gclf/acpi_tables.c
index f10a8d5..9fc2adb 100644
--- a/src/mainboard/intel/d945gclf/acpi_tables.c
+++ b/src/mainboard/intel/d945gclf/acpi_tables.c
@@ -27,6 +27,7 @@
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
+#include <arch/ioapic.h>
 #include "dmi.h"
 
 #define OLD_ACPI 0
@@ -146,8 +147,6 @@
 	    acpi_checksum((void *) hpet, sizeof(acpi_hpet_t));
 }
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
 	/* Local APICs */
diff --git a/src/mainboard/intel/d945gclf/mptable.c b/src/mainboard/intel/d945gclf/mptable.c
index bff9849..5930d2f 100644
--- a/src/mainboard/intel/d945gclf/mptable.c
+++ b/src/mainboard/intel/d945gclf/mptable.c
@@ -17,11 +17,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-
 #include <device/device.h>
 #include <device/pci.h>
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <string.h>
 #include <stdint.h>
 
@@ -65,7 +65,7 @@
 	smp_write_bus(mc, isa_bus, "ISA   ");
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 
 	/* Legacy Interrupts */
 
diff --git a/src/mainboard/intel/eagleheights/acpi_tables.c b/src/mainboard/intel/eagleheights/acpi_tables.c
index 83ed984..123ddbc 100644
--- a/src/mainboard/intel/eagleheights/acpi_tables.c
+++ b/src/mainboard/intel/eagleheights/acpi_tables.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
@@ -84,8 +85,6 @@
 
 #define IO_APIC0 2
 #define IO_APIC1 3
-#define IO_APIC0_ADDR	0xfec00000UL
-#define IO_APIC1_ADDR	0xfec10000UL
 
 unsigned long acpi_fill_madt(unsigned long current)
 {
@@ -99,9 +98,9 @@
 	current += acpi_create_madt_lapic((acpi_madt_lapic_t *) current, 2, 1);
 
 	/* IOAPIC */
-	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, IO_APIC0, IO_APIC0_ADDR, irq_start);
+	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, IO_APIC0, IO_APIC_ADDR, irq_start);
 	irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
-	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, IO_APIC1, IO_APIC1_ADDR, irq_start);
+	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, IO_APIC1, IO_APIC_ADDR + 0x10000, irq_start);
 	irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
 
 	dev = dev_find_slot(0, PCI_DEVFN(0x1e,0));
diff --git a/src/mainboard/intel/eagleheights/mptable.c b/src/mainboard/intel/eagleheights/mptable.c
index 5ee1d1f..33d7b01 100644
--- a/src/mainboard/intel/eagleheights/mptable.c
+++ b/src/mainboard/intel/eagleheights/mptable.c
@@ -23,6 +23,7 @@
 
 #include <console/console.h>
 #include <arch/io.h>
+#include <arch/ioapic.h>
 #include <arch/smp/mpspec.h>
 #include <device/pci.h>
 #include <string.h>
@@ -144,7 +145,7 @@
 	smp_write_bus(mc, bus_isa, "ISA   ");
 
 	/*I/O APICs: APIC ID Version State Address*/
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	/*
 	{
 		device_t dev;
diff --git a/src/mainboard/intel/jarrell/mptable.c b/src/mainboard/intel/jarrell/mptable.c
index 863ddf8..7a2a594 100644
--- a/src/mainboard/intel/jarrell/mptable.c
+++ b/src/mainboard/intel/jarrell/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -111,7 +112,7 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 8, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 8, 0x20, IO_APIC_ADDR);
 	{
 		struct resource *res;
 		device_t dev;
diff --git a/src/mainboard/intel/mtarvon/mptable.c b/src/mainboard/intel/mtarvon/mptable.c
index 8d600dd..2f3cd27 100644
--- a/src/mainboard/intel/mtarvon/mptable.c
+++ b/src/mainboard/intel/mtarvon/mptable.c
@@ -22,6 +22,7 @@
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -62,7 +63,7 @@
 	smp_write_bus(mc, bus_isa, "ISA   ");
 
 	/* IOAPIC handling */
-	smp_write_ioapic(mc, 0x01, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 0x01, 0x20, IO_APIC_ADDR);
 
 	mptable_add_isa_interrupts(mc, bus_isa, 0x1, 0);
 
diff --git a/src/mainboard/intel/truxton/mptable.c b/src/mainboard/intel/truxton/mptable.c
index c80d5d3..6f0054d 100644
--- a/src/mainboard/intel/truxton/mptable.c
+++ b/src/mainboard/intel/truxton/mptable.c
@@ -20,6 +20,7 @@
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -95,7 +96,7 @@
 	smp_write_bus(mc, bus_isa, "ISA	  ");
 
 	/* IOAPIC handling */
-	smp_write_ioapic(mc, 0x8, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 0x8, 0x20, IO_APIC_ADDR);
 
 	mptable_add_isa_interrupts(mc, bus_isa, 0x8, 0);
 
diff --git a/src/mainboard/intel/xe7501devkit/acpi_tables.c b/src/mainboard/intel/xe7501devkit/acpi_tables.c
index 1188467..3695bb4 100644
--- a/src/mainboard/intel/xe7501devkit/acpi_tables.c
+++ b/src/mainboard/intel/xe7501devkit/acpi_tables.c
@@ -8,6 +8,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <assert.h>
@@ -48,7 +49,7 @@
 
 
 	// Southbridge IOAPIC
-	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_ICH3, 0xfec00000, irq_start);
+	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_ICH3, IO_APIC_ADDR, irq_start);
 	irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
 
 	// P64H2#2 Bus A IOAPIC
diff --git a/src/mainboard/intel/xe7501devkit/mptable.c b/src/mainboard/intel/xe7501devkit/mptable.c
index ed81884..d39e754 100644
--- a/src/mainboard/intel/xe7501devkit/mptable.c
+++ b/src/mainboard/intel/xe7501devkit/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -37,7 +38,7 @@
 	// TODO: Gack. This is REALLY ugly.
 
 	// Southbridge IOAPIC
-	smp_write_ioapic(mc, IOAPIC_ICH3, 0x20, 0xfec00000);	// APIC ID, Version, Address
+	smp_write_ioapic(mc, IOAPIC_ICH3, 0x20, IO_APIC_ADDR);	// APIC ID, Version, Address
 
 	// P64H2#2 Bus A IOAPIC
 	dev = dev_find_slot(PCI_BUS_E7501_HI_B, PCI_DEVFN(30, 0));
diff --git a/src/mainboard/iwill/dk8_htx/acpi_tables.c b/src/mainboard/iwill/dk8_htx/acpi_tables.c
index 2221ae4..e497fb4 100644
--- a/src/mainboard/iwill/dk8_htx/acpi_tables.c
+++ b/src/mainboard/iwill/dk8_htx/acpi_tables.c
@@ -11,13 +11,13 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
 #include <cpu/amd/mtrr.h>
 #include <cpu/amd/amdk8_sysconf.h>
 #include "northbridge/amd/amdk8/amdk8_acpi.h"
-
 #include "mb_sysconf.h"
 
 #define DUMP_ACPI_TABLES 0
@@ -47,8 +47,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/iwill/dk8_htx/mptable.c b/src/mainboard/iwill/dk8_htx/mptable.c
index 14df316..8bfaec8 100644
--- a/src/mainboard/iwill/dk8_htx/mptable.c
+++ b/src/mainboard/iwill/dk8_htx/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -54,7 +55,7 @@
         smp_write_bus(mc, m->bus_isa, "ISA   ");
 
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, m->apicid_8111, 0x11, 0xfec00000); //8111
+	smp_write_ioapic(mc, m->apicid_8111, 0x11, IO_APIC_ADDR); //8111
         {
                 device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/iwill/dk8s2/mptable.c b/src/mainboard/iwill/dk8s2/mptable.c
index 19d769d..4938d76 100644
--- a/src/mainboard/iwill/dk8s2/mptable.c
+++ b/src/mainboard/iwill/dk8s2/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -82,7 +83,7 @@
 	smp_write_bus(mc, bus_isa, "ISA	  ");
 
 	/* IOAPIC handling */
-	smp_write_ioapic(mc, 2, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/iwill/dk8x/mptable.c b/src/mainboard/iwill/dk8x/mptable.c
index 19d769d..4938d76 100644
--- a/src/mainboard/iwill/dk8x/mptable.c
+++ b/src/mainboard/iwill/dk8x/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -82,7 +83,7 @@
 	smp_write_bus(mc, bus_isa, "ISA	  ");
 
 	/* IOAPIC handling */
-	smp_write_ioapic(mc, 2, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/jetway/pa78vm5/acpi_tables.c b/src/mainboard/jetway/pa78vm5/acpi_tables.c
index 591c922..ee920e8 100644
--- a/src/mainboard/jetway/pa78vm5/acpi_tables.c
+++ b/src/mainboard/jetway/pa78vm5/acpi_tables.c
@@ -21,6 +21,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -55,8 +56,6 @@
 extern const unsigned char AmlCode_ssdt5[];
 #endif
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/kontron/986lcd-m/acpi_tables.c b/src/mainboard/kontron/986lcd-m/acpi_tables.c
index 063127b..f8009c3 100644
--- a/src/mainboard/kontron/986lcd-m/acpi_tables.c
+++ b/src/mainboard/kontron/986lcd-m/acpi_tables.c
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <arch/acpigen.h>
 #include <arch/smp/mpspec.h>
 #include <device/device.h>
@@ -86,8 +87,6 @@
 	    acpi_checksum((void *) hpet, sizeof(acpi_hpet_t));
 }
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
 	/* Local APICs */
diff --git a/src/mainboard/kontron/986lcd-m/mptable.c b/src/mainboard/kontron/986lcd-m/mptable.c
index ce7a6c5..2b1a90e 100644
--- a/src/mainboard/kontron/986lcd-m/mptable.c
+++ b/src/mainboard/kontron/986lcd-m/mptable.c
@@ -17,11 +17,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-
 #include <device/device.h>
 #include <device/pci.h>
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <string.h>
 #include <stdint.h>
 
@@ -72,7 +72,7 @@
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
 	ioapic_id = 2;
-	smp_write_ioapic(mc, ioapic_id, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, ioapic_id, 0x20, IO_APIC_ADDR);
 
 	/* Legacy Interrupts */
 	mptable_add_isa_interrupts(mc, isa_bus, ioapic_id, 0);
diff --git a/src/mainboard/kontron/kt690/acpi_tables.c b/src/mainboard/kontron/kt690/acpi_tables.c
index 0df4385..02f04cf 100644
--- a/src/mainboard/kontron/kt690/acpi_tables.c
+++ b/src/mainboard/kontron/kt690/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -59,8 +60,6 @@
 
 extern const unsigned char AmlCode[];
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/newisys/khepri/mptable.c b/src/mainboard/newisys/khepri/mptable.c
index 7901ab5..8f388d2 100644
--- a/src/mainboard/newisys/khepri/mptable.c
+++ b/src/mainboard/newisys/khepri/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -83,7 +84,7 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x11, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/roda/rk886ex/acpi_tables.c b/src/mainboard/roda/rk886ex/acpi_tables.c
index 3bd4868..2dd7c5c 100644
--- a/src/mainboard/roda/rk886ex/acpi_tables.c
+++ b/src/mainboard/roda/rk886ex/acpi_tables.c
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <arch/io.h>
+#include <arch/ioapic.h>
 #include <arch/acpi.h>
 #include <arch/acpigen.h>
 #include <arch/smp/mpspec.h>
@@ -142,10 +143,6 @@
 	    acpi_checksum((void *) hpet, sizeof(acpi_hpet_t));
 }
 
-
-
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
 	/* Local APICs */
diff --git a/src/mainboard/roda/rk886ex/mptable.c b/src/mainboard/roda/rk886ex/mptable.c
index ec6166c..bdf38fb 100644
--- a/src/mainboard/roda/rk886ex/mptable.c
+++ b/src/mainboard/roda/rk886ex/mptable.c
@@ -19,11 +19,11 @@
  * MA 02110-1301 USA
  */
 
-
 #include <device/device.h>
 #include <device/pci.h>
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <string.h>
 #include <stdint.h>
 
@@ -67,7 +67,7 @@
 	smp_write_bus(mc, isa_bus, "ISA   ");
 
 	/* I/O APICs:	APIC ID	Version	State		Address */
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 
 	/* Legacy Interrupts */
 	mptable_add_isa_interrupts(mc, isa_bus, 0x2, 0);
diff --git a/src/mainboard/supermicro/x6dai_g/mptable.c b/src/mainboard/supermicro/x6dai_g/mptable.c
index f50f876..d13c308 100644
--- a/src/mainboard/supermicro/x6dai_g/mptable.c
+++ b/src/mainboard/supermicro/x6dai_g/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -58,8 +59,8 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
-	smp_write_ioapic(mc, 3, 0x20, 0xfec10000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
+	smp_write_ioapic(mc, 3, 0x20, IO_APIC_ADDR + 0x10000);
 
 	mptable_add_isa_interrupts(mc, bus_isa, 0x2, 0);
 
diff --git a/src/mainboard/supermicro/x6dhe_g/mptable.c b/src/mainboard/supermicro/x6dhe_g/mptable.c
index 65bb1b9..ba712d3 100644
--- a/src/mainboard/supermicro/x6dhe_g/mptable.c
+++ b/src/mainboard/supermicro/x6dhe_g/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -84,8 +85,8 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
-	smp_write_ioapic(mc, 3, 0x20, 0xfec10000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
+	smp_write_ioapic(mc, 3, 0x20, IO_APIC_ADDR + 0x10000);
 	{
 	    	struct resource *res;
 		device_t dev;
diff --git a/src/mainboard/supermicro/x6dhe_g2/mptable.c b/src/mainboard/supermicro/x6dhe_g2/mptable.c
index c961d37..50b6299 100644
--- a/src/mainboard/supermicro/x6dhe_g2/mptable.c
+++ b/src/mainboard/supermicro/x6dhe_g2/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -84,8 +85,8 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
-	smp_write_ioapic(mc, 3, 0x20, 0xfec10000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
+	smp_write_ioapic(mc, 3, 0x20, IO_APIC_ADDR + 0x10000);
 	{
 	    	struct resource *res;
 		device_t dev;
diff --git a/src/mainboard/supermicro/x6dhr_ig/mptable.c b/src/mainboard/supermicro/x6dhr_ig/mptable.c
index 1164e7f..c16017b 100644
--- a/src/mainboard/supermicro/x6dhr_ig/mptable.c
+++ b/src/mainboard/supermicro/x6dhr_ig/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -109,7 +110,7 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	{
 		struct resource *res;
 		device_t dev;
diff --git a/src/mainboard/supermicro/x6dhr_ig2/mptable.c b/src/mainboard/supermicro/x6dhr_ig2/mptable.c
index 1ee769d..146b40a 100644
--- a/src/mainboard/supermicro/x6dhr_ig2/mptable.c
+++ b/src/mainboard/supermicro/x6dhr_ig2/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -109,7 +110,7 @@
 
 	/* IOAPIC handling */
 
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	{
 		struct resource *res;
 		device_t dev;
diff --git a/src/mainboard/technexion/tim5690/acpi_tables.c b/src/mainboard/technexion/tim5690/acpi_tables.c
index 0df4385..02f04cf 100644
--- a/src/mainboard/technexion/tim5690/acpi_tables.c
+++ b/src/mainboard/technexion/tim5690/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -59,8 +60,6 @@
 
 extern const unsigned char AmlCode[];
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/technexion/tim8690/acpi_tables.c b/src/mainboard/technexion/tim8690/acpi_tables.c
index 0df4385..02f04cf 100644
--- a/src/mainboard/technexion/tim8690/acpi_tables.c
+++ b/src/mainboard/technexion/tim8690/acpi_tables.c
@@ -20,6 +20,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <cpu/x86/msr.h>
@@ -59,8 +60,6 @@
 
 extern const unsigned char AmlCode[];
 
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
 	/* Just a dummy */
diff --git a/src/mainboard/tyan/s2735/mptable.c b/src/mainboard/tyan/s2735/mptable.c
index 7cfa5ef..5e4afae 100644
--- a/src/mainboard/tyan/s2735/mptable.c
+++ b/src/mainboard/tyan/s2735/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -32,7 +33,7 @@
         smp_write_processors(mc);
 	mptable_write_buses(mc, NULL, &isa_bus);
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, 8, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 8, 0x20, IO_APIC_ADDR);
 	{
                 device_t dev;
                 struct resource *res;
diff --git a/src/mainboard/tyan/s2850/mptable.c b/src/mainboard/tyan/s2850/mptable.c
index a2fdd32..d452dd9 100644
--- a/src/mainboard/tyan/s2850/mptable.c
+++ b/src/mainboard/tyan/s2850/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -105,7 +106,7 @@
 #endif
         apicid_8111 = apicid_base+0;
 
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
 
 	mptable_add_isa_interrupts(mc, bus_isa, apicid_8111, 0);
 
diff --git a/src/mainboard/tyan/s2875/mptable.c b/src/mainboard/tyan/s2875/mptable.c
index 73dc051..a2aa275 100644
--- a/src/mainboard/tyan/s2875/mptable.c
+++ b/src/mainboard/tyan/s2875/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -120,7 +121,7 @@
         apicid_base = CONFIG_MAX_PHYSICAL_CPUS;
 #endif
         apicid_8111 = apicid_base+0;
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
 
 	mptable_add_isa_interrupts(mc, bus_isa, apicid_8111, 0);
 
diff --git a/src/mainboard/tyan/s2880/mptable.c b/src/mainboard/tyan/s2880/mptable.c
index 0a97967..176aed2 100644
--- a/src/mainboard/tyan/s2880/mptable.c
+++ b/src/mainboard/tyan/s2880/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -135,7 +136,7 @@
         apicid_8111 = apicid_base+0;
         apicid_8131_1 = apicid_base+1;
         apicid_8131_2 = apicid_base+2;
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
         {
 
                 device_t dev;
diff --git a/src/mainboard/tyan/s2881/mptable.c b/src/mainboard/tyan/s2881/mptable.c
index 4be900e..3e9c55d 100644
--- a/src/mainboard/tyan/s2881/mptable.c
+++ b/src/mainboard/tyan/s2881/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -62,7 +63,7 @@
 
 
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
         {
                 device_t dev;
                 struct resource *res;
diff --git a/src/mainboard/tyan/s2882/mptable.c b/src/mainboard/tyan/s2882/mptable.c
index a5d6c19..f824025 100644
--- a/src/mainboard/tyan/s2882/mptable.c
+++ b/src/mainboard/tyan/s2882/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <string.h>
@@ -143,7 +144,7 @@
         apicid_8131_1 = apicid_base+1;
         apicid_8131_2 = apicid_base+2;
 
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
         {
                 device_t dev;
                 struct resource *res;
diff --git a/src/mainboard/tyan/s2885/mptable.c b/src/mainboard/tyan/s2885/mptable.c
index 45cf55c..3d2d5a9 100644
--- a/src/mainboard/tyan/s2885/mptable.c
+++ b/src/mainboard/tyan/s2885/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -64,7 +65,7 @@
         smp_write_bus(mc, bus_isa, "ISA   ");
 
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000); //8111
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR); //8111
         {
                 device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/tyan/s4880/mptable.c b/src/mainboard/tyan/s4880/mptable.c
index a9746b3..edef047 100644
--- a/src/mainboard/tyan/s4880/mptable.c
+++ b/src/mainboard/tyan/s4880/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -135,7 +136,7 @@
         apicid_8131_1 = apicid_base+1;
         apicid_8131_2 = apicid_base+2;
 
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
         {
                 device_t dev;
                 struct resource *res;
diff --git a/src/mainboard/tyan/s4882/mptable.c b/src/mainboard/tyan/s4882/mptable.c
index 73dbcfc..1c791fc 100644
--- a/src/mainboard/tyan/s4882/mptable.c
+++ b/src/mainboard/tyan/s4882/mptable.c
@@ -1,5 +1,6 @@
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -135,7 +136,7 @@
         apicid_8111 = apicid_base+0;
         apicid_8131_1 = apicid_base+1;
         apicid_8131_2 = apicid_base+2;
-	smp_write_ioapic(mc, apicid_8111, 0x11, 0xfec00000);
+	smp_write_ioapic(mc, apicid_8111, 0x11, IO_APIC_ADDR);
         {
                 device_t dev;
                 struct resource *res;
diff --git a/src/mainboard/via/epia-n/acpi_tables.c b/src/mainboard/via/epia-n/acpi_tables.c
index d8b28b25..741784e 100644
--- a/src/mainboard/via/epia-n/acpi_tables.c
+++ b/src/mainboard/via/epia-n/acpi_tables.c
@@ -30,6 +30,7 @@
 #include <console/console.h>
 #include <string.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
@@ -94,7 +95,7 @@
 
 	/* Write SB IOAPIC. */
 	current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
-				   VT8237R_APIC_ID, VT8237R_APIC_BASE, gsi_base);
+				   VT8237R_APIC_ID, IO_APIC_ADDR, gsi_base);
 
 	/* IRQ0 -> APIC IRQ2. */
 	current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
diff --git a/src/mainboard/via/epia-n/mainboard.c b/src/mainboard/via/epia-n/mainboard.c
index 4206b24..9227f0a 100644
--- a/src/mainboard/via/epia-n/mainboard.c
+++ b/src/mainboard/via/epia-n/mainboard.c
@@ -23,6 +23,7 @@
 #include <device/pci.h>
 #include <device/pci_ids.h>
 #include <boot/tables.h>
+#include <arch/ioapic.h>
 #include <southbridge/via/vt8237r/vt8237r.h>
 #include "chip.h"
 
@@ -30,7 +31,7 @@
 {
 #if CONFIG_IOAPIC == 1
 	lb_add_memory_range(mem, LB_MEM_RESERVED,
-		VT8237R_APIC_BASE, 0x1000);
+		IO_APIC_ADDR, 0x1000);
 	lb_add_memory_range(mem, LB_MEM_RESERVED,
 		0xFEE00000ULL, 0x1000);
 	lb_add_memory_range(mem, LB_MEM_RESERVED,
diff --git a/src/mainboard/via/epia-n/mptable.c b/src/mainboard/via/epia-n/mptable.c
index ddd96be..676c7e1 100644
--- a/src/mainboard/via/epia-n/mptable.c
+++ b/src/mainboard/via/epia-n/mptable.c
@@ -2,6 +2,7 @@
 /* as modified by RGM for coreboot */
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -35,7 +36,7 @@
         mptable_write_buses(mc, NULL, &isa_bus);
 
 /*I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, 2, 0x20, 0xfec00000);
+	smp_write_ioapic(mc, 2, 0x20, IO_APIC_ADDR);
 	{
 		device_t dev;
 		struct resource *res;
diff --git a/src/mainboard/via/pc2500e/mptable.c b/src/mainboard/via/pc2500e/mptable.c
index 3e36e87..3e31abf 100644
--- a/src/mainboard/via/pc2500e/mptable.c
+++ b/src/mainboard/via/pc2500e/mptable.c
@@ -24,6 +24,7 @@
 
 #include <console/console.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <device/pci.h>
 #include <string.h>
 #include <stdint.h>
@@ -59,7 +60,7 @@
 	mptable_write_buses(mc, NULL, &isa_bus);
 
 /* I/O APICs:	APIC ID	Version	State		Address*/
-	smp_write_ioapic(mc, VT8237R_APIC_ID, 0x20, VT8237R_APIC_BASE);
+	smp_write_ioapic(mc, VT8237R_APIC_ID, 0x20, IO_APIC_ADDR);
 
 	/* Now, assemble the table. */
 	mptable_add_isa_interrupts(mc, isa_bus, VT8237R_APIC_ID, 0);
diff --git a/src/mainboard/via/vt8454c/acpi_tables.c b/src/mainboard/via/vt8454c/acpi_tables.c
index 737a5c8..434bf87 100644
--- a/src/mainboard/via/vt8454c/acpi_tables.c
+++ b/src/mainboard/via/vt8454c/acpi_tables.c
@@ -22,6 +22,7 @@
 #include <string.h>
 #include <console/console.h>
 #include <arch/acpi.h>
+#include <arch/ioapic.h>
 #include <device/device.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
@@ -85,10 +86,6 @@
 	    acpi_checksum((void *) hpet, sizeof(acpi_hpet_t));
 }
 
-
-
-#define IO_APIC_ADDR	0xfec00000UL
-
 unsigned long acpi_fill_madt(unsigned long current)
 {
 	/* Local Apic */
diff --git a/src/mainboard/via/vt8454c/mptable.c b/src/mainboard/via/vt8454c/mptable.c
index 588694f..22a4769 100644
--- a/src/mainboard/via/vt8454c/mptable.c
+++ b/src/mainboard/via/vt8454c/mptable.c
@@ -22,6 +22,7 @@
 #include <device/device.h>
 #include <device/pci.h>
 #include <arch/smp/mpspec.h>
+#include <arch/ioapic.h>
 #include <cpu/x86/lapic.h>
 #include <console/console.h>
 #include <string.h>
@@ -56,7 +57,7 @@
 	mptable_write_buses(mc, NULL, &isa_bus);
 
 	/* I/O APICs:   APIC ID Version State Address */
-	smp_write_ioapic(mc, 2, 17, 0xfec00000);
+	smp_write_ioapic(mc, 2, 17, IO_APIC_ADDR);
 
 	mptable_add_isa_interrupts(mc, isa_bus, 0x2, 0);