@@ -50,12 +50,15 @@ static int ksz9021rn_phy_fixup(struct phy_device *phy)
{
int value;
+ /* Should probably use dts to configure skew, see
+ micrel-ksz90x1.txt */
+
/* Set delay values */
- value = MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW | 0x8000;
+ value = MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW | 0x8000;
phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value);
value = 0xF2F4;
phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value);
- value = MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW | 0x8000;
+ value = MICREL_KSZ9021_RGMII_RX_DATA_PAD_SKEW | 0x8000;
phy_write(phy, MICREL_KSZ9021_EXTREG_CTRL, value);
value = 0x2222;
phy_write(phy, MICREL_KSZ9021_EXTREG_DATA_WRITE, value);
@@ -42,18 +42,19 @@
/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
static int ksz9021rn_phy_fixup(struct phy_device *phydev)
{
+ /* Should probably use dt to set these, see micrel-ksz90x1.txt */
if (IS_BUILTIN(CONFIG_PHYLIB)) {
/* min rx data delay */
phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL,
- 0x8000 | MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW);
+ 0x8000 | MICREL_KSZ9021_RGMII_RX_DATA_PAD_SKEW);
phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0x0000);
/* max rx/tx clock delay, min rx/tx control delay */
phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL,
- 0x8000 | MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW);
+ 0x8000 | MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW);
phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0xf0f0);
phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL,
- MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW);
+ MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW);
}
return 0;
@@ -38,9 +38,12 @@
/* struct phy_device dev_flags definitions */
#define MICREL_PHY_50MHZ_CLK 0x00000001
+/* These probably should not be exported; see micrel-ksz90x1.txt on
+ how to configure skew from device tree. */
#define MICREL_KSZ9021_EXTREG_CTRL 0xB
#define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC
-#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW 0x104
-#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW 0x105
+#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SKEW 0x104
+#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SKEW 0x105
+#define MICREL_KSZ9021_RGMII_TX_DATA_PAD_SKEW 0x106
#endif /* _MICREL_PHY_H */
There's typo "SCEW" in some defines, which made my greps fail and confused me a lot. Plus, Dinh Nguyen pointed out that direct phy accesses from board files should no longer be needed -- device tree should be able to configure skew. Signed-off-by: Pavel Machek <pavel@denx.de>