For our design, we use an external clock source for the RMII interface. So I have to configure GPR1[21] bit to zero to pick the external clock as a clock source. This works by changing mach-imx6q.c:
* If enet_ref from ANATOP/CCM is the PTP clock source, we need to
* set bit IOMUXC_GPR1[21]. Or the PTP clock must be from pad
* (external OSC), and we need to clear the bit.
*/
gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
if (!IS_ERR(gpr))
regmap_update_bits(gpr, IOMUXC_GPR1,
IMX6Q_GPR1_ENET_CLK_SEL_MASK,
0 /*IMX6Q_GPR1_ENET_CLK_SEL_ANATOP*/);
But if possible, I prefer not to patch the kernel itself by something like that...
Is there another possibility to do this via devicetree?
I already found patch [PATCH] ARM: imx6q: support ptp and rmii clock from pad
However, that's already rather old, and already mostly in the kernel. (I wonder why not completely)
Anybody knows?
Hi Wouter
on nxp bsps described on below link seems there is no device tree GPR1[21] settings.
i.MX 6 / i.MX 7 Series Software and Development Tool|NXP
Description of fec driver (drivers/net/ethernet/freescale/fec_main.c)
can be found in Chapter 43 Fast Ethernet Controller (FEC) Driver attached Linux Manual.
Documentation/devicetree/bindings/..fsl-fec.txt
linux-imx.git - i.MX Linux Kernel
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------