/[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 151 - (hide annotations) (download) (as text)
Mon Aug 29 09:34:13 2005 UTC (15 years, 3 months ago) by dsd
Original Path: genpatches-2.6/trunk/2.6.13/4320_promise-pdc2037x.patch
File MIME type: text/x-diff
File size: 4169 byte(s)
2.6.13-pre --> 2.6.13
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     diff -X dontdiff -urNp linux-2.6.10/drivers/scsi/sata_promise.c linux-dsd/drivers/scsi/sata_promise.c
13     --- linux-2.6.10/drivers/scsi/sata_promise.c 2004-12-24 21:35:23.000000000 +0000
14     +++ linux-dsd/drivers/scsi/sata_promise.c 2005-01-13 23:54:16.742589400 +0000
15     @@ -79,6 +79,8 @@ static void pdc_eng_timeout(struct ata_p
16     static int pdc_port_start(struct ata_port *ap);
17     static void pdc_port_stop(struct ata_port *ap);
18     static void pdc_phy_reset(struct ata_port *ap);
19     +static void pdc_pata_phy_reset(struct ata_port *ap);
20     +static void pdc_pata_cbl_detect(struct ata_port *ap);
21     static void pdc_qc_prep(struct ata_queued_cmd *qc);
22     static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
23     static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
24     @@ -127,7 +129,7 @@ static struct ata_port_info pdc_port_inf
25     /* board_2037x */
26     {
27     .sht = &pdc_ata_sht,
28     - .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
29     + .host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY |
30     ATA_FLAG_SRST | ATA_FLAG_MMIO,
31     .pio_mask = 0x1f, /* pio0-4 */
32     .mwdma_mask = 0x07, /* mwdma0-2 */
33     @@ -244,7 +246,35 @@ static void pdc_reset_port(struct ata_po
34     static void pdc_phy_reset(struct ata_port *ap)
35     {
36     pdc_reset_port(ap);
37     - sata_phy_reset(ap);
38     + if (ap->flags & ATA_FLAG_SATA)
39     + sata_phy_reset(ap);
40     + else
41     + pdc_pata_phy_reset(ap);
42     +}
43     +
44     +static void pdc_pata_cbl_detect(struct ata_port *ap)
45     +{
46     + u8 tmp;
47     + void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
48     +
49     + tmp = readb(mmio);
50     +
51     + if (tmp & 0x01)
52     + {
53     + ap->cbl = ATA_CBL_PATA40;
54     + ap->udma_mask &= ATA_UDMA_MASK_40C;
55     + }
56     + else
57     + ap->cbl = ATA_CBL_PATA80;
58     +}
59     +
60     +static void pdc_pata_phy_reset(struct ata_port *ap)
61     +{
62     + pdc_pata_cbl_detect(ap);
63     +
64     + ata_port_probe(ap);
65     +
66     + ata_bus_reset(ap);
67     }
68    
69     static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
70     @@ -547,6 +577,7 @@ static int pdc_ata_init_one (struct pci_
71     void *mmio_base;
72     unsigned int board_idx = (unsigned int) ent->driver_data;
73     int rc;
74     + u8 tmp;
75    
76     if (!printed_version++)
77     printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
78     @@ -605,6 +636,9 @@ static int pdc_ata_init_one (struct pci_
79     probe_ent->port[0].scr_addr = base + 0x400;
80     probe_ent->port[1].scr_addr = base + 0x500;
81    
82     + probe_ent->port_flags[0] = ATA_FLAG_SATA;
83     + probe_ent->port_flags[1] = ATA_FLAG_SATA;
84     +
85     /* notice 4-port boards */
86     switch (board_idx) {
87     case board_20319:
88     @@ -615,9 +649,25 @@ static int pdc_ata_init_one (struct pci_
89    
90     probe_ent->port[2].scr_addr = base + 0x600;
91     probe_ent->port[3].scr_addr = base + 0x700;
92     +
93     + probe_ent->port_flags[2] = ATA_FLAG_SATA;
94     + probe_ent->port_flags[3] = ATA_FLAG_SATA;
95     break;
96     case board_2037x:
97     - probe_ent->n_ports = 2;
98     + /* Some boards have also PATA port */
99     + tmp = readb(base + PDC_FLASH_CTL+1);
100     + if (!(tmp & 0x80))
101     + {
102     + probe_ent->n_ports = 3;
103     +
104     + pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
105     +
106     + probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
107     +
108     + printk(KERN_INFO DRV_NAME " PATA port found\n");
109     + }
110     + else
111     + probe_ent->n_ports = 2;
112     break;
113     default:
114     BUG();
115     diff -X dontdiff -urNp linux-2.6.10/include/linux/libata.h linux-dsd/include/linux/libata.h
116     --- linux-2.6.10/include/linux/libata.h 2004-12-24 21:33:49.000000000 +0000
117     +++ linux-dsd/include/linux/libata.h 2005-01-13 23:53:07.623097160 +0000
118     @@ -205,6 +205,7 @@ struct ata_probe_ent {
119     unsigned long irq;
120     unsigned int irq_flags;
121     unsigned long host_flags;
122     + unsigned long port_flags[ATA_MAX_PORTS];
123     void __iomem *mmio_base;
124     void *private_data;
125     };

  ViewVC Help
Powered by ViewVC 1.1.20