Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: phy: qcom,qmp-usb3-dp: fix sc8280xp binding

The current QMP USB3-DP PHY bindings are based on the original MSM8996
binding which provided multiple PHYs per IP block and these in turn were
described by child nodes.

The QMP USB3-DP PHY block provides a single multi-protocol PHY and even
if some resources are only used by either the USB or DP part of the
device there is no real benefit in describing these resources in child
nodes.

The original MSM8996 binding also ended up describing the individual
register blocks as belonging to either the wrapper node or the PHY child
nodes.

This is an unnecessary level of detail which has lead to problems when
later IP blocks using different register layouts have been forced to fit
the original mould rather than updating the binding. The bindings are
arguable also incomplete as they only the describe register blocks used
by the current Linux drivers (e.g. does not include the PCS LANE
registers).

This is specifically true for later USB4-USB3-DP QMP PHYs where the TX
registers are used by both the USB3 and DP parts of the PHY (and where
the USB4 part of the PHY was not covered by the binding at all). Notably
there are also no DP "RX" (sic) registers as described by the current
bindings and the DP "PCS" region is really a set of DP_PHY registers.

Add a new binding for the USB4-USB3-DP QMP PHYs found on SC8280XP which
further bindings can be based on.

Note that the binding uses a PHY index to access either the USB3 or DP
part of the PHY and that this can later be used also for the USB4 part
if needed.

Similarly, the clock inputs and outputs can later be extended to support
USB4.

Also note that the current binding is simply removed instead of being
deprecated as it was only recently merged and would not allow for
supporting DP mode.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221121085058.31213-3-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Johan Hovold and committed by
Vinod Koul
e1c4c543 32efdb0b

+119 -12
-12
Documentation/devicetree/bindings/phy/qcom,sc7180-qmp-usb3-dp-phy.yaml
··· 23 23 - qcom,sc7180-qmp-usb3-dp-phy 24 24 - qcom,sc7280-qmp-usb3-dp-phy 25 25 - qcom,sc8180x-qmp-usb3-dp-phy 26 - - qcom,sc8280xp-qmp-usb43dp-phy 27 26 - qcom,sdm845-qmp-usb3-dp-phy 28 27 - qcom,sm8250-qmp-usb3-dp-phy 29 28 reg: ··· 167 168 - vdda-pll-supply 168 169 169 170 additionalProperties: false 170 - 171 - allOf: 172 - - if: 173 - properties: 174 - compatible: 175 - contains: 176 - enum: 177 - - qcom,sc8280xp-qmp-usb43dp-phy 178 - then: 179 - required: 180 - - power-domains 181 171 182 172 examples: 183 173 - |
+99
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm QMP USB4-USB3-DP PHY controller (SC8280XP) 8 + 9 + maintainers: 10 + - Vinod Koul <vkoul@kernel.org> 11 + 12 + description: 13 + The QMP PHY controller supports physical layer functionality for a number of 14 + controllers on Qualcomm chipsets, such as, PCIe, UFS and USB. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - qcom,sc8280xp-qmp-usb43dp-phy 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + clocks: 25 + maxItems: 4 26 + 27 + clock-names: 28 + items: 29 + - const: aux 30 + - const: ref 31 + - const: com_aux 32 + - const: usb3_pipe 33 + 34 + power-domains: 35 + maxItems: 1 36 + 37 + resets: 38 + maxItems: 2 39 + 40 + reset-names: 41 + items: 42 + - const: phy 43 + - const: common 44 + 45 + vdda-phy-supply: true 46 + 47 + vdda-pll-supply: true 48 + 49 + "#clock-cells": 50 + const: 1 51 + description: 52 + See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h 53 + 54 + "#phy-cells": 55 + const: 1 56 + description: 57 + See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h 58 + 59 + required: 60 + - compatible 61 + - reg 62 + - clocks 63 + - clock-names 64 + - power-domains 65 + - resets 66 + - reset-names 67 + - vdda-phy-supply 68 + - vdda-pll-supply 69 + - "#clock-cells" 70 + - "#phy-cells" 71 + 72 + additionalProperties: false 73 + 74 + examples: 75 + - | 76 + #include <dt-bindings/clock/qcom,gcc-sc8280xp.h> 77 + 78 + phy@88eb000 { 79 + compatible = "qcom,sc8280xp-qmp-usb43dp-phy"; 80 + reg = <0x088eb000 0x4000>; 81 + 82 + clocks = <&gcc GCC_USB3_PRIM_PHY_AUX_CLK>, 83 + <&gcc GCC_USB4_EUD_CLKREF_CLK>, 84 + <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>, 85 + <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; 86 + clock-names = "aux", "ref", "com_aux", "usb3_pipe"; 87 + 88 + power-domains = <&gcc USB30_PRIM_GDSC>; 89 + 90 + resets = <&gcc GCC_USB3_PHY_PRIM_BCR>, 91 + <&gcc GCC_USB4_DP_PHY_PRIM_BCR>; 92 + reset-names = "phy", "common"; 93 + 94 + vdda-phy-supply = <&vreg_l9d>; 95 + vdda-pll-supply = <&vreg_l4d>; 96 + 97 + #clock-cells = <1>; 98 + #phy-cells = <1>; 99 + };
+20
include/dt-bindings/phy/phy-qcom-qmp.h
··· 1 + /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */ 2 + /* 3 + * Qualcomm QMP PHY constants 4 + * 5 + * Copyright (C) 2022 Linaro Limited 6 + */ 7 + 8 + #ifndef _DT_BINDINGS_PHY_QMP 9 + #define _DT_BINDINGS_PHY_QMP 10 + 11 + /* QMP USB4-USB3-DP clocks */ 12 + #define QMP_USB43DP_USB3_PIPE_CLK 0 13 + #define QMP_USB43DP_DP_LINK_CLK 1 14 + #define QMP_USB43DP_DP_VCO_DIV_CLK 2 15 + 16 + /* QMP USB4-USB3-DP PHYs */ 17 + #define QMP_USB43DP_USB3_PHY 0 18 + #define QMP_USB43DP_DP_PHY 1 19 + 20 + #endif /* _DT_BINDINGS_PHY_QMP */