Devicetree
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes
@ 2026-10-26 18:21 Laurentiu Mihalcea
  2026-10-26 18:44 ` sashiko-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Laurentiu Mihalcea @ 2026-10-26 18:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Frank Li,
	Sascha Hauer, Fabio Estevam, elena.popa, cosmin.stoica
  Cc: Pengutronix Kernel Team, devicetree, imx, linux-arm-kernel,
	linux-kernel

From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Add and enable the DT nodes for USB1 and USB2.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx95-navq.dts | 121 +++++++++++++++++++
 1 file changed, 121 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx95-navq.dts b/arch/arm64/boot/dts/freescale/imx95-navq.dts
index 7860c113e9e0..5fe245b62306 100644
--- a/arch/arm64/boot/dts/freescale/imx95-navq.dts
+++ b/arch/arm64/boot/dts/freescale/imx95-navq.dts
@@ -5,6 +5,8 @@
 
 /dts-v1/;
 
+#include <dt-bindings/usb/pd.h>
+
 #include "imx95.dtsi"
 
 / {
@@ -80,6 +82,72 @@ i2c3_gpio_expander_21: gpio-expander@21 {
 		pinctrl-0 = <&pinctrl_i2c3_gpio_expander_21>;
 		pinctrl-names = "default";
 	};
+
+	ptn5110_usb3: tcpc@50 {
+		compatible = "nxp,ptn5110", "tcpci";
+		reg = <0x50>;
+		interrupt-parent = <&gpio4>;
+		/* USB_PTN5110_ALERT_B - shared IRQ line with tcpc@51 */
+		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&pinctrl_typec>;
+		pinctrl-names = "default";
+
+		/* no SINK circuit (EN_SINK1 tied to TP32) */
+		connector {
+			compatible = "usb-c-connector";
+			label = "USB1 3.0 Type C";
+			data-role = "dual";
+			power-role = "source";
+			self-powered;
+			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					typec1_con_hs: endpoint {
+						remote-endpoint = <&usb3_data_hs>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					typec1_con_ss: endpoint {
+						remote-endpoint = <&usb3_data_ss>;
+					};
+				};
+			};
+		};
+	};
+
+	ptn5110_usb2: tcpc@51 {
+		compatible = "nxp,ptn5110", "tcpci";
+		reg = <0x51>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-0 = <&pinctrl_typec>;
+		pinctrl-names = "default";
+
+		/* no SINK circuit (EN_SINK1 tied to TP30) */
+		connector {
+			compatible = "usb-c-connector";
+			label = "USB2 2.0 Type C";
+			data-role = "dual";
+			power-role = "source";
+			self-powered;
+			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
+
+			port {
+				typec2_con_hs: endpoint {
+					remote-endpoint = <&usb2_data_hs>;
+				};
+			};
+		};
+	};
 };
 
 &lpuart1 {
@@ -145,6 +213,10 @@ pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp {
 		fsl,pins = <IMX95_PAD_SD2_RESET_B__GPIO3_IO_BIT7			0x31e>;
 	};
 
+	pinctrl_typec: typecgrp {
+		fsl,pins = <IMX95_PAD_ENET2_RD1__GPIO4_IO_BIT25				0x31e>;
+	};
+
 	pinctrl_uart1: uart1grp {
 		bootph-pre-ram;
 		fsl,pins = <IMX95_PAD_UART1_RXD__AONMIX_TOP_LPUART1_RX			0x31e>,
@@ -198,6 +270,55 @@ pinctrl_usdhc2: usdhc2grp {
 	};
 };
 
+&usb2 {
+	disable-over-current;
+	dr_mode = "host";
+	usb-role-switch;
+
+	status = "okay";
+
+	port {
+		usb2_data_hs: endpoint {
+			remote-endpoint = <&typec2_con_hs>;
+		};
+	};
+};
+
+&usb3_dwc3 {
+	adp-disable;
+	dr_mode = "otg";
+	hnp-disable;
+	srp-disable;
+	usb-role-switch;
+	snps,dis-u1-entry-quirk;
+	snps,dis-u2-entry-quirk;
+
+	status = "okay";
+
+	port {
+		usb3_data_hs: endpoint {
+			remote-endpoint = <&typec1_con_hs>;
+		};
+	};
+};
+
+&usb3_phy {
+	orientation-switch;
+	fsl,phy-pcs-tx-deemph-3p5db-attenuation-db = <17>;
+	fsl,phy-pcs-tx-swing-full-percent = <100>;
+	fsl,phy-tx-preemp-amp-tune-microamp = <600>;
+	fsl,phy-tx-vboost-level-microvolt = <1156>;
+	fsl,phy-tx-vref-tune-percent = <100>;
+
+	status = "okay";
+
+	port {
+		usb3_data_ss: endpoint {
+			remote-endpoint = <&typec1_con_ss>;
+		};
+	};
+};
+
 &usdhc1 {
 	bootph-pre-ram;
 	bus-width = <8>;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes
  2026-10-26 18:21 [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes Laurentiu Mihalcea
@ 2026-10-26 18:44 ` sashiko-bot
  2026-10-26 20:09   ` Frank Li
  0 siblings, 1 reply; 3+ messages in thread
From: sashiko-bot @ 2026-10-26 18:44 UTC (permalink / raw)
  To: Laurentiu Mihalcea; +Cc: devicetree, imx, robh, conor+dt, Frank.Li

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm64: dts: imx95-navq: usb2 dr_mode = host breaks usb-role-switch
--

commit 7aa413a1299c4bee8b5a2613c0acf6256cd30c16
Author: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

arm64: dts: imx95-navq: add USB1/USB2 nodes

This commit adds and enables the device tree nodes for the USB1 and USB2
controllers and their Type-C port controllers on the imx95-navq board.

> diff --git a/arch/arm64/boot/dts/freescale/imx95-navq.dts b/arch/arm64/boot/dts/freescale/imx95-navq.dts
> index 7860c113e9e02..5fe245b623068 100644
> --- a/arch/arm64/boot/dts/freescale/imx95-navq.dts
> +++ b/arch/arm64/boot/dts/freescale/imx95-navq.dts

[ ... ]

> @@ -80,6 +82,72 @@ i2c3_gpio_expander_21: gpio-expander@21 {

[ ... ]

> +	ptn5110_usb2: tcpc@51 {
> +		compatible = "nxp,ptn5110", "tcpci";
> +		reg = <0x51>;
> +		interrupt-parent = <&gpio4>;
> +		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-0 = <&pinctrl_typec>;
> +		pinctrl-names = "default";
> +
> +		/* no SINK circuit (EN_SINK1 tied to TP30) */
> +		connector {
> +			compatible = "usb-c-connector";
> +			label = "USB2 2.0 Type C";
> +			data-role = "dual";
> +			power-role = "source";
> +			self-powered;
> +			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> +
> +			port {
> +				typec2_con_hs: endpoint {
> +					remote-endpoint = <&usb2_data_hs>;
> +				};
> +			};
> +		};
> +	};
>  };

[ ... ]

> @@ -198,6 +270,55 @@ pinctrl_usdhc2: usdhc2grp {
>  	};
>  };
>  
> +&usb2 {
> +	disable-over-current;
> +	dr_mode = "host";
> +	usb-role-switch;
> +
> +	status = "okay";
> +
> +	port {
> +		usb2_data_hs: endpoint {
> +			remote-endpoint = <&typec2_con_hs>;
> +		};
> +	};
> +};

[Severity: Medium]
Should usb2 use dr_mode = "otg" here instead of "host" to match the
usb-role-switch property and the connector's data-role = "dual" in
ptn5110_usb2, or should ptn5110_usb2 use data-role = "host" without
usb-role-switch on usb2?

When dr_mode is set to "host", ci_hdrc_probe() in drivers/usb/chipidea/core.c
skips initializing the gadget role and OTG handling:

	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_PERIPHERAL) {
		ret = ci_hdrc_gadget_init(ci);
		...
	}
	...
	if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) {
		ret = ci_hdrc_otg_init(ci);
		...
	}

Because ci->roles[CI_ROLE_GADGET] remains NULL, ci_get_role() never enables
OTGSC_IDIE:

	if (ci->roles[CI_ROLE_HOST] && ci->roles[CI_ROLE_GADGET]) {
		if (ci->is_otg) {
			role = ci_otg_role(ci);
			hw_write_otgsc(ci, OTGSC_IDIE, OTGSC_IDIE);
		} else {

As a result, id_extcon.enabled and vbus_extcon.enabled remain false. Although
the Type-C port manager configures ptn5110_usb2 for dual-role data and accepts
USB PD data role swaps, calls along usb_role_switch_set_role() ->
ci_usb_role_switch_set() -> ci_irq() -> ci_irq_handler() will have OTGSC_IDIE
and OTGSC_BSVIE masked out by hw_read_otgsc(), leaving role switching
non-functional and the controller permanently in host mode.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261026182150.11330-1-laurentiumihalcea111@gmail.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes
  2026-10-26 18:44 ` sashiko-bot
@ 2026-10-26 20:09   ` Frank Li
  0 siblings, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-10-26 20:09 UTC (permalink / raw)
  To: sashiko-reviews
  Cc: Laurentiu Mihalcea, devicetree, imx, robh, conor+dt, Frank.Li

On Mon, Oct 26, 2026 at 06:44:28PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] arm64: dts: imx95-navq: usb2 dr_mode = host breaks usb-role-switch
> --
>
> commit 7aa413a1299c4bee8b5a2613c0acf6256cd30c16
> Author: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
> arm64: dts: imx95-navq: add USB1/USB2 nodes
>
> This commit adds and enables the device tree nodes for the USB1 and USB2
> controllers and their Type-C port controllers on the imx95-navq board.
>
> > diff --git a/arch/arm64/boot/dts/freescale/imx95-navq.dts b/arch/arm64/boot/dts/freescale/imx95-navq.dts
> > index 7860c113e9e02..5fe245b623068 100644
> > --- a/arch/arm64/boot/dts/freescale/imx95-navq.dts
> > +++ b/arch/arm64/boot/dts/freescale/imx95-navq.dts
>
> [ ... ]
>
> > @@ -80,6 +82,72 @@ i2c3_gpio_expander_21: gpio-expander@21 {
>
> [ ... ]
>
> > +	ptn5110_usb2: tcpc@51 {
> > +		compatible = "nxp,ptn5110", "tcpci";
> > +		reg = <0x51>;
> > +		interrupt-parent = <&gpio4>;
> > +		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> > +		pinctrl-0 = <&pinctrl_typec>;
> > +		pinctrl-names = "default";
> > +
> > +		/* no SINK circuit (EN_SINK1 tied to TP30) */
> > +		connector {
> > +			compatible = "usb-c-connector";
> > +			label = "USB2 2.0 Type C";
> > +			data-role = "dual";
> > +			power-role = "source";
> > +			self-powered;
> > +			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> > +
> > +			port {
> > +				typec2_con_hs: endpoint {
> > +					remote-endpoint = <&usb2_data_hs>;
> > +				};
> > +			};
> > +		};
> > +	};
> >  };
>
> [ ... ]
>
> > @@ -198,6 +270,55 @@ pinctrl_usdhc2: usdhc2grp {
> >  	};
> >  };
> >
> > +&usb2 {
> > +	disable-over-current;
> > +	dr_mode = "host";
> > +	usb-role-switch;
> > +
> > +	status = "okay";
> > +
> > +	port {
> > +		usb2_data_hs: endpoint {
> > +			remote-endpoint = <&typec2_con_hs>;
> > +		};
> > +	};
> > +};
>
> [Severity: Medium]
> Should usb2 use dr_mode = "otg" here instead of "host" to match the
> usb-role-switch property and the connector's data-role = "dual" in
> ptn5110_usb2, or should ptn5110_usb2 use data-role = "host" without
> usb-role-switch on usb2?

if use type C port, suppose it should be dual role device.

Frank

>
> When dr_mode is set to "host", ci_hdrc_probe() in drivers/usb/chipidea/core.c
> skips initializing the gadget role and OTG handling:
>
> 	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_PERIPHERAL) {
> 		ret = ci_hdrc_gadget_init(ci);
> 		...
> 	}
> 	...
> 	if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) {
> 		ret = ci_hdrc_otg_init(ci);
> 		...
> 	}
>
> Because ci->roles[CI_ROLE_GADGET] remains NULL, ci_get_role() never enables
> OTGSC_IDIE:
>
> 	if (ci->roles[CI_ROLE_HOST] && ci->roles[CI_ROLE_GADGET]) {
> 		if (ci->is_otg) {
> 			role = ci_otg_role(ci);
> 			hw_write_otgsc(ci, OTGSC_IDIE, OTGSC_IDIE);
> 		} else {
>
> As a result, id_extcon.enabled and vbus_extcon.enabled remain false. Although
> the Type-C port manager configures ptn5110_usb2 for dual-role data and accepts
> USB PD data role swaps, calls along usb_role_switch_set_role() ->
> ci_usb_role_switch_set() -> ci_irq() -> ci_irq_handler() will have OTGSC_IDIE
> and OTGSC_BSVIE masked out by hw_read_otgsc(), leaving role switching
> non-functional and the controller permanently in host mode.
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20261026182150.11330-1-laurentiumihalcea111@gmail.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-26 20:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-26 18:21 [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes Laurentiu Mihalcea
2026-10-26 18:44 ` sashiko-bot
2026-10-26 20:09   ` Frank Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox