aboutsummaryrefslogtreecommitdiff
path: root/board/phytec/pcm052
diff options
context:
space:
mode:
authorLukasz Majewski <lukma@denx.de>2019-02-13 22:46:59 +0100
committerStefano Babic <sbabic@denx.de>2019-04-13 20:30:08 +0200
commitbdc9fefcbf9c2b8c9b2db84de696ec894bc66341 (patch)
tree93dbfbf090bff9c8b8956eb4be4b12aa4257e51e /board/phytec/pcm052
parent15a445690358462226df8038fe34e295d23b5319 (diff)
downloadu-boot-bdc9fefcbf9c2b8c9b2db84de696ec894bc66341.zip
u-boot-bdc9fefcbf9c2b8c9b2db84de696ec894bc66341.tar.gz
u-boot-bdc9fefcbf9c2b8c9b2db84de696ec894bc66341.tar.bz2
pcm052: bk4: Add board_phy_config() for BK4 to setup ksz8081 phy
BK4 requires setup of 50MHz reference clock for its KSZ8081 PHY devices. Signed-off-by: Lukasz Majewski <lukma@denx.de> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'board/phytec/pcm052')
-rw-r--r--board/phytec/pcm052/pcm052.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/board/phytec/pcm052/pcm052.c b/board/phytec/pcm052/pcm052.c
index 1e443a585..c30df5d 100644
--- a/board/phytec/pcm052/pcm052.c
+++ b/board/phytec/pcm052/pcm052.c
@@ -15,6 +15,7 @@
#include <asm/arch/clock.h>
#include <led.h>
#include <environment.h>
+#include <miiphy.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -382,6 +383,21 @@ int board_late_init(void)
return 0;
}
+
+/**
+ * KSZ8081
+ */
+#define MII_KSZ8081_REFERENCE_CLOCK_SELECT 0x1f
+#define RMII_50MHz_CLOCK 0x8180
+
+int board_phy_config(struct phy_device *phydev)
+{
+ /* Set 50 MHz reference clock */
+ phy_write(phydev, MDIO_DEVAD_NONE, MII_KSZ8081_REFERENCE_CLOCK_SELECT,
+ RMII_50MHz_CLOCK);
+
+ return genphy_config(phydev);
+}
#endif /* CONFIG_TARGET_BK4R1 */
int checkboard(void)