aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ata_piix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ata_piix.c')
-rw-r--r--drivers/ata/ata_piix.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 12b3a42fb356..1a4c03d5de9f 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -127,7 +127,7 @@ enum {
127 ich6_sata_ahci = 8, 127 ich6_sata_ahci = 8,
128 ich6m_sata_ahci = 9, 128 ich6m_sata_ahci = 9,
129 ich8_sata_ahci = 10, 129 ich8_sata_ahci = 10,
130 130
131 /* constants for mapping table */ 131 /* constants for mapping table */
132 P0 = 0, /* port 0 */ 132 P0 = 0, /* port 0 */
133 P1 = 1, /* port 1 */ 133 P1 = 1, /* port 1 */
@@ -196,7 +196,7 @@ static const struct pci_device_id piix_pci_tbl[] = {
196 { 0x8086, 0x24DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_133 }, 196 { 0x8086, 0x24DB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_133 },
197 /* C-ICH (i810E2) */ 197 /* C-ICH (i810E2) */
198 { 0x8086, 0x245B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, 198 { 0x8086, 0x245B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
199 /* ESB (855GME/875P + 6300ESB) UDMA 100 */ 199 /* ESB (855GME/875P + 6300ESB) UDMA 100 */
200 { 0x8086, 0x25A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, 200 { 0x8086, 0x25A2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
201 /* ICH6 (and 6) (i915) UDMA 100 */ 201 /* ICH6 (and 6) (i915) UDMA 100 */
202 { 0x8086, 0x266F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 }, 202 { 0x8086, 0x266F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich_pata_100 },
@@ -458,7 +458,7 @@ static struct ata_port_info piix_port_info[] = {
458 .udma_mask = ATA_UDMA4, 458 .udma_mask = ATA_UDMA4,
459 .port_ops = &ich_pata_ops, 459 .port_ops = &ich_pata_ops,
460 }, 460 },
461 461
462 /* ich_pata_100: 3 */ 462 /* ich_pata_100: 3 */
463 { 463 {
464 .sht = &piix_sht, 464 .sht = &piix_sht,
@@ -759,7 +759,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
759 u8 slave_data; 759 u8 slave_data;
760 u8 udma_enable; 760 u8 udma_enable;
761 int control = 0; 761 int control = 0;
762 762
763 /* 763 /*
764 * See Intel Document 298600-004 for the timing programing rules 764 * See Intel Document 298600-004 for the timing programing rules
765 * for ICH controllers. 765 * for ICH controllers.
@@ -777,7 +777,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
777 if (ata_pio_need_iordy(adev)) 777 if (ata_pio_need_iordy(adev))
778 control |= 2; /* IE enable */ 778 control |= 2; /* IE enable */
779 779
780 /* Intel specifies that the PPE functionality is for disk only */ 780 /* Intel specifies that the PPE functionality is for disk only */
781 if (adev->class == ATA_DEV_ATA) 781 if (adev->class == ATA_DEV_ATA)
782 control |= 4; /* PPE enable */ 782 control |= 4; /* PPE enable */
783 783
@@ -806,7 +806,7 @@ static void piix_set_piomode (struct ata_port *ap, struct ata_device *adev)
806 806
807 /* Ensure the UDMA bit is off - it will be turned back on if 807 /* Ensure the UDMA bit is off - it will be turned back on if
808 UDMA is selected */ 808 UDMA is selected */
809 809
810 if (ap->udma_mask) { 810 if (ap->udma_mask) {
811 pci_read_config_byte(dev, 0x48, &udma_enable); 811 pci_read_config_byte(dev, 0x48, &udma_enable);
812 udma_enable &= ~(1 << (2 * ap->port_no + adev->devno)); 812 udma_enable &= ~(1 << (2 * ap->port_no + adev->devno));
@@ -835,7 +835,7 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
835 u8 speed = adev->dma_mode; 835 u8 speed = adev->dma_mode;
836 int devid = adev->devno + 2 * ap->port_no; 836 int devid = adev->devno + 2 * ap->port_no;
837 u8 udma_enable; 837 u8 udma_enable;
838 838
839 static const /* ISP RTC */ 839 static const /* ISP RTC */
840 u8 timings[][2] = { { 0, 0 }, 840 u8 timings[][2] = { { 0, 0 },
841 { 0, 0 }, 841 { 0, 0 },
@@ -851,13 +851,13 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
851 u16 udma_timing; 851 u16 udma_timing;
852 u16 ideconf; 852 u16 ideconf;
853 int u_clock, u_speed; 853 int u_clock, u_speed;
854 854
855 /* 855 /*
856 * UDMA is handled by a combination of clock switching and 856 * UDMA is handled by a combination of clock switching and
857 * selection of dividers 857 * selection of dividers
858 * 858 *
859 * Handy rule: Odd modes are UDMATIMx 01, even are 02 859 * Handy rule: Odd modes are UDMATIMx 01, even are 02
860 * except UDMA0 which is 00 860 * except UDMA0 which is 00
861 */ 861 */
862 u_speed = min(2 - (udma & 1), udma); 862 u_speed = min(2 - (udma & 1), udma);
863 if (udma == 5) 863 if (udma == 5)
@@ -866,16 +866,16 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
866 u_clock = 1; /* 66Mhz */ 866 u_clock = 1; /* 66Mhz */
867 else 867 else
868 u_clock = 0; /* 33Mhz */ 868 u_clock = 0; /* 33Mhz */
869 869
870 udma_enable |= (1 << devid); 870 udma_enable |= (1 << devid);
871 871
872 /* Load the CT/RP selection */ 872 /* Load the CT/RP selection */
873 pci_read_config_word(dev, 0x4A, &udma_timing); 873 pci_read_config_word(dev, 0x4A, &udma_timing);
874 udma_timing &= ~(3 << (4 * devid)); 874 udma_timing &= ~(3 << (4 * devid));
875 udma_timing |= u_speed << (4 * devid); 875 udma_timing |= u_speed << (4 * devid);
876 pci_write_config_word(dev, 0x4A, udma_timing); 876 pci_write_config_word(dev, 0x4A, udma_timing);
877 877
878 if (isich) { 878 if (isich) {
879 /* Select a 33/66/100Mhz clock */ 879 /* Select a 33/66/100Mhz clock */
880 pci_read_config_word(dev, 0x54, &ideconf); 880 pci_read_config_word(dev, 0x54, &ideconf);
881 ideconf &= ~(0x1001 << devid); 881 ideconf &= ~(0x1001 << devid);
@@ -897,12 +897,12 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
897 XFER_PIO_0, XFER_PIO_3, XFER_PIO_4 897 XFER_PIO_0, XFER_PIO_3, XFER_PIO_4
898 }; 898 };
899 int pio = needed_pio[mwdma] - XFER_PIO_0; 899 int pio = needed_pio[mwdma] - XFER_PIO_0;
900 900
901 control = 3; /* IORDY|TIME1 */ 901 control = 3; /* IORDY|TIME1 */
902 902
903 /* If the drive MWDMA is faster than it can do PIO then 903 /* If the drive MWDMA is faster than it can do PIO then
904 we must force PIO into PIO0 */ 904 we must force PIO into PIO0 */
905 905
906 if (adev->pio_mode < needed_pio[mwdma]) 906 if (adev->pio_mode < needed_pio[mwdma])
907 /* Enable DMA timing only */ 907 /* Enable DMA timing only */
908 control |= 8; /* PIO cycles in PIO0 */ 908 control |= 8; /* PIO cycles in PIO0 */
@@ -916,7 +916,7 @@ static void do_pata_set_dmamode (struct ata_port *ap, struct ata_device *adev, i
916 slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0); 916 slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << (ap->port_no ? 4 : 0);
917 pci_write_config_byte(dev, 0x44, slave_data); 917 pci_write_config_byte(dev, 0x44, slave_data);
918 } else { /* Master */ 918 } else { /* Master */
919 master_data &= 0xCCF4; /* Mask out IORDY|TIME1|DMAONLY 919 master_data &= 0xCCF4; /* Mask out IORDY|TIME1|DMAONLY
920 and master timing bits */ 920 and master timing bits */
921 master_data |= control; 921 master_data |= control;
922 master_data |= 922 master_data |=