HPT370 controller set wrong udma mode
Quoted 8 lines · Oliver Feiler
Quoted 3 lines · Alan Cox
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.
Quoted 9 lines
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/hpt366with 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
drivers/ide/hpt366.c renamed from drivers/ide/hpt366.c~ +15 -1
@@ -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",
Quoted 5 lines · Duncan Laurie
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.
That solved the problem. Thank you.
Oliver
Signature · 3 lines
Oliver Feiler [email protected] http://www.lionking.org/~kiza/pgpkey PGP key ID: 0x561D4FD2 http://www.lionking.org/~kiza/