lkml.org 
[lkml]   [2001]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] Intel ICHx PCI quirk
From
Hi all,

this patch adds quirk for Intel ICHx (I/O Controller Hub) LPC bridge to properly
report ACPI/TCO and GPIO base addresses.

Also quirk_via_acpi() function merged with quirk_vt82c586_acpi(). IMHO it's
not right to have two quirks for one device.

Best regards.

--
Andrey Panin | Embedded systems software engineer
pazke@orbita1.ru | PGP key: http://www.orbita1.ru/~pazke/AndreyPanin.ascdiff -u linux.vanilla/drivers/pci/quirks.c linux/drivers/pci/quirks.c
--- linux.vanilla/drivers/pci/quirks.c Thu Jun 14 10:12:38 2001
+++ linux/drivers/pci/quirks.c Mon Jun 18 16:11:52 2001
@@ -223,18 +223,38 @@
}

/*
+ * Intel ICHx LPC bridge: Two IO regions pointed to by longwords at
+ * 0x40 (128 bytes of ACPI and TCO registers)
+ * 0x58 (64 bytes of GPIO registers)
+ */
+static void __init quirk_ichx_lpc(struct pci_dev *dev)
+{
+ u32 region;
+
+ pci_read_config_dword(dev, 0x40, &region);
+ quirk_io_region(dev, region, 128, PCI_BRIDGE_RESOURCES);
+ pci_read_config_dword(dev, 0x58, &region);
+ quirk_io_region(dev, region, 64, PCI_BRIDGE_RESOURCES+1);
+}
+
+/*
* VIA ACPI: One IO region pointed to by longword at
* 0x48 or 0x20 (256 bytes of ACPI registers)
+ * SCI IRQ line in PCI config byte 0x42
*/
static void __init quirk_vt82c586_acpi(struct pci_dev *dev)
{
- u8 rev;
+ u8 rev, irq;
u32 region;

+ pci_read_config_byte(dev, 0x42, &irq);
+ irq &= 0xf;
+ if (irq && (irq != 2))
+ dev->irq = irq;
+
pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
if (rev & 0x10) {
pci_read_config_dword(dev, 0x48, &region);
- region &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, region, 256, PCI_BRIDGE_RESOURCES);
}
}
@@ -244,6 +264,7 @@
* 0x48 (256 bytes of ACPI registers)
* 0x70 (128 bytes of hardware monitoring register)
* 0x90 (16 bytes of SMB registers)
+ * SCI IRQ line in PCI config byte 0x42
*/
static void __init quirk_vt82c686_acpi(struct pci_dev *dev)
{
@@ -253,11 +274,9 @@
quirk_vt82c586_acpi(dev);

pci_read_config_word(dev, 0x70, &hm);
- hm &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, hm, 128, PCI_BRIDGE_RESOURCES + 1);

pci_read_config_dword(dev, 0x90, &smb);
- smb &= PCI_BASE_ADDRESS_IO_MASK;
quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 2);
}

@@ -313,17 +332,6 @@
* value of the ACPI SCI interrupt is only done for convenience.
* -jgarzik
*/
-static void __init quirk_via_acpi(struct pci_dev *d)
-{
- /*
- * VIA ACPI device: SCI IRQ line in PCI config byte 0x42
- */
- u8 irq;
- pci_read_config_byte(d, 0x42, &irq);
- irq &= 0xf;
- if (irq && (irq != 2))
- d->irq = irq;
-}

static void __init quirk_via_irqpic(struct pci_dev *dev)
{
@@ -421,6 +429,9 @@
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_vt82c586_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vt82c686_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4_acpi },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, quirk_ichx_lpc },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0, quirk_ichx_lpc },
+ { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, quirk_ichx_lpc },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, quirk_ali7101_acpi },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_2, quirk_piix3_usb },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_2, quirk_piix3_usb },
@@ -429,8 +440,6 @@
#ifdef CONFIG_X86_IO_APIC
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_ioapic },
#endif
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi },
- { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irqpic },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irqpic },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_6, quirk_via_irqpic },[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.087 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site