Skip to content

Commit 53c6d85

Browse files
Krishna Kurapatigregkh
authored andcommitted
dt-bindings: usb: dwc3: Clean up hs_phy_irq in binding
The high speed related interrupts present on QC targets are as follows: 1. dp/dm irq's These IRQ's directly reflect changes on the DP/DM pads of the SoC. These are used as wakeup interrupts only on SoCs with non-QUSB2 targets with exception of SDM670/SDM845/SM6350. 2. qusb2_phy irq SoCs with QUSB2 PHY do not have separate DP/DM IRQs and expose only a single IRQ whose behavior can be modified by the QUSB2PHY_INTR_CTRL register. The required DPSE/DMSE configuration is done in QUSB2PHY_INTR_CTRL register of phy address space. 3. hs_phy_irq This is completely different from the above two and is present on all targets with exception of a few IPQ ones. The interrupt is not enabled by default and its functionality is mutually exclusive of qusb2_phy on QUSB targets and DP/DM on femto phy targets. The DTs of several QUSB2 PHY based SoCs incorrectly define "hs_phy_irq" when they should have been "qusb2_phy_irq". On Femto phy targets, the "hs_phy_irq" mentioned is either the actual "hs_phy_irq" or "pwr_event", neither of which would never be triggered directly are non-functional currently. The implementation tries to clean up this issue by addressing the discrepencies involved and fixing the hs_phy_irq's in respective DT's. Classify SoC's into four groups based on whether qusb2_phy interrupt or {dp/dm}_hs_phy_irq is used for wakeup in high speed and whether the SoCs have hs_phy_irq present in them or not. The ss_phy_irq is optional interrupt because there are mutliple SoC's which either support only High Speed or there are multiple controllers within same Soc and the secondary controller is High Speed only capable. This breaks ABI on targets running older kernels, but since the interrupt definitions are given wrong on many targets and to establish proper rules for usage of DWC3 interrupts on Qualcomm platforms, DT binding update is necessary. The bindings put pwr_event as the first interrupt and ss_phy as the last. Since all SoCs have the pwr_event (HS) interrupt, but not all controllers have the SS PHY interrupt, this would prevent, to some extent, expressing that the SS PHY is optional by keeping it last in the binding schema and making sure that minItems = maxItems - 1. No new targets have been added to schema. Only the existing ones have been re-ordered. Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20231227091951.685-2-quic_kriskura@quicinc.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 76c9457 commit 53c6d85

File tree

1 file changed

+61
-80
lines changed

1 file changed

+61
-80
lines changed

Documentation/devicetree/bindings/usb/qcom,dwc3.yaml

Lines changed: 61 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,29 @@ properties:
9999
- const: apps-usb
100100

101101
interrupts:
102-
minItems: 1
103-
maxItems: 4
102+
description: |
103+
Different types of interrupts are used based on HS PHY used on target:
104+
- pwr_event: Used for wakeup based on other power events.
105+
- hs_phY_irq: Apart from DP/DM/QUSB2 PHY interrupts, there is
106+
hs_phy_irq which is not triggered by default and its
107+
functionality is mutually exclusive to that of
108+
{dp/dm}_hs_phy_irq and qusb2_phy_irq.
109+
- qusb2_phy: SoCs with QUSB2 PHY do not have separate DP/DM IRQs and
110+
expose only a single IRQ whose behavior can be modified
111+
by the QUSB2PHY_INTR_CTRL register. The required DPSE/
112+
DMSE configuration is done in QUSB2PHY_INTR_CTRL register
113+
of PHY address space.
114+
- {dp/dm}_hs_phy_irq: These IRQ's directly reflect changes on the DP/
115+
DM pads of the SoC. These are used for wakeup
116+
only on SoCs with non-QUSB2 targets with
117+
exception of SDM670/SDM845/SM6350.
118+
- ss_phy_irq: Used for remote wakeup in Super Speed mode of operation.
119+
minItems: 2
120+
maxItems: 5
104121

105122
interrupt-names:
106-
minItems: 1
107-
maxItems: 4
123+
minItems: 2
124+
maxItems: 5
108125

109126
qcom,select-utmi-as-pipe-clk:
110127
description:
@@ -361,106 +378,50 @@ allOf:
361378
compatible:
362379
contains:
363380
enum:
364-
- qcom,ipq4019-dwc3
381+
- qcom,ipq5018-dwc3
365382
- qcom,ipq6018-dwc3
366-
- qcom,ipq8064-dwc3
367383
- qcom,ipq8074-dwc3
368-
- qcom,msm8994-dwc3
369-
- qcom,qcs404-dwc3
370-
- qcom,sc7180-dwc3
371-
- qcom,sdm670-dwc3
372-
- qcom,sdm845-dwc3
373-
- qcom,sdx55-dwc3
374-
- qcom,sdx65-dwc3
375-
- qcom,sdx75-dwc3
376-
- qcom,sm4250-dwc3
377-
- qcom,sm6350-dwc3
378-
- qcom,sm8150-dwc3
379-
- qcom,sm8250-dwc3
380-
- qcom,sm8350-dwc3
381-
- qcom,sm8450-dwc3
382-
- qcom,sm8550-dwc3
383-
- qcom,sm8650-dwc3
384-
then:
385-
properties:
386-
interrupts:
387-
items:
388-
- description: The interrupt that is asserted
389-
when a wakeup event is received on USB2 bus.
390-
- description: The interrupt that is asserted
391-
when a wakeup event is received on USB3 bus.
392-
- description: Wakeup event on DM line.
393-
- description: Wakeup event on DP line.
394-
interrupt-names:
395-
items:
396-
- const: hs_phy_irq
397-
- const: ss_phy_irq
398-
- const: dm_hs_phy_irq
399-
- const: dp_hs_phy_irq
400-
401-
- if:
402-
properties:
403-
compatible:
404-
contains:
405-
enum:
406384
- qcom,msm8953-dwc3
407-
- qcom,msm8996-dwc3
408385
- qcom,msm8998-dwc3
409-
- qcom,sm6115-dwc3
410-
- qcom,sm6125-dwc3
411386
then:
412387
properties:
413388
interrupts:
414-
maxItems: 2
389+
minItems: 2
390+
maxItems: 3
415391
interrupt-names:
416392
items:
417-
- const: hs_phy_irq
393+
- const: pwr_event
394+
- const: qusb2_phy
418395
- const: ss_phy_irq
419396

420397
- if:
421398
properties:
422399
compatible:
423400
contains:
424401
enum:
425-
- qcom,ipq5018-dwc3
426-
- qcom,ipq5332-dwc3
402+
- qcom,msm8996-dwc3
403+
- qcom,qcs404-dwc3
427404
- qcom,sdm660-dwc3
428-
then:
429-
properties:
430-
interrupts:
431-
minItems: 1
432-
maxItems: 2
433-
interrupt-names:
434-
minItems: 1
435-
items:
436-
- const: hs_phy_irq
437-
- const: ss_phy_irq
438-
439-
- if:
440-
properties:
441-
compatible:
442-
contains:
443-
enum:
444-
- qcom,sc7280-dwc3
405+
- qcom,sm6115-dwc3
406+
- qcom,sm6125-dwc3
445407
then:
446408
properties:
447409
interrupts:
448410
minItems: 3
449411
maxItems: 4
450412
interrupt-names:
451-
minItems: 3
452413
items:
414+
- const: pwr_event
415+
- const: qusb2_phy
453416
- const: hs_phy_irq
454-
- const: dp_hs_phy_irq
455-
- const: dm_hs_phy_irq
456417
- const: ss_phy_irq
457418

458419
- if:
459420
properties:
460421
compatible:
461422
contains:
462423
enum:
463-
- qcom,sc8280xp-dwc3
424+
- qcom,ipq5332-dwc3
464425
- qcom,x1e80100-dwc3
465426
then:
466427
properties:
@@ -478,16 +439,35 @@ allOf:
478439
compatible:
479440
contains:
480441
enum:
442+
- qcom,ipq4019-dwc3
443+
- qcom,ipq8064-dwc3
444+
- qcom,msm8994-dwc3
481445
- qcom,sa8775p-dwc3
446+
- qcom,sc7180-dwc3
447+
- qcom,sc7280-dwc3
448+
- qcom,sc8280xp-dwc3
449+
- qcom,sdm670-dwc3
450+
- qcom,sdm845-dwc3
451+
- qcom,sdx55-dwc3
452+
- qcom,sdx65-dwc3
453+
- qcom,sdx75-dwc3
454+
- qcom,sm4250-dwc3
455+
- qcom,sm6350-dwc3
456+
- qcom,sm8150-dwc3
457+
- qcom,sm8250-dwc3
458+
- qcom,sm8350-dwc3
459+
- qcom,sm8450-dwc3
460+
- qcom,sm8550-dwc3
461+
- qcom,sm8650-dwc3
482462
then:
483463
properties:
484464
interrupts:
485-
minItems: 3
486-
maxItems: 4
465+
minItems: 4
466+
maxItems: 5
487467
interrupt-names:
488-
minItems: 3
489468
items:
490469
- const: pwr_event
470+
- const: hs_phy_irq
491471
- const: dp_hs_phy_irq
492472
- const: dm_hs_phy_irq
493473
- const: ss_phy_irq
@@ -525,12 +505,13 @@ examples:
525505
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
526506
assigned-clock-rates = <19200000>, <150000000>;
527507
528-
interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
529-
<GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
508+
interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
509+
<GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
510+
<GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
530511
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
531-
<GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
532-
interrupt-names = "hs_phy_irq", "ss_phy_irq",
533-
"dm_hs_phy_irq", "dp_hs_phy_irq";
512+
<GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
513+
interrupt-names = "pwr_event", "hs_phy_irq",
514+
"dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq";
534515
535516
power-domains = <&gcc USB30_PRIM_GDSC>;
536517

0 commit comments

Comments
 (0)