aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorMikael Pettersson <mikpe@it.uu.se>2007-05-06 16:14:01 -0400
committerJeff Garzik <jeff@garzik.org>2007-05-09 20:15:46 -0400
commit5ac2fe57569c5fbbd4288e3e7fead332b4300ef0 (patch)
tree05b6f04dbec9c76a0cfb73a3124668d5cee1cc56 /drivers/ata
parent8ffcfd9d0dc735071379760c23317f15904f9056 (diff)
sata_promise: SATAII-150/300 TX4 port numbering fix
There is a known problem with sata_promise on SATAII-150/300 TX4 controller cards: it enumerates drives in an order that differs from the port numbers printed on the controller cards. However, Promise's BIOS and Linux driver both get the order right. I investigated Promise's Linux driver (v1.01.0.23), and found that it explicitly changes the mapping from logical port number to ATA engine MMIO address on the SATAII TX4 cards. It does this on all SATAII TX4 cards, without inspecting revision etc. The SATAII TX2plus cards continue to use the same mapping that was used for the first-generation chips. This patch updates sata_promise to use the new port number to ATA engine mapping on SATAII TX4 cards, which fixes the drive enumeration order problem on those cards. Tested on several 1st and 2nd generation TX2plus and TX4 chips. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_promise.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 753402ec5716..3a7d9b5332af 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -45,7 +45,7 @@
45#include "sata_promise.h" 45#include "sata_promise.h"
46 46
47#define DRV_NAME "sata_promise" 47#define DRV_NAME "sata_promise"
48#define DRV_VERSION "2.06" 48#define DRV_VERSION "2.07"
49 49
50 50
51enum { 51enum {
@@ -926,6 +926,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
926 struct ata_host *host; 926 struct ata_host *host;
927 void __iomem *base; 927 void __iomem *base;
928 int n_ports, i, rc; 928 int n_ports, i, rc;
929 int is_sataii_tx4;
929 930
930 if (!printed_version++) 931 if (!printed_version++)
931 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); 932 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -964,10 +965,23 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
964 } 965 }
965 host->iomap = pcim_iomap_table(pdev); 966 host->iomap = pcim_iomap_table(pdev);
966 967
967 for (i = 0; i < host->n_ports; i++) 968 is_sataii_tx4 = 0;
969 if ((pi->flags & (PDC_FLAG_GEN_II|PDC_FLAG_4_PORTS)) == (PDC_FLAG_GEN_II|PDC_FLAG_4_PORTS)) {
970 is_sataii_tx4 = 1;
971 dev_printk(KERN_INFO, &pdev->dev, "applying SATAII TX4 port numbering workaround\n");
972 }
973 for (i = 0; i < host->n_ports; i++) {
974 static const unsigned char sataii_tx4_port_remap[4] = { 3, 1, 0, 2};
975 int ata_nr;
976
977 ata_nr = i;
978 if (is_sataii_tx4)
979 ata_nr = sataii_tx4_port_remap[i];
980
968 pdc_ata_setup_port(host->ports[i], 981 pdc_ata_setup_port(host->ports[i],
969 base + 0x200 + i * 0x80, 982 base + 0x200 + ata_nr * 0x80,
970 base + 0x400 + i * 0x100); 983 base + 0x400 + ata_nr * 0x100);
984 }
971 985
972 /* initialize adapter */ 986 /* initialize adapter */
973 pdc_host_init(host); 987 pdc_host_init(host);