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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20