linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>,
	IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH 02/03] sata_mv: PHY_MODEx errata fixes
Date: Tue, 27 May 2008 17:56:31 -0400	[thread overview]
Message-ID: <483C838F.9060208@rtr.ca> (raw)
In-Reply-To: <483C8328.1030807@rtr.ca>

Fix and update the errata handling for the PHY_MODEx registers.
This improves receiver noise tolerance, among other things.

Signed-off-by: Mark Lord <mlord@pobox.com>

--- old/drivers/ata/sata_mv.c	2008-05-27 11:53:01.000000000 -0400
+++ linux/drivers/ata/sata_mv.c	2008-05-27 12:01:25.000000000 -0400
@@ -2546,7 +2546,7 @@
 		hp_flags & (MV_HP_ERRATA_60X1B2 | MV_HP_ERRATA_60X1C0);
 	int fix_phy_mode4 =
 		hp_flags & (MV_HP_ERRATA_60X1B2 | MV_HP_ERRATA_60X1C0);
-	u32 m2, tmp;
+	u32 m2, m3;
 
 	if (fix_phy_mode2) {
 		m2 = readl(port_mmio + PHY_MODE2);
@@ -2563,27 +2563,27 @@
 		udelay(200);
 	}
 
-	/* who knows what this magic does */
-	tmp = readl(port_mmio + PHY_MODE3);
-	tmp &= ~0x7F800000;
-	tmp |= 0x2A800000;
-	writel(tmp, port_mmio + PHY_MODE3);
+	/*
+	 * Gen-II/IIe PHY_MODE3 errata RM#2:
+	 * Achieves better receiver noise performance than the h/w default:
+	 */
+	m3 = readl(port_mmio + PHY_MODE3);
+	m3 = (m3 & 0x1f) | (0x5555601 << 5);
+	writel(m3, port_mmio + PHY_MODE3);
 
 	if (fix_phy_mode4) {
 		u32 m4;
 
 		m4 = readl(port_mmio + PHY_MODE4);
 
-		if (hp_flags & MV_HP_ERRATA_60X1B2)
-			tmp = readl(port_mmio + PHY_MODE3);
-
 		/* workaround for errata FEr SATA#10 (part 1) */
 		m4 = (m4 & ~(1 << 1)) | (1 << 0);
 
-		writel(m4, port_mmio + PHY_MODE4);
+		/* enforce bit restrictions on GenIIe devices */
+		if (IS_GEN_IIE(hpriv))
+			m4 = (m4 & ~0x5DE3FFFC) | (1 << 2);
 
-		if (hp_flags & MV_HP_ERRATA_60X1B2)
-			writel(tmp, port_mmio + PHY_MODE3);
+		writel(m4, port_mmio + PHY_MODE4);
 	}
 
 	/* Revert values of pre-emphasis and signal amps to the saved ones */

  reply	other threads:[~2008-05-27 21:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 21:54 [PATCH 01/03] sata_mv: move SOC_FLAG to hpriv Mark Lord
2008-05-27 21:56 ` Mark Lord [this message]
2008-05-27 21:58   ` [PATCH 03/03] sata_mv: nuke unreleased GenIIe revisions Mark Lord
2008-05-28 16:01     ` [PATCH 04/04] sata_mv: workaround for 60x1 errata sata13 Mark Lord
2008-05-28 17:41       ` [PATCH 05/05] sata_mv: implement SoC guideline SATA_S11 Mark Lord
2008-05-30 22:11   ` [PATCH 02/03] sata_mv: PHY_MODEx errata fixes Jeff Garzik
2008-05-30 23:20     ` Mark Lord
2008-05-31 20:46     ` [PATCH 01/01] sata_mv: PHY_MODE4 cleanups Mark Lord
2008-06-04 10:29       ` Jeff Garzik
2008-05-30 22:10 ` [PATCH 01/03] sata_mv: move SOC_FLAG to hpriv Jeff Garzik

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=483C838F.9060208@rtr.ca \
    --to=liml@rtr.ca \
    --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).