From: Horatiu Vultur Date: Wed, 24 Apr 2019 11:27:58 +0200 Subject: [U-Boot] [PATCH 2/3] board: mscc: ocelot: Update MSCC Ocelot board. In-Reply-To: <1556098079-25263-1-git-send-email-horatiu.vultur@microchip.com> References: <1556098079-25263-1-git-send-email-horatiu.vultur@microchip.com> Message-ID: <1556098079-25263-3-git-send-email-horatiu.vultur@microchip.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Implement method board_phy_config to configure the phy for pcb120. Signed-off-by: Horatiu Vultur --- board/mscc/ocelot/ocelot.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c index 532d06f..bcae8fa 100644 --- a/board/mscc/ocelot/ocelot.c +++ b/board/mscc/ocelot/ocelot.c @@ -11,6 +11,7 @@ #include #include #include +#include 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 */ -- 2.7.4