Re: HPT370 controller set wrong udma mode

Duncan Laurie (void@sun.com)
Sat, 12 Jan 2002 21:47:05 -0800


On Thu, Jan 10 2002, Oliver Feiler wrote:
>
> Alan Cox wrote:
> > Make sure you use the Andre Hedrick ide patches with the HPT 370. That fixed
> > all my problems with them at least
> > (http://www.linux-ide.org)
>
> Didn't solve my problem unfortunately.
>
> With the patch applied, the kernel still says it uses UDMA(66) on boot
> and hdparm also says the drive is in udma4 mode. Writing data to it results in
> BadCRC.
>
> However, /proc/ide/hpt366 with the patch applied shows ATA-33 mode.
> Something's wrong here.
>
> CC'ing this to Andre Hedrick. Maybe he knows what's wrong?
>

Try this patch... apply it after the latest patch from Andre becuase that
includes several other crucial highpoint fixes. It looks like the cable
detect pins are also used as address lines and so must be configured as
inputs to read valid cable detect state.

-duncan

--- linux/drivers/ide/hpt366.c~ Thu Jan 10 17:08:01 2002
+++ linux/drivers/ide/hpt366.c Thu Jan 10 17:10:17 2002
@@ -1140,7 +1140,21 @@
byte ata66 = 0;
byte regmask = (hwif->channel) ? 0x01 : 0x02;

- pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66);
+ if (pci_rev_check_hpt3xx(hwif->pci_dev)) {
+ byte scr2;
+ /*
+ * The HPT370 uses the CBLID pin outputs as MA15/MA16
+ * address lines to access an external eeprom. To
+ * read cable detect state the pins must be enabled
+ * as inputs by clearing bit 0 of reg 0x5b.
+ */
+ pci_read_config_byte(hwif->pci_dev, 0x5b, &scr2);
+ pci_write_config_byte(hwif->pci_dev, 0x5b, scr2 & ~1);
+ pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66);
+ pci_write_config_byte(hwif->pci_dev, 0x5b, scr2 | 1);
+ } else {
+ pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66);
+ }
#ifdef DEBUG
printk("HPT366: reg5ah=0x%02x ATA-%s Cable Port%d\n",
ata66, (ata66 & regmask) ? "33" : "66",

-
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/