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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 175 Revision 178
7 ap->flags |= ent->host_flags; 7 ap->flags |= ent->host_flags;
8+ ap->flags |= ent->port_flags[port_no]; 8+ ap->flags |= ent->port_flags[port_no];
9 ap->ops = ent->port_ops; 9 ap->ops = ent->port_ops;
10 ap->cbl = ATA_CBL_NONE; 10 ap->cbl = ATA_CBL_NONE;
11 ap->active_tag = ATA_TAG_POISON; 11 ap->active_tag = ATA_TAG_POISON;
12diff -X dontdiff -urNp linux-2.6.10/drivers/scsi/sata_promise.c linux-dsd/drivers/scsi/sata_promise.c 12diff -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 };
13--- linux-2.6.10/drivers/scsi/sata_promise.c 2004-12-24 21:35:23.000000000 +0000 23--- linux/drivers/scsi/sata_promise.c.orig 2005-10-08 12:17:27.000000000 +0100
14+++ linux-dsd/drivers/scsi/sata_promise.c 2005-01-13 23:54:16.742589400 +0000 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
15@@ -79,6 +79,8 @@ static void pdc_eng_timeout(struct ata_p 26 static void pdc_eng_timeout(struct ata_port *ap);
16 static int pdc_port_start(struct ata_port *ap); 27 static int pdc_port_start(struct ata_port *ap);
17 static void pdc_port_stop(struct ata_port *ap); 28 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); 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);
21 static void pdc_qc_prep(struct ata_queued_cmd *qc); 32 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 33@@ -161,7 +162,7 @@ static struct ata_port_info pdc_port_inf
25 /* board_2037x */ 34 /* board_2037x */
26 { 35 {
27 .sht = &pdc_ata_sht, 36 .sht = &pdc_ata_sht,
28- .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | 37- .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
29+ .host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY | 38+ .host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY |
30 ATA_FLAG_SRST | ATA_FLAG_MMIO, 39 ATA_FLAG_SRST | ATA_FLAG_MMIO,
31 .pio_mask = 0x1f, /* pio0-4 */ 40 .pio_mask = 0x1f, /* pio0-4 */
32 .mwdma_mask = 0x07, /* mwdma0-2 */ 41 .mwdma_mask = 0x07, /* mwdma0-2 */
33@@ -244,7 +246,35 @@ static void pdc_reset_port(struct ata_po 42@@ -306,17 +307,34 @@ static void pdc_reset_port(struct ata_po
34 static void pdc_phy_reset(struct ata_port *ap) 43 static void pdc_sata_phy_reset(struct ata_port *ap)
35 { 44 {
36 pdc_reset_port(ap); 45 pdc_reset_port(ap);
37- sata_phy_reset(ap); 46- sata_phy_reset(ap);
38+ if (ap->flags & ATA_FLAG_SATA) 47+ if (ap->flags & ATA_FLAG_SATA)
39+ sata_phy_reset(ap); 48+ sata_phy_reset(ap);
40+ else 49+ else
41+ pdc_pata_phy_reset(ap); 50+ pdc_pata_phy_reset(ap);
42+} 51 }
43+ 52
44+static void pdc_pata_cbl_detect(struct ata_port *ap) 53+static void pdc_pata_cbl_detect(struct ata_port *ap)
45+{ 54+{
46+ u8 tmp; 55+ u8 tmp;
47+ void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; 56+ void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
48+ 57+
55+ } 64+ }
56+ else 65+ else
57+ ap->cbl = ATA_CBL_PATA80; 66+ ap->cbl = ATA_CBL_PATA80;
58+} 67+}
59+ 68+
60+static void pdc_pata_phy_reset(struct ata_port *ap) 69 static void pdc_pata_phy_reset(struct ata_port *ap)
61+{ 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;
62+ pdc_pata_cbl_detect(ap); 74+ pdc_pata_cbl_detect(ap);
63+ 75
76- pdc_reset_port(ap);
64+ ata_port_probe(ap); 77 ata_port_probe(ap);
65+ 78+
66+ ata_bus_reset(ap); 79 ata_bus_reset(ap);
67 } 80 }
68 81
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_ 82@@ -629,6 +647,7 @@ static int pdc_ata_init_one (struct pci_
71 void *mmio_base;
72 unsigned int board_idx = (unsigned int) ent->driver_data; 83 unsigned int board_idx = (unsigned int) ent->driver_data;
84 int pci_dev_busy = 0;
73 int rc; 85 int rc;
74+ u8 tmp; 86+ u8 tmp;
75 87
76 if (!printed_version++) 88 if (!printed_version++)
77 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); 89 printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
78@@ -605,6 +636,9 @@ static int pdc_ata_init_one (struct pci_ 90@@ -688,6 +707,9 @@ static int pdc_ata_init_one (struct pci_
79 probe_ent->port[0].scr_addr = base + 0x400; 91 probe_ent->port[0].scr_addr = base + 0x400;
80 probe_ent->port[1].scr_addr = base + 0x500; 92 probe_ent->port[1].scr_addr = base + 0x500;
81 93
82+ probe_ent->port_flags[0] = ATA_FLAG_SATA; 94+ probe_ent->port_flags[0] = ATA_FLAG_SATA;
83+ probe_ent->port_flags[1] = ATA_FLAG_SATA; 95+ probe_ent->port_flags[1] = ATA_FLAG_SATA;
84+ 96+
85 /* notice 4-port boards */ 97 /* notice 4-port boards */
86 switch (board_idx) { 98 switch (board_idx) {
87 case board_20319: 99 case board_20319:
88@@ -615,9 +649,25 @@ static int pdc_ata_init_one (struct pci_ 100@@ -698,9 +720,25 @@ static int pdc_ata_init_one (struct pci_
89 101
90 probe_ent->port[2].scr_addr = base + 0x600; 102 probe_ent->port[2].scr_addr = base + 0x600;
91 probe_ent->port[3].scr_addr = base + 0x700; 103 probe_ent->port[3].scr_addr = base + 0x700;
92+ 104+
93+ probe_ent->port_flags[2] = ATA_FLAG_SATA; 105+ probe_ent->port_flags[2] = ATA_FLAG_SATA;
94+ probe_ent->port_flags[3] = ATA_FLAG_SATA; 106+ probe_ent->port_flags[3] = ATA_FLAG_SATA;
95 break; 107 break;
96 case board_2037x: 108 case board_2037x:
97- probe_ent->n_ports = 2; 109- probe_ent->n_ports = 2;
98+ /* Some boards have also PATA port */ 110+ /* Some boards have also PATA port */
99+ tmp = readb(base + PDC_FLASH_CTL+1); 111+ tmp = readb(mmio_base + PDC_FLASH_CTL+1);
100+ if (!(tmp & 0x80)) 112+ if (!(tmp & 0x80))
101+ { 113+ {
102+ probe_ent->n_ports = 3; 114+ probe_ent->n_ports = 3;
103+ 115+
104+ pdc_ata_setup_port(&probe_ent->port[2], base + 0x300); 116+ pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
108+ printk(KERN_INFO DRV_NAME " PATA port found\n"); 120+ printk(KERN_INFO DRV_NAME " PATA port found\n");
109+ } 121+ }
110+ else 122+ else
111+ probe_ent->n_ports = 2; 123+ probe_ent->n_ports = 2;
112 break; 124 break;
113 default: 125 case board_20619:
114 BUG(); 126 probe_ent->n_ports = 4;
115diff -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 };

Legend:
Removed from v.175  
changed lines
  Added in v.178

  ViewVC Help
Powered by ViewVC 1.1.20