Workaround some broken BIOSes that specify edge-sensitive but active-low

settings for ACPI-enumerated serial ports by forcing any IRQs that use
an ISA IRQ value with these settings to active-high instead of active-low.

This is known to occur with the BIOS on an Intel D2500CCE motherboard.

Tested by:	Robert Ames <robertames@hotmail.com>, lev
Submitted by:	Juergen Weiss weiss at uni-mainz.de (original patch)
This commit is contained in:
John Baldwin 2013-07-16 14:42:16 +00:00
parent c780f37850
commit 9a7bf07ccd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=253392

View File

@ -135,6 +135,17 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res)
default:
panic("%s: bad resource type %u", __func__, res->Type);
}
#if defined(__amd64__) || defined(__i386__)
/*
* XXX: Certain BIOSes have buggy AML that specify an IRQ that is
* edge-sensitive and active-lo. However, edge-sensitive IRQs
* should be active-hi. Force IRQs with an ISA IRQ value to be
* active-hi instead.
*/
if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW)
pol = ACPI_ACTIVE_HIGH;
#endif
BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ?
INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ?
INTR_POLARITY_HIGH : INTR_POLARITY_LOW);