2021-06-27 11:48:01

by Bhupesh Sharma

[permalink] [raw]
Subject: [PATCH v2 0/3] arm64: dts: qcom: Fix usb entries for SA8155p-adp board

Changes since v1:
----------------
- v1 can be seen here: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#mc49710316c9b527c2ee6562f4b91a05a2d15ca8b
- Addressed review comments from Bjorn.

This series enables the support for two USB ports (named portB and
portC) found on the SA8155p-adp board which are connected to USB Type A
connectors.

It also contains two minor cleanups:
- naming related fix for dwc3 usb nodes found in qcom arm64 dts files.
- arrange usb nodes together in sm8150 dts.

Cc: Bjorn Andersson <[email protected]>

Bhupesh Sharma (3):
arm64: dts: qcom: Use correct naming for dwc3 usb nodes in dts files
arm64: dts: qcom: Cosmetic changes - arrange USB nodes together in
sm8150 dts
arm64: dts: qcom: Fix usb entries for SA8155p adp board

arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 60 ++++++++++++++++++++----
arch/arm64/boot/dts/qcom/sm8150.dtsi | 30 ++++++------
arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 +-
arch/arm64/boot/dts/qcom/sm8350.dtsi | 4 +-
5 files changed, 71 insertions(+), 29 deletions(-)

--
2.31.1


2021-06-27 11:50:04

by Bhupesh Sharma

[permalink] [raw]
Subject: [PATCH v2 1/3] arm64: dts: qcom: Use correct naming for dwc3 usb nodes in dts files

The dwc3 usb nodes in several arm64 qcom dts are currently named
differently, somewhere as 'usb@<addr>' and somewhere as 'dwc3@<addr>',
leading to some confusion when one sees the entries in sysfs or
dmesg:
[ 1.943482] dwc3 a600000.usb: Adding to iommu group 1
[ 2.266127] dwc3 a800000.dwc3: Adding to iommu group 2

Name the usb nodes as 'usb@<addr>' for consistency, which is
the correct convention as per the 'snps,dwc3' dt-binding as
well (see [1]).

[1]. Documentation/devicetree/bindings/usb/snps,dwc3.yaml

Cc: Bjorn Andersson <[email protected]>
Signed-off-by: Bhupesh Sharma <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++--
arch/arm64/boot/dts/qcom/sm8350.dtsi | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi b/arch/arm64/boot/dts/qcom/msm8994.dtsi
index f9f0b5aa6a26..662f2f246b9b 100644
--- a/arch/arm64/boot/dts/qcom/msm8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi
@@ -430,7 +430,7 @@ usb3: usb@f92f8800 {
power-domains = <&gcc USB30_GDSC>;
qcom,select-utmi-as-pipe-clk;

- dwc3@f9200000 {
+ usb@f9200000 {
compatible = "snps,dwc3";
reg = <0xf9200000 0xcc00>;
interrupts = <0 131 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 612dda0fef43..9c931beeb614 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -2389,7 +2389,7 @@ usb_2: usb@a8f8800 {

resets = <&gcc GCC_USB30_SEC_BCR>;

- usb_2_dwc3: dwc3@a800000 {
+ usb_2_dwc3: usb@a800000 {
compatible = "snps,dwc3";
reg = <0 0x0a800000 0 0xcd00>;
interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 4798368b02ef..9c1462cc9dad 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -2321,7 +2321,7 @@ usb_1: usb@a6f8800 {

resets = <&gcc GCC_USB30_PRIM_BCR>;

- usb_1_dwc3: dwc3@a600000 {
+ usb_1_dwc3: usb@a600000 {
compatible = "snps,dwc3";
reg = <0 0x0a600000 0 0xcd00>;
interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
@@ -2372,7 +2372,7 @@ usb_2: usb@a8f8800 {

resets = <&gcc GCC_USB30_SEC_BCR>;

- usb_2_dwc3: dwc3@a800000 {
+ usb_2_dwc3: usb@a800000 {
compatible = "snps,dwc3";
reg = <0 0x0a800000 0 0xcd00>;
interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
index 0d16392bb976..a631d58166b1 100644
--- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
@@ -1273,7 +1273,7 @@ usb_1: usb@a6f8800 {

resets = <&gcc GCC_USB30_PRIM_BCR>;

- usb_1_dwc3: dwc3@a600000 {
+ usb_1_dwc3: usb@a600000 {
compatible = "snps,dwc3";
reg = <0 0x0a600000 0 0xcd00>;
interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
@@ -1317,7 +1317,7 @@ usb_2: usb@a8f8800 {

resets = <&gcc GCC_USB30_SEC_BCR>;

- usb_2_dwc3: dwc3@a800000 {
+ usb_2_dwc3: usb@a800000 {
compatible = "snps,dwc3";
reg = <0 0x0a800000 0 0xcd00>;
interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
--
2.31.1

2021-06-27 11:50:17

by Bhupesh Sharma

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: qcom: Fix usb entries for SA8155p adp board

SA8155p adp board has two USB A-type receptacles called
USB-portB and USB-portC respectively.

While USB-portB is a USB High-Speed connector/interface, the
USB-portC one is a USB 3.1 Super-Speed connector/interface.

Also the USB-portB is used as the USB emergency
download port (for image download purposes).

Enable both the ports on the board in USB Host mode (since all
the USB interfaces are brought out to USB Type A
connectors).

Cc: Bjorn Andersson <[email protected]>
Signed-off-by: Bhupesh Sharma <[email protected]>
---
arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 60 ++++++++++++++++++++----
1 file changed, 51 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
index 0da7a3b8d1bf..5ae2ddc65f7e 100644
--- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
+++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts
@@ -307,10 +307,6 @@ &qupv3_id_1 {
status = "okay";
};

-&tlmm {
- gpio-reserved-ranges = <0 4>;
-};
-
&uart2 {
status = "okay";
};
@@ -337,6 +333,16 @@ &ufs_mem_phy {
vdda-pll-max-microamp = <18300>;
};

+&usb_1 {
+ status = "okay";
+};
+
+&usb_1_dwc3 {
+ dr_mode = "host";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&usb2phy_ac_en1_default>;
+};

&usb_1_hsphy {
status = "okay";
@@ -346,15 +352,51 @@ &usb_1_hsphy {
};

&usb_1_qmpphy {
+ status = "disabled";
+};
+
+&usb_2 {
status = "okay";
- vdda-phy-supply = <&vreg_l8c_1p2>;
- vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
};

-&usb_1 {
+&usb_2_dwc3 {
+ dr_mode = "host";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&usb2phy_ac_en2_default>;
+};
+
+&usb_2_hsphy {
status = "okay";
+ vdda-pll-supply = <&vdd_usb_hs_core>;
+ vdda33-supply = <&vdda_usb_hs_3p1>;
+ vdda18-supply = <&vdda_usb_hs_1p8>;
};

-&usb_1_dwc3 {
- dr_mode = "peripheral";
+&usb_2_qmpphy {
+ status = "okay";
+ vdda-phy-supply = <&vreg_l8c_1p2>;
+ vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
+};
+
+&tlmm {
+ gpio-reserved-ranges = <0 4>;
+
+ usb2phy_ac_en1_default: usb2phy_ac_en1_default {
+ mux {
+ pins = "gpio113";
+ function = "usb2phy_ac";
+ bias-disable;
+ drive-strength = <2>;
+ };
+ };
+
+ usb2phy_ac_en2_default: usb2phy_ac_en2_default {
+ mux {
+ pins = "gpio123";
+ function = "usb2phy_ac";
+ bias-disable;
+ drive-strength = <2>;
+ };
+ };
};
--
2.31.1

2021-06-27 11:50:30

by Bhupesh Sharma

[permalink] [raw]
Subject: [PATCH v2 2/3] arm64: dts: qcom: Cosmetic changes - arrange USB nodes together in sm8150 dts

Arrange the two usb controller, hs-phy and
ss-phy nodes closer in the dts for better readability.

Cc: Bjorn Andersson <[email protected]>
Signed-off-by: Bhupesh Sharma <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 9c931beeb614..163eb430eb1e 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -2205,6 +2205,20 @@ glink-edge {
};
};

+ dc_noc: interconnect@9160000 {
+ compatible = "qcom,sm8150-dc-noc";
+ reg = <0 0x09160000 0 0x3200>;
+ #interconnect-cells = <1>;
+ qcom,bcm-voters = <&apps_bcm_voter>;
+ };
+
+ gem_noc: interconnect@9680000 {
+ compatible = "qcom,sm8150-gem-noc";
+ reg = <0 0x09680000 0 0x3e200>;
+ #interconnect-cells = <1>;
+ qcom,bcm-voters = <&apps_bcm_voter>;
+ };
+
usb_1_hsphy: phy@88e2000 {
compatible = "qcom,sm8150-usb-hs-phy",
"qcom,usb-snps-hs-7nm-phy";
@@ -2266,20 +2280,6 @@ usb_1_ssphy: lanes@88e9200 {
};
};

- dc_noc: interconnect@9160000 {
- compatible = "qcom,sm8150-dc-noc";
- reg = <0 0x09160000 0 0x3200>;
- #interconnect-cells = <1>;
- qcom,bcm-voters = <&apps_bcm_voter>;
- };
-
- gem_noc: interconnect@9680000 {
- compatible = "qcom,sm8150-gem-noc";
- reg = <0 0x09680000 0 0x3e200>;
- #interconnect-cells = <1>;
- qcom,bcm-voters = <&apps_bcm_voter>;
- };
-
usb_2_qmpphy: phy@88eb000 {
compatible = "qcom,sm8150-qmp-usb3-uni-phy";
reg = <0 0x088eb000 0 0x200>;
--
2.31.1

2021-07-19 18:30:49

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] arm64: dts: qcom: Cosmetic changes - arrange USB nodes together in sm8150 dts

On Sun 27 Jun 06:46 CDT 2021, Bhupesh Sharma wrote:

> Arrange the two usb controller, hs-phy and
> ss-phy nodes closer in the dts for better readability.
>

The nodes are supposed to be sorted by address, then alphabetically by
name and lastly when referred to using the &label by the label.

As such the two nodes should live after &usb_2_qmpphy, so I took the
liberty of adjusting your patch to resolve this.

Thanks,
Bjorn

> Cc: Bjorn Andersson <[email protected]>
> Signed-off-by: Bhupesh Sharma <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sm8150.dtsi | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> index 9c931beeb614..163eb430eb1e 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> @@ -2205,6 +2205,20 @@ glink-edge {
> };
> };
>
> + dc_noc: interconnect@9160000 {
> + compatible = "qcom,sm8150-dc-noc";
> + reg = <0 0x09160000 0 0x3200>;
> + #interconnect-cells = <1>;
> + qcom,bcm-voters = <&apps_bcm_voter>;
> + };
> +
> + gem_noc: interconnect@9680000 {
> + compatible = "qcom,sm8150-gem-noc";
> + reg = <0 0x09680000 0 0x3e200>;
> + #interconnect-cells = <1>;
> + qcom,bcm-voters = <&apps_bcm_voter>;
> + };
> +
> usb_1_hsphy: phy@88e2000 {
> compatible = "qcom,sm8150-usb-hs-phy",
> "qcom,usb-snps-hs-7nm-phy";
> @@ -2266,20 +2280,6 @@ usb_1_ssphy: lanes@88e9200 {
> };
> };
>
> - dc_noc: interconnect@9160000 {
> - compatible = "qcom,sm8150-dc-noc";
> - reg = <0 0x09160000 0 0x3200>;
> - #interconnect-cells = <1>;
> - qcom,bcm-voters = <&apps_bcm_voter>;
> - };
> -
> - gem_noc: interconnect@9680000 {
> - compatible = "qcom,sm8150-gem-noc";
> - reg = <0 0x09680000 0 0x3e200>;
> - #interconnect-cells = <1>;
> - qcom,bcm-voters = <&apps_bcm_voter>;
> - };
> -
> usb_2_qmpphy: phy@88eb000 {
> compatible = "qcom,sm8150-qmp-usb3-uni-phy";
> reg = <0 0x088eb000 0 0x200>;
> --
> 2.31.1
>

2021-07-19 18:31:32

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] arm64: dts: qcom: Use correct naming for dwc3 usb nodes in dts files

On Sun 27 Jun 06:46 CDT 2021, Bhupesh Sharma wrote:

> The dwc3 usb nodes in several arm64 qcom dts are currently named
> differently, somewhere as 'usb@<addr>' and somewhere as 'dwc3@<addr>',
> leading to some confusion when one sees the entries in sysfs or
> dmesg:
> [ 1.943482] dwc3 a600000.usb: Adding to iommu group 1
> [ 2.266127] dwc3 a800000.dwc3: Adding to iommu group 2
>
> Name the usb nodes as 'usb@<addr>' for consistency, which is
> the correct convention as per the 'snps,dwc3' dt-binding as
> well (see [1]).
>
> [1]. Documentation/devicetree/bindings/usb/snps,dwc3.yaml
>

I thought we had more of the platforms sorted out already, thanks for
fixing this Bhupesh.

Reviewed-by: Bjorn Andersson <[email protected]>

Regards,
Bjorn

> Cc: Bjorn Andersson <[email protected]>
> Signed-off-by: Bhupesh Sharma <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +-
> arch/arm64/boot/dts/qcom/sm8150.dtsi | 2 +-
> arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++--
> arch/arm64/boot/dts/qcom/sm8350.dtsi | 4 ++--
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi b/arch/arm64/boot/dts/qcom/msm8994.dtsi
> index f9f0b5aa6a26..662f2f246b9b 100644
> --- a/arch/arm64/boot/dts/qcom/msm8994.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi
> @@ -430,7 +430,7 @@ usb3: usb@f92f8800 {
> power-domains = <&gcc USB30_GDSC>;
> qcom,select-utmi-as-pipe-clk;
>
> - dwc3@f9200000 {
> + usb@f9200000 {
> compatible = "snps,dwc3";
> reg = <0xf9200000 0xcc00>;
> interrupts = <0 131 IRQ_TYPE_LEVEL_HIGH>;
> diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> index 612dda0fef43..9c931beeb614 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
> @@ -2389,7 +2389,7 @@ usb_2: usb@a8f8800 {
>
> resets = <&gcc GCC_USB30_SEC_BCR>;
>
> - usb_2_dwc3: dwc3@a800000 {
> + usb_2_dwc3: usb@a800000 {
> compatible = "snps,dwc3";
> reg = <0 0x0a800000 0 0xcd00>;
> interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> index 4798368b02ef..9c1462cc9dad 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
> @@ -2321,7 +2321,7 @@ usb_1: usb@a6f8800 {
>
> resets = <&gcc GCC_USB30_PRIM_BCR>;
>
> - usb_1_dwc3: dwc3@a600000 {
> + usb_1_dwc3: usb@a600000 {
> compatible = "snps,dwc3";
> reg = <0 0x0a600000 0 0xcd00>;
> interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
> @@ -2372,7 +2372,7 @@ usb_2: usb@a8f8800 {
>
> resets = <&gcc GCC_USB30_SEC_BCR>;
>
> - usb_2_dwc3: dwc3@a800000 {
> + usb_2_dwc3: usb@a800000 {
> compatible = "snps,dwc3";
> reg = <0 0x0a800000 0 0xcd00>;
> interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
> diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> index 0d16392bb976..a631d58166b1 100644
> --- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> @@ -1273,7 +1273,7 @@ usb_1: usb@a6f8800 {
>
> resets = <&gcc GCC_USB30_PRIM_BCR>;
>
> - usb_1_dwc3: dwc3@a600000 {
> + usb_1_dwc3: usb@a600000 {
> compatible = "snps,dwc3";
> reg = <0 0x0a600000 0 0xcd00>;
> interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
> @@ -1317,7 +1317,7 @@ usb_2: usb@a8f8800 {
>
> resets = <&gcc GCC_USB30_SEC_BCR>;
>
> - usb_2_dwc3: dwc3@a800000 {
> + usb_2_dwc3: usb@a800000 {
> compatible = "snps,dwc3";
> reg = <0 0x0a800000 0 0xcd00>;
> interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
> --
> 2.31.1
>