/[linux-patches]/genpatches-2.6/trunk/2.6.16/4110_promise-pdc2037x.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.16/4110_promise-pdc2037x.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 339 - (show annotations) (download) (as text)
Mon Mar 20 16:25:16 2006 UTC (14 years, 8 months ago) by dsd
File MIME type: text/x-diff
File size: 3990 byte(s)
pdc2037x patch fix
1 Index: linux-git/drivers/scsi/libata-core.c
2 ===================================================================
3 --- linux-git.orig/drivers/scsi/libata-core.c
4 +++ linux-git/drivers/scsi/libata-core.c
5 @@ -4431,6 +4431,7 @@ static void ata_host_init(struct ata_por
6 ap->mwdma_mask = ent->mwdma_mask;
7 ap->udma_mask = ent->udma_mask;
8 ap->flags |= ent->host_flags;
9 + ap->flags |= ent->port_flags[port_no];
10 ap->ops = ent->port_ops;
11 ap->cbl = ATA_CBL_NONE;
12 ap->active_tag = ATA_TAG_POISON;
13 Index: linux-git/drivers/scsi/sata_promise.c
14 ===================================================================
15 --- linux-git.orig/drivers/scsi/sata_promise.c
16 +++ linux-git/drivers/scsi/sata_promise.c
17 @@ -89,6 +89,7 @@ static irqreturn_t pdc_interrupt (int ir
18 static void pdc_eng_timeout(struct ata_port *ap);
19 static int pdc_port_start(struct ata_port *ap);
20 static void pdc_port_stop(struct ata_port *ap);
21 +static void pdc_pata_cbl_detect(struct ata_port *ap);
22 static void pdc_pata_phy_reset(struct ata_port *ap);
23 static void pdc_sata_phy_reset(struct ata_port *ap);
24 static void pdc_qc_prep(struct ata_queued_cmd *qc);
25 @@ -165,7 +166,7 @@ static const struct ata_port_info pdc_po
26 /* board_2037x */
27 {
28 .sht = &pdc_ata_sht,
29 - .host_flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA,
30 + .host_flags = PDC_COMMON_FLAGS /* | ATA_FLAG_SATA */,
31 .pio_mask = 0x1f, /* pio0-4 */
32 .mwdma_mask = 0x07, /* mwdma0-2 */
33 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
34 @@ -323,17 +324,34 @@ static void pdc_reset_port(struct ata_po
35 static void pdc_sata_phy_reset(struct ata_port *ap)
36 {
37 pdc_reset_port(ap);
38 - sata_phy_reset(ap);
39 + if (ap->flags & ATA_FLAG_SATA)
40 + sata_phy_reset(ap);
41 + else
42 + pdc_pata_phy_reset(ap);
43 +}
44 +
45 +static void pdc_pata_cbl_detect(struct ata_port *ap)
46 +{
47 + u8 tmp;
48 + void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
49 +
50 + tmp = readb(mmio);
51 +
52 + if (tmp & 0x01)
53 + {
54 + ap->cbl = ATA_CBL_PATA40;
55 + ap->udma_mask &= ATA_UDMA_MASK_40C;
56 + }
57 + else
58 + ap->cbl = ATA_CBL_PATA80;
59 }
60
61 static void pdc_pata_phy_reset(struct ata_port *ap)
62 {
63 - /* FIXME: add cable detect. Don't assume 40-pin cable */
64 - ap->cbl = ATA_CBL_PATA40;
65 - ap->udma_mask &= ATA_UDMA_MASK_40C;
66 + pdc_pata_cbl_detect(ap);
67
68 - pdc_reset_port(ap);
69 ata_port_probe(ap);
70 +
71 ata_bus_reset(ap);
72 }
73
74 @@ -646,6 +664,7 @@ static int pdc_ata_init_one (struct pci_
75 unsigned int board_idx = (unsigned int) ent->driver_data;
76 int pci_dev_busy = 0;
77 int rc;
78 + u8 tmp;
79
80 if (!printed_version++)
81 dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
82 @@ -705,6 +724,9 @@ static int pdc_ata_init_one (struct pci_
83 probe_ent->port[0].scr_addr = base + 0x400;
84 probe_ent->port[1].scr_addr = base + 0x500;
85
86 + probe_ent->port_flags[0] = ATA_FLAG_SATA;
87 + probe_ent->port_flags[1] = ATA_FLAG_SATA;
88 +
89 /* notice 4-port boards */
90 switch (board_idx) {
91 case board_20319:
92 @@ -715,9 +737,25 @@ static int pdc_ata_init_one (struct pci_
93
94 probe_ent->port[2].scr_addr = base + 0x600;
95 probe_ent->port[3].scr_addr = base + 0x700;
96 +
97 + probe_ent->port_flags[2] = ATA_FLAG_SATA;
98 + probe_ent->port_flags[3] = ATA_FLAG_SATA;
99 break;
100 case board_2037x:
101 - probe_ent->n_ports = 2;
102 + /* Some boards also have a PATA port */
103 + tmp = readb(mmio_base + PDC_FLASH_CTL+1);
104 + if (!(tmp & 0x80))
105 + {
106 + probe_ent->n_ports = 3;
107 +
108 + pdc_ata_setup_port(&probe_ent->port[2], base +0x300);
109 +
110 + probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
111 +
112 + printk(KERN_INFO DRV_NAME " PATA port found\n");
113 + }
114 + else
115 + probe_ent->n_ports = 2;
116 break;
117 case board_20771:
118 probe_ent->n_ports = 2;
119 Index: linux-git/include/linux/libata.h
120 ===================================================================
121 --- linux-git.orig/include/linux/libata.h
122 +++ linux-git/include/linux/libata.h
123 @@ -237,6 +237,7 @@ struct ata_probe_ent {
124 unsigned long irq;
125 unsigned int irq_flags;
126 unsigned long host_flags;
127 + unsigned long port_flags[ATA_MAX_PORTS];
128 void __iomem *mmio_base;
129 void *private_data;
130 };

  ViewVC Help
Powered by ViewVC 1.1.20