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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 376 - (show annotations) (download)
Wed Apr 12 12:20:21 2006 UTC (8 years, 5 months ago) by phreak
File size: 4135 byte(s)
Fixing file ranges in 4105_dm-bbr.patch, 4110_promise-pdc2037x.patch, 4205_vesafb-tng-1.0-rc1-r3.patch, 4300_squashfs-3.0.patch, 4400_speakup-20060103.patch and 4405_alpha-sysctl-uac.patch
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 @@ -4441,6 +4441,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 @@ -96,6 +96,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 @@ -171,7 +172,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 @@ -360,17 +361,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 @@ -672,6 +690,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 @@ -740,6 +759,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_40518:
92 @@ -754,13 +776,29 @@ 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_2057x:
101 /* Override hotplug offset for SATAII150 */
102 hp->hotplug_offset = PDC2_SATA_PLUG_CSR;
103 /* Fall through */
104 case board_2037x:
105 - probe_ent->n_ports = 2;
106 + /* Some boards also have a PATA port */
107 + tmp = readb(mmio_base + PDC_FLASH_CTL+1);
108 + if (!(tmp & 0x80))
109 + {
110 + probe_ent->n_ports = 3;
111 +
112 + pdc_ata_setup_port(&probe_ent->port[2], base +0x300);
113 +
114 + probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
115 +
116 + printk(KERN_INFO DRV_NAME " PATA port found\n");
117 + }
118 + else
119 + probe_ent->n_ports = 2;
120 break;
121 case board_20771:
122 probe_ent->n_ports = 2;
123 Index: linux-git/include/linux/libata.h
124 ===================================================================
125 --- linux-git.orig/include/linux/libata.h
126 +++ linux-git/include/linux/libata.h
127 @@ -282,6 +282,7 @@ struct ata_probe_ent {
128 unsigned int irq_flags;
129 unsigned long host_flags;
130 unsigned long host_set_flags;
131 + unsigned long port_flags[ATA_MAX_PORTS];
132 void __iomem *mmio_base;
133 void *private_data;
134 };

  ViewVC Help
Powered by ViewVC 1.1.20