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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 197 - (hide annotations) (download) (as text)
Fri Oct 28 11:44:31 2005 UTC (15 years, 1 month ago) by dsd
File MIME type: text/x-diff
File size: 4071 byte(s)
2.6.14-pre --> 2.6.14
1 dsd 3 diff -X dontdiff -urNp linux-2.6.10/drivers/scsi/libata-core.c linux-dsd/drivers/scsi/libata-core.c
2     --- linux-2.6.10/drivers/scsi/libata-core.c 2004-12-24 21:33:48.000000000 +0000
3     +++ linux-dsd/drivers/scsi/libata-core.c 2005-01-13 23:53:07.621097464 +0000
4     @@ -3209,6 +3209,7 @@ static void ata_host_init(struct ata_por
5     ap->mwdma_mask = ent->mwdma_mask;
6     ap->udma_mask = ent->udma_mask;
7     ap->flags |= ent->host_flags;
8     + ap->flags |= ent->port_flags[port_no];
9     ap->ops = ent->port_ops;
10     ap->cbl = ATA_CBL_NONE;
11     ap->active_tag = ATA_TAG_POISON;
12 dsd 178 diff -X dontdiff -urNp linux-2.6.10/include/linux/libata.h linux-dsd/include/linux/libata.h
13     --- linux-2.6.10/include/linux/libata.h 2004-12-24 21:33:49.000000000 +0000
14     +++ linux-dsd/include/linux/libata.h 2005-01-13 23:53:07.623097160 +0000
15     @@ -205,6 +205,7 @@ struct ata_probe_ent {
16     unsigned long irq;
17     unsigned int irq_flags;
18     unsigned long host_flags;
19     + unsigned long port_flags[ATA_MAX_PORTS];
20     void __iomem *mmio_base;
21     void *private_data;
22     };
23     --- linux/drivers/scsi/sata_promise.c.orig 2005-10-08 12:17:27.000000000 +0100
24     +++ linux/drivers/scsi/sata_promise.c 2005-10-08 12:17:21.000000000 +0100
25     @@ -84,6 +84,7 @@ static irqreturn_t pdc_interrupt (int ir
26     static void pdc_eng_timeout(struct ata_port *ap);
27 dsd 3 static int pdc_port_start(struct ata_port *ap);
28     static void pdc_port_stop(struct ata_port *ap);
29     +static void pdc_pata_cbl_detect(struct ata_port *ap);
30 dsd 178 static void pdc_pata_phy_reset(struct ata_port *ap);
31     static void pdc_sata_phy_reset(struct ata_port *ap);
32 dsd 3 static void pdc_qc_prep(struct ata_queued_cmd *qc);
33 dsd 178 @@ -161,7 +162,7 @@ static struct ata_port_info pdc_port_inf
34 dsd 3 /* board_2037x */
35     {
36     .sht = &pdc_ata_sht,
37     - .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
38 dsd 178 + .host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY |
39 dsd 3 ATA_FLAG_SRST | ATA_FLAG_MMIO,
40     .pio_mask = 0x1f, /* pio0-4 */
41     .mwdma_mask = 0x07, /* mwdma0-2 */
42 dsd 178 @@ -306,17 +307,34 @@ static void pdc_reset_port(struct ata_po
43     static void pdc_sata_phy_reset(struct ata_port *ap)
44 dsd 3 {
45     pdc_reset_port(ap);
46     - sata_phy_reset(ap);
47     + if (ap->flags & ATA_FLAG_SATA)
48     + sata_phy_reset(ap);
49     + else
50     + pdc_pata_phy_reset(ap);
51 dsd 178 }
52    
53 dsd 3 +static void pdc_pata_cbl_detect(struct ata_port *ap)
54     +{
55     + u8 tmp;
56     + void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
57     +
58     + tmp = readb(mmio);
59     +
60     + if (tmp & 0x01)
61     + {
62     + ap->cbl = ATA_CBL_PATA40;
63     + ap->udma_mask &= ATA_UDMA_MASK_40C;
64     + }
65     + else
66     + ap->cbl = ATA_CBL_PATA80;
67     +}
68     +
69 dsd 178 static void pdc_pata_phy_reset(struct ata_port *ap)
70     {
71     - /* FIXME: add cable detect. Don't assume 40-pin cable */
72     - ap->cbl = ATA_CBL_PATA40;
73     - ap->udma_mask &= ATA_UDMA_MASK_40C;
74 dsd 3 + pdc_pata_cbl_detect(ap);
75 dsd 178
76     - pdc_reset_port(ap);
77     ata_port_probe(ap);
78 dsd 3 +
79 dsd 178 ata_bus_reset(ap);
80 dsd 3 }
81    
82 dsd 178 @@ -629,6 +647,7 @@ static int pdc_ata_init_one (struct pci_
83 dsd 3 unsigned int board_idx = (unsigned int) ent->driver_data;
84 dsd 178 int pci_dev_busy = 0;
85 dsd 3 int rc;
86     + u8 tmp;
87    
88     if (!printed_version++)
89     printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
90 dsd 178 @@ -688,6 +707,9 @@ static int pdc_ata_init_one (struct pci_
91 dsd 3 probe_ent->port[0].scr_addr = base + 0x400;
92     probe_ent->port[1].scr_addr = base + 0x500;
93    
94     + probe_ent->port_flags[0] = ATA_FLAG_SATA;
95     + probe_ent->port_flags[1] = ATA_FLAG_SATA;
96     +
97     /* notice 4-port boards */
98     switch (board_idx) {
99     case board_20319:
100 dsd 178 @@ -698,9 +720,25 @@ static int pdc_ata_init_one (struct pci_
101 dsd 3
102     probe_ent->port[2].scr_addr = base + 0x600;
103     probe_ent->port[3].scr_addr = base + 0x700;
104     +
105     + probe_ent->port_flags[2] = ATA_FLAG_SATA;
106     + probe_ent->port_flags[3] = ATA_FLAG_SATA;
107     break;
108     case board_2037x:
109     - probe_ent->n_ports = 2;
110     + /* Some boards have also PATA port */
111 dsd 178 + tmp = readb(mmio_base + PDC_FLASH_CTL+1);
112 dsd 3 + if (!(tmp & 0x80))
113     + {
114     + probe_ent->n_ports = 3;
115     +
116     + pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
117     +
118     + probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
119     +
120     + printk(KERN_INFO DRV_NAME " PATA port found\n");
121     + }
122     + else
123     + probe_ent->n_ports = 2;
124     break;
125 dsd 178 case board_20619:
126     probe_ent->n_ports = 4;

  ViewVC Help
Powered by ViewVC 1.1.20