Re: VIA52CXXX problem (2.2.15/16pre7)

From: Bartlomiej Zolnierkiewicz (dake@staszic.waw.pl)
Date: Fri Jun 02 2000 - 13:33:27 EST


oops... I forgot to attach the patch :)

--- linux.2216p7.ide/drivers/block/via82cxxx.c Wed May 31 23:43:32 2000
+++ linux/drivers/block/via82cxxx.c Fri Jun 2 20:19:23 2000
@@ -651,6 +651,7 @@
 {
         ide_hwif_t *hwif = HWIF(drive);
         struct pci_dev *dev = hwif->pci_dev;
+ struct chipset_bus_clock_list_entry * temp_table = NULL;
         byte unit = (drive->select.b.unit & 0x01);
         int drive_number = ((hwif->channel ? 2 : 0) + unit);
 
@@ -674,12 +675,20 @@
                         return -1;
         }
 
+ if ((via82cxxx_table == via82cxxx_type_four) &&
+ (!(hwif->udma_four)) &&
+ (speed <= XFER_UDMA_2)) {
+ temp_table = via82cxxx_type_three;
+ } else {
+ temp_table = via82cxxx_table;
+ }
+
         pci_read_config_byte(dev, ata2_pci, &timing);
- timing = pci_bus_clock_list(speed, bus_speed, via82cxxx_table);
+ timing = pci_bus_clock_list(speed, bus_speed, temp_table);
         pci_write_config_byte(dev, ata2_pci, timing);
 
         pci_read_config_byte(dev, ata3_pci, &ultra);
- ultra = pci_bus_clock_list_ultra(speed, bus_speed, via82cxxx_table);
+ ultra = pci_bus_clock_list_ultra(speed, bus_speed, temp_table);
         pci_write_config_byte(dev, ata3_pci, ultra);
 
         err = ide_config_drive_speed(drive, speed);
@@ -848,6 +857,7 @@
         struct pci_dev *isa;
         int i, j, ata33, ata66;
 
+ int bus_speed = system_bus_clock();
         byte revision = 0;
 
         for (i = 0; i < arraysize (ApolloHostChipInfo) && !host_dev; i++) {
@@ -876,18 +886,27 @@
                         ata33 = 1;
                         ata66 = 0;
 
+ via82cxxx_table = ApolloISAChipInfo[j].chipset_table;
+
                         if (ApolloISAChipInfo[j].flags & VIA_FLAG_CHECK_REV) {
                                 pci_read_config_byte(isa_dev, 0x0d, &revision);
                                 ata33 = (revision >= 0x20) ? 1 : 0;
                         } else if (ApolloISAChipInfo[j].flags & VIA_FLAG_ATA_66) {
+ byte ata66_0 = 0, ata66_1 = 0;
                                 ata33 = 0;
                                 ata66 = 1;
- }
+ pci_read_config_byte(dev, 0x50, &ata66_1);
+ pci_read_config_byte(dev, 0x52, &ata66_0);
+ if ((ata66_0 & 0x04) || (ata66_1 & 0x04)) {
+ via82cxxx_table = (bus_speed == 33 || bus_speed == 37) ?
+ via82cxxx_type_four :
+ via82cxxx_type_three;
+ }
+ }
 
                         if (ata33 | ata66)
                                 printk(" Chipset Core ATA-%s", ata66 ? "66" : "33");
 
- via82cxxx_table = ApolloISAChipInfo[j].chipset_table;
                 }
                 printk("\n");
         }

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



This archive was generated by hypermail 2b29 : Wed Jun 07 2000 - 21:00:15 EST