diff options
author | Tom Rini <trini@konsulko.com> | 2019-11-12 07:18:23 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-11-12 07:18:23 -0500 |
commit | 5f7ff6d63eeb81ad2c071ff5f5adae5bcc94f7a4 (patch) | |
tree | eb3707f7e5b4ae1d0f3094cc8814ef8bc389aa8c /board/freescale/imx8mm_evk | |
parent | a965a8b904093c9e6790d0460d18a144cefa5e42 (diff) | |
parent | bdcf3a88cc582ce8bb9ea024fa917d9a52e05479 (diff) |
Merge tag 'u-boot-imx-20191105' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20191105
-------------------
i.MX8MN SoC support
ROM API image download support
i.MX8MM enet enabling
Diffstat (limited to 'board/freescale/imx8mm_evk')
-rw-r--r-- | board/freescale/imx8mm_evk/imx8mm_evk.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c index e4742338e3..a0af550f5e 100644 --- a/board/freescale/imx8mm_evk/imx8mm_evk.c +++ b/board/freescale/imx8mm_evk/imx8mm_evk.c @@ -4,6 +4,11 @@ */ #include <common.h> +#include <miiphy.h> +#include <netdev.h> + +#include <asm/arch/clock.h> +#include <asm/io.h> DECLARE_GLOBAL_DATA_PTR; @@ -14,8 +19,40 @@ int dram_init(void) return 0; } +#if IS_ENABLED(CONFIG_FEC_MXC) +static int setup_fec(void) +{ + struct iomuxc_gpr_base_regs *gpr = + (struct iomuxc_gpr_base_regs *)IOMUXC_GPR_BASE_ADDR; + + /* Use 125M anatop REF_CLK1 for ENET1, not from external */ + clrsetbits_le32(&gpr->gpr[1], 0x2000, 0); + + return 0; +} + +int board_phy_config(struct phy_device *phydev) +{ + /* enable rgmii rxc skew and phy mode select to RGMII copper */ + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x1f); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x8); + + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x00); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x82ee); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1d, 0x05); + phy_write(phydev, MDIO_DEVAD_NONE, 0x1e, 0x100); + + if (phydev->drv->config) + phydev->drv->config(phydev); + return 0; +} +#endif + int board_init(void) { + if (IS_ENABLED(CONFIG_FEC_MXC)) + setup_fec(); + return 0; } |