lkml.org 
[lkml]   [2002]   [Dec]   [4]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
DateWed, 4 Dec 2002 21:09:41 +0800
Fromhugang <>
SubjectRe: [patch]back ports ICH3M support into 2.4.20
On 01 Dec 2002 18:03:25 +0000
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Sun, 2002-12-01 at 05:04, hugang wrote:
> > hello 
> >   Here is a back port patch for Intel ICH3M IDE 
> 
> 2.4.20 already has the correct version of the fixes for partially
> configured IDE devices. The code you are posting is old and in several
> places wrong, hence it was removed.
> 
> 2.4.20 will try and do a full pci device setup, then fall back to just
> configuring BAR4.
> 
> Alan
> 
Here is an new patch for it. But I'm not true that , Place the fixup function in pci_init_piix is good way. But it works.
Here is it.
Index: 2.4/drivers/ide/piix.c
diff -u 2.4/drivers/ide/piix.c:1.1.1.4 2.4/drivers/ide/piix.c:1.1.1.4.8.3
--- 2.4/drivers/ide/piix.c:1.1.1.4	Fri Nov 29 13:57:34 2002
+++ 2.4/drivers/ide/piix.c	Wed Dec  4 21:05:27 2002
@@ -480,6 +480,30 @@
 }
 #endif /* defined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_PIIX_TUNING) */
 
+inline void ide_register_xp_fix(struct pci_dev *dev)
+{
+	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);
+	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);
+}
+
 unsigned int __init pci_init_piix (struct pci_dev *dev, const char *name)
 {
 #if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS)
@@ -489,6 +513,9 @@
 		piix_display_info = &piix_get_info;
 	}
 #endif /* DISPLAY_PIIX_TIMINGS && CONFIG_PROC_FS */
+	if (dev->resource[0].start != 0x01f1)
+		ide_register_xp_fix(dev);
+
 	return 0;
 }
 

-- 
		- Hu Gang
[unhandled content-type:application/octet-stream][unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 12:31    [from the cache]
©2003-2008