printk_foo -> printk(BIOS_FOO, ...)
[coreboot.git] / src / mainboard / via / epia-m700 / acpi_tables.c
index 54480cdff52844bbbcb8d68fe2dabb57d4b28eb4..ff32f9ae4c0c663ca7994d1f0d2a91b234480a17 100644 (file)
@@ -39,13 +39,12 @@ extern unsigned char AmlCode_dsdt[];
 extern unsigned char AmlCode_ssdt[];
 
 extern u32 wake_vec;
-extern u8 acpi_sleep_type;
 
 /*
  * These four macros are copied from <arch/smp/mpspec.h>, I have to do this
- * since the "default HAVE_MP_TABLE = 0" in Options.lb, and also since
+ * since the "default CONFIG_GENERATE_MP_TABLE = 0" in Options.lb, and also since
  * mainboard/via/... have no mptable.c (so that I can not set
- * HAVE_MP_TABLE = 1) as many other mainboards.
+ * CONFIG_GENERATE_MP_TABLE = 1) as many other mainboards.
  * So I have to copy these four to here. acpi_fill_madt() needs this.
  */
 #define MP_IRQ_POLARITY_HIGH   0x1
@@ -59,25 +58,6 @@ unsigned long acpi_fill_mcfg(unsigned long current)
        return current;
 }
 
-unsigned long acpi_create_madt_lapics(unsigned long current)
-{
-       device_t cpu;
-       int cpu_index = 0;
-
-       for (cpu = all_devices; cpu; cpu = cpu->next) {
-               if ((cpu->path.type != DEVICE_PATH_APIC) ||
-                   (cpu->bus->dev->path.type != DEVICE_PATH_APIC_CLUSTER)) {
-                       continue;
-               }
-               if (!cpu->enabled)
-                       continue;
-               current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current,
-                                          cpu_index, cpu->path.apic.apic_id);
-               cpu_index++;
-       }
-       return current;
-}
-
 unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags,
                                          u8 lint)
 {
@@ -155,7 +135,7 @@ unsigned long write_acpi_tables(unsigned long start)
        start = (start + 0x0f) & -0x10;
        current = start;
 
-       printk_info("ACPI: Writing ACPI tables at %lx...\n", start);
+       printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
 
        /* We need at least an RSDP and an RSDT table. */
        rsdp = (acpi_rsdp_t *) current;
@@ -166,63 +146,59 @@ unsigned long write_acpi_tables(unsigned long start)
        /* Clear all table memory. */
        memset((void *)start, 0, current - start);
 
-       acpi_write_rsdp(rsdp, rsdt);
+       acpi_write_rsdp(rsdp, rsdt, NULL);
        acpi_write_rsdt(rsdt);
 
        /* We explicitly add these tables later on: */
-       printk_debug("ACPI:     * FACS\n");
+       printk(BIOS_DEBUG, "ACPI:     * FACS\n");
        current = ALIGN(current, 64);
        facs = (acpi_facs_t *) current;
        current += sizeof(acpi_facs_t);
        acpi_create_facs(facs);
 
-       printk_debug("ACPI:     * DSDT\n");
+       printk(BIOS_DEBUG, "ACPI:     * DSDT\n");
        dsdt = (acpi_header_t *) current;
        current += ((acpi_header_t *) AmlCode_dsdt)->length;
        memcpy((void *)dsdt, (void *)AmlCode_dsdt,
               ((acpi_header_t *) AmlCode_dsdt)->length);
        dsdt->checksum = 0; /* Don't trust iasl to get this right. */
        dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
-       printk_debug("ACPI:     * DSDT @ %08x Length %x\n", dsdt, dsdt->length);
+       printk(BIOS_DEBUG, "ACPI:     * DSDT @ %p Length %x\n", dsdt, dsdt->length);
 
-       printk_debug("ACPI:     * FADT\n");
+       printk(BIOS_DEBUG, "ACPI:     * FADT\n");
        fadt = (acpi_fadt_t *) current;
        current += sizeof(acpi_fadt_t);
 
        acpi_create_fadt(fadt, facs, dsdt);
-       acpi_add_table(rsdt, fadt);
+       acpi_add_table(rsdp, fadt);
 
        /* If we want to use HPET timers Linux wants it in MADT. */
-       printk_debug("ACPI:    * MADT\n");
+       printk(BIOS_DEBUG, "ACPI:    * MADT\n");
        madt = (acpi_madt_t *) current;
        acpi_create_madt(madt);
        current += madt->header.length;
-       acpi_add_table(rsdt, madt);
+       acpi_add_table(rsdp, madt);
 
        /* NO MCFG in VX855, no PCI-E. */
 
-       printk_debug("ACPI:    * HPET\n");
+       printk(BIOS_DEBUG, "ACPI:    * HPET\n");
        hpet = (acpi_mcfg_t *) current;
        acpi_create_hpet(hpet);
        current += hpet->header.length;
-       acpi_add_table(rsdt, hpet);
+       acpi_add_table(rsdp, hpet);
 
 #if 0
-       printk_debug("ACPI:     * SSDT\n");
+       printk(BIOS_DEBUG, "ACPI:     * SSDT\n");
        ssdt = (acpi_header_t *) current;
        current += ((acpi_header_t *)AmlCode_ssdt)->length;
        memcpy((void *)ssdt,(void *)AmlCode_ssdt, ((acpi_header_t *)AmlCode_ssdt)->length);
        ssdt->checksum = 0; /* Don't trust iasl to get this right. */
        ssdt->checksum = acpi_checksum(ssdt, ssdt->length);
-       acpi_add_table(rsdt, ssdt);
-       printk_debug("ACPI:     * SSDT @ %08x Length %x\n", ssdt, ssdt->length);
+       acpi_add_table(rsdp, ssdt);
+       printk(BIOS_DEBUG, "ACPI:     * SSDT @ %08x Length %x\n", ssdt, ssdt->length);
 #endif
 
-       printk_info("ACPI: done.\n");
+       printk(BIOS_INFO, "ACPI: done.\n");
        return current;
 }
 
-int acpi_is_wakeup(void)
-{
-       return (acpi_sleep_type == 3);
-}