Message ID | 1532029693-22764-1-git-send-email-jacopo@jmondi.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jul 19, 2018 at 09:48:13PM +0200, Jacopo Mondi wrote: > This is just an attempt to set IOMUX_GPR1[21] bit... > > Not-Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > --- > Hello imx people (recipients list comes from get_maintainer script) > > I'm very new to this platform, so pardon me if I'm asking a question here, > more than sending an actual patch. > > Context: I have a board that needs bit 21 of register IOMUX_GPR1 set. > This basically tells the SoC to use an internally generated clock as clock > reference for the external PHY chip. I think this has been handled as the default setup by function imx6q_1588_init() in arch/arm/mach-imx/mach-imx6q.c. Basically, it checks 'ptp' clock setting in FEC node. If it's the internal clock 'enet_ref', the function will set IOMUX_GPR1[21] bit. For those board designs using external OSC, they should overwrite the FEC node clocks setting in their board level DTS to get 'ptp' clock point to the external OSC. The imx6qdl-icore.dtsi is such an example. Shawn
Hi Shawn, thanks for the reply. On Fri, Jul 20, 2018 at 11:12:50AM +0800, Shawn Guo wrote: > On Thu, Jul 19, 2018 at 09:48:13PM +0200, Jacopo Mondi wrote: > > This is just an attempt to set IOMUX_GPR1[21] bit... > > > > Not-Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> > > > > --- > > Hello imx people (recipients list comes from get_maintainer script) > > > > I'm very new to this platform, so pardon me if I'm asking a question here, > > more than sending an actual patch. > > > > Context: I have a board that needs bit 21 of register IOMUX_GPR1 set. > > This basically tells the SoC to use an internally generated clock as clock > > reference for the external PHY chip. > > I think this has been handled as the default setup by function > imx6q_1588_init() in arch/arm/mach-imx/mach-imx6q.c. Basically, it > checks 'ptp' clock setting in FEC node. If it's the internal clock > 'enet_ref', the function will set IOMUX_GPR1[21] bit. For those board > designs using external OSC, they should overwrite the FEC node clocks > setting in their board level DTS to get 'ptp' clock point to the > external OSC. The imx6qdl-icore.dtsi is such an example. Indeed! I went to far with all that muxing then :) I now have the PHY correctly identified, by providing CLK_ENET_REF as ptp clock source: SMSC LAN8710/LAN8720 2188000.ethernet-1:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL) It still seems not to transmit or receive packets, but that's indeed a step forward! Thanks j > > Shawn
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi index 70483ce..4dd4d42 100644 --- a/arch/arm/boot/dts/imx6q.dtsi +++ b/arch/arm/boot/dts/imx6q.dtsi @@ -317,6 +317,11 @@ }; }; }; + + enet_clk_mux { + compatible = "enet-mux"; + mux-controls = <&mux 7>; + }; }; &hdmi { @@ -452,7 +457,8 @@ <0x0c 0x000000c0>, /* LVDS0_MUX_CTL */ <0x0c 0x00000300>, /* LVDS1_MUX_CTL */ <0x28 0x00000003>, /* DCIC1_MUX_CTL */ - <0x28 0x0000000c>; /* DCIC2_MUX_CTL */ + <0x28 0x0000000c>, /* DCIC2_MUX_CTL */ + <0x04 0x00200000>; /* ENET_CLK_SEL */ }; &vpu {