diff mbox series

[V2,3/3] arm64: dts: imx8ulp-evk: Add the fec support

Message ID 20220711094434.369377-4-wei.fang@nxp.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Add the fec node on i.MX8ULP platform | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Wei Fang July 11, 2022, 9:44 a.m. UTC
Enable the fec on i.MX8ULP EVK board.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
V2 change:
Add clock_ext_rmii and clock_ext_ts. They are both related to EVK board.
---
 arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)

Comments

Andrew Lunn July 11, 2022, 7:02 a.m. UTC | #1
On Mon, Jul 11, 2022 at 07:44:34PM +1000, Wei Fang wrote:
> Enable the fec on i.MX8ULP EVK board.
> 
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> V2 change:
> Add clock_ext_rmii and clock_ext_ts. They are both related to EVK board.
> ---
>  arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 57 +++++++++++++++++++
>  1 file changed, 57 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> index 33e84c4e9ed8..ebce716b10e6 100644
> --- a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> @@ -19,6 +19,21 @@ memory@80000000 {
>  		device_type = "memory";
>  		reg = <0x0 0x80000000 0 0x80000000>;
>  	};
> +
> +	clock_ext_rmii: clock-ext-rmii {
> +		compatible = "fixed-clock";
> +		clock-frequency = <50000000>;
> +		clock-output-names = "ext_rmii_clk";
> +		#clock-cells = <0>;
> +	};
> +
> +	clock_ext_ts: clock-ext-ts {
> +		compatible = "fixed-clock";
> +		/* External ts clock is 50MHZ from PHY on EVK board. */
> +		clock-frequency = <50000000>;
> +		clock-output-names = "ext_ts_clk";
> +		#clock-cells = <0>;
> +	};

Do you need any PHY properties to turn this clock on? Or is it
strapped to be always on?

I'm surprised it is limited to Fast Ethernet. I know the Vybrid and
some of the older SoCs are Fast Ethernet only, but i thought all the
newer supported 1G?

	 Andrew
Wei Fang July 11, 2022, 8:01 a.m. UTC | #2
> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: 2022年7月11日 15:02
> To: Wei Fang <wei.fang@nxp.com>
> Cc: davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org;
> shawnguo@kernel.org; s.hauer@pengutronix.de; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> kernel@pengutronix.de; festevam@gmail.com; dl-linux-imx
> <linux-imx@nxp.com>; Peng Fan <peng.fan@nxp.com>; Jacky Bai
> <ping.bai@nxp.com>; sudeep.holla@arm.com;
> linux-arm-kernel@lists.infradead.org; Aisheng Dong <aisheng.dong@nxp.com>
> Subject: [EXT] Re: [PATCH V2 3/3] arm64: dts: imx8ulp-evk: Add the fec
> support
> 
> Caution: EXT Email
> 
> On Mon, Jul 11, 2022 at 07:44:34PM +1000, Wei Fang wrote:
> > Enable the fec on i.MX8ULP EVK board.
> >
> > Signed-off-by: Wei Fang <wei.fang@nxp.com>
> > ---
> > V2 change:
> > Add clock_ext_rmii and clock_ext_ts. They are both related to EVK board.
> > ---
> >  arch/arm64/boot/dts/freescale/imx8ulp-evk.dts | 57
> > +++++++++++++++++++
> >  1 file changed, 57 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> > b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> > index 33e84c4e9ed8..ebce716b10e6 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> > +++ b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
> > @@ -19,6 +19,21 @@ memory@80000000 {
> >               device_type = "memory";
> >               reg = <0x0 0x80000000 0 0x80000000>;
> >       };
> > +
> > +     clock_ext_rmii: clock-ext-rmii {
> > +             compatible = "fixed-clock";
> > +             clock-frequency = <50000000>;
> > +             clock-output-names = "ext_rmii_clk";
> > +             #clock-cells = <0>;
> > +     };
> > +
> > +     clock_ext_ts: clock-ext-ts {
> > +             compatible = "fixed-clock";
> > +             /* External ts clock is 50MHZ from PHY on EVK board. */
> > +             clock-frequency = <50000000>;
> > +             clock-output-names = "ext_ts_clk";
> > +             #clock-cells = <0>;
> > +     };
> 
> Do you need any PHY properties to turn this clock on? Or is it strapped to be
> always on?
> 
Yes, the clock is strapped to be always on, so any PHY property is not required.

> I'm surprised it is limited to Fast Ethernet. I know the Vybrid and some of the
> older SoCs are Fast Ethernet only, but i thought all the newer supported 1G?
> 
>          Andrew

The FEC of imx8ulp is reused from imx6ul , it supports 10/100 Mbit/s full-duplex and configurable half-duplex operation, do not support 1G.
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
index 33e84c4e9ed8..ebce716b10e6 100644
--- a/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8ulp-evk.dts
@@ -19,6 +19,21 @@  memory@80000000 {
 		device_type = "memory";
 		reg = <0x0 0x80000000 0 0x80000000>;
 	};
+
+	clock_ext_rmii: clock-ext-rmii {
+		compatible = "fixed-clock";
+		clock-frequency = <50000000>;
+		clock-output-names = "ext_rmii_clk";
+		#clock-cells = <0>;
+	};
+
+	clock_ext_ts: clock-ext-ts {
+		compatible = "fixed-clock";
+		/* External ts clock is 50MHZ from PHY on EVK board. */
+		clock-frequency = <50000000>;
+		clock-output-names = "ext_ts_clk";
+		#clock-cells = <0>;
+	};
 };
 
 &lpuart5 {
@@ -38,7 +53,49 @@  &usdhc0 {
 	status = "okay";
 };
 
+&fec {
+	pinctrl-names = "default", "sleep";
+	pinctrl-0 = <&pinctrl_enet>;
+	pinctrl-1 = <&pinctrl_enet>;
+	clocks = <&cgc1 IMX8ULP_CLK_XBAR_DIVBUS>,
+		 <&pcc4 IMX8ULP_CLK_ENET>,
+		 <&cgc1 IMX8ULP_CLK_ENET_TS_SEL>,
+		 <&clock_ext_rmii>;
+	clock-names = "ipg", "ahb", "ptp", "enet_clk_ref";
+	assigned-clocks = <&cgc1 IMX8ULP_CLK_ENET_TS_SEL>;
+	assigned-clock-parents = <&clock_ext_ts>;
+	phy-mode = "rmii";
+	phy-handle = <&ethphy>;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy: ethernet-phy {
+			reg = <1>;
+			micrel,led-mode = <1>;
+		};
+	};
+};
+
 &iomuxc1 {
+	pinctrl_enet: enetgrp {
+		fsl,pins = <
+			MX8ULP_PAD_PTE15__ENET0_MDC     0x43
+			MX8ULP_PAD_PTE14__ENET0_MDIO    0x43
+			MX8ULP_PAD_PTE17__ENET0_RXER    0x43
+			MX8ULP_PAD_PTE18__ENET0_CRS_DV  0x43
+			MX8ULP_PAD_PTF1__ENET0_RXD0     0x43
+			MX8ULP_PAD_PTE20__ENET0_RXD1    0x43
+			MX8ULP_PAD_PTE16__ENET0_TXEN    0x43
+			MX8ULP_PAD_PTE23__ENET0_TXD0    0x43
+			MX8ULP_PAD_PTE22__ENET0_TXD1    0x43
+			MX8ULP_PAD_PTE19__ENET0_REFCLK  0x43
+			MX8ULP_PAD_PTF10__ENET0_1588_CLKIN 0x43
+		>;
+	};
+
 	pinctrl_lpuart5: lpuart5grp {
 		fsl,pins = <
 			MX8ULP_PAD_PTF14__LPUART5_TX	0x3