rpms/kernel/devel linux-2.6.11-libata-promise-pata-on-sata.patch, NONE, 1.1 kernel-2.6.spec, 1.1266, 1.1267
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Mon Apr 25 23:20:40 UTC 2005
Author: davej
Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv5683
Modified Files:
kernel-2.6.spec
Added Files:
linux-2.6.11-libata-promise-pata-on-sata.patch
Log Message:
Support PATA drives on Promise SATA. (#147303)
linux-2.6.11-libata-promise-pata-on-sata.patch:
drivers/scsi/libata-core.c | 1
drivers/scsi/sata_promise.c | 56 +++++++++++++++++++++++++++++++++++++++++---
include/linux/libata.h | 1
3 files changed, 55 insertions(+), 3 deletions(-)
--- NEW FILE linux-2.6.11-libata-promise-pata-on-sata.patch ---
This will update the following files:
drivers/scsi/libata-core.c | 1 ++
drivers/scsi/libata.h | 2
drivers/scsi/sata_promise.c | 56 +++
through these ChangeSets:
<erikbenada:yahoo.ca>:
o [libata sata_promise] support PATA ports on SATA controllers
diff -Nru a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
--- a/drivers/scsi/libata-core.c 2004-11-14 22:37:46 -05:00
+++ b/drivers/scsi/libata-core.c 2004-11-14 22:37:46 -05:00
@@ -3181,6 +3211,7 @@
ap->mwdma_mask = ent->mwdma_mask;
ap->udma_mask = ent->udma_mask;
ap->flags |= ent->host_flags;
+ ap->flags |= ent->port_flags[port_no];
ap->ops = ent->port_ops;
ap->cbl = ATA_CBL_NONE;
ap->active_tag = ATA_TAG_POISON;
diff -Nru a/drivers/scsi/sata_promise.c b/drivers/scsi/sata_promise.c
--- a/drivers/scsi/sata_promise.c 2004-11-14 22:37:46 -05:00
+++ b/drivers/scsi/sata_promise.c 2004-11-14 22:37:46 -05:00
@@ -79,6 +79,8 @@
static int pdc_port_start(struct ata_port *ap);
static void pdc_port_stop(struct ata_port *ap);
static void pdc_phy_reset(struct ata_port *ap);
+static void pdc_pata_phy_reset(struct ata_port *ap);
+static void pdc_pata_cbl_detect(struct ata_port *ap);
static void pdc_qc_prep(struct ata_queued_cmd *qc);
static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf);
static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
@@ -127,7 +129,7 @@
/* board_2037x */
{
.sht = &pdc_ata_sht,
- .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
+ .host_flags = /* ATA_FLAG_SATA | */ ATA_FLAG_NO_LEGACY |
ATA_FLAG_SRST | ATA_FLAG_MMIO,
.pio_mask = 0x1f, /* pio0-4 */
.mwdma_mask = 0x07, /* mwdma0-2 */
@@ -244,7 +246,35 @@
static void pdc_phy_reset(struct ata_port *ap)
{
pdc_reset_port(ap);
- sata_phy_reset(ap);
+ if (ap->flags & ATA_FLAG_SATA)
+ sata_phy_reset(ap);
+ else
+ pdc_pata_phy_reset(ap);
+}
+
+static void pdc_pata_cbl_detect(struct ata_port *ap)
+{
+ u8 tmp;
+ void *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
+
+ tmp = readb(mmio);
+
+ if (tmp & 0x01)
+ {
+ ap->cbl = ATA_CBL_PATA40;
+ ap->udma_mask &= ATA_UDMA_MASK_40C;
+ }
+ else
+ ap->cbl = ATA_CBL_PATA80;
+}
+
+static void pdc_pata_phy_reset(struct ata_port *ap)
+{
+ pdc_pata_cbl_detect(ap);
+
+ ata_port_probe(ap);
+
+ ata_bus_reset(ap);
}
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
@@ -547,6 +577,7 @@
void *mmio_base;
unsigned int board_idx = (unsigned int) ent->driver_data;
int rc;
+ u8 tmp;
if (!printed_version++)
printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n");
@@ -605,6 +636,9 @@
probe_ent->port[0].scr_addr = base + 0x400;
probe_ent->port[1].scr_addr = base + 0x500;
+ probe_ent->port_flags[0] = ATA_FLAG_SATA;
+ probe_ent->port_flags[1] = ATA_FLAG_SATA;
+
/* notice 4-port boards */
switch (board_idx) {
case board_20319:
@@ -615,9 +649,25 @@
probe_ent->port[2].scr_addr = base + 0x600;
probe_ent->port[3].scr_addr = base + 0x700;
+
+ probe_ent->port_flags[2] = ATA_FLAG_SATA;
+ probe_ent->port_flags[3] = ATA_FLAG_SATA;
break;
case board_2037x:
- probe_ent->n_ports = 2;
+ /* Some boards have also PATA port */
+ tmp = readb(mmio_base + PDC_FLASH_CTL+1);
+ if (!(tmp & 0x80))
+ {
+ probe_ent->n_ports = 3;
+
+ pdc_ata_setup_port(&probe_ent->port[2], base + 0x300);
+
+ probe_ent->port_flags[2] = ATA_FLAG_SLAVE_POSS;
+
+ printk(KERN_INFO DRV_NAME " PATA port found\n");
+ }
+ else
+ probe_ent->n_ports = 2;
break;
default:
BUG();
diff -Nru a/include/linux/libata.h b/include/linux/libata.h
--- a/include/linux/libata.h 2004-11-14 22:37:46 -05:00
+++ b/include/linux/libata.h 2004-11-14 22:37:46 -05:00
@@ -204,6 +204,7 @@
unsigned long irq;
unsigned int irq_flags;
unsigned long host_flags;
+ unsigned long port_flags[ATA_MAX_PORTS];
void __iomem *mmio_base;
void *private_data;
};
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1266
retrieving revision 1.1267
diff -u -r1.1266 -r1.1267
--- kernel-2.6.spec 25 Apr 2005 22:58:33 -0000 1.1266
+++ kernel-2.6.spec 25 Apr 2005 23:20:36 -0000 1.1267
@@ -324,6 +324,7 @@
Patch1790: linux-2.6.11-net-ipv6-skip_exthdr-oops-fix.patch
Patch1800: linux-2.6.11-parport-sysctl-perms.patch
Patch1801: linux-2.6.11-net-flush-sysctl-perms.patch
+Patch1810: linux-2.6.11-libata-promise-pata-on-sata.patch
Patch2000: linux-2.6.11-vm-taint.patch
Patch2001: linux-2.6.9-vm-oomkiller-debugging.patch
@@ -722,6 +723,8 @@
# Fix up some permissions in /proc
%patch1800 -p1
%patch1801 -p1
+# Support PATA on Promise SATA.
+%patch1810 -p1
#
# VM related fixes.
@@ -1150,6 +1153,7 @@
- Fix serio oops.
- Fix ipv6_skip_exthdr() invocation causing OOPS.
- Fix up some permissions on some /proc files.
+- Support PATA drives on Promise SATA. (#147303)
* Mon Apr 25 2005 Rik van Riel <riel at redhat.com>
- upgrade to the latest version of xenolinux patches
More information about the fedora-cvs-commits
mailing list