summaryrefslogtreecommitdiff
path: root/board/toradex
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2021-12-27 18:02:26 +0100
committerPhilippe Schenker <philippe.schenker@toradex.com>2021-12-28 15:08:45 +0100
commit421a6ba683f97713dc4f0e445aee48b87bbe18c8 (patch)
treef9c5bcee776ca4f74889bbf286331406d4be285d /board/toradex
parent89401b459ee15ad5da75727be4c70222a834d578 (diff)
board: colibri-imx6ull: fix detecting ethernet phy
now that it is possible to use regulator-fixed-clock make use of it. This makes U-Boot detect the PHY on first cold-boot. This commit also adjusts the code in setup_fec and follows how it is done in mx6ullevk.c This commit also slows down the boot-process by about 150ms as it now waits for the regulator-fixed-clock voltage that drives the PHY to go up. If you rely on very fast boot-speeds and don't need ethernet for your boot-process you can safely revert the changes on imx6ull-colibri.dtsi Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Diffstat (limited to 'board/toradex')
-rw-r--r--board/toradex/colibri-imx6ull/colibri-imx6ull.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/board/toradex/colibri-imx6ull/colibri-imx6ull.c b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
index 0ac86549fd..bc11ab2272 100644
--- a/board/toradex/colibri-imx6ull/colibri-imx6ull.c
+++ b/board/toradex/colibri-imx6ull/colibri-imx6ull.c
@@ -99,29 +99,23 @@ static int setup_fec(void)
struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
int ret;
- /* provide the PHY clock from the i.MX 6 */
+ /*
+ * Use 50MHz anatop loopback REF_CLK2 for ENET2,
+ * clear gpr1[14], set gpr1[18].
+ */
+ clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC2_MASK,
+ IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);
+
+
ret = enable_fec_anatop_clock(1, ENET_50MHZ);
if (ret)
return ret;
- /* Use 50M anatop REF_CLK and output it on ENET2_TX_CLK */
- clrsetbits_le32(&iomuxc_regs->gpr[1],
- IOMUX_GPR1_FEC2_CLOCK_MUX2_SEL_MASK,
- IOMUX_GPR1_FEC2_CLOCK_MUX1_SEL_MASK);
-
- /* give new Ethernet PHY power save mode circuitry time to settle */
- mdelay(300);
-
- return 0;
-}
+ enable_enet_clk(1);
-int board_phy_config(struct phy_device *phydev)
-{
- if (phydev->drv->config)
- phydev->drv->config(phydev);
return 0;
}
-#endif /* CONFIG_FEC_MXC */
+#endif
int board_init(void)
{