/[linux-patches]/genpatches-2.6/tags/2.6.20-9/4100_sata-promise-ide.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.20-9/4100_sata-promise-ide.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 927 - (show annotations) (download)
Thu Apr 26 15:33:43 2007 UTC (7 years, 2 months ago) by phreak
File size: 3969 byte(s)
2.6.20-9 release
1 From: Mikael Pettersson <mikpe@it.uu.se>
2 Date: Tue, 9 Jan 2007 09:50:27 +0000 (+0100)
3 Subject: sata_promise: TX2plus PATA support
4 X-Git-Tag: v2.6.21-rc1^0~274^2~535
5 X-Git-Url: http://www2.kernel.org/git/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=870ae337d568e8633ec30ca6f6afb7b58a558ba3
6
7 sata_promise: TX2plus PATA support
8
9 This patch implements a simple way of setting up per-port
10 flags on the SATA+PATA Promise TX2plus chips, which is a
11 prerequisite for supporting the PATA port on those chips.
12
13 It is based on the observation that ap->flags isn't really
14 used until after ->port_start() has been invoked. So it
15 places the "exceptional" per-port flags array in the driver's
16 private host structure, and uses it in ->port_start() to
17 finalise the port's flags.
18
19 This patch obsoletes the #promise-sata-pata branch included
20 in the #all branch.
21
22 Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
23 Signed-off-by: Jeff Garzik <jeff@garzik.org>
24 ---
25
26 diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
27 index f055874..6ab0574 100644
28 --- a/drivers/ata/sata_promise.c
29 +++ b/drivers/ata/sata_promise.c
30 @@ -92,6 +92,7 @@ struct pdc_port_priv {
31
32 struct pdc_host_priv {
33 unsigned long flags;
34 + unsigned long port_flags[ATA_MAX_PORTS];
35 };
36
37 static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg);
38 @@ -183,7 +184,7 @@ static const struct ata_port_info pdc_port_info[] = {
39 /* board_2037x */
40 {
41 .sht = &pdc_ata_sht,
42 - .flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA,
43 + .flags = PDC_COMMON_FLAGS,
44 .pio_mask = 0x1f, /* pio0-4 */
45 .mwdma_mask = 0x07, /* mwdma0-2 */
46 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
47 @@ -213,7 +214,7 @@ static const struct ata_port_info pdc_port_info[] = {
48 /* board_2057x */
49 {
50 .sht = &pdc_ata_sht,
51 - .flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA,
52 + .flags = PDC_COMMON_FLAGS,
53 .pio_mask = 0x1f, /* pio0-4 */
54 .mwdma_mask = 0x07, /* mwdma0-2 */
55 .udma_mask = 0x7f, /* udma0-6 ; FIXME */
56 @@ -271,6 +272,11 @@ static int pdc_port_start(struct ata_port *ap)
57 struct pdc_port_priv *pp;
58 int rc;
59
60 + /* fix up port flags and cable type for SATA+PATA chips */
61 + ap->flags |= hp->port_flags[ap->port_no];
62 + if (ap->flags & ATA_FLAG_SATA)
63 + ap->cbl = ATA_CBL_SATA;
64 +
65 rc = ata_port_start(ap);
66 if (rc)
67 return rc;
68 @@ -377,7 +383,7 @@ static void pdc_pata_phy_reset(struct ata_port *ap)
69
70 static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
71 {
72 - if (sc_reg > SCR_CONTROL)
73 + if (sc_reg > SCR_CONTROL || ap->cbl != ATA_CBL_SATA)
74 return 0xffffffffU;
75 return readl((void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
76 }
77 @@ -386,7 +392,7 @@ static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
78 static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
79 u32 val)
80 {
81 - if (sc_reg > SCR_CONTROL)
82 + if (sc_reg > SCR_CONTROL || ap->cbl != ATA_CBL_SATA)
83 return;
84 writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
85 }
86 @@ -740,6 +746,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
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 @@ -820,7 +827,17 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
95 hp->flags |= PDC_FLAG_GEN_II;
96 /* Fall through */
97 case board_2037x:
98 - probe_ent->n_ports = 2;
99 + /* TX2plus boards also have a PATA port */
100 + tmp = readb(mmio_base + PDC_FLASH_CTL+1);
101 + if (!(tmp & 0x80)) {
102 + probe_ent->n_ports = 3;
103 + pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
104 + hp->port_flags[2] = ATA_FLAG_SLAVE_POSS;
105 + printk(KERN_INFO DRV_NAME " PATA port found\n");
106 + } else
107 + probe_ent->n_ports = 2;
108 + hp->port_flags[0] = ATA_FLAG_SATA;
109 + hp->port_flags[1] = ATA_FLAG_SATA;
110 break;
111 case board_20619:
112 probe_ent->n_ports = 4;

  ViewVC Help
Powered by ViewVC 1.1.20