* [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms
@ 2023-12-04 10:09 Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
` (6 more replies)
0 siblings, 7 replies; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
Qualcomm targets define the following interrupts for usb wakeup:
{dp/dm}_hs_phy_irq, hs_phy_irq, pwr_event, ss_phy_irq.
But QUSB2 Phy based targets have another interrupt which gets triggered
in response to J/K states on dp/dm pads. Its functionality is replaced
by dp/dm interrupts on Femto/m31/eusb2 phy based targets for wakeup
purposes. Exceptions are some targets like SDM845/SDM670/SM6350 where
dp/dm irq's are used although they are qusb2 phy targets.
Currently in QUSB2 Phy based DT's, te qusb2_phy interrupt is named and
used as "hs_phy_irq" when in fact it is a different interrupt (used by
HW validation folks for debug purposes and not used on any downstream
target qusb/non-qusb).
On some non-QUSB2 targets (like sm8450/sm8550), the pwr_event IRQ was
named as hs_phy_irq and actual pwr_event_irq was skipped.
This series tries to address the discrepancies in the interrupt numbering
adding the missing interrupts and correcting the existing ones.
This series has been compared with downstream counter part and hw specifics
to ensure the numbering is right. Since there is not functionality change
the code has been only compile tested.
Changes in v2:
Removed additional compatibles added for different targets in v1.
Specified permuations of interrupts possible for QC targets and regrouped
interrupts for most of the DT's.
Rebased on top of wakeup interrupts fixes by Johan Hovold:
https://patchwork.kernel.org/project/linux-arm-msm/cover/20231120164331.8116-1-johan+linaro@kernel.org/
Link to v1: (providing patchwork link since threading was broken in v1)
https://patchwork.kernel.org/project/linux-arm-msm/cover/20231122191259.3021-1-quic_kriskura@quicinc.com/
Krishna Kurapati (6):
dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets
arm64: dts: qcom: Fix hs_phy_irq for non-QUSB2 targets
arm64: dts: qcom: Fix hs_phy_irq for SDM670/SDM845/SM6350
arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332
.../devicetree/bindings/usb/qcom,dwc3.yaml | 122 +++++-------------
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 14 +-
arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 14 +-
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 8 +-
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 13 ++
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 14 ++
arch/arm64/boot/dts/qcom/msm8953.dtsi | 7 +-
arch/arm64/boot/dts/qcom/msm8996.dtsi | 17 ++-
arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +-
arch/arm64/boot/dts/qcom/qcs404.dtsi | 16 +++
arch/arm64/boot/dts/qcom/sa8775p.dtsi | 6 +
arch/arm64/boot/dts/qcom/sc7180.dtsi | 14 +-
arch/arm64/boot/dts/qcom/sc7280.dtsi | 12 +-
arch/arm64/boot/dts/qcom/sdm630.dtsi | 17 ++-
arch/arm64/boot/dts/qcom/sdm670.dtsi | 14 +-
arch/arm64/boot/dts/qcom/sdm845.dtsi | 28 ++--
arch/arm64/boot/dts/qcom/sm6115.dtsi | 9 +-
arch/arm64/boot/dts/qcom/sm6125.dtsi | 9 ++
arch/arm64/boot/dts/qcom/sm6350.dtsi | 13 +-
arch/arm64/boot/dts/qcom/sm6375.dtsi | 12 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 ++--
arch/arm64/boot/dts/qcom/sm8250.dtsi | 28 ++--
arch/arm64/boot/dts/qcom/sm8350.dtsi | 28 ++--
arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 +-
arch/arm64/boot/dts/qcom/sm8550.dtsi | 12 +-
drivers/usb/dwc3/dwc3-qcom.c | 22 ++--
26 files changed, 293 insertions(+), 203 deletions(-)
--
2.42.0
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
@ 2023-12-04 10:09 ` Krishna Kurapati
2023-12-07 15:23 ` Johan Hovold
` (2 more replies)
2023-12-04 10:09 ` [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq Krishna Kurapati
` (5 subsequent siblings)
6 siblings, 3 replies; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
The high speed related interrupts present on QC targets are as follows:
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.
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.
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 interrupts based on whether qusb2_phy interrupt is used or
{dp/dm}_hs_phy_irq is used and whether hs_phy_irq is present or not.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
.../devicetree/bindings/usb/qcom,dwc3.yaml | 147 +++++++-----------
1 file changed, 58 insertions(+), 89 deletions(-)
diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
index 3ec62027f663..94deef765ec3 100644
--- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
@@ -98,12 +98,30 @@ properties:
- const: apps-usb
interrupts:
- minItems: 1
- maxItems: 4
+ description: |
+ Different types of interrupts are used based on HS phy used on target::
+ - qusb2_phy:: 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.
+ - {dp/dm}_hs_phy_irq:: These IRQ's directly reflect changes on the DP/
+ DM pads of the SoC. These are used for wakeup
+ only on SoCs with non-QUSBb2 targets with
+ exception of SDM670/SDM845/SM6350.
+ - ss_phy_irq:: When in super speed mode of operation, interrupts are
+ received when a wakeup event is received on ss_phy_irq.
+ - hs_phY_irq:: Apart from DP/DM/QUSB2 Phy interrupts, there is
+ hs_phy_irq which is not triggered by default and its
+ functionality is mutually exclusive to that of
+ {dp/dm}_hs_phy_irq and qusb2_phy_irq.
+ - pwr_event:: Used for wakeup based on other power events.
+ minItems: 2
+ maxItems: 5
interrupt-names:
- minItems: 1
- maxItems: 4
+ minItems: 2
+ maxItems: 5
qcom,select-utmi-as-pipe-clk:
description:
@@ -359,116 +377,54 @@ allOf:
compatible:
contains:
enum:
- - qcom,ipq4019-dwc3
+ - qcom,ipq5018-dwc3
- qcom,ipq6018-dwc3
- - qcom,ipq8064-dwc3
- qcom,ipq8074-dwc3
- - qcom,msm8994-dwc3
- - qcom,qcs404-dwc3
- - qcom,sc7180-dwc3
- - qcom,sdm670-dwc3
- - qcom,sdm845-dwc3
- - qcom,sdx55-dwc3
- - qcom,sdx65-dwc3
- - qcom,sdx75-dwc3
- - qcom,sm4250-dwc3
- - qcom,sm6350-dwc3
- - qcom,sm8150-dwc3
- - qcom,sm8250-dwc3
- - qcom,sm8350-dwc3
- - qcom,sm8450-dwc3
- - qcom,sm8550-dwc3
- - qcom,sm8650-dwc3
+ - qcom,msm8953-dwc3
+ - qcom,msm8998-dwc3
+ - qcom,qcm2290-dwc3
then:
properties:
- interrupts:
- items:
- - description: The interrupt that is asserted
- when a wakeup event is received on USB2 bus.
- - description: The interrupt that is asserted
- when a wakeup event is received on USB3 bus.
- - description: Wakeup event on DM line.
- - description: Wakeup event on DP line.
interrupt-names:
items:
- - const: hs_phy_irq
- - const: ss_phy_irq
- - const: dm_hs_phy_irq
- - const: dp_hs_phy_irq
+ - const: pwr_event
+ - const: qusb2_phy
+ - const: ss_phy_irq (optional)
- if:
properties:
compatible:
contains:
enum:
- - qcom,msm8953-dwc3
- qcom,msm8996-dwc3
- - qcom,msm8998-dwc3
+ - qcom,qcs404-dwc3
+ - qcom,sdm660-dwc3
- qcom,sm6115-dwc3
- qcom,sm6125-dwc3
then:
properties:
- interrupts:
- maxItems: 2
interrupt-names:
items:
+ - const: pwr_event
- const: hs_phy_irq
- - const: ss_phy_irq
+ - const: qusb2_phy
+ - const: ss_phy_irq (optional)
- if:
properties:
compatible:
contains:
enum:
- - qcom,ipq5018-dwc3
- qcom,ipq5332-dwc3
- - qcom,sdm660-dwc3
- then:
- properties:
- interrupts:
- minItems: 1
- maxItems: 2
- interrupt-names:
- minItems: 1
- items:
- - const: hs_phy_irq
- - const: ss_phy_irq
-
- - if:
- properties:
- compatible:
- contains:
- enum:
- - qcom,sc7280-dwc3
- then:
- properties:
- interrupts:
- minItems: 3
- maxItems: 4
- interrupt-names:
- minItems: 3
- items:
- - const: hs_phy_irq
- - const: dp_hs_phy_irq
- - const: dm_hs_phy_irq
- - const: ss_phy_irq
-
- - if:
- properties:
- compatible:
- contains:
- enum:
- qcom,sc8280xp-dwc3
then:
properties:
- interrupts:
- maxItems: 4
interrupt-names:
items:
- const: pwr_event
- const: dp_hs_phy_irq
- const: dm_hs_phy_irq
- - const: ss_phy_irq
+ - const: ss_phy_irq (optional)
- if:
properties:
@@ -476,18 +432,30 @@ allOf:
contains:
enum:
- qcom,sa8775p-dwc3
+ - qcom,sc7180-dwc3
+ - qcom,sc7280-dwc3
+ - qcom,sdm670-dwc3
+ - qcom,sdm845-dwc3
+ - qcom,sdx55-dwc3
+ - qcom,sdx65-dwc3
+ - qcom,sdx75-dwc3
+ - qcom,sm6350-dwc3
+ - qcom,sm6375-dwc3
+ - qcom,sm8150-dwc3
+ - qcom,sm8250-dwc3
+ - qcom,sm8350-dwc3
+ - qcom,sm8450-dwc3
+ - qcom,sm8550-dwc3
+ - qcom,sm8650-dwc3
then:
properties:
- interrupts:
- minItems: 3
- maxItems: 4
interrupt-names:
- minItems: 3
items:
- const: pwr_event
+ - const: hs_phy_irq
- const: dp_hs_phy_irq
- const: dm_hs_phy_irq
- - const: ss_phy_irq
+ - const: ss_phy_irq (optional)
additionalProperties: false
@@ -522,12 +490,13 @@ examples:
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <150000000>;
- interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event", "hs_phy_irq",
+ "dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
--
2.42.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
@ 2023-12-04 10:09 ` Krishna Kurapati
2023-12-07 15:28 ` Johan Hovold
2023-12-04 10:09 ` [PATCH v2 3/6] arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets Krishna Kurapati
` (4 subsequent siblings)
6 siblings, 1 reply; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
For wakeup to work, driver needs to enable interrupts that depict what is
happening on th DP/DM lines. On QUSB targets, this is identified by
qusb2_phy whereas on SoCs using Femto PHY, separate {dp,dm}_hs_phy_irq's
are used instead.
The implementation incorrectly names qusb2_phy interrupts as "hs_phy_irq".
Clean this up so that driver would be using only qusb2/(dp & dm) for wakeup
purposes.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
drivers/usb/dwc3/dwc3-qcom.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index fdf6d5d3c2ad..dbd6a5b2b289 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -57,7 +57,7 @@ struct dwc3_acpi_pdata {
u32 qscratch_base_offset;
u32 qscratch_base_size;
u32 dwc3_core_base_size;
- int hs_phy_irq_index;
+ int qusb2_phy_irq_index;
int dp_hs_phy_irq_index;
int dm_hs_phy_irq_index;
int ss_phy_irq_index;
@@ -73,7 +73,7 @@ struct dwc3_qcom {
int num_clocks;
struct reset_control *resets;
- int hs_phy_irq;
+ int qusb2_phy_irq;
int dp_hs_phy_irq;
int dm_hs_phy_irq;
int ss_phy_irq;
@@ -372,7 +372,7 @@ static void dwc3_qcom_disable_wakeup_irq(int irq)
static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
{
- dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq);
+ dwc3_qcom_disable_wakeup_irq(qcom->qusb2_phy_irq);
if (qcom->usb2_speed == USB_SPEED_LOW) {
dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq);
@@ -389,7 +389,7 @@ static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
{
- dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq, 0);
+ dwc3_qcom_enable_wakeup_irq(qcom->qusb2_phy_irq, 0);
/*
* Configure DP/DM line interrupts based on the USB2 device attached to
@@ -542,19 +542,19 @@ static int dwc3_qcom_setup_irq(struct platform_device *pdev)
int irq;
int ret;
- irq = dwc3_qcom_get_irq(pdev, "hs_phy_irq",
- pdata ? pdata->hs_phy_irq_index : -1);
+ irq = dwc3_qcom_get_irq(pdev, "qusb2_phy",
+ pdata ? pdata->qusb2_phy_irq_index : -1);
if (irq > 0) {
/* Keep wakeup interrupts disabled until suspend */
ret = devm_request_threaded_irq(qcom->dev, irq, NULL,
qcom_dwc3_resume_irq,
IRQF_ONESHOT | IRQF_NO_AUTOEN,
- "qcom_dwc3 HS", qcom);
+ "qcom_dwc3 QUSB2", qcom);
if (ret) {
- dev_err(qcom->dev, "hs_phy_irq failed: %d\n", ret);
+ dev_err(qcom->dev, "qusb2_phy_irq failed: %d\n", ret);
return ret;
}
- qcom->hs_phy_irq = irq;
+ qcom->qusb2_phy_irq = irq;
}
irq = dwc3_qcom_get_irq(pdev, "dp_hs_phy_irq",
@@ -1058,7 +1058,7 @@ static const struct dwc3_acpi_pdata sdm845_acpi_pdata = {
.qscratch_base_offset = SDM845_QSCRATCH_BASE_OFFSET,
.qscratch_base_size = SDM845_QSCRATCH_SIZE,
.dwc3_core_base_size = SDM845_DWC3_CORE_SIZE,
- .hs_phy_irq_index = 1,
+ .qusb2_phy_irq_index = 1,
.dp_hs_phy_irq_index = 4,
.dm_hs_phy_irq_index = 3,
.ss_phy_irq_index = 2
@@ -1068,7 +1068,7 @@ static const struct dwc3_acpi_pdata sdm845_acpi_urs_pdata = {
.qscratch_base_offset = SDM845_QSCRATCH_BASE_OFFSET,
.qscratch_base_size = SDM845_QSCRATCH_SIZE,
.dwc3_core_base_size = SDM845_DWC3_CORE_SIZE,
- .hs_phy_irq_index = 1,
+ .qusb2_phy_irq_index = 1,
.dp_hs_phy_irq_index = 4,
.dm_hs_phy_irq_index = 3,
.ss_phy_irq_index = 2,
--
2.42.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 3/6] arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq Krishna Kurapati
@ 2023-12-04 10:09 ` Krishna Kurapati
2023-12-07 15:32 ` Johan Hovold
2023-12-04 10:09 ` [PATCH v2 4/6] arm64: dts: qcom: Fix hs_phy_irq for non-QUSB2 targets Krishna Kurapati
` (3 subsequent siblings)
6 siblings, 1 reply; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
On several QUSB2 Targets, the hs_phy_irq mentioned is actually
qusb2_phy interrupt specific to QUSB2 Phy's. Rename hs_phy_irq
to qusb_phy for such targets.
In actuality, the hs_phy_irq is also present in these targets, but
kept in for debug purposes in hw test environments. This is not
triggered by default and its functionality is mutually exclusive
to that of qusb2_phy interrupt.
Add missing hs_phy_irq's, pwr_event irq's for qusb2 phy targets.
Also modify order of interrupts in accordance to bindings update.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 13 +++++++++++++
arch/arm64/boot/dts/qcom/ipq8074.dtsi | 14 ++++++++++++++
arch/arm64/boot/dts/qcom/msm8953.dtsi | 7 +++++--
arch/arm64/boot/dts/qcom/msm8996.dtsi | 17 +++++++++++++----
arch/arm64/boot/dts/qcom/msm8998.dtsi | 7 +++++--
arch/arm64/boot/dts/qcom/sdm630.dtsi | 17 +++++++++++++----
arch/arm64/boot/dts/qcom/sm6115.dtsi | 9 +++++++--
arch/arm64/boot/dts/qcom/sm6125.dtsi | 9 +++++++++
8 files changed, 79 insertions(+), 14 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
index e59b9df96c7e..4b75990d6b56 100644
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -411,6 +411,12 @@ usb2: usb@70f8800 {
<&gcc GCC_USB1_MOCK_UTMI_CLK>;
assigned-clock-rates = <133330000>,
<24000000>;
+
+ interrupts-extended = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "qusb2_phy";
+
resets = <&gcc GCC_USB1_BCR>;
status = "disabled";
@@ -559,6 +565,13 @@ usb3: usb@8af8800 {
<133330000>,
<20000000>;
+ interrupts-extended = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "qusb2_phy",
+ "ss_phy_irq";
+
resets = <&gcc GCC_USB0_BCR>;
status = "disabled";
diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
index 2f275c84e566..a363229ee73f 100644
--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
@@ -619,6 +619,13 @@ usb_0: usb@8af8800 {
<133330000>,
<19200000>;
+ interrupts-extended = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "qusb2_phy",
+ "ss_phy_irq";
+
power-domains = <&gcc USB0_GDSC>;
resets = <&gcc GCC_USB0_BCR>;
@@ -661,6 +668,13 @@ usb_1: usb@8cf8800 {
<133330000>,
<19200000>;
+ interrupts-extended = <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "qusb2_phy",
+ "ss_phy_irq";
+
power-domains = <&gcc USB1_GDSC>;
resets = <&gcc GCC_USB1_BCR>;
diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi b/arch/arm64/boot/dts/qcom/msm8953.dtsi
index e7de7632669a..29a6f9ad3df3 100644
--- a/arch/arm64/boot/dts/qcom/msm8953.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi
@@ -1118,9 +1118,12 @@ usb3: usb@70f8800 {
#size-cells = <1>;
ranges;
- interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq";
+ interrupt-names = "pwr_event",
+ "qusb2_phy",
+ "ss_phy_irq";
clocks = <&gcc GCC_USB_PHY_CFG_AHB_CLK>,
<&gcc GCC_USB30_MASTER_CLK>,
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 6ba9da9e6a8b..700b7b89bd69 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -3026,9 +3026,14 @@ usb3: usb@6af8800 {
#size-cells = <1>;
ranges;
- interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq";
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy",
+ "ss_phy_irq";
clocks = <&gcc GCC_SYS_NOC_USB3_AXI_CLK>,
<&gcc GCC_USB30_MASTER_CLK>,
@@ -3388,8 +3393,12 @@ usb2: usb@76f8800 {
#size-cells = <1>;
ranges;
- interrupts = <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq";
+ interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy";
clocks = <&gcc GCC_PERIPH_NOC_USB20_AHB_CLK>,
<&gcc GCC_USB20_MASTER_CLK>,
diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
index b485bf925ce6..9b7d22c4f197 100644
--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
@@ -2135,9 +2135,12 @@ usb3: usb@a8f8800 {
<&gcc GCC_USB30_MASTER_CLK>;
assigned-clock-rates = <19200000>, <120000000>;
- interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq";
+ interrupt-names = "pwr_event",
+ "qusb2_phy",
+ "ss_phy_irq";
power-domains = <&gcc USB_30_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi
index 775700f78e0f..701f83d7e405 100644
--- a/arch/arm64/boot/dts/qcom/sdm630.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi
@@ -1303,9 +1303,14 @@ usb3: usb@a8f8800 {
assigned-clock-rates = <19200000>, <120000000>,
<19200000>;
- interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq";
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy",
+ "ss_phy_irq";
power-domains = <&gcc USB_30_GDSC>;
qcom,select-utmi-as-pipe-clk;
@@ -1485,8 +1490,12 @@ usb2: usb@c2f8800 {
<&gcc GCC_USB20_MASTER_CLK>;
assigned-clock-rates = <19200000>, <60000000>;
- interrupts = <GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq";
+ interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy";
qcom,select-utmi-as-pipe-clk;
diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi
index 839c60351240..7799c00ee8a3 100644
--- a/arch/arm64/boot/dts/qcom/sm6115.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi
@@ -1301,9 +1301,14 @@ usb: usb@4ef8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <66666667>;
- interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq";
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy",
+ "ss_phy_irq";
resets = <&gcc GCC_USB30_PRIM_BCR>;
power-domains = <&gcc GCC_USB30_PRIM_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm6125.dtsi b/arch/arm64/boot/dts/qcom/sm6125.dtsi
index eb07eca3a48d..3f9dc4eef871 100644
--- a/arch/arm64/boot/dts/qcom/sm6125.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6125.dtsi
@@ -1185,6 +1185,15 @@ usb3: usb@4ef8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <66666667>;
+ interrupts = <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy",
+ "ss_phy_irq";
+
power-domains = <&gcc USB30_PRIM_GDSC>;
qcom,select-utmi-as-pipe-clk;
status = "disabled";
--
2.42.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 4/6] arm64: dts: qcom: Fix hs_phy_irq for non-QUSB2 targets
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
` (2 preceding siblings ...)
2023-12-04 10:09 ` [PATCH v2 3/6] arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets Krishna Kurapati
@ 2023-12-04 10:09 ` Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 5/6] arm64: dts: qcom: Fix hs_phy_irq for SDM670/SDM845/SM6350 Krishna Kurapati
` (2 subsequent siblings)
6 siblings, 0 replies; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
On non-QUSB2 targets (like the ones that use femto phys, M31 phy, eusb2
phy), many of the QCOM DTs are missing the IRQ for either hs_phy_irq or
pwr_event. In one case, the hs_phy_irq was incorrectly defined with the
latter's IRQ number. Since the DT must describe the hw whether or not
the driver uses these interrupts, fix and add the missing entries in order
to describe the HW completely and accurately.
Also modify order of interrupts in accordance to bindings update.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 14 ++++++++-----
arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 14 +++++++------
arch/arm64/boot/dts/qcom/sa8775p.dtsi | 6 ++++++
arch/arm64/boot/dts/qcom/sc7180.dtsi | 14 ++++++++-----
arch/arm64/boot/dts/qcom/sc7280.dtsi | 12 +++++++----
arch/arm64/boot/dts/qcom/sm6375.dtsi | 12 ++++++-----
arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 +++++++++++++++++---------
arch/arm64/boot/dts/qcom/sm8250.dtsi | 28 +++++++++++++++-----------
arch/arm64/boot/dts/qcom/sm8350.dtsi | 28 +++++++++++++++-----------
arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 ++++++-----
arch/arm64/boot/dts/qcom/sm8550.dtsi | 12 ++++++-----
11 files changed, 111 insertions(+), 69 deletions(-)
diff --git a/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi b/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi
index e30dbf12990a..3c85f7d0f163 100644
--- a/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi
@@ -585,12 +585,16 @@ usb: usb@a6f8800 {
<&gcc GCC_USB30_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 157 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 158 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 157 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_GDSC>;
diff --git a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
index e559adaaeee7..1014853007cf 100644
--- a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
@@ -498,14 +498,16 @@ usb: usb@a6f8800 {
<&gcc GCC_USB30_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 76 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 19 IRQ_TYPE_EDGE_BOTH>,
<&pdc 18 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 19 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 76 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
index 4b42a329460c..a75613d26c06 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
@@ -1610,10 +1610,12 @@ usb_0: usb@a6f8800 {
assigned-clock-rates = <19200000>, <200000000>;
interrupts-extended = <&intc GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
<&pdc 12 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "pwr_event",
+ "hs_phy_irq",
"dp_hs_phy_irq",
"dm_hs_phy_irq",
"ss_phy_irq";
@@ -1697,10 +1699,12 @@ usb_1: usb@a8f8800 {
assigned-clock-rates = <19200000>, <200000000>;
interrupts-extended = <&intc GIC_SPI 352 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 8 IRQ_TYPE_EDGE_BOTH>,
<&pdc 7 IRQ_TYPE_EDGE_BOTH>,
<&pdc 13 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "pwr_event",
+ "hs_phy_irq",
"dp_hs_phy_irq",
"dm_hs_phy_irq",
"ss_phy_irq";
@@ -1760,9 +1764,11 @@ usb_2: usb@a4f8800 {
assigned-clock-rates = <19200000>, <200000000>;
interrupts-extended = <&intc GIC_SPI 444 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 443 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 10 IRQ_TYPE_EDGE_BOTH>,
<&pdc 9 IRQ_TYPE_EDGE_BOTH>;
interrupt-names = "pwr_event",
+ "hs_phy_irq",
"dp_hs_phy_irq",
"dm_hs_phy_irq";
diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 8dc50d4afe29..9ae62df49274 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -2964,12 +2964,16 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <150000000>;
- interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 6 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 9 IRQ_TYPE_EDGE_BOTH>,
<&pdc 8 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 9 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <&pdc 6 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
required-opps = <&rpmhpd_opp_nom>;
diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 5ca77acd2a46..c8847220aac0 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -3425,10 +3425,12 @@ usb_2: usb@8cf8800 {
<&gcc GCC_USB30_SEC_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 12 IRQ_TYPE_EDGE_BOTH>,
<&pdc 13 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
"dp_hs_phy_irq",
"dm_hs_phy_irq";
@@ -3680,11 +3682,13 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
<&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
<&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq",
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
"dp_hs_phy_irq",
"dm_hs_phy_irq",
"ss_phy_irq";
diff --git a/arch/arm64/boot/dts/qcom/sm6375.dtsi b/arch/arm64/boot/dts/qcom/sm6375.dtsi
index b479f3d9a3a8..27ea0668a681 100644
--- a/arch/arm64/boot/dts/qcom/sm6375.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6375.dtsi
@@ -1361,13 +1361,15 @@ usb_1: usb@4ef8800 {
assigned-clock-rates = <19200000>, <133333333>;
interrupts = <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 254 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 94 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 93 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 94 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 3e7048d8ac55..f05397443111 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -3565,12 +3565,16 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
@@ -3618,12 +3622,16 @@ usb_2: usb@a8f8800 {
<&gcc GCC_USB30_SEC_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_SEC_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index be970472f6c4..3cd07813d402 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -4131,14 +4131,16 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
@@ -4199,14 +4201,16 @@ usb_2: usb@a8f8800 {
<&gcc GCC_USB30_SEC_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 16 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
<&pdc 13 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 12 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 16 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_SEC_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
index b46236235b7f..7fc2997456a5 100644
--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
@@ -2321,14 +2321,16 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
@@ -2394,14 +2396,16 @@ usb_2: usb@a8f8800 {
<&gcc GCC_USB30_SEC_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
- interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 16 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts-extended = <&intc GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
<&pdc 13 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 12 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 16 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_SEC_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
index 1783fa78bdbc..163186f009c4 100644
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -4298,13 +4298,15 @@ usb_1: usb@a6f8800 {
assigned-clock-rates = <19200000>, <200000000>;
interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qcom/sm8550.dtsi
index 9b5b098bb7e8..0c55c46dd2bb 100644
--- a/arch/arm64/boot/dts/qcom/sm8550.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi
@@ -2922,13 +2922,15 @@ usb_1: usb@a6f8800 {
assigned-clock-rates = <19200000>, <200000000>;
interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq",
- "ss_phy_irq",
+ <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
"dm_hs_phy_irq",
- "dp_hs_phy_irq";
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
required-opps = <&rpmhpd_opp_nom>;
--
2.42.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 5/6] arm64: dts: qcom: Fix hs_phy_irq for SDM670/SDM845/SM6350
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
` (3 preceding siblings ...)
2023-12-04 10:09 ` [PATCH v2 4/6] arm64: dts: qcom: Fix hs_phy_irq for non-QUSB2 targets Krishna Kurapati
@ 2023-12-04 10:09 ` Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 6/6] arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332 Krishna Kurapati
2023-12-07 14:53 ` [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Johan Hovold
6 siblings, 0 replies; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
For sm6350/sdm670/sdm845, although they are qusb2 phy targets, dp/dm
interrupts are used for wakeup instead of qusb2_phy irq. These targets
were part of a generation that were the last ones to implement QUSB2 PHY
and the design incorporated dedicated DP/DM interrupts which eventually
carried forward to the newer femto based targets.
Add the missing pwr_event irq for these targets. Also modify order of
interrupts in accordance to bindings update.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
arch/arm64/boot/dts/qcom/sdm670.dtsi | 14 +++++++++-----
arch/arm64/boot/dts/qcom/sdm845.dtsi | 28 ++++++++++++++++++----------
arch/arm64/boot/dts/qcom/sm6350.dtsi | 13 ++++++++-----
3 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm670.dtsi b/arch/arm64/boot/dts/qcom/sdm670.dtsi
index c873560ae9d5..d189bcfeeb05 100644
--- a/arch/arm64/boot/dts/qcom/sdm670.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm670.dtsi
@@ -1295,12 +1295,16 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <150000000>;
- interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 0d2be706505a..e672707ee4de 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -4053,12 +4053,16 @@ usb_1: usb@a6f8800 {
<&gcc GCC_USB30_PRIM_MASTER_CLK>;
assigned-clock-rates = <19200000>, <150000000>;
- interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
@@ -4104,12 +4108,16 @@ usb_2: usb@a8f8800 {
<&gcc GCC_USB30_SEC_MASTER_CLK>;
assigned-clock-rates = <19200000>, <150000000>;
- interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>,
<GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>,
- <GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>;
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_SEC_GDSC>;
diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 8fd6f4d03490..be1ee176b520 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1840,12 +1840,15 @@ usb_1: usb@a6f8800 {
"mock_utmi";
interrupts-extended = <&intc GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
- <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
+ <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
+ <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
<&pdc 15 IRQ_TYPE_EDGE_BOTH>,
- <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
-
- interrupt-names = "hs_phy_irq", "ss_phy_irq",
- "dm_hs_phy_irq", "dp_hs_phy_irq";
+ <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq",
+ "ss_phy_irq";
power-domains = <&gcc USB30_PRIM_GDSC>;
--
2.42.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH v2 6/6] arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
` (4 preceding siblings ...)
2023-12-04 10:09 ` [PATCH v2 5/6] arm64: dts: qcom: Fix hs_phy_irq for SDM670/SDM845/SM6350 Krishna Kurapati
@ 2023-12-04 10:09 ` Krishna Kurapati
2023-12-07 15:36 ` Johan Hovold
2023-12-07 14:53 ` [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Johan Hovold
6 siblings, 1 reply; 19+ messages in thread
From: Krishna Kurapati @ 2023-12-04 10:09 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp, Krishna Kurapati
For qcs404 and ipq5332, certain interrupts are missing in DT.
Add them to ensure they are in accordance to bindings.
Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
---
arch/arm64/boot/dts/qcom/ipq5332.dtsi | 8 ++++++--
arch/arm64/boot/dts/qcom/qcs404.dtsi | 16 ++++++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index d3fef2f80a81..82cd807af475 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -307,8 +307,12 @@ usb: usb@8af8800 {
compatible = "qcom,ipq5332-dwc3", "qcom,dwc3";
reg = <0x08af8800 0x400>;
- interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "hs_phy_irq";
+ interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 53 IRQ_TYPE_EDGE_BOTH>,
+ <GIC_SPI 52 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-names = "pwr_event",
+ "dp_hs_phy_irq",
+ "dm_hs_phy_irq";
clocks = <&gcc GCC_USB0_MASTER_CLK>,
<&gcc GCC_SNOC_USB_CLK>,
diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 2721f32dfb71..469ea4d8cd3b 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -684,6 +684,14 @@ usb3: usb@7678800 {
assigned-clocks = <&gcc GCC_USB20_MOCK_UTMI_CLK>,
<&gcc GCC_USB30_MASTER_CLK>;
assigned-clock-rates = <19200000>, <200000000>;
+
+ interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 319 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy";
+
status = "disabled";
usb3_dwc3: usb@7580000 {
@@ -713,6 +721,14 @@ usb2: usb@79b8800 {
assigned-clocks = <&gcc GCC_USB20_MOCK_UTMI_CLK>,
<&gcc GCC_USB_HS_SYSTEM_CLK>;
assigned-clock-rates = <19200000>, <133333333>;
+
+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 318 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "pwr_event",
+ "hs_phy_irq",
+ "qusb2_phy";
+
status = "disabled";
usb@78c0000 {
--
2.42.0
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
` (5 preceding siblings ...)
2023-12-04 10:09 ` [PATCH v2 6/6] arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332 Krishna Kurapati
@ 2023-12-07 14:53 ` Johan Hovold
6 siblings, 0 replies; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 14:53 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Mon, Dec 04, 2023 at 03:39:44PM +0530, Krishna Kurapati wrote:
> Qualcomm targets define the following interrupts for usb wakeup:
> {dp/dm}_hs_phy_irq, hs_phy_irq, pwr_event, ss_phy_irq.
>
> But QUSB2 Phy based targets have another interrupt which gets triggered
> in response to J/K states on dp/dm pads. Its functionality is replaced
> by dp/dm interrupts on Femto/m31/eusb2 phy based targets for wakeup
> purposes. Exceptions are some targets like SDM845/SDM670/SM6350 where
> dp/dm irq's are used although they are qusb2 phy targets.
>
> Currently in QUSB2 Phy based DT's, te qusb2_phy interrupt is named and
> used as "hs_phy_irq" when in fact it is a different interrupt (used by
> HW validation folks for debug purposes and not used on any downstream
> target qusb/non-qusb).
>
> On some non-QUSB2 targets (like sm8450/sm8550), the pwr_event IRQ was
> named as hs_phy_irq and actual pwr_event_irq was skipped.
>
> This series tries to address the discrepancies in the interrupt numbering
> adding the missing interrupts and correcting the existing ones.
>
> This series has been compared with downstream counter part and hw specifics
> to ensure the numbering is right. Since there is not functionality change
> the code has been only compile tested.
This is a good summary.
> Changes in v2:
> Removed additional compatibles added for different targets in v1.
> Specified permuations of interrupts possible for QC targets and regrouped
> interrupts for most of the DT's.
>
> Rebased on top of wakeup interrupts fixes by Johan Hovold:
> https://patchwork.kernel.org/project/linux-arm-msm/cover/20231120164331.8116-1-johan+linaro@kernel.org/
>
> Link to v1: (providing patchwork link since threading was broken in v1)
> https://patchwork.kernel.org/project/linux-arm-msm/cover/20231122191259.3021-1-quic_kriskura@quicinc.com/
>
> Krishna Kurapati (6):
> dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
> usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
> arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets
> arm64: dts: qcom: Fix hs_phy_irq for non-QUSB2 targets
> arm64: dts: qcom: Fix hs_phy_irq for SDM670/SDM845/SM6350
> arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332
You're still mixing USB binding/driver and DT updates, which is what we
want for most subsystems, but not for USB.
For the next version, please split it in two series as these will go in
through two different maintainer trees.
You can link to the driver/binding series from the devicetree series and
mention to Bjorn that it should not be merged before the bindings are
in.
And please use lore for any links instead of patchwork.
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
@ 2023-12-07 15:23 ` Johan Hovold
2023-12-07 15:44 ` Krishna Kurapati PSSNV
2023-12-08 16:29 ` Rob Herring
2023-12-09 8:02 ` Krzysztof Kozlowski
2 siblings, 1 reply; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 15:23 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Mon, Dec 04, 2023 at 03:39:45PM +0530, Krishna Kurapati wrote:
> The high speed related interrupts present on QC targets are as follows:
>
> 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.
>
> 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.
>
> 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 interrupts based on whether qusb2_phy interrupt is used or
> {dp/dm}_hs_phy_irq is used and whether hs_phy_irq is present or not.
s/interrupts/SoCs in four groups/
And say something about the SS PHY interrupt being treated as optional
as there are SoCs with multiple controllers where only some supports SS.
As Krzysztof mentioned you should also add something to motivate why
this de-facto ABI breakage by reordering interrupts is justified and
safe in this case.
> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
> ---
> .../devicetree/bindings/usb/qcom,dwc3.yaml | 147 +++++++-----------
> 1 file changed, 58 insertions(+), 89 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> index 3ec62027f663..94deef765ec3 100644
> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> @@ -98,12 +98,30 @@ properties:
> - const: apps-usb
>
> interrupts:
> - minItems: 1
> - maxItems: 4
> + description: |
> + Different types of interrupts are used based on HS phy used on target::
Try to use uppercase 'PHY' consistently in text throughout the series.
> + - qusb2_phy:: 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.
> + - {dp/dm}_hs_phy_irq:: These IRQ's directly reflect changes on the DP/
> + DM pads of the SoC. These are used for wakeup
> + only on SoCs with non-QUSBb2 targets with
QUSB2 typo
> + exception of SDM670/SDM845/SM6350.
> + - ss_phy_irq:: When in super speed mode of operation, interrupts are
Capitalise 'Super Speed'
> + received when a wakeup event is received on ss_phy_irq.
The description as it stands sounds circular. And this one is only used
for remote wakeup right?
> + - hs_phY_irq:: Apart from DP/DM/QUSB2 Phy interrupts, there is
s/phY/phy/
Perhaps rephrase to sound less like a commit message and to make it a
bit more concise.
But this is already an improvement over the current descriptions which
are too terse and not even correct.
> + hs_phy_irq which is not triggered by default and its
> + functionality is mutually exclusive to that of
> + {dp/dm}_hs_phy_irq and qusb2_phy_irq.
> + - pwr_event:: Used for wakeup based on other power events.
I'm not sure about the free text description of these (format etc), but
at least this avoid repeating the descriptions for each permutation.
Perhaps the DT maintainers can chime in here.
I think you should reorder them to match the permutations below though.
> + minItems: 2
> + maxItems: 5
>
> interrupt-names:
> - minItems: 1
> - maxItems: 4
> + minItems: 2
> + maxItems: 5
>
> qcom,select-utmi-as-pipe-clk:
> description:
> @@ -359,116 +377,54 @@ allOf:
> compatible:
> contains:
> enum:
> - - qcom,ipq4019-dwc3
> + - qcom,ipq5018-dwc3
> - qcom,ipq6018-dwc3
> - - qcom,ipq8064-dwc3
> - qcom,ipq8074-dwc3
> - - qcom,msm8994-dwc3
> - - qcom,qcs404-dwc3
> - - qcom,sc7180-dwc3
> - - qcom,sdm670-dwc3
> - - qcom,sdm845-dwc3
> - - qcom,sdx55-dwc3
> - - qcom,sdx65-dwc3
> - - qcom,sdx75-dwc3
> - - qcom,sm4250-dwc3
> - - qcom,sm6350-dwc3
> - - qcom,sm8150-dwc3
> - - qcom,sm8250-dwc3
> - - qcom,sm8350-dwc3
> - - qcom,sm8450-dwc3
> - - qcom,sm8550-dwc3
> - - qcom,sm8650-dwc3
> + - qcom,msm8953-dwc3
> + - qcom,msm8998-dwc3
> + - qcom,qcm2290-dwc3
> then:
> properties:
> - interrupts:
> - items:
> - - description: The interrupt that is asserted
> - when a wakeup event is received on USB2 bus.
> - - description: The interrupt that is asserted
> - when a wakeup event is received on USB3 bus.
> - - description: Wakeup event on DM line.
> - - description: Wakeup event on DP line.
> interrupt-names:
> items:
> - - const: hs_phy_irq
> - - const: ss_phy_irq
> - - const: dm_hs_phy_irq
> - - const: dp_hs_phy_irq
> + - const: pwr_event
> + - const: qusb2_phy
> + - const: ss_phy_irq (optional)
You should not include the string "(optional)" here. It was only a
notation I used when we discussed this earlier.
The fact that these are optional should be expressed using min/maxItems
as I mentioned earlier. For the above SoCs that would be
minItems: 2
maxItems: 3
> @@ -522,12 +490,13 @@ examples:
> <&gcc GCC_USB30_PRIM_MASTER_CLK>;
> assigned-clock-rates = <19200000>, <150000000>;
>
> - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
> - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
> + interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
> <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
> - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
> - interrupt-names = "hs_phy_irq", "ss_phy_irq",
> - "dm_hs_phy_irq", "dp_hs_phy_irq";
> + <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "pwr_event", "hs_phy_irq",
> + "dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq";
Perhaps you should align the continuation line here too.
>
> power-domains = <&gcc USB30_PRIM_GDSC>;
Also have you set up the tools so that you can verify your bindings
before posing them? I assume the above wouldn't pass (e.g. due to the
"(optional)" strings).
There's some more details here:
https://docs.kernel.org/devicetree/bindings/writing-schema.html
under "Running checks".
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
2023-12-04 10:09 ` [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq Krishna Kurapati
@ 2023-12-07 15:28 ` Johan Hovold
2023-12-07 15:47 ` Krishna Kurapati PSSNV
0 siblings, 1 reply; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 15:28 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Mon, Dec 04, 2023 at 03:39:46PM +0530, Krishna Kurapati wrote:
> For wakeup to work, driver needs to enable interrupts that depict what is
> happening on th DP/DM lines. On QUSB targets, this is identified by
typo: the
> qusb2_phy whereas on SoCs using Femto PHY, separate {dp,dm}_hs_phy_irq's
> are used instead.
>
> The implementation incorrectly names qusb2_phy interrupts as "hs_phy_irq".
> Clean this up so that driver would be using only qusb2/(dp & dm) for wakeup
> purposes.
Here too you should say something about why this won't break any systems
booting using an older devicetree. Specifically, the QUSB2 PHY interrupt
has never been armed on any system running mainline as those bits never
made it upstream.
So an alternative to this could also be to just drop the QUSB2 PHY
interrupt handling from this driver for now.
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 3/6] arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets
2023-12-04 10:09 ` [PATCH v2 3/6] arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets Krishna Kurapati
@ 2023-12-07 15:32 ` Johan Hovold
0 siblings, 0 replies; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 15:32 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Mon, Dec 04, 2023 at 03:39:47PM +0530, Krishna Kurapati wrote:
> On several QUSB2 Targets, the hs_phy_irq mentioned is actually
> qusb2_phy interrupt specific to QUSB2 Phy's. Rename hs_phy_irq
('PHY' throughout)
> to qusb_phy for such targets.
'qusb2_phy'
> In actuality, the hs_phy_irq is also present in these targets, but
> kept in for debug purposes in hw test environments. This is not
> triggered by default and its functionality is mutually exclusive
> to that of qusb2_phy interrupt.
>
> Add missing hs_phy_irq's, pwr_event irq's for qusb2 phy targets.
You also add some SS_PHY interrupts which could potentially enable
remote wakeup.
> Also modify order of interrupts in accordance to bindings update.
Say something here to as to why this is safe (e.g. all known current
users look up these interrupts by name).
> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 6/6] arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332
2023-12-04 10:09 ` [PATCH v2 6/6] arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332 Krishna Kurapati
@ 2023-12-07 15:36 ` Johan Hovold
0 siblings, 0 replies; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 15:36 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Mon, Dec 04, 2023 at 03:39:50PM +0530, Krishna Kurapati wrote:
> For qcs404 and ipq5332, certain interrupts are missing in DT.
> Add them to ensure they are in accordance to bindings.
Here too you can say something about the remote wakeup functionality
that this potentially enables (at least on ipq5332 with the current
Linux implementation).
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
2023-12-07 15:23 ` Johan Hovold
@ 2023-12-07 15:44 ` Krishna Kurapati PSSNV
2023-12-07 16:13 ` Johan Hovold
0 siblings, 1 reply; 19+ messages in thread
From: Krishna Kurapati PSSNV @ 2023-12-07 15:44 UTC (permalink / raw)
To: Johan Hovold
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
Hi Johan. Thanks for the review.
>
> And say something about the SS PHY interrupt being treated as optional
> as there are SoCs with multiple controllers where only some supports SS.
>
> As Krzysztof mentioned you should also add something to motivate why
> this de-facto ABI breakage by reordering interrupts is justified and
> safe in this case.
>
Sure. Let me come up with a good reason why this breakage is needed.
>
> Try to use uppercase 'PHY' consistently in text throughout the series.
>
ACK.
>> + - qusb2_phy:: 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.
>> + - {dp/dm}_hs_phy_irq:: These IRQ's directly reflect changes on the DP/
>> + DM pads of the SoC. These are used for wakeup
>> + only on SoCs with non-QUSBb2 targets with
>
> QUSB2 typo
>
>> + exception of SDM670/SDM845/SM6350.
>> + - ss_phy_irq:: When in super speed mode of operation, interrupts are
>
> Capitalise 'Super Speed'
>
>> + received when a wakeup event is received on ss_phy_irq.
>
> The description as it stands sounds circular. And this one is only used
> for remote wakeup right?
>
Yes. It is used for remote wakeup. Mentioning it as wakeup event should
be changed ?
>> + - hs_phY_irq:: Apart from DP/DM/QUSB2 Phy interrupts, there is
>
> s/phY/phy/
>
> Perhaps rephrase to sound less like a commit message and to make it a
> bit more concise.
>
> But this is already an improvement over the current descriptions which
> are too terse and not even correct.
>
>> + hs_phy_irq which is not triggered by default and its
>> + functionality is mutually exclusive to that of
>> + {dp/dm}_hs_phy_irq and qusb2_phy_irq.
>> + - pwr_event:: Used for wakeup based on other power events.
>
> I'm not sure about the free text description of these (format etc), but
> at least this avoid repeating the descriptions for each permutation.
>
> Perhaps the DT maintainers can chime in here.
>
> I think you should reorder them to match the permutations below though.
>
Sure. Will reorder them as per permutations.
>> + minItems: 2
>> + maxItems: 5
>>
>> interrupt-names:
>> - minItems: 1
>> - maxItems: 4
>> + minItems: 2
>> + maxItems: 5
>>
>> qcom,select-utmi-as-pipe-clk:
>> description:
>> @@ -359,116 +377,54 @@ allOf:
>> compatible:
>> contains:
>> enum:
>> - - qcom,ipq4019-dwc3
>> + - qcom,ipq5018-dwc3
>> - qcom,ipq6018-dwc3
>> - - qcom,ipq8064-dwc3
>> - qcom,ipq8074-dwc3
>> - - qcom,msm8994-dwc3
>> - - qcom,qcs404-dwc3
>> - - qcom,sc7180-dwc3
>> - - qcom,sdm670-dwc3
>> - - qcom,sdm845-dwc3
>> - - qcom,sdx55-dwc3
>> - - qcom,sdx65-dwc3
>> - - qcom,sdx75-dwc3
>> - - qcom,sm4250-dwc3
>> - - qcom,sm6350-dwc3
>> - - qcom,sm8150-dwc3
>> - - qcom,sm8250-dwc3
>> - - qcom,sm8350-dwc3
>> - - qcom,sm8450-dwc3
>> - - qcom,sm8550-dwc3
>> - - qcom,sm8650-dwc3
>> + - qcom,msm8953-dwc3
>> + - qcom,msm8998-dwc3
>> + - qcom,qcm2290-dwc3
>> then:
>> properties:
>> - interrupts:
>> - items:
>> - - description: The interrupt that is asserted
>> - when a wakeup event is received on USB2 bus.
>> - - description: The interrupt that is asserted
>> - when a wakeup event is received on USB3 bus.
>> - - description: Wakeup event on DM line.
>> - - description: Wakeup event on DP line.
>> interrupt-names:
>> items:
>> - - const: hs_phy_irq
>> - - const: ss_phy_irq
>> - - const: dm_hs_phy_irq
>> - - const: dp_hs_phy_irq
>> + - const: pwr_event
>> + - const: qusb2_phy
>> + - const: ss_phy_irq (optional)
>
> You should not include the string "(optional)" here. It was only a
> notation I used when we discussed this earlier.
>
> The fact that these are optional should be expressed using min/maxItems
> as I mentioned earlier. For the above SoCs that would be
>
> minItems: 2
> maxItems: 3
> >> @@ -522,12 +490,13 @@ examples:
>> <&gcc GCC_USB30_PRIM_MASTER_CLK>;
>> assigned-clock-rates = <19200000>, <150000000>;
>>
>> - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
>> - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
>> + interrupts = <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>,
>> + <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
>> + <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>,
>> <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
>> - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
>> - interrupt-names = "hs_phy_irq", "ss_phy_irq",
>> - "dm_hs_phy_irq", "dp_hs_phy_irq";
>> + <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>;
>> + interrupt-names = "pwr_event", "hs_phy_irq",
>> + "dp_hs_phy_irq", "dm_hs_phy_irq", "ss_phy_irq";
>
> Perhaps you should align the continuation line here too.
>
>>
>> power-domains = <&gcc USB30_PRIM_GDSC>;
>
> Also have you set up the tools so that you can verify your bindings
> before posing them? I assume the above wouldn't pass (e.g. due to the
> "(optional)" strings).
>
> There's some more details here:
>
> https://docs.kernel.org/devicetree/bindings/writing-schema.html
>
> under "Running checks".
I did do a dt-binding check and got the following line as well:
DTC_CHK Documentation/devicetree/bindings/usb/qcom,dwc3.example.dtb
/local/mnt/workspace/sriramd/upstream/torvalds/linux/Documentation/devicetree/bindings/usb/qcom,dwc3.example.dtb:
usb@a6f8800: interrupt-names:4: 'ss_phy_irq (optional)' was expected
From schema:
I ignored this because it isn't a warning and the example dtb too was
generated. Will remove the optional thing in v3.
Regards,
Krishna,
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
2023-12-07 15:28 ` Johan Hovold
@ 2023-12-07 15:47 ` Krishna Kurapati PSSNV
2023-12-07 16:34 ` Johan Hovold
0 siblings, 1 reply; 19+ messages in thread
From: Krishna Kurapati PSSNV @ 2023-12-07 15:47 UTC (permalink / raw)
To: Johan Hovold
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On 12/7/2023 8:58 PM, Johan Hovold wrote:
> On Mon, Dec 04, 2023 at 03:39:46PM +0530, Krishna Kurapati wrote:
>> For wakeup to work, driver needs to enable interrupts that depict what is
>> happening on th DP/DM lines. On QUSB targets, this is identified by
>
> typo: the
>
>> qusb2_phy whereas on SoCs using Femto PHY, separate {dp,dm}_hs_phy_irq's
>> are used instead.
>>
>> The implementation incorrectly names qusb2_phy interrupts as "hs_phy_irq".
>> Clean this up so that driver would be using only qusb2/(dp & dm) for wakeup
>> purposes.
>
> Here too you should say something about why this won't break any systems
> booting using an older devicetree. Specifically, the QUSB2 PHY interrupt
> has never been armed on any system running mainline as those bits never
> made it upstream.
>
> So an alternative to this could also be to just drop the QUSB2 PHY
> interrupt handling from this driver for now. >
Hi Johan,
So, are you suggesting that we drop the whole patch ?
I assume if the older kernels are using old DT, they would be using an
old driver version too right ? Is there a case where DT is not updated
but driver is ? Because if we drop this patch from series, targets with
updated DT's would break.
Regards,
Krishna,
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
2023-12-07 15:44 ` Krishna Kurapati PSSNV
@ 2023-12-07 16:13 ` Johan Hovold
0 siblings, 0 replies; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 16:13 UTC (permalink / raw)
To: Krishna Kurapati PSSNV
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Thu, Dec 07, 2023 at 09:14:55PM +0530, Krishna Kurapati PSSNV wrote:
> >> + - qusb2_phy:: 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.
> >> + - {dp/dm}_hs_phy_irq:: These IRQ's directly reflect changes on the DP/
> >> + DM pads of the SoC. These are used for wakeup
> >> + only on SoCs with non-QUSBb2 targets with
> >
> > QUSB2 typo
> >
> >> + exception of SDM670/SDM845/SM6350.
> >> + - ss_phy_irq:: When in super speed mode of operation, interrupts are
> >
> > Capitalise 'Super Speed'
> >
> >> + received when a wakeup event is received on ss_phy_irq.
> >
> > The description as it stands sounds circular. And this one is only used
> > for remote wakeup right?
> >
> Yes. It is used for remote wakeup. Mentioning it as wakeup event should
> be changed ?
It would be good to clarify that this one is the IIUC not used for
connect/disconnect events but just for remote wakeup, that is, unlike
the qusb2_phy and dp/dm_hs_phy interrupts.
The old descriptions just vaguely said "wakeup event" and
connect/disconnect events aren't necessarily wakeup events.
> > Also have you set up the tools so that you can verify your bindings
> > before posing them? I assume the above wouldn't pass (e.g. due to the
> > "(optional)" strings).
> >
> > There's some more details here:
> >
> > https://docs.kernel.org/devicetree/bindings/writing-schema.html
> >
> > under "Running checks".
>
> I did do a dt-binding check and got the following line as well:
>
> DTC_CHK Documentation/devicetree/bindings/usb/qcom,dwc3.example.dtb
> /local/mnt/workspace/sriramd/upstream/torvalds/linux/Documentation/devicetree/bindings/usb/qcom,dwc3.example.dtb:
> usb@a6f8800: interrupt-names:4: 'ss_phy_irq (optional)' was expected
> From schema:
Good that you got that set up.
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
2023-12-07 15:47 ` Krishna Kurapati PSSNV
@ 2023-12-07 16:34 ` Johan Hovold
2023-12-08 12:14 ` Krishna Kurapati PSSNV
0 siblings, 1 reply; 19+ messages in thread
From: Johan Hovold @ 2023-12-07 16:34 UTC (permalink / raw)
To: Krishna Kurapati PSSNV
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Thu, Dec 07, 2023 at 09:17:32PM +0530, Krishna Kurapati PSSNV wrote:
> On 12/7/2023 8:58 PM, Johan Hovold wrote:
> > Here too you should say something about why this won't break any systems
> > booting using an older devicetree. Specifically, the QUSB2 PHY interrupt
> > has never been armed on any system running mainline as those bits never
> > made it upstream.
> >
> > So an alternative to this could also be to just drop the QUSB2 PHY
> > interrupt handling from this driver for now. >
> So, are you suggesting that we drop the whole patch ?
No, I meant that an alternative could be to drop the current hs_phy_irq
handling from the driver.
> I assume if the older kernels are using old DT, they would be using an
> old driver version too right ?
No, and this is part of the devicetree ABI as we discussed the other
week.
You should generally be able to continue booting with an older devicetree
on a newer kernel (even if newer functionality may not be enabled then).
> Is there a case where DT is not updated but driver is ? Because if we
> drop this patch from series, targets with updated DT's would break.
Actually they would not due to the fact that the QUSB2 PHY interrupt is
currently never armed in the PHY (and the interrupts are looked up by
name and are considered optional by the driver).
But simply dropping this patch is not an option here. I'm fine with this
patch as it is, but the reason we can merge it is that those interrupts
are currently not actually used. Otherwise, this would break older
devicetrees.
But this also means, we could consider dropping the current hs_phy_irq
handling altogether.
Hmm. Looking at the qusb2_phy_runtime_suspend() again now I see that the
interrupt is actually armed on runtime suspend, it's just that it is
configured incorrectly and would wakeup immediately if someone ever
exercised this path.
Specifically, the bits that would set those PHY_MODE_USB_HOST_HS modes
(that should never have been merged) never made it upstream so this code
is just dead code currently. I said before I'll look into ripping this
out, but yeah, I'm swamped with work as usual (and it has been sitting
there dead for years so there's no rush).
So to summarise, the QUSB2 wakeup handling is incomplete and broken, so
we won't actually make things worse by renaming the interrupts. If this
was working, we would need to continue supporting the old names, though.
Johan
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq
2023-12-07 16:34 ` Johan Hovold
@ 2023-12-08 12:14 ` Krishna Kurapati PSSNV
0 siblings, 0 replies; 19+ messages in thread
From: Krishna Kurapati PSSNV @ 2023-12-08 12:14 UTC (permalink / raw)
To: Johan Hovold
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Wesley Cheng,
Conor Dooley, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On 12/7/2023 10:04 PM, Johan Hovold wrote:
> On Thu, Dec 07, 2023 at 09:17:32PM +0530, Krishna Kurapati PSSNV wrote:
>> On 12/7/2023 8:58 PM, Johan Hovold wrote:
>
>>> Here too you should say something about why this won't break any systems
>>> booting using an older devicetree. Specifically, the QUSB2 PHY interrupt
>>> has never been armed on any system running mainline as those bits never
>>> made it upstream.
>>>
>>> So an alternative to this could also be to just drop the QUSB2 PHY
>>> interrupt handling from this driver for now. >
>
>> So, are you suggesting that we drop the whole patch ?
>
> No, I meant that an alternative could be to drop the current hs_phy_irq
> handling from the driver.
>
>> I assume if the older kernels are using old DT, they would be using an
>> old driver version too right ?
>
> No, and this is part of the devicetree ABI as we discussed the other
> week.
>
> You should generally be able to continue booting with an older devicetree
> on a newer kernel (even if newer functionality may not be enabled then).
>
>> Is there a case where DT is not updated but driver is ? Because if we
>> drop this patch from series, targets with updated DT's would break.
>
> Actually they would not due to the fact that the QUSB2 PHY interrupt is
> currently never armed in the PHY (and the interrupts are looked up by
> name and are considered optional by the driver).
>
> But simply dropping this patch is not an option here. I'm fine with this
> patch as it is, but the reason we can merge it is that those interrupts
> are currently not actually used. Otherwise, this would break older
> devicetrees.
>
> But this also means, we could consider dropping the current hs_phy_irq
> handling altogether.
>
> Hmm. Looking at the qusb2_phy_runtime_suspend() again now I see that the
> interrupt is actually armed on runtime suspend, it's just that it is
> configured incorrectly and would wakeup immediately if someone ever
> exercised this path.
>
> Specifically, the bits that would set those PHY_MODE_USB_HOST_HS modes
> (that should never have been merged) never made it upstream so this code
> is just dead code currently. I said before I'll look into ripping this
> out, but yeah, I'm swamped with work as usual (and it has been sitting
> there dead for years so there's no rush).
>
> So to summarise, the QUSB2 wakeup handling is incomplete and broken, so
> we won't actually make things worse by renaming the interrupts. If this
> was working, we would need to continue supporting the old names, though.
>
Thanks for the review. Since renaming the interrupts won't be an issue,
I will keep this patch as is in that case in v3.
Regards,
Krishna,
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
2023-12-07 15:23 ` Johan Hovold
@ 2023-12-08 16:29 ` Rob Herring
2023-12-09 8:02 ` Krzysztof Kozlowski
2 siblings, 0 replies; 19+ messages in thread
From: Rob Herring @ 2023-12-08 16:29 UTC (permalink / raw)
To: Krishna Kurapati
Cc: Thinh Nguyen, Greg Kroah-Hartman, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Krzysztof Kozlowski, Wesley Cheng, Conor Dooley,
Johan Hovold, cros-qcom-dts-watchers, linux-usb, linux-kernel,
linux-arm-msm, devicetree, quic_ppratap, quic_jackp
On Mon, Dec 04, 2023 at 03:39:45PM +0530, Krishna Kurapati wrote:
> The high speed related interrupts present on QC targets are as follows:
>
> 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.
>
> 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.
>
> 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 interrupts based on whether qusb2_phy interrupt is used or
> {dp/dm}_hs_phy_irq is used and whether hs_phy_irq is present or not.
>
> Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com>
> ---
> .../devicetree/bindings/usb/qcom,dwc3.yaml | 147 +++++++-----------
> 1 file changed, 58 insertions(+), 89 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> index 3ec62027f663..94deef765ec3 100644
> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> @@ -98,12 +98,30 @@ properties:
> - const: apps-usb
>
> interrupts:
> - minItems: 1
> - maxItems: 4
> + description: |
> + Different types of interrupts are used based on HS phy used on target::
Why the double colon? This isn't rSt.
Rob
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
2023-12-07 15:23 ` Johan Hovold
2023-12-08 16:29 ` Rob Herring
@ 2023-12-09 8:02 ` Krzysztof Kozlowski
2 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-09 8:02 UTC (permalink / raw)
To: Krishna Kurapati, Thinh Nguyen, Greg Kroah-Hartman, Andy Gross,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Wesley Cheng, Conor Dooley, Johan Hovold, cros-qcom-dts-watchers
Cc: linux-usb, linux-kernel, linux-arm-msm, devicetree, quic_ppratap,
quic_jackp
On 04/12/2023 11:09, Krishna Kurapati wrote:
> then:
> properties:
> - interrupts:
> - items:
> - - description: The interrupt that is asserted
> - when a wakeup event is received on USB2 bus.
> - - description: The interrupt that is asserted
> - when a wakeup event is received on USB3 bus.
> - - description: Wakeup event on DM line.
> - - description: Wakeup event on DP line.
> interrupt-names:
> items:
> - - const: hs_phy_irq
> - - const: ss_phy_irq
> - - const: dm_hs_phy_irq
> - - const: dp_hs_phy_irq
> + - const: pwr_event
> + - const: qusb2_phy
> + - const: ss_phy_irq (optional)
You did not test your bindings.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2023-12-09 8:02 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-04 10:09 [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 1/6] dt-bindings: usb: dwc3: Clean up hs_phy_irq in bindings Krishna Kurapati
2023-12-07 15:23 ` Johan Hovold
2023-12-07 15:44 ` Krishna Kurapati PSSNV
2023-12-07 16:13 ` Johan Hovold
2023-12-08 16:29 ` Rob Herring
2023-12-09 8:02 ` Krzysztof Kozlowski
2023-12-04 10:09 ` [PATCH v2 2/6] usb: dwc3: qcom: Rename hs_phy_irq to qusb2_phy_irq Krishna Kurapati
2023-12-07 15:28 ` Johan Hovold
2023-12-07 15:47 ` Krishna Kurapati PSSNV
2023-12-07 16:34 ` Johan Hovold
2023-12-08 12:14 ` Krishna Kurapati PSSNV
2023-12-04 10:09 ` [PATCH v2 3/6] arm64: dts: qcom: Fix hs_phy_irq for QUSB2 targets Krishna Kurapati
2023-12-07 15:32 ` Johan Hovold
2023-12-04 10:09 ` [PATCH v2 4/6] arm64: dts: qcom: Fix hs_phy_irq for non-QUSB2 targets Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 5/6] arm64: dts: qcom: Fix hs_phy_irq for SDM670/SDM845/SM6350 Krishna Kurapati
2023-12-04 10:09 ` [PATCH v2 6/6] arm64: dts: qcom: Add missing interrupts for qcs404/ipq5332 Krishna Kurapati
2023-12-07 15:36 ` Johan Hovold
2023-12-07 14:53 ` [PATCH v2 0/6] Refine USB interrupt vectors on Qualcomm platforms Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).