Commit 72c550fc authored by Len Brown's avatar Len Brown

[ACPI] enhance intr-src-override parsing to handle ES7000

http://bugme.osdl.org/show_bug.cgi?id=2520
parent f3995c32
...@@ -653,9 +653,6 @@ acpi_parse_madt_ioapic_entries(void) ...@@ -653,9 +653,6 @@ acpi_parse_madt_ioapic_entries(void)
return count; return count;
} }
/* Build a default routing table for legacy (ISA) interrupts. */
mp_config_acpi_legacy_irqs();
count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS); count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
if (count < 0) { if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n"); printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
...@@ -670,6 +667,9 @@ acpi_parse_madt_ioapic_entries(void) ...@@ -670,6 +667,9 @@ acpi_parse_madt_ioapic_entries(void)
if (!acpi_sci_override_gsi) if (!acpi_sci_override_gsi)
acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0); acpi_sci_ioapic_setup(acpi_fadt.sci_int, 0, 0);
/* Fill in identity legacy mapings where no override */
mp_config_acpi_legacy_irqs();
count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS); count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS);
if (count < 0) { if (count < 0) {
printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n"); printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
......
...@@ -929,8 +929,6 @@ void __init mp_override_legacy_irq ( ...@@ -929,8 +929,6 @@ void __init mp_override_legacy_irq (
u32 gsi) u32 gsi)
{ {
struct mpc_config_intsrc intsrc; struct mpc_config_intsrc intsrc;
int i = 0;
int found = 0;
int ioapic = -1; int ioapic = -1;
int pin = -1; int pin = -1;
...@@ -963,23 +961,9 @@ void __init mp_override_legacy_irq ( ...@@ -963,23 +961,9 @@ void __init mp_override_legacy_irq (
(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus,
intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq);
/*
* If an existing [IOAPIC.PIN -> IRQ] routing entry exists we override it.
* Otherwise create a new entry (e.g. gsi == 2).
*/
for (i = 0; i < mp_irq_entries; i++) {
if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus)
&& (mp_irqs[i].mpc_srcbusirq == intsrc.mpc_srcbusirq)) {
mp_irqs[i] = intsrc;
found = 1;
break;
}
}
if (!found) {
mp_irqs[mp_irq_entries] = intsrc; mp_irqs[mp_irq_entries] = intsrc;
if (++mp_irq_entries == MAX_IRQ_SOURCES) if (++mp_irq_entries == MAX_IRQ_SOURCES)
panic("Max # of irq sources exceeded!\n"); panic("Max # of irq sources exceeded!\n");
}
return; return;
} }
...@@ -1010,13 +994,20 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -1010,13 +994,20 @@ void __init mp_config_acpi_legacy_irqs (void)
intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;
/* /*
* Use the default configuration for the IRQs 0-15. These may be * Use the default configuration for the IRQs 0-15. Unless
* overriden by (MADT) interrupt source override entries. * overriden by (MADT) interrupt source override entries.
*/ */
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
int idx;
if (i == 2) for (idx = 0; idx < mp_irq_entries; idx++)
continue; /* Don't connect IRQ2 */ if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
(mp_irqs[idx].mpc_srcbusirq == i ||
mp_irqs[idx].mpc_dstirq == i))
break;
if (idx != mp_irq_entries)
continue; /* IRQ already used */
intsrc.mpc_irqtype = mp_INT; intsrc.mpc_irqtype = mp_INT;
intsrc.mpc_srcbusirq = i; /* Identity mapped */ intsrc.mpc_srcbusirq = i; /* Identity mapped */
......
...@@ -780,8 +780,6 @@ void __init mp_override_legacy_irq ( ...@@ -780,8 +780,6 @@ void __init mp_override_legacy_irq (
u32 gsi) u32 gsi)
{ {
struct mpc_config_intsrc intsrc; struct mpc_config_intsrc intsrc;
int i = 0;
int found = 0;
int ioapic = -1; int ioapic = -1;
int pin = -1; int pin = -1;
...@@ -814,23 +812,9 @@ void __init mp_override_legacy_irq ( ...@@ -814,23 +812,9 @@ void __init mp_override_legacy_irq (
(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus,
intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq);
/*
* If an existing [IOAPIC.PIN -> IRQ] routing entry exists we override it.
* Otherwise create a new entry (e.g. gsi == 2).
*/
for (i = 0; i < mp_irq_entries; i++) {
if ((mp_irqs[i].mpc_srcbus == intsrc.mpc_srcbus)
&& (mp_irqs[i].mpc_srcbusirq == intsrc.mpc_srcbusirq)) {
mp_irqs[i] = intsrc;
found = 1;
break;
}
}
if (!found) {
mp_irqs[mp_irq_entries] = intsrc; mp_irqs[mp_irq_entries] = intsrc;
if (++mp_irq_entries == MAX_IRQ_SOURCES) if (++mp_irq_entries == MAX_IRQ_SOURCES)
panic("Max # of irq sources exceeded!\n"); panic("Max # of irq sources exceeded!\n");
}
return; return;
} }
...@@ -861,13 +845,22 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -861,13 +845,22 @@ void __init mp_config_acpi_legacy_irqs (void)
intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;
/* /*
* Use the default configuration for the IRQs 0-15. These may be * Use the default configuration for the IRQs 0-15. Unless
* overridden by (MADT) interrupt source override entries. * overridden by (MADT) interrupt source override entries.
*/ */
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
int idx;
if (i == 2) for (idx = 0; idx < mp_irq_entries; idx++)
continue; /* Don't connect IRQ2 */ if (mp_irqs[idx].mpc_srcbus == MP_ISA_BUS &&
(mp_irqs[idx].mpc_srcbusirq == i ||
mp_irqs[idx].mpc_dstirq == i))
break;
if (idx != mp_irq_entries) {
printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i);
continue; /* IRQ already used */
}
intsrc.mpc_irqtype = mp_INT; intsrc.mpc_irqtype = mp_INT;
intsrc.mpc_srcbusirq = i; /* Identity mapped */ intsrc.mpc_srcbusirq = i; /* Identity mapped */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment