From: Josep Orga Date: Sat, 18 Apr 2020 14:44:11 +0000 (+0200) Subject: ARM: imx: Enable ENET1_TX_CLK during board startup. X-Git-Tag: rel_imx_4.19.35_1.1.0-somdevices.0~31 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=fbf782b381b4e3189d66aaf12a06591361c15972;p=linux.git ARM: imx: Enable ENET1_TX_CLK during board startup. Signed-off-by: Josep Orga --- diff --git a/arch/arm/mach-imx/mach-imx6ul.c b/arch/arm/mach-imx/mach-imx6ul.c index b59ba27efedb..7f1cbebd5999 100644 --- a/arch/arm/mach-imx/mach-imx6ul.c +++ b/arch/arm/mach-imx/mach-imx6ul.c @@ -22,11 +22,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");