Thread (11 messages) 11 messages, 4 authors, 2024-09-03

回复: [PATCH v2 1/3] dt-bindings: phy: jh7110-usb-phy: Add sys-syscon property

From: Minda Chen <minda.chen@starfivetech.com>
Date: 2024-08-15 19:06:54
Also in: linux-devicetree, linux-riscv, lkml

On Tue, Aug 13, 2024 at 07:31:50AM +0200, Jan Kiszka wrote:
quoted
On 12.08.24 17:55, Conor Dooley wrote:
quoted
On Mon, Aug 12, 2024 at 04:15:51PM +0200, Jan Kiszka wrote:
quoted
From: Jan Kiszka <jan.kiszka@siemens.com>

Analogously to the PCI PHY, access to sys_syscon is needed to
connect the USB PHY to its controller.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
CC: Rob Herring <robh@kernel.org>
CC: Krzysztof Kozlowski <krzk+dt@kernel.org>
CC: Conor Dooley <conor+dt@kernel.org>
---
 .../bindings/phy/starfive,jh7110-usb-phy.yaml         | 11
+++++++++++
quoted
quoted
quoted
 1 file changed, 11 insertions(+)

diff --git
a/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yam
l
b/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yam
l index 269e9f9f12b6..eaf0050c6f17 100644
---
a/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy.yam
l
+++ b/Documentation/devicetree/bindings/phy/starfive,jh7110-usb-phy
+++ .yaml
@@ -19,6 +19,16 @@ properties:
   "#phy-cells":
     const: 0

+  starfive,sys-syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      - items:
+          - description: phandle to System Register Controller
sys_syscon node.
quoted
quoted
quoted
+          - description: PHY connect offset of
SYS_SYSCONSAIF__SYSCFG register for USB PHY.
quoted
quoted
Why is having a new property for this required? The devicetree only
has a single usb phy, so isn't it sufficient to look up the syscon
by compatible, rather than via phandle + offset?
I didn't design this, I just copied it from
starfive,jh7110-pcie-phy.yaml. As that already exists, I'm neither
sure we want to change that anymore nor deviate in the pattern here.
To be honest, I think some of the other users of phandle + offset on this soc were
just copy-pasted without thinking about whether or not they were required too.
This one seems like it should just be a lookup by compatible in the driver instead
of by phandle. As a bonus, it will work with existing devicetrees - whereas your
current implementation will fail to probe on systems that have the old
devicetree, a regression for systems running with that devicetree and
downstream firmware.

Cheers,
Conor.
Hi Conor
I know you would like to put the offset value to the code, Just set syscon in dts.
Just like pcie-starfive.c. right?
quoted
Jan
quoted
quoted
+    description:
+      The phandle to System Register Controller syscon node and the
PHY connect offset
quoted
quoted
quoted
+      of SYS_SYSCONSAIF__SYSCFG register. Connect PHY to USB
controller.
quoted
quoted
quoted
+
   clocks:
     items:
       - description: PHY 125m
@@ -47,4 +57,5 @@ examples:
                  <&stgcrg 6>;
         clock-names = "125m", "app_125m";
         #phy-cells = <0>;
+        starfive,sys-syscon = <&sys_syscon 0x18>;
     };
--
2.43.0
--
Siemens AG, Technology
Linux Expert Center
-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help