Skip to content

Commit 33a9caa

Browse files
committed
Merge tag 'phy-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy
Pull phy updates from Vinod Koul: "New Support: - Qualcomm SM8650 UFS, PCIe and USB/DP Combo PHY, eUSB2 PHY, SDX75 USB3, X1E80100 USB3 support - Mediatek MT8195 support - Rockchip RK3128 usb2 support - TI SGMII mode for J784S4 Updates: - Qualcomm v7 register offsets updates - Mediatek tphy support for force phy mode switch" * tag 'phy-for-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (34 commits) phy: ti: j721e-wiz: Add SGMII support in WIZ driver for J784S4 phy: ti: gmii-sel: Enable SGMII mode for J784S4 phy: qcom-qmp-usb: Add Qualcomm X1E80100 USB3 PHY support dt-bindings: phy: qcom,sc8280xp-qmp-usb3-uni: Add X1E80100 USB PHY binding phy: qcom-qmp-combo: Add x1e80100 USB/DP combo phys dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: Document X1E80100 compatible dt-bindings: phy: qcom: snps-eusb2: Document the X1E80100 compatible phy: mediatek: tphy: add support force phy mode switch dt-bindings: phy: mediatek: tphy: add a property for force-mode switch phy: phy-can-transceiver: insert space after include phy: qualcomm: phy-qcom-qmp-ufs: Rectify SM8550 UFS HS-G4 PHY Settings dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header phy: renesas: phy-rcar-gen2: use select for GENERIC_PHY phy: qcom-qmp: qserdes-txrx: Add v7 register offsets phy: qcom-qmp: qserdes-txrx: Add V6 N4 register offsets phy: qcom-qmp: qserdes-com: Add v7 register offsets phy: qcom-qmp: pcs-usb: Add v7 register offsets phy: qcom-qmp: pcs: Add v7 register offsets phy: qcom-qmp: qserdes-txrx: Add some more v6.20 register offsets phy: qcom-qmp: qserdes-com: Add some more v6 register offsets ...
2 parents 4d5d604 + 2029e71 commit 33a9caa

31 files changed

+1168
-78
lines changed

Documentation/devicetree/bindings/phy/amlogic,g12a-mipi-dphy-analog.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,8 @@ properties:
1616
"#phy-cells":
1717
const: 0
1818

19-
reg:
20-
maxItems: 1
21-
2219
required:
2320
- compatible
24-
- reg
2521
- "#phy-cells"
2622

2723
additionalProperties: false
28-
29-
examples:
30-
- |
31-
phy@0 {
32-
compatible = "amlogic,g12a-mipi-dphy-analog";
33-
reg = <0x0 0xc>;
34-
#phy-cells = <0>;
35-
};

Documentation/devicetree/bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ title: Amlogic AXG shared MIPI/PCIE analog PHY
99
maintainers:
1010
- Remi Pommarel <[email protected]>
1111

12-
description: |+
13-
The Everything-Else Power Domains node should be the child of a syscon
14-
node with the required property:
15-
16-
- compatible: Should be the following:
17-
"amlogic,meson-gx-hhi-sysctrl", "simple-mfd", "syscon"
18-
19-
Refer to the bindings described in
20-
Documentation/devicetree/bindings/mfd/syscon.yaml
21-
2212
properties:
2313
compatible:
2414
const: amlogic,axg-mipi-pcie-analog-phy
@@ -31,10 +21,3 @@ required:
3121
- "#phy-cells"
3222

3323
additionalProperties: false
34-
35-
examples:
36-
- |
37-
mpphy: phy {
38-
compatible = "amlogic,axg-mipi-pcie-analog-phy";
39-
#phy-cells = <0>;
40-
};

Documentation/devicetree/bindings/phy/mediatek,dsi-phy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ properties:
3131
- items:
3232
- enum:
3333
- mediatek,mt8188-mipi-tx
34+
- mediatek,mt8195-mipi-tx
3435
- mediatek,mt8365-mipi-tx
3536
- const: mediatek,mt8183-mipi-tx
3637
- const: mediatek,mt2701-mipi-tx

Documentation/devicetree/bindings/phy/mediatek,tphy.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,15 @@ patternProperties:
235235
Specify the flag to enable BC1.2 if support it
236236
type: boolean
237237

238+
mediatek,force-mode:
239+
description:
240+
The force mode is used to manually switch the shared phy mode between
241+
USB3 and PCIe, when USB3 phy type is selected by the consumer, and
242+
force-mode is set, will cause phy's power and pipe toggled and force
243+
phy as USB3 mode which switched from default PCIe mode. But perfer to
244+
use the property "mediatek,syscon-type" for newer SoCs that support it.
245+
type: boolean
246+
238247
mediatek,syscon-type:
239248
$ref: /schemas/types.yaml#/definitions/phandle-array
240249
maxItems: 1

Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ properties:
3636
- qcom,sm8450-qmp-gen4x2-pcie-phy
3737
- qcom,sm8550-qmp-gen3x2-pcie-phy
3838
- qcom,sm8550-qmp-gen4x2-pcie-phy
39+
- qcom,sm8650-qmp-gen3x2-pcie-phy
40+
- qcom,sm8650-qmp-gen4x2-pcie-phy
3941

4042
reg:
4143
minItems: 1
@@ -147,6 +149,8 @@ allOf:
147149
- qcom,sm8450-qmp-gen3x2-pcie-phy
148150
- qcom,sm8550-qmp-gen3x2-pcie-phy
149151
- qcom,sm8550-qmp-gen4x2-pcie-phy
152+
- qcom,sm8650-qmp-gen3x2-pcie-phy
153+
- qcom,sm8650-qmp-gen4x2-pcie-phy
150154
then:
151155
properties:
152156
clocks:
@@ -189,6 +193,7 @@ allOf:
189193
contains:
190194
enum:
191195
- qcom,sm8550-qmp-gen4x2-pcie-phy
196+
- qcom,sm8650-qmp-gen4x2-pcie-phy
192197
then:
193198
properties:
194199
resets:

Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ properties:
3232
- qcom,sm8350-qmp-ufs-phy
3333
- qcom,sm8450-qmp-ufs-phy
3434
- qcom,sm8550-qmp-ufs-phy
35+
- qcom,sm8650-qmp-ufs-phy
3536

3637
reg:
3738
maxItems: 1
@@ -112,6 +113,7 @@ allOf:
112113
- qcom,sm8250-qmp-ufs-phy
113114
- qcom,sm8350-qmp-ufs-phy
114115
- qcom,sm8550-qmp-ufs-phy
116+
- qcom,sm8650-qmp-ufs-phy
115117
then:
116118
properties:
117119
clocks:

Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb3-uni-phy.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ properties:
3232
- qcom,sm8150-qmp-usb3-uni-phy
3333
- qcom,sm8250-qmp-usb3-uni-phy
3434
- qcom,sm8350-qmp-usb3-uni-phy
35+
- qcom,x1e80100-qmp-usb3-uni-phy
3536

3637

3738
reg:
@@ -135,6 +136,7 @@ allOf:
135136
- qcom,sm8150-qmp-usb3-uni-phy
136137
- qcom,sm8250-qmp-usb3-uni-phy
137138
- qcom,sm8350-qmp-usb3-uni-phy
139+
- qcom,x1e80100-qmp-usb3-uni-phy
138140
then:
139141
properties:
140142
clocks:
@@ -171,6 +173,7 @@ allOf:
171173
enum:
172174
- qcom,sa8775p-qmp-usb3-uni-phy
173175
- qcom,sc8280xp-qmp-usb3-uni-phy
176+
- qcom,x1e80100-qmp-usb3-uni-phy
174177
then:
175178
required:
176179
- power-domains

Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-usb43dp-phy.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ properties:
2727
- qcom,sm8350-qmp-usb3-dp-phy
2828
- qcom,sm8450-qmp-usb3-dp-phy
2929
- qcom,sm8550-qmp-usb3-dp-phy
30+
- qcom,sm8650-qmp-usb3-dp-phy
31+
- qcom,x1e80100-qmp-usb3-dp-phy
3032

3133
reg:
3234
maxItems: 1
@@ -62,12 +64,12 @@ properties:
6264
"#clock-cells":
6365
const: 1
6466
description:
65-
See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
67+
See include/dt-bindings/phy/phy-qcom-qmp.h
6668

6769
"#phy-cells":
6870
const: 1
6971
description:
70-
See include/dt-bindings/dt-bindings/phy/phy-qcom-qmp.h
72+
See include/dt-bindings/phy/phy-qcom-qmp.h
7173

7274
orientation-switch:
7375
description:
@@ -128,6 +130,8 @@ allOf:
128130
- qcom,sc8280xp-qmp-usb43dp-phy
129131
- qcom,sm6350-qmp-usb3-dp-phy
130132
- qcom,sm8550-qmp-usb3-dp-phy
133+
- qcom,sm8650-qmp-usb3-dp-phy
134+
- qcom,x1e80100-qmp-usb3-dp-phy
131135
then:
132136
required:
133137
- power-domains

Documentation/devicetree/bindings/phy/qcom,snps-eusb2-phy.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ properties:
1818
- items:
1919
- enum:
2020
- qcom,sdx75-snps-eusb2-phy
21+
- qcom,sm8650-snps-eusb2-phy
22+
- qcom,x1e80100-snps-eusb2-phy
2123
- const: qcom,sm8550-snps-eusb2-phy
2224
- const: qcom,sm8550-snps-eusb2-phy
2325

drivers/phy/mediatek/phy-mtk-tphy.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@
185185
#define P3D_RG_CDR_BIR_LTD1 GENMASK(28, 24)
186186
#define P3D_RG_CDR_BIR_LTD0 GENMASK(12, 8)
187187

188+
#define U3P_U3_PHYD_TOP1 0x100
189+
#define P3D_RG_PHY_MODE GENMASK(2, 1)
190+
#define P3D_RG_FORCE_PHY_MODE BIT(0)
191+
188192
#define U3P_U3_PHYD_RXDET1 0x128
189193
#define P3D_RG_RXDET_STB2_SET GENMASK(17, 9)
190194

@@ -327,6 +331,7 @@ struct mtk_phy_instance {
327331
int discth;
328332
int pre_emphasis;
329333
bool bc12_en;
334+
bool type_force_mode;
330335
};
331336

332337
struct mtk_tphy {
@@ -768,6 +773,23 @@ static void u3_phy_instance_init(struct mtk_tphy *tphy,
768773
void __iomem *phya = u3_banks->phya;
769774
void __iomem *phyd = u3_banks->phyd;
770775

776+
if (instance->type_force_mode) {
777+
/* force phy as usb mode, default is pcie rc mode */
778+
mtk_phy_update_field(phyd + U3P_U3_PHYD_TOP1, P3D_RG_PHY_MODE, 1);
779+
mtk_phy_set_bits(phyd + U3P_U3_PHYD_TOP1, P3D_RG_FORCE_PHY_MODE);
780+
/* power down phy by ip and pipe reset */
781+
mtk_phy_set_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLD,
782+
P3C_FORCE_IP_SW_RST | P3C_MCU_BUS_CK_GATE_EN);
783+
mtk_phy_set_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLE,
784+
P3C_RG_SWRST_U3_PHYD | P3C_RG_SWRST_U3_PHYD_FORCE_EN);
785+
udelay(10);
786+
/* power on phy again */
787+
mtk_phy_clear_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLD,
788+
P3C_FORCE_IP_SW_RST | P3C_MCU_BUS_CK_GATE_EN);
789+
mtk_phy_clear_bits(u3_banks->chip + U3P_U3_CHIP_GPIO_CTLE,
790+
P3C_RG_SWRST_U3_PHYD | P3C_RG_SWRST_U3_PHYD_FORCE_EN);
791+
}
792+
771793
/* gating PCIe Analog XTAL clock */
772794
mtk_phy_set_bits(u3_banks->spllc + U3P_SPLLC_XTALCTL3,
773795
XC3_RG_U3_XTAL_RX_PWD | XC3_RG_U3_FRC_XTAL_RX_PWD);
@@ -1120,6 +1142,9 @@ static void phy_parse_property(struct mtk_tphy *tphy,
11201142
{
11211143
struct device *dev = &instance->phy->dev;
11221144

1145+
if (instance->type == PHY_TYPE_USB3)
1146+
instance->type_force_mode = device_property_read_bool(dev, "mediatek,force-mode");
1147+
11231148
if (instance->type != PHY_TYPE_USB2)
11241149
return;
11251150

0 commit comments

Comments
 (0)