From: Phillip Jordan <phillip.m.jordan@gmail.com>
To: linux-ide@vger.kernel.org, jgarzik@pobox.com
Subject: [PATCH 2.6.16.4 1/2] sata_promise: alternative PATA support on pdc2037x without libata interface changes
Date: Fri, 21 Apr 2006 01:09:07 +0100 [thread overview]
Message-ID: <444822A3.60906@gmail.com> (raw)
Add support for detecting the cable bit for PATA ports in the
sata_promise driver.
Signed-off-by: Phil Jordan <phillip.m.jordan@gmail.com>
---
Notes:
* Use together with alternative PATA support patch. (2/2)
* Based on current libata development branch and PATA support patch by
Erik Benada from early 2005 (?)
phil
--- sata_promise.c 2006-04-12 21:27:57.000000000 +0100
+++ sata_promise.c 2006-04-16 22:27:00.000000000 +0100
@@ -96,6 +96,7 @@ static void pdc_tf_load_mmio(struct ata_
static void pdc_exec_command_mmio(struct ata_port *ap, const struct
ata_taskfile *tf);
static void pdc_irq_clear(struct ata_port *ap);
static int pdc_qc_issue_prot(struct ata_queued_cmd *qc);
+static void pdc_pata_cbl_detect(struct ata_port *ap);
static struct scsi_host_template pdc_ata_sht = {
@@ -326,11 +339,25 @@ static void pdc_sata_phy_reset(struct at
sata_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)
{
- /* FIXME: add cable detect. Don't assume 40-pin cable */
- ap->cbl = ATA_CBL_PATA40;
- ap->udma_mask &= ATA_UDMA_MASK_40C;
+ /* FIX: added cable detect. Don't assume 40-pin cable */
+ pdc_pata_cbl_detect(ap);
pdc_reset_port(ap);
ata_port_probe(ap);
reply other threads:[~2006-04-21 0:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=444822A3.60906@gmail.com \
--to=phillip.m.jordan@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).