summaryrefslogtreecommitdiff
path: root/board/mscc
diff options
context:
space:
mode:
authorHoratiu Vultur <horatiu.vultur@microchip.com>2019-04-24 11:27:58 +0200
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2019-05-03 16:42:23 +0200
commit06d270cf57a48abbb71daa2ea30178ab04dc9cef (patch)
tree1de2e581a91de9dff135c68b4faaea4c033a45cc /board/mscc
parent6390da4a5770e59ac220c1b0412a66d2c861a547 (diff)
board: mscc: ocelot: Update MSCC Ocelot board.
Implement method board_phy_config to configure the phy for pcb120. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Diffstat (limited to 'board/mscc')
-rw-r--r--board/mscc/ocelot/ocelot.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c
index 532d06f000..bcae8fa50c 100644
--- a/board/mscc/ocelot/ocelot.c
+++ b/board/mscc/ocelot/ocelot.c
@@ -11,6 +11,7 @@
#include <spi.h>
#include <led.h>
#include <wait_bit.h>
+#include <miiphy.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -42,6 +43,20 @@ void mscc_switch_reset(bool enter)
mscc_gpio_set_alternate(19, 0);
}
+int board_phy_config(struct phy_device *phydev)
+{
+ if (gd->board_type == BOARD_TYPE_PCB123)
+ return 0;
+
+ phy_write(phydev, 0, 31, 0x10);
+ phy_write(phydev, 0, 18, 0x80F0);
+ while (phy_read(phydev, 0, 18) & 0x8000)
+ ;
+ phy_write(phydev, 0, 31, 0);
+
+ return 0;
+}
+
void board_debug_uart_init(void)
{
/* too early for the pinctrl driver, so configure the UART pins here */