All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Bisson <gary.bisson@boundarydevices.com>
To: Adrien Grassein <adrien.grassein@gmail.com>
Cc: devicetree@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, linux-kernel@vger.kernel.org,
	troy.kisky@boundarydevices.com, robh+dt@kernel.org,
	linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: dts: imx8mq-nitrogen: add USB support
Date: Thu, 28 Jan 2021 14:30:44 +0100	[thread overview]
Message-ID: <YBK8hAxvjJBuMdl2@p1g2> (raw)
In-Reply-To: <20210126215511.1056600-1-adrien.grassein@gmail.com>

Hi Adrien,

Thanks for improving Nitrogen upstream, much appreciated.

On Tue, Jan 26, 2021 at 10:55:11PM +0100, Adrien Grassein wrote:
> add USB support for imx8mq-nitrogen. It consists
> in 2 phys: OTG and host.
> 
> The OTG port uses a dedicated regulator for vbus.
> 
> Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>  .../boot/dts/freescale/imx8mq-nitrogen.dts    | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts b/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
> index 81d269296610..fb8acd83a280 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
> @@ -34,6 +34,17 @@ power {
>  		};
>  	};
>  
> +	reg_usb_otg_vbus: regulator-usb-otg-vbus {
> +		compatible = "regulator-fixed";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_reg_usbotg_vbus>;
> +		regulator-name = "usb_otg_vbus";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
>  	reg_vref_0v9: regulator-vref-0v9 {
>  		compatible = "regulator-fixed";
>  		regulator-name = "vref-0v9";
> @@ -190,6 +201,25 @@ &uart2 {
>  	status = "okay";
>  };
>  
> +&usb_dwc3_0 {
> +	dr_mode = "otg";
> +	status = "okay";

Please add a pinctrl here to mux GPIO1_IO13 as over current pin.
But I confirm the port is working.

> +};
> +
> +&usb3_phy0 {
> +	vbus-supply = <&reg_usb_otg_vbus>;
> +	status = "okay";
> +};
> +
> +&usb_dwc3_1 {
> +	dr_mode = "host";
> +	status = "okay";
> +};

The Host port doesn't work for me. This is because of the missing reset
signal. Maybe it's time to revive the gpio-reset driver [1]?

Anyway, here is how to fix the USB Host ports:
# gpioset 0 14=1

I guess it'd be best to have a proper reset solution before merging the
host port addition.

Regards,
Gary

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/1374834384-8071-1-git-send-email-p.zabel@pengutronix.de/

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Gary Bisson <gary.bisson@boundarydevices.com>
To: Adrien Grassein <adrien.grassein@gmail.com>
Cc: troy.kisky@boundarydevices.com, robh+dt@kernel.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64: dts: imx8mq-nitrogen: add USB support
Date: Thu, 28 Jan 2021 14:30:44 +0100	[thread overview]
Message-ID: <YBK8hAxvjJBuMdl2@p1g2> (raw)
In-Reply-To: <20210126215511.1056600-1-adrien.grassein@gmail.com>

Hi Adrien,

Thanks for improving Nitrogen upstream, much appreciated.

On Tue, Jan 26, 2021 at 10:55:11PM +0100, Adrien Grassein wrote:
> add USB support for imx8mq-nitrogen. It consists
> in 2 phys: OTG and host.
> 
> The OTG port uses a dedicated regulator for vbus.
> 
> Signed-off-by: Adrien Grassein <adrien.grassein@gmail.com>
> ---
>  .../boot/dts/freescale/imx8mq-nitrogen.dts    | 36 +++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts b/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
> index 81d269296610..fb8acd83a280 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
> @@ -34,6 +34,17 @@ power {
>  		};
>  	};
>  
> +	reg_usb_otg_vbus: regulator-usb-otg-vbus {
> +		compatible = "regulator-fixed";
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pinctrl_reg_usbotg_vbus>;
> +		regulator-name = "usb_otg_vbus";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
>  	reg_vref_0v9: regulator-vref-0v9 {
>  		compatible = "regulator-fixed";
>  		regulator-name = "vref-0v9";
> @@ -190,6 +201,25 @@ &uart2 {
>  	status = "okay";
>  };
>  
> +&usb_dwc3_0 {
> +	dr_mode = "otg";
> +	status = "okay";

Please add a pinctrl here to mux GPIO1_IO13 as over current pin.
But I confirm the port is working.

> +};
> +
> +&usb3_phy0 {
> +	vbus-supply = <&reg_usb_otg_vbus>;
> +	status = "okay";
> +};
> +
> +&usb_dwc3_1 {
> +	dr_mode = "host";
> +	status = "okay";
> +};

The Host port doesn't work for me. This is because of the missing reset
signal. Maybe it's time to revive the gpio-reset driver [1]?

Anyway, here is how to fix the USB Host ports:
# gpioset 0 14=1

I guess it'd be best to have a proper reset solution before merging the
host port addition.

Regards,
Gary

[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/1374834384-8071-1-git-send-email-p.zabel@pengutronix.de/

  reply	other threads:[~2021-01-28 13:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-26 21:55 [PATCH] arm64: dts: imx8mq-nitrogen: add USB support Adrien Grassein
2021-01-26 21:55 ` Adrien Grassein
2021-01-28 13:30 ` Gary Bisson [this message]
2021-01-28 13:30   ` Gary Bisson
2021-01-28 15:42   ` Adrien Grassein
2021-01-28 15:42     ` Adrien Grassein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YBK8hAxvjJBuMdl2@p1g2 \
    --to=gary.bisson@boundarydevices.com \
    --cc=adrien.grassein@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=troy.kisky@boundarydevices.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.