Linux SpacemiT device drivers
 help / color / mirror / Atom feed
* [PATCH] riscv: dts: spacemit: drop unnecessary power supply from PCIe
@ 2026-05-13  2:14 Yixun Lan
  2026-05-13  8:24 ` Anand Moon
       [not found] ` <20260514005435.484B5C2BCB8@smtp.kernel.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Yixun Lan @ 2026-05-13  2:14 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti
  Cc: Chukun Pan, Andre Heider, devicetree, linux-riscv, spacemit,
	linux-kernel, Yixun Lan

The PCIe Root Complex found on the SpacemiT K1 SoC does not require
external power supply, this match with the dt-binding documentation[1],
Instead it's the sub node of PCIe ports which should add vpcie3v3 power
supply. So, explicitly remove "vpcie3v3-supply" property from the PCIe
controller.

Link: https://lore.kernel.org/all/20251113214540.2623070-4-elder@riscstar.com/ [1]
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
The problem was introduced at the time of PCIe DTS first committed to
kernel, the vpcie3v3-supply should be added to PCIe ports instead of PCIe
RC node.

Refer the example dts of Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml

I'm not adding the Fixes tag, as this doesn't cause any severe bug, thus
not necessary to do the back port..
---
 arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts   | 2 --
 arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 2 --
 2 files changed, 4 deletions(-)

diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index e20daa50a152..c70081856606 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -316,7 +316,6 @@ &pcie1_port {
 };
 
 &pcie1 {
-	vpcie3v3-supply = <&pcie_vcc_3v3>;
 	status = "okay";
 };
 
@@ -332,7 +331,6 @@ &pcie2_port {
 };
 
 &pcie2 {
-	vpcie3v3-supply = <&pcie_vcc_3v3>;
 	status = "okay";
 };
 
diff --git a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
index afaad59e6bce..7e5915023eaa 100644
--- a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
@@ -313,7 +313,6 @@ &pcie1_port {
 };
 
 &pcie1 {
-	vpcie3v3-supply = <&pcie_vcc_3v3>;
 	status = "okay";
 };
 
@@ -329,7 +328,6 @@ &pcie2_port {
 };
 
 &pcie2 {
-	vpcie3v3-supply = <&pcie_vcc_3v3>;
 	status = "okay";
 };
 

---
base-commit: f068b204555ad62d6a841a49feb4ea8c4f45b25c
change-id: 20260512-k1-pcie-fix-supply-d12f6d50d8d4

Best regards,
--  
Yixun Lan <dlan@kernel.org>


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

* Re: [PATCH] riscv: dts: spacemit: drop unnecessary power supply from PCIe
  2026-05-13  2:14 [PATCH] riscv: dts: spacemit: drop unnecessary power supply from PCIe Yixun Lan
@ 2026-05-13  8:24 ` Anand Moon
       [not found] ` <20260514005435.484B5C2BCB8@smtp.kernel.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Anand Moon @ 2026-05-13  8:24 UTC (permalink / raw)
  To: Yixun Lan
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Chukun Pan,
	Andre Heider, devicetree, linux-riscv, spacemit, linux-kernel

Hi Yixun,

On Wed, 13 May 2026 at 09:06, Yixun Lan <dlan@kernel.org> wrote:
>
> The PCIe Root Complex found on the SpacemiT K1 SoC does not require
> external power supply, this match with the dt-binding documentation[1],
> Instead it's the sub node of PCIe ports which should add vpcie3v3 power
> supply. So, explicitly remove "vpcie3v3-supply" property from the PCIe
> controller.
>
> Link: https://lore.kernel.org/all/20251113214540.2623070-4-elder@riscstar.com/ [1]
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> The problem was introduced at the time of PCIe DTS first committed to
> kernel, the vpcie3v3-supply should be added to PCIe ports instead of PCIe
> RC node.
>
> Refer the example dts of Documentation/devicetree/bindings/pci/spacemit,k1-pcie-host.yaml
>
> I'm not adding the Fixes tag, as this doesn't cause any severe bug, thus
> not necessary to do the back port..

The vpcie3v3-supply is required for PCIe operation.

However, according to the device tree binding, vpcie3v3-supply is defined
as a required property of the PHY. To align with this binding, the supply should
be moved to the PHY node, and the PHY driver should be updated to handle
enabling and disabling of vpcie3v3-supply.

Thanks
-Anand
> ---
>  arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts   | 2 --
>  arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts | 2 --
>  2 files changed, 4 deletions(-)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> index e20daa50a152..c70081856606 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> @@ -316,7 +316,6 @@ &pcie1_port {
>  };
>
>  &pcie1 {
> -       vpcie3v3-supply = <&pcie_vcc_3v3>;
>         status = "okay";
>  };
>
> @@ -332,7 +331,6 @@ &pcie2_port {
>  };
>
>  &pcie2 {
> -       vpcie3v3-supply = <&pcie_vcc_3v3>;
>         status = "okay";
>  };
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> index afaad59e6bce..7e5915023eaa 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-milkv-jupiter.dts
> @@ -313,7 +313,6 @@ &pcie1_port {
>  };
>
>  &pcie1 {
> -       vpcie3v3-supply = <&pcie_vcc_3v3>;
>         status = "okay";
>  };
>
> @@ -329,7 +328,6 @@ &pcie2_port {
>  };
>
>  &pcie2 {
> -       vpcie3v3-supply = <&pcie_vcc_3v3>;
>         status = "okay";
>  };
>
>
> ---
> base-commit: f068b204555ad62d6a841a49feb4ea8c4f45b25c
> change-id: 20260512-k1-pcie-fix-supply-d12f6d50d8d4
>
> Best regards,
> --
> Yixun Lan <dlan@kernel.org>
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH] riscv: dts: spacemit: drop unnecessary power supply from PCIe
       [not found] ` <20260514005435.484B5C2BCB8@smtp.kernel.org>
@ 2026-05-15  7:47   ` Yixun Lan
  0 siblings, 0 replies; 3+ messages in thread
From: Yixun Lan @ 2026-05-15  7:47 UTC (permalink / raw)
  To: sashiko-reviews; +Cc: robh, krzk+dt, conor+dt, devicetree, spacemit

Hi

On 00:54 Thu 14 May     , sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Removing `vpcie3v3-supply` from the PCIe controller node breaks power sequencing because the `spacemit,k1-pcie` driver expects it on the controller node.
> --
> 
> commit ab7558e23a3bb4900f7961804151870f4c1f99fe
> Author: Yixun Lan <dlan@kernel.org>
> 
> riscv: dts: spacemit: drop unnecessary power supply from PCIe
> 
> This commit removes the vpcie3v3-supply property from the PCIe controller
> nodes in the Banana Pi F3 and Milk-V Jupiter device trees. The commit message
> states that the supply belongs to the child port node rather than the Root
> Complex, aligning with the dt-binding documentation.
> 
> Link: https://lore.kernel.org/all/20251113214540.2623070-4-elder@riscstar.com/
> 
> > diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > index e20daa50a152f..c70081856606f 100644
> > --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> > @@ -316,7 +316,6 @@ &pcie1_port {
> >  };
> >  
> >  &pcie1 {
> > -	vpcie3v3-supply = <&pcie_vcc_3v3>;
> 
> Will removing the vpcie3v3-supply property from the controller node break
> power sequencing?
> 
No, I don't think so, the PCIe RC do not require external power supply

> Looking at drivers/pci/controller/dwc/pcie-spacemit-k1.c, the host driver
> calls devm_regulator_get_enable(dev, "vpcie3v3") during k1_pcie_probe().
> 
Right, I think the vpcie3v3 supply should be removed from host driver

> Without this property on the controller node, won't the driver fall back
> to a dummy regulator?
> 
Currently, yes if above code not removed, it will fallback to dummy
regulator if no vpcie3v3-supply specified

> Since the spacemit-k1-pcie driver does not currently integrate with the PCI
> power control framework (by calling pci_pwrctrl_create_devices()), does any
> driver in the kernel actually control the power supply for the child port node?
> 
Yes, the PCIe sub ports node will request the power supply, in 
drivers/pci/pwrctrl/generic.c:119
 slot_pwrctrl_probe() -> of_regulator_buck_get_all()

> While this issue might be masked on the Banana Pi F3 and Milk-V Jupiter
> boards because their vpcie3v3 regulators are defined as regulator-always-on,
> does this change break dynamic power management for the PCIe slots?
> 
> Should the host driver be updated to adopt the pci_pwrctrl framework before
> dropping this property from the device tree?
> 
The host driver already adopt pci_pwrctrl framework

> [ ... ]
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260513-k1-pcie-fix-supply-v1-1-4eecbdd44ebe@kernel.org?part=1

-- 
Yixun Lan (dlan)

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

end of thread, other threads:[~2026-05-15  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-13  2:14 [PATCH] riscv: dts: spacemit: drop unnecessary power supply from PCIe Yixun Lan
2026-05-13  8:24 ` Anand Moon
     [not found] ` <20260514005435.484B5C2BCB8@smtp.kernel.org>
2026-05-15  7:47   ` Yixun Lan

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