We define IO_APIC_ADDR in <arch/ioapic.h>, let's use it.
[coreboot.git] / src / mainboard / technexion / tim5690 / acpi_tables.c
index 7be5e990bc546a32b2afc58385cb6289de99d3dc..02f04cf0b8c069ccef787404833bad124b5e3ac7 100644 (file)
 #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 "northbridge/amd/amdk8/amdk8_acpi.h"
 #include <arch/cpu.h>
 #include <cpu/amd/model_fxx_powernow.h>
 
@@ -57,9 +58,7 @@ static void dump_mem(u32 start, u32 end)
 }
 #endif
 
-extern const acpi_header_t AmlCode;
-
-#define IO_APIC_ADDR   0xfec00000UL
+extern const unsigned char AmlCode[];
 
 unsigned long acpi_fill_mcfg(unsigned long current)
 {
@@ -92,30 +91,6 @@ unsigned long acpi_fill_madt(unsigned long current)
        return current;
 }
 
-
-
-static void update_ssdtx(void *ssdtx, int i)
-{
-       uint8_t *PCI;
-       uint8_t *HCIN;
-       uint8_t *UID;
-
-       PCI = ssdtx + 0x32;
-       HCIN = ssdtx + 0x39;
-       UID = ssdtx + 0x40;
-
-       if (i < 7) {
-               *PCI = (uint8_t) ('4' + i - 1);
-       } else {
-               *PCI = (uint8_t) ('A' + i - 1 - 6);
-       }
-       *HCIN = (uint8_t) i;
-       *UID = (uint8_t) (i + 3);
-
-       /* FIXME: need to update the GSI id in the ssdtx too */
-
-}
-
 unsigned long acpi_fill_ssdt_generator(unsigned long current, const char *oem_table_id) {
        k8acpi_write_vars();
        amd_model_fxx_generate_powernow(pm_base + 8, 6, 1);
@@ -187,8 +162,9 @@ unsigned long write_acpi_tables(unsigned long start)
        /* DSDT */
        printk(BIOS_DEBUG, "ACPI:    * DSDT\n");
        dsdt = (acpi_header_t *) current;
-       memcpy((void *)dsdt, &AmlCode, AmlCode.length);
+       memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
        current += dsdt->length;
+       memcpy(dsdt, &AmlCode, dsdt->length);
        printk(BIOS_DEBUG, "ACPI:    * DSDT @ %p Length %x\n", dsdt, dsdt->length);
        /* FADT */
        printk(BIOS_DEBUG, "ACPI:    * FADT\n");