Devicetree
 help / color / mirror / Atom feed
From: Icenowy Zheng <zhengxingda@iscas.ac.cn>
To: Drew Fustini <fustini@kernel.org>, Guo Ren <guoren@kernel.org>,
	Fu Wei	 <wefu@redhat.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd	 <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski	 <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Vinod Koul	 <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	Jisheng Zhang <jszhang@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org,  linux-kernel@vger.kernel.org,
	linux-gpio@vger.kernel.org,  linux-phy@lists.infradead.org,
	linux-usb@vger.kernel.org, Han Gao	 <rabenda.cn@gmail.com>,
	Yao Zi <ziyao@disroot.org>
Subject: Re: [PATCH 12/12] riscv: dts: thead: enable USB3 ports on Lichee Pi 4A
Date: Wed, 02 Sep 2026 02:32:28 +0800	[thread overview]
Message-ID: <51a0c0657870a424f6bc9e149542a57ff6fb3ecd.camel@iscas.ac.cn> (raw)
In-Reply-To: <20260507081710.4090814-13-zhengxingda@iscas.ac.cn>

在 2026-05-07四的 16:17 +0800,Icenowy Zheng写道:
> The Lichee Pi 4A board features an onboard VIA VL817 hub connected to
> the SoC's USB3 as upstream and 4 USB-3.0-capable Type-A ports as
> downstream.
> 
> Enable SoC USB3 and the hub on Lichee Pi 4A.
> 
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> ---
>  .../dts/thead/th1520-lichee-module-4a.dtsi    |  15 ++
>  .../boot/dts/thead/th1520-lichee-pi-4a.dts    | 231
> ++++++++++++++++++
>  2 files changed, 246 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
> b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
> index 8e76b63e0100a..bfda5a6b56b8f 100644
> --- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
> +++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
> @@ -20,6 +20,16 @@ memory@0 {
>  		device_type = "memory";
>  		reg = <0x0 0x00000000 0x2 0x00000000>;
>  	};
> +
> +	/* TODO: Switch to AON regulator when it's available. */
> +	avdd33_usb3: regulator-avdd33-usb3 {
> +		compatible = "regulator-fixed";
> +		regulator-name = "AVDD33_USB3";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		/* Marked as always on on the schematics */
> +		regulator-always-on;
> +	};
>  };
>  
>  &osc {
> @@ -202,3 +212,8 @@ &sdio0 {
>  	max-frequency = <198000000>;
>  	status = "okay";
>  };
> +
> +&usb_phy {
> +	avdd33-usb3-supply = <&avdd33_usb3>;
> +	status = "okay";
> +};
> diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> index 354f3893aa8cf..de38f1f457e6b 100644
> --- a/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> +++ b/arch/riscv/boot/dts/thead/th1520-lichee-pi-4a.dts
> @@ -4,6 +4,7 @@
>   */
>  
>  #include "th1520-lichee-module-4a.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
>  
>  / {
>  	model = "Sipeed Lichee Pi 4A";
> @@ -97,6 +98,141 @@ fan: pwm-fan {
>  		cooling-levels = <0 66 196 255>;
>  	};
>  
> +	hub_5v: regulator-hub-5v {
> +		compatible = "regulator-fixed";
> +		regulator-name = "HUB_5V";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&ioexp3 3 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
> +	vcc5v_usb: regulator-vcc5v-usb {
> +		compatible = "regulator-fixed";
> +		regulator-name = "VCC5V_USB";
> +		regulator-min-microvolt = <5000000>;
> +		regulator-max-microvolt = <5000000>;
> +		gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		/*
> +		 * Workaround for Linux currently being not able to
> power on
> +		 * Vbus for USB Type-A connectors.
> +		 */
> +		regulator-always-on;

OHHHHH onboard_usb_dev now matches "usb-a-connector" and is able to
power on the vbus-supply regulator.

This hack should be removable now.

Thanks,
Icenowy

> +	};
> +
> +	connector-usb-a-1 {
> +		compatible = "usb-a-connector";
> +		vbus-supply = <&vcc5v_usb>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				usb_a_1_hs_ep: endpoint {
> +					remote-endpoint =
> <&hub_hs_port1_ep>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				usb_a_1_ss_ep: endpoint {
> +					remote-endpoint =
> <&hub_ss_port1_ep>;
> +				};
> +			};
> +		};
> +	};
> +
> +	connector-usb-a-2 {
> +		compatible = "usb-a-connector";
> +		vbus-supply = <&vcc5v_usb>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				usb_a_2_hs_ep: endpoint {
> +					remote-endpoint =
> <&hub_hs_port2_ep>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				usb_a_2_ss_ep: endpoint {
> +					remote-endpoint =
> <&hub_ss_port2_ep>;
> +				};
> +			};
> +		};
> +	};
> +
> +	connector-usb-a-3 {
> +		compatible = "usb-a-connector";
> +		vbus-supply = <&vcc5v_usb>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				usb_a_3_hs_ep: endpoint {
> +					remote-endpoint =
> <&hub_hs_port3_ep>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				usb_a_3_ss_ep: endpoint {
> +					remote-endpoint =
> <&hub_ss_port3_ep>;
> +				};
> +			};
> +		};
> +	};
> +
> +	connector-usb-a-4 {
> +		compatible = "usb-a-connector";
> +		vbus-supply = <&vcc5v_usb>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@0 {
> +				reg = <0>;
> +
> +				usb_a_4_hs_ep: endpoint {
> +					remote-endpoint =
> <&hub_hs_port4_ep>;
> +				};
> +			};
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				usb_a_4_ss_ep: endpoint {
> +					remote-endpoint =
> <&hub_ss_port4_ep>;
> +				};
> +			};
> +		};
> +	};
> +};
> +
> +&aogpio {
> +	/* Route USB2 to the onboard hub for normal operation */
> +	sel-usb-hub-hog {
> +		gpio-hog;
> +		gpios = <4 GPIO_ACTIVE_HIGH>;
> +		output-high;
> +	};
>  };
>  
>  &dpu {
> @@ -262,3 +398,98 @@ &uart0 {
>  	pinctrl-0 = <&uart0_pins>;
>  	status = "okay";
>  };
> +
> +&usb {
> +	dr_mode = "host";
> +	#address-cells = <1>;
> +	#size-cells = <0>;
> +	status = "okay";
> +
> +	hub_hs: hub@1 {
> +		compatible = "usb2109,2817";
> +		reg = <1>;
> +		peer-hub = <&hub_ss>;
> +		vdd-supply = <&hub_5v>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				hub_hs_port1_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_1_hs_ep>;
> +				};
> +			};
> +
> +			port@2 {
> +				reg = <2>;
> +
> +				hub_hs_port2_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_2_hs_ep>;
> +				};
> +			};
> +
> +			port@3 {
> +				reg = <3>;
> +
> +				hub_hs_port3_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_3_hs_ep>;
> +				};
> +			};
> +
> +			port@4 {
> +				reg = <4>;
> +
> +				hub_hs_port4_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_4_hs_ep>;
> +				};
> +			};
> +		};
> +	};
> +
> +	hub_ss: hub@2 {
> +		compatible = "usb2109,817";
> +		reg = <2>;
> +		peer-hub = <&hub_hs>;
> +		vdd-supply = <&hub_5v>;
> +
> +		ports {
> +			#address-cells = <1>;
> +			#size-cells = <0>;
> +
> +			port@1 {
> +				reg = <1>;
> +
> +				hub_ss_port1_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_1_ss_ep>;
> +				};
> +			};
> +
> +			port@2 {
> +				reg = <2>;
> +
> +				hub_ss_port2_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_2_ss_ep>;
> +				};
> +			};
> +
> +			port@3 {
> +				reg = <3>;
> +
> +				hub_ss_port3_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_3_ss_ep>;
> +				};
> +			};
> +
> +			port@4 {
> +				reg = <4>;
> +
> +				hub_ss_port4_ep: endpoint {
> +					remote-endpoint =
> <&usb_a_4_ss_ep>;
> +				};
> +			};
> +		};
> +	};
> +};


  reply	other threads:[~2026-09-01 18:32 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  8:16 [PATCH 00/12] Add TH1520 USB support Icenowy Zheng
2026-05-07  8:16 ` [PATCH 01/12] dt-bindings: clock: thead: add TH1520 MISC subsys clock controller Icenowy Zheng
2026-05-07 17:26   ` Conor Dooley
2026-06-09  3:26   ` Drew Fustini
2026-05-07  8:17 ` [PATCH 02/12] clk: thead: th1520-ap: add support for MISC subsys clocks Icenowy Zheng
2026-06-09  6:00   ` Drew Fustini
2026-06-09  6:01     ` Icenowy Zheng
2026-06-09  6:15       ` Drew Fustini
2026-06-10  4:33         ` Drew Fustini
2026-08-16 18:12           ` Drew Fustini
2026-08-17  4:24             ` Icenowy Zheng
2026-08-17 23:52               ` Drew Fustini
2026-05-07  8:17 ` [PATCH 03/12] riscv: dts: thead: add device tree node for MISC clock controller Icenowy Zheng
2026-06-09  5:14   ` Drew Fustini
2026-06-09  5:35     ` Icenowy Zheng
2026-06-09  6:16       ` Drew Fustini
2026-08-17 23:49         ` Drew Fustini
2026-05-07  8:17 ` [PATCH 04/12] dt-bindings: phy: add binding for T-Head TH1520 USB PHY Icenowy Zheng
2026-05-07 17:26   ` Conor Dooley
2026-05-07  8:17 ` [PATCH 05/12] phy: add a driver " Icenowy Zheng
2026-05-10  7:44   ` Vinod Koul
2026-05-10  9:17     ` Icenowy Zheng
2026-05-11 16:16       ` Vinod Koul
2026-05-07  8:17 ` [PATCH 06/12] riscv: dts: thead: add device nodes for USB Icenowy Zheng
2026-05-07  8:17 ` [PATCH 07/12] dt-bindings: gpio: dwapb: allow GPIO hogs Icenowy Zheng
2026-05-07 17:25   ` Conor Dooley
2026-05-07  8:17 ` [PATCH 08/12] dt-bindings: usb: vialab,vl817: allow ports property Icenowy Zheng
2026-05-07 17:25   ` Conor Dooley
2026-05-07  8:17 ` [PATCH 09/12] riscv: dts: thead: lpi4a: sort nodes Icenowy Zheng
2026-05-07  8:17 ` [PATCH 10/12] riscv: dts: thead: Add TH1520 I2C nodes Icenowy Zheng
2026-05-07  8:17 ` [PATCH 11/12] riscv: dts: thead: Add Lichee Pi 4A IO expansions Icenowy Zheng
2026-07-10 14:56   ` Icenowy Zheng
2026-07-10 15:55     ` Drew Fustini
2026-05-07  8:17 ` [PATCH 12/12] riscv: dts: thead: enable USB3 ports on Lichee Pi 4A Icenowy Zheng
2026-09-01 18:32   ` Icenowy Zheng [this message]
2026-05-11 10:54 ` (subset) [PATCH 00/12] Add TH1520 USB support Bartosz Golaszewski
2026-06-09  4:17 ` Drew Fustini
2026-06-09  5:10   ` Icenowy Zheng
2026-06-09  6:14     ` Drew Fustini

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=51a0c0657870a424f6bc9e149542a57ff6fb3ecd.camel@iscas.ac.cn \
    --to=zhengxingda@iscas.ac.cn \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=fustini@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=guoren@kernel.org \
    --cc=jszhang@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rabenda.cn@gmail.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=wefu@redhat.com \
    --cc=ziyao@disroot.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox