diff mbox series

[4/5] arm: dts: imx287: Provide description for MTIP L2 switch

Message ID 20250325115736.1732721-5-lukma@denx.de (mailing list archive)
State Superseded
Headers show
Series net: mtip: Add support for MTIP imx287 L2 switch driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 68 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2025-03-25--15-00 (tests: 896)

Commit Message

Lukasz Majewski March 25, 2025, 11:57 a.m. UTC
This description is similar to one supprted with the cpsw_new.c
driver.

It has separated ports and PHYs (connected to mdio bus).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---
 arch/arm/boot/dts/nxp/mxs/imx28-xea.dts | 56 +++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

Comments

Andrew Lunn March 25, 2025, 3:14 p.m. UTC | #1
On Tue, Mar 25, 2025 at 12:57:35PM +0100, Lukasz Majewski wrote:
> This description is similar to one supprted with the cpsw_new.c
> driver.
> 
> It has separated ports and PHYs (connected to mdio bus).
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
>  arch/arm/boot/dts/nxp/mxs/imx28-xea.dts | 56 +++++++++++++++++++++++++
>  1 file changed, 56 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts b/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
> index 6c5e6856648a..e645b086574d 100644
> --- a/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
> +++ b/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
> @@ -5,6 +5,7 @@
>   */
>  
>  /dts-v1/;
> +#include<dt-bindings/interrupt-controller/irq.h>
>  #include "imx28-lwe.dtsi"
>  
>  / {
> @@ -18,6 +19,61 @@ &can0 {
>  	status = "okay";
>  };
>  
> +&eth_switch {
> +	compatible = "fsl,imx287-mtip-switch";

The switch is part of the SoC. So i would expect the compatible to be
in the .dtsi file for the SoC.

> +	pinctrl-names = "default";
> +	pinctrl-0 = <&mac0_pins_a>, <&mac1_pins_a>;
> +	phy-supply = <&reg_fec_3v3>;
> +	phy-reset-duration = <25>;
> +	phy-reset-post-delay = <10>;
> +	interrupts = <100>, <101>, <102>;
> +	clocks = <&clks 57>, <&clks 57>, <&clks 64>, <&clks 35>;
> +	clock-names = "ipg", "ahb", "enet_out", "ptp";

Which of these properties are SoC properties? I _guess_ interrupts,
clocks and clock-names. So they should be in the SoC .dtsi file. You
should only add board properties here.

       Andrew
Lukasz Majewski March 25, 2025, 4:16 p.m. UTC | #2
Hi Andrew,

> On Tue, Mar 25, 2025 at 12:57:35PM +0100, Lukasz Majewski wrote:
> > This description is similar to one supprted with the cpsw_new.c
> > driver.
> > 
> > It has separated ports and PHYs (connected to mdio bus).
> > 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >  arch/arm/boot/dts/nxp/mxs/imx28-xea.dts | 56
> > +++++++++++++++++++++++++ 1 file changed, 56 insertions(+)
> > 
> > diff --git a/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
> > b/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts index
> > 6c5e6856648a..e645b086574d 100644 ---
> > a/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts +++
> > b/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts @@ -5,6 +5,7 @@
> >   */
> >  
> >  /dts-v1/;
> > +#include<dt-bindings/interrupt-controller/irq.h>
> >  #include "imx28-lwe.dtsi"
> >  
> >  / {
> > @@ -18,6 +19,61 @@ &can0 {
> >  	status = "okay";
> >  };
> >  
> > +&eth_switch {
> > +	compatible = "fsl,imx287-mtip-switch";  
> 
> The switch is part of the SoC. So i would expect the compatible to be
> in the .dtsi file for the SoC.

Ok.

I'm also wondering if I shall use "fsl," or "nxp," prefix. The former
one is the same as in fec_main.c, but as I do add new driver, the
prefix could be updated.

> 
> > +	pinctrl-names = "default";
> > +	pinctrl-0 = <&mac0_pins_a>, <&mac1_pins_a>;
> > +	phy-supply = <&reg_fec_3v3>;
> > +	phy-reset-duration = <25>;
> > +	phy-reset-post-delay = <10>;
> > +	interrupts = <100>, <101>, <102>;
> > +	clocks = <&clks 57>, <&clks 57>, <&clks 64>, <&clks 35>;
> > +	clock-names = "ipg", "ahb", "enet_out", "ptp";  
> 
> Which of these properties are SoC properties? I _guess_ interrupts,
> clocks and clock-names. So they should be in the SoC .dtsi file. You
> should only add board properties here.

Ok. I will add them.

> 
>        Andrew

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts b/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
index 6c5e6856648a..e645b086574d 100644
--- a/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
+++ b/arch/arm/boot/dts/nxp/mxs/imx28-xea.dts
@@ -5,6 +5,7 @@ 
  */
 
 /dts-v1/;
+#include<dt-bindings/interrupt-controller/irq.h>
 #include "imx28-lwe.dtsi"
 
 / {
@@ -18,6 +19,61 @@  &can0 {
 	status = "okay";
 };
 
+&eth_switch {
+	compatible = "fsl,imx287-mtip-switch";
+	pinctrl-names = "default";
+	pinctrl-0 = <&mac0_pins_a>, <&mac1_pins_a>;
+	phy-supply = <&reg_fec_3v3>;
+	phy-reset-duration = <25>;
+	phy-reset-post-delay = <10>;
+	interrupts = <100>, <101>, <102>;
+	clocks = <&clks 57>, <&clks 57>, <&clks 64>, <&clks 35>;
+	clock-names = "ipg", "ahb", "enet_out", "ptp";
+	status = "okay";
+
+	ethernet-ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		mtip_port1: port@1 {
+			reg = <1>;
+			label = "lan0";
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			phy-mode = "rmii";
+			phy-handle = <&ethphy0>;
+		};
+
+		mtip_port2: port@2 {
+			reg = <2>;
+			label = "lan1";
+			local-mac-address = [ 00 00 00 00 00 00 ];
+			phy-mode = "rmii";
+			phy-handle = <&ethphy1>;
+		};
+	};
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy0: ethernet-phy@0 {
+			reg = <0>;
+			smsc,disable-energy-detect;
+			/* Both PHYs (i.e. 0,1) have the same, single GPIO, */
+			/* line to handle both, their interrupts (AND'ed) */
+			interrupt-parent = <&gpio4>;
+			interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+		};
+
+		ethphy1: ethernet-phy@1 {
+			reg = <1>;
+			smsc,disable-energy-detect;
+			interrupt-parent = <&gpio4>;
+			interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+		};
+	};
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_pins_b>;