public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ze Huang" <huang.ze@linux.dev>
To: "Krzysztof Kozlowski" <krzk@kernel.org>,
	"Chukun Pan" <amadeus@jmu.edu.cn>
Cc: "Yixun Lan" <dlan@kernel.org>, "Vinod Koul" <vkoul@kernel.org>,
	"Ze Huang" <huang.ze@linux.dev>, "Rob Herring" <robh@kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	<linux-riscv@lists.infradead.org>,
	<linux-phy@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <spacemit@lists.linux.dev>
Subject: Re: [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY
Date: Sat, 07 Feb 2026 20:30:46 +0800	[thread overview]
Message-ID: <DG8QBWSJ79MP.2MVIHFRBX3WXX@linux.dev> (raw)
In-Reply-To: <20260207-dancing-finch-of-chemistry-f98cf2@quoll>

On Sat Feb 7, 2026 at 6:48 PM CST, Krzysztof Kozlowski wrote:
> On Fri, Feb 06, 2026 at 06:00:08PM +0800, Chukun Pan wrote:
>> Add an optional phy-supply property to describe the regulator
>> supplying for USB VBUS.
>
> Why wasn't it there before? USB did not have VBUS?

Previously, the VBUS regulator was defined as regulator-always-on in
the device tree as a workaround.

>
> Explanation is so incomplete I suspect you are patching broken things,
> so as well this could be completely different hardware (e.g. there is no
> regulator for this block but e.g. connector).
>

usb ports under usb hub node can describe the topology well, but
still regulator always-on is necessary as no driver toggles it.

    usb3 {
     dr_mode = "host";
     #address-cells = <1>;
     #size-cells = <0>;
     status = "okay";

     hub_2_0: hub@1 {
      compatible = "usb2109,2817";
      reg = <0x1>;
      #address-cells = <1>;
      #size-cells = <0>;
      vdd-supply = <&usb3_vhub>;
      peer-hub = <&hub_3_0>;
      reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;

      port@1 {
       reg = <1>;
       vbus-supply = <&usb3_vbus>;
      };

      port@2 {
       reg = <2>;
       vbus-supply = <&usb3_vbus>;
      };

      ...

      hub_3_0: hub@2 {
        ...
      };
    };

Here is the diagram for the USB2, USB3 controller on K1 Jupiter board [1] (page 21)

    +-----------------------+
    |        K1 SoC         |
    |                       |
    |  +-----------------+  |   (USB 3.0)
    |  | USB3 Controller |--|---------------------------------->+--------------------------+
    |  +-----------------+  |                                   |        VL817 Hub         |
    |                       |                                   |                          |---> [USB3 Ports]
    |      HUB_PWREN        |                                   | +----------------------+ |     ^
    |       (GPIO)  --------|---------------------------------->| | Enable Chip Power    | |     |
    |                       |                                   | +----------------------+ |     |
    |                       |                                   +--------------------------+     |
    |      USB3_PWREN       |                                                                    |
    |       (GPIO)   -------|----------------------------------------------------------> [VBUS of USB3 Ports]
    |                       |
    |                       |
    |~~~~~~~~~~~~~~~~~~~~~~~|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    |                       |
    |  +-----------------+  |   (USB 2.0)
    |  | USB2 Controller |--|---------------------------------->+--------------------------+
    |  +-----------------+  |                                   |      FE1_1S Hub          |---> [USB2 Ports]
    |                       |                                   +--------------------------+     ^
    |   USB_HOST_PWREN_H    |                                                                    |
    |       (GPIO)      ----|-----------------------------------------------------------> [VBUS of USB2 Ports]
    |                       |
    |                       |
    +-----------------------+

[1] https://github.com/milkv-jupiter/jupiter-files/blob/main/hardware/v1_0/jupiter-sch-v1_0.pdf

>
>> 
>> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
>> ---
>>  Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> index 43eaca90d88c..74a1cd5bcdbe 100644
>> --- a/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> +++ b/Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
>> @@ -19,6 +19,10 @@ properties:
>>    clocks:
>>      maxItems: 1
>>  
>> +  phy-supply:
>> +    description:
>> +      Phandle to a regulator that provides power to VBUS.
>

"vbus-supply" should be more accurate.

> Drop redundant part. This cannot be anything else than phandle and
> regulator.
>
> "VBUS power supply" for example.
>

> But anyway, I don't have certainty that
> this is correct hardware representation. It's your task to provide that.
>
> Best regards,
> Krzysztof

I initially considered handling VBUS via the onboard_usb_dev driver, as
we discussed previously for the BananaPi-F3 board (which uses a VL817
Hub) [2]. I was waiting for Marco Felsch's patch series "onboard-dev USB
hub host managed vbus" to land [3].

[2] https://lore.kernel.org/linux-riscv/aWJAT3n_KcND8bOz@monica.localdomain/
[3] https://lore.kernel.org/all/20250911-v6-16-topic-usb-onboard-dev-v4-0-1af288125d74@pengutronix.de/

I am not certain if managing VBUS in the PHY driver (e.g.,
phy-stm32-usbphyc.c and phy-rockchip-usb.c) is the standard method.
I would not insist on the "onboard_usb_dev managed vbus" if this patch
(PHY managed) is considered proper way.

  parent reply	other threads:[~2026-02-07 12:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 10:00 [PATCH 1/2] dt-bindings: phy: spacemit: add regulator support to K1 USB2 PHY Chukun Pan
2026-02-06 10:00 ` [PATCH 2/2] " Chukun Pan
2026-02-07 10:48 ` [PATCH 1/2] dt-bindings: " Krzysztof Kozlowski
2026-02-07 10:49   ` Krzysztof Kozlowski
2026-02-07 12:30   ` Ze Huang [this message]
2026-02-07 13:44     ` Krzysztof Kozlowski
2026-02-09  6:40       ` Chukun Pan
2026-02-10  5:50         ` Ze Huang
2026-02-10  7:00           ` Chukun Pan
2026-02-07 11:55 ` Yixun Lan

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=DG8QBWSJ79MP.2MVIHFRBX3WXX@linux.dev \
    --to=huang.ze@linux.dev \
    --cc=amadeus@jmu.edu.cn \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    --cc=vkoul@kernel.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