/[linux-patches]/genpatches-2.6/tags/2.6.15-2/4320_promise-pdc2037x.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.15-2/4320_promise-pdc2037x.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 259 - (show annotations) (download)
Wed Jan 11 21:46:01 2006 UTC (8 years, 11 months ago) by dsd
File size: 4027 byte(s)
2.6.15-2 release
1 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/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 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 static void pdc_pata_phy_reset(struct ata_port *ap);
31 static void pdc_sata_phy_reset(struct ata_port *ap);
32 static void pdc_qc_prep(struct ata_queued_cmd *qc);
33 @@ -161,6 +162,6 @@ static struct ata_port_info pdc_port_inf
34 /* board_2037x */
35 {
36 .sht = &pdc_ata_sht,
37 - .host_flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA,
38 + .host_flags = PDC_COMMON_FLAGS /* | ATA_FLAG_SATA */,
39 .pio_mask = 0x1f, /* pio0-4 */
40 .mwdma_mask = 0x07, /* mwdma0-2 */
41 @@ -306,17 +307,34 @@ static void pdc_reset_port(struct ata_po
42 static void pdc_sata_phy_reset(struct ata_port *ap)
43 {
44 pdc_reset_port(ap);
45 - sata_phy_reset(ap);
46 + if (ap->flags & ATA_FLAG_SATA)
47 + sata_phy_reset(ap);
48 + else
49 + pdc_pata_phy_reset(ap);
50 }
51
52 +static void pdc_pata_cbl_detect(struct ata_port *ap)
53 +{
54 + u8 tmp;
55 + void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
56 +
57 + tmp = readb(mmio);
58 +
59 + if (tmp & 0x01)
60 + {
61 + ap->cbl = ATA_CBL_PATA40;
62 + ap->udma_mask &= ATA_UDMA_MASK_40C;
63 + }
64 + else
65 + ap->cbl = ATA_CBL_PATA80;
66 +}
67 +
68 static void pdc_pata_phy_reset(struct ata_port *ap)
69 {
70 - /* FIXME: add cable detect. Don't assume 40-pin cable */
71 - ap->cbl = ATA_CBL_PATA40;
72 - ap->udma_mask &= ATA_UDMA_MASK_40C;
73 + pdc_pata_cbl_detect(ap);
74
75 - pdc_reset_port(ap);
76 ata_port_probe(ap);
77 +
78 ata_bus_reset(ap);
79 }
80
81 @@ -629,6 +647,7 @@ static int pdc_ata_init_one (struct pci_
82 unsigned int board_idx = (unsigned int) ent->driver_data;
83 int pci_dev_busy = 0;
84 int rc;
85 + u8 tmp;
86
87 if (!printed_version++)
88 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
89 @@ -688,6 +707,9 @@ static int pdc_ata_init_one (struct pci_
90 probe_ent->port[0].scr_addr = base + 0x400;
91 probe_ent->port[1].scr_addr = base + 0x500;
92
93 + probe_ent->port_flags[0] = ATA_FLAG_SATA;
94 + probe_ent->port_flags[1] = ATA_FLAG_SATA;
95 +
96 /* notice 4-port boards */
97 switch (board_idx) {
98 case board_20319:
99 @@ -698,9 +720,25 @@ static int pdc_ata_init_one (struct pci_
100
101 probe_ent->port[2].scr_addr = base + 0x600;
102 probe_ent->port[3].scr_addr = base + 0x700;
103 +
104 + probe_ent->port_flags[2] = ATA_FLAG_SATA;
105 + probe_ent->port_flags[3] = ATA_FLAG_SATA;
106 break;
107 case board_2037x:
108 - probe_ent->n_ports = 2;
109 + /* Some boards have also PATA port */
110 + tmp = readb(mmio_base + PDC_FLASH_CTL+1);
111 + if (!(tmp & 0x80))
112 + {
113 + probe_ent->n_ports = 3;
114 +
115 + pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
116 +
117 + probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
118 +
119 + printk(KERN_INFO DRV_NAME " PATA port found\n");
120 + }
121 + else
122 + probe_ent->n_ports = 2;
123 break;
124 case board_20619:
125 probe_ent->n_ports = 4;

  ViewVC Help
Powered by ViewVC 1.1.20