--- linux-2.4.7.compile/drivers/pci/quirks.c.orig Tue Jul 24 16:50:41 2001 +++ linux-2.4.7.compile/drivers/pci/quirks.c Mon Jul 30 20:21:56 2001 @@ -160,6 +160,49 @@ } /* + * KT133a will fsck up under some circumstances if Burst Refresh (4 times) + * is enabled or if data latch delay is disabled + * and we use the fast streaming K7 optimized zero_page + * and copy_page routines from arch/i386/lib/mmx.c + * -- garloff@suse.de, 2001-07-30 + */ +static void __init quirk_via_noburstrefresh(struct pci_dev *dev) +{ + u8 dram_ctrl; + pci_read_config_byte(dev, 0x68, &dram_ctrl); + if (dram_ctrl & 0x04 || !(dram_ctrl & 0x10)) { + if (dram_ctrl & 0x04) + printk(KERN_INFO "VIA KT133a: Disabling burst refresh.\n"); + dram_ctrl &= ~0x04; + if (!(dram_ctrl & 0x10)) + printk(KERN_INFO "VIA KT133a: Enabling data latch delay.\n"); + dram_ctrl |= 0x10; + pci_write_config_byte(dev, 0x68, dram_ctrl); + } +} + +/* + * KT133a will fsck up under some circumstances if Probe Next Tag State + * T1 is set to 1 and we use the fast streaming K7 optimized zero_page + * and copy_page routines from arch/i386/lib/mmx.c + * -- garloff@suse.de, 2001-07-30 + */ +static void __init quirk_via_noprobenexttag(struct pci_dev *dev) +{ + u8 biu_ctrl; + pci_read_config_byte(dev, 0x54, &biu_ctrl); + if (biu_ctrl & 0x40 || biu_ctrl & 0x01) { + if (biu_ctrl & 0x40) + printk(KERN_INFO "VIA KT133a: Disabling probe next tag state T1.\n"); + if (biu_ctrl & 0x01) + printk(KERN_INFO "VIA KT133a: Disabling fast write-to-read.\n"); + biu_ctrl &= ~0x41; + pci_write_config_byte(dev, 0x54, biu_ctrl); + } +} + + +/* * Natoma has some interesting boundary conditions with Zoran stuff * at least */ @@ -452,6 +495,9 @@ { 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 }, + + { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_via_noburstrefresh }, + { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, quirk_via_noprobenexttag }, { 0 } };