From 1f0152c00fbf2b538602cf0904d38035647ba88f Mon Sep 17 00:00:00 2001 From: Josep Orga Date: Wed, 27 Nov 2019 10:39:27 +0100 Subject: [PATCH] Enable ENET1_TX_CLK during board startup. TODO: Check if it is necessary when hard reset is present. Signed-off-by: Josep Orga --- arch/arm/mach-imx/mach-imx6ul.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index 851034d5f73f..1c4f7ee48394 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c @@ -24,11 +24,24 @@ static void __init imx6ul_enet_clk_init(void) { struct regmap *gpr; + //struct regmap *iomuxc; + volatile uint32_t* mux_eth1; + volatile uint32_t* pad_eth1; gpr = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc-gpr"); - if (!IS_ERR(gpr)) + //iomuxc = syscon_regmap_lookup_by_compatible("fsl,imx6ul-iomuxc"); + if (!IS_ERR(gpr)) { regmap_update_bits(gpr, IOMUXC_GPR1, IMX6UL_GPR1_ENET_CLK_DIR, IMX6UL_GPR1_ENET_CLK_OUTPUT); + //TODO: Check it + //regmap_update_bits(iomuxc, 0xdc, 0x1f, 0x14); + //regmap_write(iomuxc, 0xdc, 0x14); + //regmap_update_bits(iomuxc, 0x368, 0xfffff, 0x0001b031); + mux_eth1 = (volatile uint32_t*)ioremap(0x020e00dc, 16); + pad_eth1 = (volatile uint32_t*)ioremap(0x020e0368, 16); + writel(0x0001b031, pad_eth1); //Take the value from the device tree + writel(0x14, mux_eth1); //Enable and set ENET1_TX_CLK* + } else pr_err("failed to find fsl,imx6ul-iomux-gpr regmap\n"); -- 2.17.1