Skip to contentSkip to conversation

arm64: dts: qcom: USB clock and interrupt fixes

PATCH Applied Johan Hovold 3 participants 7 messages Jul 15, 2022 – Jul 17, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover arm64: dts: qcom: USB clock and interrupt fixes

This is the second half of the series which adds the missing binding for SC8280XP and cleans up the current bindings somewhat:

	https://lore.kernel.org/all/[email protected]/

The binding updates have now been merged by Greg so that the qcom dts fixes that depend on them can also be applied.

Johan

Changes in v2:
- fix the pwr_event interrupt number for usb_1 (Andrew)
- amend commit summary of first patch to mention also clock "naming" (Krzysztof)
- add ack and review tags from Andrew and Krzysztof

Johan Hovold (4):
arm64: dts: qcom: sc8280xp: fix USB clock order and naming
arm64: dts: qcom: sc8280xp: fix USB interrupts
arm64: dts: qcom: sc7280: reorder USB interrupts
arm64: dts: qcom: reorder USB interrupts

 arch/arm/boot/dts/qcom-sdx65.dtsi      | 10 +++++----
 arch/arm64/boot/dts/qcom/sc7280.dtsi   | 15 +++++++------
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 30 +++++++++++++++-----------
 arch/arm64/boot/dts/qcom/sm8250.dtsi   | 20 ++++++++++-------
 arch/arm64/boot/dts/qcom/sm8350.dtsi   | 20 ++++++++++-------
 5 files changed, 55 insertions(+), 40 deletions(-)
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 1/4 arm64: dts: qcom: sc8280xp: fix USB clock order and naming

Fix the USB controller clock order and naming so that they match the devicetree binding.

Note that the driver currently simply enables all clocks in the order that they are specified in the devicetree. Reordering the clocks as per the binding means that the only explicit ordering constraint found in the vendor driver, that cfg_noc should be enabled before the core_clk, is now honoured.

Fixes 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform")
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +8 -8
index 285a9828c250..45cc7d714fd2 100644
@@ -1855,16 +1855,16 @@ usb_0: usb@a6f8800 {
 			#size-cells = <2>;
 			ranges;
 
-			clocks = <&gcc GCC_USB30_PRIM_MASTER_CLK>,
-				 <&gcc GCC_CFG_NOC_USB3_PRIM_AXI_CLK>,
+			clocks = <&gcc GCC_CFG_NOC_USB3_PRIM_AXI_CLK>,
+				 <&gcc GCC_USB30_PRIM_MASTER_CLK>,
 				 <&gcc GCC_AGGRE_USB3_PRIM_AXI_CLK>,
-				 <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>,
 				 <&gcc GCC_USB30_PRIM_SLEEP_CLK>,
+				 <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>,
 				 <&gcc GCC_AGGRE_USB_NOC_AXI_CLK>,
 				 <&gcc GCC_AGGRE_USB_NOC_NORTH_AXI_CLK>,
 				 <&gcc GCC_AGGRE_USB_NOC_SOUTH_AXI_CLK>,
 				 <&gcc GCC_SYS_NOC_USB_AXI_CLK>;
-			clock-names = "core", "iface", "bus_aggr", "utmi", "sleep",
+			clock-names = "cfg_noc", "core", "iface", "sleep", "mock_utmi",
 				      "noc_aggr", "noc_aggr_north", "noc_aggr_south", "noc_sys";
 
 			assigned-clocks = <&gcc GCC_USB30_PRIM_MOCK_UTMI_CLK>,
@@ -1905,16 +1905,16 @@ usb_1: usb@a8f8800 {
 			#size-cells = <2>;
 			ranges;
 
-			clocks = <&gcc GCC_USB30_SEC_MASTER_CLK>,
-				 <&gcc GCC_CFG_NOC_USB3_SEC_AXI_CLK>,
+			clocks = <&gcc GCC_CFG_NOC_USB3_SEC_AXI_CLK>,
+				 <&gcc GCC_USB30_SEC_MASTER_CLK>,
 				 <&gcc GCC_AGGRE_USB3_SEC_AXI_CLK>,
-				 <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>,
 				 <&gcc GCC_USB30_SEC_SLEEP_CLK>,
+				 <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>,
 				 <&gcc GCC_AGGRE_USB_NOC_AXI_CLK>,
 				 <&gcc GCC_AGGRE_USB_NOC_NORTH_AXI_CLK>,
 				 <&gcc GCC_AGGRE_USB_NOC_SOUTH_AXI_CLK>,
 				 <&gcc GCC_SYS_NOC_USB_AXI_CLK>;
-			clock-names = "core", "iface", "bus_aggr", "utmi", "sleep",
+			clock-names = "cfg_noc", "core", "iface", "sleep", "mock_utmi",
 				      "noc_aggr", "noc_aggr_north", "noc_aggr_south", "noc_sys";
 
 			assigned-clocks = <&gcc GCC_USB30_SEC_MOCK_UTMI_CLK>,
Signature · 1 line
2.35.1
Acked-by on v2 1/4
#2 lore raw

Re: [PATCH v2 1/4] arm64: dts: qcom: sc8280xp: fix USB clock order and naming

Quoted 8 lines · Johan Hovold

Fix the USB controller clock order and naming so that they match the devicetree binding.

Note that the driver currently simply enables all clocks in the order that they are specified in the devicetree. Reordering the clocks as per the binding means that the only explicit ordering constraint found in the vendor driver, that cfg_noc should be enabled before the core_clk, is now honoured.

Best regards,
Krzysztof

#3 lore raw

PATCH v2 2/4 arm64: dts: qcom: sc8280xp: fix USB interrupts

In reply to Johan Hovold

The two single-port SC8280XP USB controllers do not have an hs_phy_irq interrupt. Instead they have a pwr_event interrupt which is distinct from the former and not yet supported by the driver.

Fix the USB node interrupt names so that they match the devicetree binding.

Also fix the pwr_event interrupt of the second controller which should be 811 as noticed by Andrew Halaney.

Fixes 152d1faf1e2f ("arm64: dts: qcom: add SC8280XP platform")
---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +9 -5
index 45cc7d714fd2..f002a63d8507 100644
@@ -1875,8 +1875,10 @@ usb_0: usb@a6f8800 {
 					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 138 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "dm_hs_phy_irq", "ss_phy_irq";
+			interrupt-names = "pwr_event",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq",
+					  "ss_phy_irq";
 
 			power-domains = <&gcc USB30_PRIM_GDSC>;
 
@@ -1921,12 +1923,14 @@ usb_1: usb@a8f8800 {
 					  <&gcc GCC_USB30_SEC_MASTER_CLK>;
 			assigned-clock-rates = <19200000>, <200000000>;
 
-			interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
+			interrupts-extended = <&intc GIC_SPI 811 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 13 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 136 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "dm_hs_phy_irq", "ss_phy_irq";
+			interrupt-names = "pwr_event",
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq",
+					  "ss_phy_irq";
 
 			power-domains = <&gcc USB30_SEC_GDSC>;
 
Signature · 1 line
2.35.1
#4 lore raw

PATCH v2 3/4 arm64: dts: qcom: sc7280: reorder USB interrupts

In reply to Johan Hovold

Only one of the USB controllers supports SuperSpeed and have an SS PHY wakeup interrupt.

Reorder the interrupts so that they match the updated binding which specifically has the optional interrupt last.

---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +8 -7
index ef431c954ab5..1e739ba1923d 100644
@@ -3174,10 +3174,11 @@ usb_2: usb@8cf8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH>,
-				     <&pdc 13 IRQ_TYPE_EDGE_RISING>,
-				     <&pdc 12 IRQ_TYPE_EDGE_RISING>;
+					      <&pdc 12 IRQ_TYPE_EDGE_RISING>,
+					      <&pdc 13 IRQ_TYPE_EDGE_RISING>;
 			interrupt-names = "hs_phy_irq",
-					  "dm_hs_phy_irq", "dp_hs_phy_irq";
+					  "dp_hs_phy_irq",
+					  "dm_hs_phy_irq";
 
 			power-domains = <&gcc GCC_USB30_SEC_GDSC>;
 
@@ -3357,13 +3358,13 @@ usb_1: usb@a6f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 17 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 14 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
-					      <&pdc 14 IRQ_TYPE_LEVEL_HIGH>;
+					      <&pdc 17 IRQ_TYPE_EDGE_BOTH>;
 			interrupt-names = "hs_phy_irq",
-					  "ss_phy_irq",
+					  "dp_hs_phy_irq",
 					  "dm_hs_phy_irq",
-					  "dp_hs_phy_irq";
+					  "ss_phy_irq";
 
 			power-domains = <&gcc GCC_USB30_PRIM_GDSC>;
 
Signature · 1 line
2.35.1
#5 lore raw

PATCH v2 4/4 arm64: dts: qcom: reorder USB interrupts

In reply to Johan Hovold

Three SoCs did not follow the interrupt order specified by the USB controller binding.

While keeping the non-SuperSpeed interrupts together seems natural, reorder the interrupts to match the binding.

---
 arch/arm/boot/dts/qcom-sdx65.dtsi    | 10 ++++++----
 arch/arm64/boot/dts/qcom/sm8250.dtsi | 20 ++++++++++++--------
 arch/arm64/boot/dts/qcom/sm8350.dtsi | 20 ++++++++++++--------
 3 files changed, 30 insertions(+), 20 deletions(-)
arch/arm/boot/dts/qcom-sdx65.dtsi +6 -4
index 7a193678b4f5..8daefd50217a 100644
@@ -372,11 +372,13 @@ usb: usb@a6f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 19 IRQ_TYPE_EDGE_BOTH>,
 					      <&pdc 76 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 18 IRQ_TYPE_EDGE_BOTH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "ss_phy_irq", "dm_hs_phy_irq";
+					      <&pdc 18 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 19 IRQ_TYPE_EDGE_BOTH>;
+			interrupt-names = "hs_phy_irq",
+					  "ss_phy_irq",
+					  "dm_hs_phy_irq",
+					  "dp_hs_phy_irq";
 
 			power-domains = <&gcc USB30_GDSC>;
 
arch/arm64/boot/dts/qcom/sm8250.dtsi +12 -8
index 7ac8aa110f81..65be7f3ec74c 100644
@@ -3026,11 +3026,13 @@ usb_1: usb@a6f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
-					      <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "dm_hs_phy_irq", "ss_phy_irq";
+					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
+			interrupt-names = "hs_phy_irq",
+					  "ss_phy_irq",
+					  "dm_hs_phy_irq",
+					  "dp_hs_phy_irq";
 
 			power-domains = <&gcc USB30_PRIM_GDSC>;
 
@@ -3081,11 +3083,13 @@ usb_2: usb@a8f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 16 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 13 IRQ_TYPE_EDGE_BOTH>,
-					      <&pdc 16 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "dm_hs_phy_irq", "ss_phy_irq";
+					      <&pdc 12 IRQ_TYPE_EDGE_BOTH>;
+			interrupt-names = "hs_phy_irq",
+					  "ss_phy_irq",
+					  "dm_hs_phy_irq",
+					  "dp_hs_phy_irq";
 
 			power-domains = <&gcc USB30_SEC_GDSC>;
 
arch/arm64/boot/dts/qcom/sm8350.dtsi +12 -8
index 65c7fe54613d..e72a04411888 100644
@@ -2461,11 +2461,13 @@ usb_1: usb@a6f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 17 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 15 IRQ_TYPE_EDGE_BOTH>,
-					      <&pdc 17 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "dm_hs_phy_irq", "ss_phy_irq";
+					      <&pdc 14 IRQ_TYPE_EDGE_BOTH>;
+			interrupt-names = "hs_phy_irq",
+					  "ss_phy_irq",
+					  "dm_hs_phy_irq",
+					  "dp_hs_phy_irq";
 
 			power-domains = <&gcc USB30_PRIM_GDSC>;
 
@@ -2509,11 +2511,13 @@ usb_2: usb@a8f8800 {
 			assigned-clock-rates = <19200000>, <200000000>;
 
 			interrupts-extended = <&intc GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
-					      <&pdc 12 IRQ_TYPE_EDGE_BOTH>,
+					      <&pdc 16 IRQ_TYPE_LEVEL_HIGH>,
 					      <&pdc 13 IRQ_TYPE_EDGE_BOTH>,
-					      <&pdc 16 IRQ_TYPE_LEVEL_HIGH>;
-			interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
-					  "dm_hs_phy_irq", "ss_phy_irq";
+					      <&pdc 12 IRQ_TYPE_EDGE_BOTH>;
+			interrupt-names = "hs_phy_irq",
+					  "ss_phy_irq",
+					  "dm_hs_phy_irq",
+					  "dp_hs_phy_irq";
 
 			power-domains = <&gcc USB30_SEC_GDSC>;
 
Signature · 1 line
2.35.1
#6 lore raw

Re: (subset) [PATCH v2 0/4] arm64: dts: qcom: USB clock and interrupt fixes

In reply to Johan Hovold
Quoted 9 lines · Johan Hovold

This is the second half of the series which adds the missing binding for SC8280XP and cleans up the current bindings somewhat:

	https://lore.kernel.org/all/[email protected]/

The binding updates have now been merged by Greg so that the qcom dts fixes that depend on them can also be applied.

[...]

Applied, thanks!

[4/4] arm64: dts: qcom: reorder USB interrupts

      commit: 079926b5a22ac92c4ac1e15e6cfb20a431802cb5

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>