summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/mach-imx6q.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-06-20 17:34:33 +0200
committerShawn Guo <shawn.guo@linaro.org>2013-08-16 13:11:20 +0800
commitdbf6719a4a080669acb5087893704586c791aa41 (patch)
tree578da9ec6cd0757ab7ce6e3eaf431a877a100156 /arch/arm/mach-imx/mach-imx6q.c
parent12da484485b0ae0cd1588ade3904c1f647ab58cd (diff)
downloadlwn-dbf6719a4a080669acb5087893704586c791aa41.tar.gz
lwn-dbf6719a4a080669acb5087893704586c791aa41.zip
ARM: i.MX6: add ethernet phy fixup for KSZ9031
The KSZ9031 is used on the i.MX6 based Data Modul eDM-QMX6 board. It needs the same fixup to the rx/tx delays as other i.MX6 boards. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx/mach-imx6q.c')
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 57f350cd66b4..db1db78b28fc 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -115,6 +115,27 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev)
return 0;
}
+static void mmd_write_reg(struct phy_device *dev, int device, int reg, int val)
+{
+ phy_write(dev, 0x0d, device);
+ phy_write(dev, 0x0e, reg);
+ phy_write(dev, 0x0d, (1 << 14) | device);
+ phy_write(dev, 0x0e, val);
+}
+
+static int ksz9031rn_phy_fixup(struct phy_device *dev)
+{
+ /*
+ * min rx data delay, max rx/tx clock delay,
+ * min rx/tx control delay
+ */
+ mmd_write_reg(dev, 2, 4, 0);
+ mmd_write_reg(dev, 2, 5, 0);
+ mmd_write_reg(dev, 2, 8, 0x003ff);
+
+ return 0;
+}
+
static int ar8031_phy_fixup(struct phy_device *dev)
{
u16 val;
@@ -169,6 +190,8 @@ static void __init imx6q_enet_phy_init(void)
if (IS_BUILTIN(CONFIG_PHYLIB)) {
phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
ksz9021rn_phy_fixup);
+ phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
+ ksz9031rn_phy_fixup);
phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffff,
ar8031_phy_fixup);
}