Add ethernet support to ar934x using Atheros phy Signed-off-by: Nikolaos Pasaloukos <nikolaos.pasalou...@imgtec.com> Cc: Joe Hershberger <joe.hershber...@gmail.com> --- drivers/net/phy/atheros.c | 42 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/drivers/net/phy/atheros.c b/drivers/net/phy/atheros.c index b20b4df..f69b4ec 100644 --- a/drivers/net/phy/atheros.c +++ b/drivers/net/phy/atheros.c @@ -5,6 +5,9 @@ * * Copyright 2011, 2013 Freescale Semiconductor, Inc. * author Andy Fleming + * + * Copyright (C) 2013 Imagination Technologies + * */ #include <phy.h> @@ -37,6 +40,34 @@ static int ar8035_config(struct phy_device *phydev) return 0; } +static int ar9344_config(struct phy_device *phydev) +{ + /* configure the RGMII */ + phy_write(phydev, 0x18, 0x00, 0x0000); + phy_write(phydev, 0x10, 0x01, 0x8000); + phy_write(phydev, 0x10, 0x00, 0x0000); + udelay(10000); + phy_write(phydev, 0x18, 0x00, 0x0003); + phy_write(phydev, 0x10, 0x13, 0x7f7f); + phy_write(phydev, 0x10, 0x12, 0x7f7f); + phy_write(phydev, 0x18, 0x00, 0x0000); + phy_write(phydev, 0x10, 0x09, 0x4000); + phy_write(phydev, 0x10, 0x08, 0x0000); + phy_write(phydev, 0x18, 0x00, 0x0000); + phy_write(phydev, 0x10, 0x03, 0x0760); + phy_write(phydev, 0x10, 0x02, 0x0000); + phy_write(phydev, 0x18, 0x00, 0x0000); + phy_write(phydev, 0x10, 0x07, 0x0100); + phy_write(phydev, 0x10, 0x06, 0x0000); + phy_write(phydev, 0x18, 0x00, 0x0000); + phy_write(phydev, 0x11, 0x1f, 0x0000); + phy_write(phydev, 0x11, 0x1e, 0x007e); + + genphy_config_aneg(phydev); + + return 0; +} + static struct phy_driver AR8021_driver = { .name = "AR8021", .uid = 0x4dd040, @@ -67,11 +98,22 @@ static struct phy_driver AR8035_driver = { .shutdown = genphy_shutdown, }; +static struct phy_driver AR9344_driver = { + .name = "AR9344", + .uid = 0x4dd036, + .mask = 0x4fffff, + .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause, + .config = ar9344_config, + .startup = genphy_startup, + .shutdown = genphy_shutdown, +}; + int phy_atheros_init(void) { phy_register(&AR8021_driver); phy_register(&AR8031_driver); phy_register(&AR8035_driver); + phy_register(&AR9344_driver); return 0; } -- 1.8.3.2 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot