[IDE-PATCH] Add piix fix up function into pii.c

From: hugang (hugang@soulinfo.com)
Date: Wed Dec 04 2002 - 08:10:55 EST


Hello all:

Please apply.
Index: drivers/ide//pci/piix.c
===================================================================
RCS file: /home/hugang/local/cvs/2.4/drivers/ide/pci/piix.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 piix.c
--- drivers/ide//pci/piix.c 28 Nov 2002 06:41:20 -0000 1.1.1.2
+++ drivers/ide//pci/piix.c 4 Dec 2002 13:02:36 -0000
@@ -652,6 +652,27 @@
  
 static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d)
 {
+ int i;
+ unsigned short cmd;
+ unsigned long flags;
+ unsigned long base_address[4] = { 0x1f0, 0x3f4, 0x170, 0x374 };
+
+ printk(KERN_INFO "PIIX: fixup IDE controller\n");
+ local_irq_save(flags);
+ pci_read_config_word(dev, PCI_COMMAND, &cmd);
+ pci_write_config_word(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO);
+
+ for (i=0; i<4; i++) {
+ dev->resource[i].start = base_address[i];
+ dev->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO;
+ pci_write_config_dword(dev,
+ (PCI_BASE_ADDRESS_0 + (i * 4)),
+ dev->resource[i].start);
+ }
+
+ pci_write_config_word(dev, PCI_COMMAND, cmd);
+ local_irq_restore(flags);
+
         ide_setup_pci_device(dev, d);
 }
 

-- 
		- Hu Gang



- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:19 EST