From 92088d2dca7a02c8df4732103eb84bdc422786bc Mon Sep 17 00:00:00 2001 From: Dominik Muth Date: Fri, 12 Sep 2014 07:50:35 +0200 Subject: [PATCH] Ported Ronetix patch for Micrel KSZ9021RNI from U-Boot to linux. --- drivers/net/phy/micrel.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index e5af259..652cb48 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -141,6 +141,16 @@ static int ks8051_config_init(struct phy_device *phydev) return rc < 0 ? rc : 0; } +static int ksz9021_config_init(struct phy_device *phydev) +{ + /* make industrial variant KSZ9021RNI work on Ronetix SAMA5D3x-CM */ + phy_write(phydev, 11, 260 | 0x8000); + phy_write(phydev, 12, 0xF0F0); + phy_write(phydev, 11, 261 | 0x8000); + phy_write(phydev, 12, 0x2222); + return 0; +} + #define KSZ8873MLL_GLOBAL_CONTROL_4 0x06 #define KSZ8873MLL_GLOBAL_CONTROL_4_DUPLEX (1 << 6) #define KSZ8873MLL_GLOBAL_CONTROL_4_SPEED (1 << 4) @@ -297,7 +307,7 @@ static struct phy_driver ksphy_driver[] = { .name = "Micrel KSZ9021 Gigabit PHY", .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause), .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, - .config_init = kszphy_config_init, + .config_init = ksz9021_config_init, .config_aneg = genphy_config_aneg, .read_status = genphy_read_status, .ack_interrupt = kszphy_ack_interrupt, -- 1.7.9.5