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");