From patchwork Tue Oct 13 22:51:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: s289x ACPI fix Date: Tue, 13 Oct 2009 22:51:20 -0000 From: Myles Watson X-Patchwork-Id: 402 Message-Id: <2831fecf0910131551s6eac5bd1xcdf5812c01a6c72e@mail.gmail.com> To: coreboot Initialize the interrupts even if you don't generate the MP_TABLE. I just copied the values from mptable.c. Also set IRQ 9 to be edge-triggered to make Linux stop complaining. Signed-off-by: Myles Watson Thanks, Myles Acked-by: Peter Stuge Index: cbv2/src/mainboard/tyan/s2891/acpi_tables.c =================================================================== --- cbv2.orig/src/mainboard/tyan/s2891/acpi_tables.c +++ cbv2/src/mainboard/tyan/s2891/acpi_tables.c @@ -42,6 +42,19 @@ unsigned long acpi_fill_madt(unsigned lo apic_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1) & ~0xf; current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 4, apic_addr, 0); + #if !CONFIG_HAVE_MP_TABLE /* Initialize interrupt mapping. */ + { + u32 dword; + dword = 0x0120d218; + pci_write_config32(dev, 0x7c, dword); + + dword = 0x12008a00; + pci_write_config32(dev, 0x80, dword); + + dword = 0x0000007d; + pci_write_config32(dev, 0x84, dword); + } + #endif } /* Write AMD 8131 two IOAPICs. */ @@ -61,7 +74,7 @@ unsigned long acpi_fill_madt(unsigned lo /* IRQ9 ACPI active low. */ current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) - current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW); + current, 0, 9, 9, MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_LOW); /* 0: mean bus 0--->ISA */ /* 0: PIC 0 */ Index: cbv2/src/mainboard/tyan/s2892/acpi_tables.c =================================================================== --- cbv2.orig/src/mainboard/tyan/s2892/acpi_tables.c +++ cbv2/src/mainboard/tyan/s2892/acpi_tables.c @@ -42,6 +42,19 @@ unsigned long acpi_fill_madt(unsigned lo apic_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1) & ~0xf; current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 4, apic_addr, 0); + #if !CONFIG_HAVE_MP_TABLE /* Initialize interrupt mapping. */ + { + u32 dword; + dword = 0x0120d218; + pci_write_config32(dev, 0x7c, dword); + + dword = 0x12008a00; + pci_write_config32(dev, 0x80, dword); + + dword = 0x0000007d; + pci_write_config32(dev, 0x84, dword); + } + #endif } /* Write AMD 8131 two IOAPICs. */ @@ -61,7 +74,7 @@ unsigned long acpi_fill_madt(unsigned lo /* IRQ9 ACPI active low. */ current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) - current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW); + current, 0, 9, 9, MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_LOW); /* 0: mean bus 0--->ISA */ /* 0: PIC 0 */ Index: cbv2/src/mainboard/tyan/s2895/acpi_tables.c =================================================================== --- cbv2.orig/src/mainboard/tyan/s2895/acpi_tables.c +++ cbv2/src/mainboard/tyan/s2895/acpi_tables.c @@ -42,6 +42,19 @@ unsigned long acpi_fill_madt(unsigned lo apic_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1) & ~0xf; current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 4, apic_addr, 0); + #if !CONFIG_HAVE_MP_TABLE /* Initialize interrupt mapping. */ + { + u32 dword; + dword = 0x0120d218; + pci_write_config32(dev, 0x7c, dword); + + dword = 0x12008a00; + pci_write_config32(dev, 0x80, dword); + + dword = 0x00080d7d; + pci_write_config32(dev, 0x84, dword); + } + #endif } /* Write AMD 8131 two IOAPICs. */ @@ -65,11 +78,24 @@ unsigned long acpi_fill_madt(unsigned lo apic_addr = pci_read_config32(dev, PCI_BASE_ADDRESS_1) & ~0xf; current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 7, apic_addr, 0x20); + #if !CONFIG_HAVE_MP_TABLE /* Initialize interrupt mapping. */ + { + u32 dword; + dword = 0x0000d218; // Why does the factory BIOS have 0? + pci_write_config32(dev, 0x7c, dword); + + dword = 0x00000000; + pci_write_config32(dev, 0x80, dword); + + dword = 0x00000d00; // Same here. + pci_write_config32(dev, 0x84, dword); + } + #endif } /* IRQ9 ACPI active low. */ current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) - current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW); + current, 0, 9, 9, MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_LOW); /* IRQ0 -> APIC IRQ2. */ /* Doesn't work on this board. */