* [PATCH v3 1/3] riscv: dts: spacemit: Enable i2c8 adapter for OrangePi RV2
2026-03-29 17:05 [PATCH v3 0/3] riscv: dts: spacemit: Add PMIC regulators usb pcie Han Gao
@ 2026-03-29 17:05 ` Han Gao
2026-03-29 17:05 ` [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators " Han Gao
2026-03-29 17:05 ` [PATCH v3 3/3] riscv: dts: spacemit: Enable USB3.0/PCIe on " Han Gao
2 siblings, 0 replies; 7+ messages in thread
From: Han Gao @ 2026-03-29 17:05 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Han Gao, Han Gao
The adapter is used to access the SpacemiT P1 PMIC present in this board.
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
---
arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 7b7331cb3c72..93880ba7bdfe 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -87,6 +87,12 @@ &pdma {
status = "okay";
};
+&i2c8 {
+ pinctrl-0 = <&i2c8_cfg>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_2_cfg>;
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators for OrangePi RV2
2026-03-29 17:05 [PATCH v3 0/3] riscv: dts: spacemit: Add PMIC regulators usb pcie Han Gao
2026-03-29 17:05 ` [PATCH v3 1/3] riscv: dts: spacemit: Enable i2c8 adapter for OrangePi RV2 Han Gao
@ 2026-03-29 17:05 ` Han Gao
2026-03-30 0:31 ` Yixun Lan
2026-03-30 6:50 ` Chukun Pan
2026-03-29 17:05 ` [PATCH v3 3/3] riscv: dts: spacemit: Enable USB3.0/PCIe on " Han Gao
2 siblings, 2 replies; 7+ messages in thread
From: Han Gao @ 2026-03-29 17:05 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Han Gao, Han Gao
Define the DC power input and the 4v power as fixed regulator supplies.
Define the SpacemiT P1 PMIC voltage regulators and their constraints.
The power management hardware design on the OrangePi RV2 is identical to
the Banana Pi BPI-F3, so the DT Nodes were taken from k1-bananapi-f3.dts.
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
---
.../boot/dts/spacemit/k1-orangepi-rv2.dts | 137 ++++++++++++++++++
1 file changed, 137 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 93880ba7bdfe..1b1b27bc95d8 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -23,6 +23,25 @@ chosen {
stdout-path = "serial0";
};
+ reg_dc_in: regulator-vcc-in-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "dc_in_5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_vcc_4v: regulator-vcc-4v {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc_4v";
+ regulator-min-microvolt = <4000000>;
+ regulator-max-microvolt = <4000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ vin-supply = <®_dc_in>;
+ };
+
leds {
compatible = "gpio-leds";
@@ -91,6 +110,124 @@ &i2c8 {
pinctrl-0 = <&i2c8_cfg>;
pinctrl-names = "default";
status = "okay";
+
+ pmic@41 {
+ compatible = "spacemit,p1";
+ reg = <0x41>;
+ interrupts = <64>;
+ vin1-supply = <®_vcc_4v>;
+ vin2-supply = <®_vcc_4v>;
+ vin3-supply = <®_vcc_4v>;
+ vin4-supply = <®_vcc_4v>;
+ vin5-supply = <®_vcc_4v>;
+ vin6-supply = <®_vcc_4v>;
+ aldoin-supply = <®_vcc_4v>;
+ dldoin1-supply = <&buck5>;
+ dldoin2-supply = <&buck5>;
+
+ regulators {
+ buck1 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3450000>;
+ regulator-ramp-delay = <5000>;
+ regulator-always-on;
+ };
+
+ buck2 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3450000>;
+ regulator-ramp-delay = <5000>;
+ regulator-always-on;
+ };
+
+ buck3_1v8: buck3 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-ramp-delay = <5000>;
+ regulator-always-on;
+ };
+
+ buck4 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-ramp-delay = <5000>;
+ regulator-always-on;
+ };
+
+ buck5: buck5 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3450000>;
+ regulator-ramp-delay = <5000>;
+ regulator-always-on;
+ };
+
+ buck6 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3450000>;
+ regulator-ramp-delay = <5000>;
+ regulator-always-on;
+ };
+
+ aldo1 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-boot-on;
+ };
+
+ aldo2 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+
+ aldo3 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+
+ aldo4 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+
+ dldo1 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-boot-on;
+ };
+
+ dldo2 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+
+ dldo3 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+
+ dldo4 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-always-on;
+ };
+
+ dldo5 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+
+ dldo6 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-always-on;
+ };
+
+ dldo7 {
+ regulator-min-microvolt = <500000>;
+ regulator-max-microvolt = <3400000>;
+ };
+ };
+ };
};
&uart0 {
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators for OrangePi RV2
2026-03-29 17:05 ` [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators " Han Gao
@ 2026-03-30 0:31 ` Yixun Lan
2026-03-30 6:50 ` Chukun Pan
1 sibling, 0 replies; 7+ messages in thread
From: Yixun Lan @ 2026-03-30 0:31 UTC (permalink / raw)
To: Han Gao
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, devicetree,
linux-riscv, spacemit, linux-kernel, Han Gao
Hi Han,
On 01:05 Mon 30 Mar , Han Gao wrote:
> Define the DC power input and the 4v power as fixed regulator supplies.
>
> Define the SpacemiT P1 PMIC voltage regulators and their constraints.
>
..
> The power management hardware design on the OrangePi RV2 is identical to
> the Banana Pi BPI-F3, so the DT Nodes were taken from k1-bananapi-f3.dts.
I'd suggest to drop above comment, it's vague and even not a direct reason..
>
> Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
> ---
> .../boot/dts/spacemit/k1-orangepi-rv2.dts | 137 ++++++++++++++++++
> 1 file changed, 137 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> index 93880ba7bdfe..1b1b27bc95d8 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> @@ -23,6 +23,25 @@ chosen {
> stdout-path = "serial0";
> };
>
..
> + reg_dc_in: regulator-vcc-in-5v {
> + compatible = "regulator-fixed";
> + regulator-name = "dc_in_5v";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + regulator-boot-on;
> + regulator-always-on;
> + };
This regulator can be dropped, it's not used by *device*, take a look at Krzysztof's comment
https://lore.kernel.org/all/6530526f-59ca-4753-a068-46c62a1a1fed@kernel.org
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators for OrangePi RV2
2026-03-29 17:05 ` [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators " Han Gao
2026-03-30 0:31 ` Yixun Lan
@ 2026-03-30 6:50 ` Chukun Pan
1 sibling, 0 replies; 7+ messages in thread
From: Chukun Pan @ 2026-03-30 6:50 UTC (permalink / raw)
To: gaohan
Cc: alex, aou, conor+dt, devicetree, dlan, krzk+dt, linux-kernel,
linux-riscv, palmer, pjw, rabenda.cn, robh, spacemit, Chukun Pan
Hi,
> The power management hardware design on the OrangePi RV2 is identical to
> the Banana Pi BPI-F3, so the DT Nodes were taken from k1-bananapi-f3.dts.
Why? If you've looked at the schematics, you'll find there are differences.
e.g. The regulator name and the PMIC have several pins left floating:
aldo2, aldo3, aldo4, dldo2, dldo3, dldo7.
> + reg_dc_in: regulator-vcc-in-5v {
> + compatible = "regulator-fixed";
> + regulator-name = "dc_in_5v";
vcc_5v0
> + reg_vcc_4v: regulator-vcc-4v {
> + compatible = "regulator-fixed";
> + regulator-name = "vcc_4v";
vcc4v0
Thanks,
Chukun
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 3/3] riscv: dts: spacemit: Enable USB3.0/PCIe on OrangePi RV2
2026-03-29 17:05 [PATCH v3 0/3] riscv: dts: spacemit: Add PMIC regulators usb pcie Han Gao
2026-03-29 17:05 ` [PATCH v3 1/3] riscv: dts: spacemit: Enable i2c8 adapter for OrangePi RV2 Han Gao
2026-03-29 17:05 ` [PATCH v3 2/3] riscv: dts: spacemit: Define the P1 PMIC regulators " Han Gao
@ 2026-03-29 17:05 ` Han Gao
2026-03-30 7:00 ` Chukun Pan
2 siblings, 1 reply; 7+ messages in thread
From: Han Gao @ 2026-03-29 17:05 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
Cc: devicetree, linux-riscv, spacemit, linux-kernel, Han Gao, Han Gao
Enable the DWC3 USB 3.0 controller and its associated usbphy2 on the
OrangePi RV2 board.
The board utilizes a Genesys Logic GL3523 hub, which requires one
separate power supplies for hub itself.
Define a 3.3v fixed voltage regulator to be used by PCIe on OPi RV2.
Define PCIe and PHY-related Device Tree nodes for the OPi RV2.
Signed-off-by: Han Gao <gaohan@iscas.ac.cn>
---
.../boot/dts/spacemit/k1-orangepi-rv2.dts | 79 +++++++++++++++++++
1 file changed, 79 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
index 1b1b27bc95d8..a53cd2e037ef 100644
--- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
@@ -23,6 +23,15 @@ chosen {
stdout-path = "serial0";
};
+ pcie_vcc_3v3: regulator-pcie-vcc3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "PCIE_VCC3V3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio K1_GPIO(116) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
reg_dc_in: regulator-vcc-in-5v {
compatible = "regulator-fixed";
regulator-name = "dc_in_5v";
@@ -42,6 +51,15 @@ reg_vcc_4v: regulator-vcc-4v {
vin-supply = <®_dc_in>;
};
+ usb3_hub_5v: regulator-usb3-hub-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "USB_HUB_EN";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ gpio = <&gpio K1_GPIO(123) GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
leds {
compatible = "gpio-leds";
@@ -54,6 +72,10 @@ led1 {
};
};
+&combo_phy {
+ status = "okay";
+};
+
ð0 {
phy-handle = <&rgmii0>;
phy-mode = "rgmii-id";
@@ -230,8 +252,65 @@ dldo7 {
};
};
+&pcie1_phy {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie1_3_cfg>;
+ status = "okay";
+};
+
+&pcie1_port {
+ phys = <&pcie1_phy>;
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+};
+
+&pcie1 {
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+ status = "okay";
+};
+
+&pcie2_phy {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pcie2_4_cfg>;
+ status = "okay";
+};
+
+&pcie2_port {
+ phys = <&pcie2_phy>;
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+};
+
+&pcie2 {
+ vpcie3v3-supply = <&pcie_vcc_3v3>;
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_2_cfg>;
status = "okay";
};
+
+&usbphy2 {
+ status = "okay";
+};
+
+&usb_dwc3 {
+ dr_mode = "host";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ hub_2_0: hub@1 {
+ compatible = "usb5e3,610";
+ reg = <0x1>;
+ vdd-supply = <&usb3_hub_5v>;
+ peer-hub = <&hub_3_0>;
+ };
+
+ hub_3_0: hub@2 {
+ compatible = "usb5e3,620";
+ reg = <0x2>;
+ vdd-supply = <&usb3_hub_5v>;
+ peer-hub = <&hub_2_0>;
+ };
+};
--
2.47.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v3 3/3] riscv: dts: spacemit: Enable USB3.0/PCIe on OrangePi RV2
2026-03-29 17:05 ` [PATCH v3 3/3] riscv: dts: spacemit: Enable USB3.0/PCIe on " Han Gao
@ 2026-03-30 7:00 ` Chukun Pan
0 siblings, 0 replies; 7+ messages in thread
From: Chukun Pan @ 2026-03-30 7:00 UTC (permalink / raw)
To: gaohan
Cc: alex, aou, conor+dt, devicetree, dlan, krzk+dt, linux-kernel,
linux-riscv, palmer, pjw, rabenda.cn, robh, spacemit, Chukun Pan
Hi,
> + usb3_hub_5v: regulator-usb3-hub-5v {
> + compatible = "regulator-fixed";
> + regulator-name = "USB_HUB_EN";
regulator-name = "vcc5v0_usb30";
"USB_HUB_EN" is the pin name.
> +&usb_dwc3 {
> + dr_mode = "host";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + hub_2_0: hub@1 {
> + compatible = "usb5e3,610";
> + reg = <0x1>;
> + vdd-supply = <&usb3_hub_5v>;
This is incorrect...
The hub is powered by VCC_5V0.
VCC5V0_USB30 provides USB VBUS.
Thanks,
Chukun
^ permalink raw reply [flat|nested] 7+ messages in thread