hello
Here is a back port patch for Intel ICH3M IDE support. It's more stable for me. Hope can merage into stable tree. thanks.
--
- Hu Gang
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
On 01 Dec 2002 18:03:25 +0000
Alan Cox <[email protected]> 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
On Wed, 2002-12-04 at 13:09, hugang wrote:
> > 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.
See what I said before. 2.4.20 already does a pci BAR4 fixup if needed.
Your change is still wrong.