X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=board%2Fmscc%2Fjr2%2Fjr2.c;h=f806576b90cd8e0bbf56d8e0d3389c0946dd3ab8;hb=c05ed00afb95fa5237f16962fccf5810437317bf;hp=58a4a04162b2e371bf8f5ef2be7d3159d1b579a4;hpb=544d5e98f3657e4ac1966be8971586aa42dad8c4;p=oweals%2Fu-boot.git diff --git a/board/mscc/jr2/jr2.c b/board/mscc/jr2/jr2.c index 58a4a04162..f806576b90 100644 --- a/board/mscc/jr2/jr2.c +++ b/board/mscc/jr2/jr2.c @@ -4,8 +4,12 @@ */ #include +#include +#include #include #include +#include +#include enum { BOARD_TYPE_PCB110 = 0xAABBCE00, @@ -64,6 +68,28 @@ static void vcoreiii_gpio_set_alternate(int gpio, int mode) } } +int board_phy_config(struct phy_device *phydev) +{ + if (gd->board_type == BOARD_TYPE_PCB110 || + gd->board_type == BOARD_TYPE_PCB112) { + 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); + } + if (gd->board_type == BOARD_TYPE_PCB111) { + phy_write(phydev, 0, 31, 0x10); + phy_write(phydev, 0, 18, 0x80A0); + while (phy_read(phydev, 0, 18) & 0x8000) + ; + phy_write(phydev, 0, 14, 0x800); + 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 */