ARM: imx: Enable ENET1_TX_CLK during board startup.
authorJosep Orga <jorga@somdevices.com>
Sat, 18 Apr 2020 14:44:11 +0000 (16:44 +0200)
committerJosep Orga <jorga@somdevices.com>
Sat, 18 Apr 2020 14:44:11 +0000 (16:44 +0200)
Signed-off-by: Josep Orga <jorga@somdevices.com>
arch/arm/mach-imx/mach-imx6ul.c

index b59ba27..7f1cbeb 100644 (file)
 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");