ia64/xen-unstable

changeset 5781:98b83cc57eca

Missing quirks.c file.
author kaf24@firebug.cl.cam.ac.uk
date Thu Jul 14 14:01:21 2005 +0000 (2005-07-14)
parents ca90d2903b7b
children cd95b96a172e
files linux-2.6-xen-sparse/arch/xen/i386/kernel/quirks.c
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/quirks.c	Thu Jul 14 14:01:21 2005 +0000
     1.3 @@ -0,0 +1,49 @@
     1.4 +/*
     1.5 + * This file contains work-arounds for x86 and x86_64 platform bugs.
     1.6 + */
     1.7 +#include <linux/config.h>
     1.8 +#include <linux/pci.h>
     1.9 +#include <linux/irq.h>
    1.10 +
    1.11 +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_SMP) && defined(CONFIG_PCI)
    1.12 +
    1.13 +static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
    1.14 +{
    1.15 +	u8 config, rev;
    1.16 +	u32 word;
    1.17 +
    1.18 +	/* BIOS may enable hardware IRQ balancing for
    1.19 +	 * E7520/E7320/E7525(revision ID 0x9 and below)
    1.20 +	 * based platforms.
    1.21 +	 * Disable SW irqbalance/affinity on those platforms.
    1.22 +	 */
    1.23 +	pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
    1.24 +	if (rev > 0x9)
    1.25 +		return;
    1.26 +
    1.27 +	printk(KERN_INFO "Intel E7520/7320/7525 detected.");
    1.28 +
    1.29 +	/* enable access to config space*/
    1.30 +	pci_read_config_byte(dev, 0xf4, &config);
    1.31 +	config |= 0x2;
    1.32 +	pci_write_config_byte(dev, 0xf4, config);
    1.33 +
    1.34 +	/* read xTPR register */
    1.35 +	raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, &word);
    1.36 +
    1.37 +	if (!(word & (1 << 13))) {
    1.38 +		dom0_op_t op;
    1.39 +		printk(KERN_INFO "Disabling irq balancing and affinity\n");
    1.40 +		op.cmd = DOM0_PLATFORM_QUIRK;
    1.41 +		op.u.platform_quirk.quirk_id = QUIRK_NOIRQBALANCING;
    1.42 +		(void)HYPERVISOR_dom0_op(&op);
    1.43 +	}
    1.44 +
    1.45 +	config &= ~0x2;
    1.46 +	/* disable access to config space*/
    1.47 +	pci_write_config_byte(dev, 0xf4, config);
    1.48 +}
    1.49 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7320_MCH,	quirk_intel_irqbalance);
    1.50 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7525_MCH,	quirk_intel_irqbalance);
    1.51 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7520_MCH,	quirk_intel_irqbalance);
    1.52 +#endif