Skip to contentSkip to conversation

Revert "arm64: dts: qcom: Collapse usb support into one node"

PATCH In review Rob Clark 2 participants 5 messages Jul 12, 2017 – Jul 13, 2017

Subsystems (3)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 Revert "arm64: dts: qcom: Collapse usb support into one node"

This gets host USB working again for me on db410c on master.

This reverts commit ed75d6a969056cc8f5dd2df3af6c75b792b9116b.

---
 arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 34 ++++++++---------
 arch/arm64/boot/dts/qcom/msm8916.dtsi     | 62 ++++++++++++++++---------------
 2 files changed, 49 insertions(+), 47 deletions(-)
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +16 -18
index bd310ac1967a..f326f4fb4d72 100644
@@ -215,16 +215,22 @@
 		usb@78d9000 {
 			extcon = <&usb_id>, <&usb_id>;
 			status = "okay";
-			adp-disable;
-			hnp-disable;
-			srp-disable;
-			ulpi {
-				phy {
-					v1p8-supply = <&pm8916_l7>;
-					v3p3-supply = <&pm8916_l13>;
-					extcon = <&usb_id>;
-				};
-			};
+		};
+
+		ehci@78d9000 {
+			status = "okay";
+		};
+
+		phy@78d9000 {
+			v1p8-supply = <&pm8916_l7>;
+			v3p3-supply = <&pm8916_l13>;
+			vddcx-supply = <&pm8916_s1>;
+			extcon = <&usb_id>, <&usb_id>;
+			dr_mode = "otg";
+			status = "okay";
+			switch-gpio = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&usb_sw_sel_pm>;
 		};
 
 		lpass@07708000 {
@@ -342,14 +348,6 @@
 		pinctrl-0 = <&usb_id_default>;
 	};
 
-	usb-switch {
-		compatible = "toshiba,tc7usb40mu";
-		switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
-		extcon = <&usb_id>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&usb_sw_sel_pm>;
-	};
-
 	hdmi-out {
 		compatible = "hdmi-connector";
 		type = "a";
arch/arm64/boot/dts/qcom/msm8916.dtsi +33 -29

73 lines not on this page · raw message

Signature · 1 line
2.13.0
#1 lore raw
Quoted 3 lines · Rob Clark

This gets host USB working again for me on db410c on master.

This reverts commit ed75d6a969056cc8f5dd2df3af6c75b792b9116b.

Signoff? Or was it left out on purpose?

Was device mode working on v4.12? I wonder if we could change dr_mode to host and configure the pmic gpio to mux out the right lines to the hub. Then we could retain host mode on db410c (which is probably all that people care about). It would be a smaller fix for this release while we work out the role switch patches. Like this patch? I still need to test it tomorrow, but this may work and allow us to delete the ehci-msm driver sooner.

----8<----

arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi +1 -0
index d94640812194..790b7775b901 100644
@@ -17,6 +17,7 @@
 			function = PMIC_GPIO_FUNC_NORMAL;
 			power-source = <PM8916_GPIO_VPH>;
 			input-disable;
+			output-high;
 		};
 	};
 
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +4 -10
index bd310ac1967a..8f2decf84bbf 100644
@@ -213,16 +213,18 @@
 		};
 
 		usb@78d9000 {
-			extcon = <&usb_id>, <&usb_id>;
+			extcon = <&usb_id>;
 			status = "okay";
 			adp-disable;
 			hnp-disable;
 			srp-disable;
+			dr_mode = "host";
+			pinctrl-names = "default";
+			pinctrl-0 = <&usb_sw_sel_pm>;
 			ulpi {
 				phy {
 					v1p8-supply = <&pm8916_l7>;
 					v3p3-supply = <&pm8916_l13>;
-					extcon = <&usb_id>;
 				};
 			};
 		};
@@ -342,14 +344,6 @@
 		pinctrl-0 = <&usb_id_default>;
 	};
 
-	usb-switch {
-		compatible = "toshiba,tc7usb40mu";
-		switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
-		extcon = <&usb_id>;
-		pinctrl-names = "default";
-		pinctrl-0 = <&usb_sw_sel_pm>;
-	};
-
 	hdmi-out {
 		compatible = "hdmi-connector";
 		type = "a";
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
author
#2 lore raw
Quoted 6 lines · Stephen Boyd
Quoted 3 lines · Rob Clark

This gets host USB working again for me on db410c on master.

This reverts commit ed75d6a969056cc8f5dd2df3af6c75b792b9116b.

Signoff? Or was it left out on purpose?

whoops

Quoted 7 lines

Was device mode working on v4.12? I wonder if we could change dr_mode to host and configure the pmic gpio to mux out the right lines to the hub. Then we could retain host mode on db410c (which is probably all that people care about). It would be a smaller fix for this release while we work out the role switch patches. Like this patch? I still need to test it tomorrow, but this may work and allow us to delete the ehci-msm driver sooner.

yup, was working on v4.12 so this patch that I reverted was a regression. At least for host mode. (I don't really use device mode much outside of android, so never tried that on v4.12, but it did work in the past)

I can try other patches.. although a bit wary of deleting ehci-msm or a big dt change in general since some people seem to think taking dt and kernel from two different places is a sane thing)

BR,
-R

Quoted 57 lines

----8<----

arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi +1 -0
index d94640812194..790b7775b901 100644
@@ -17,6 +17,7 @@
                        function = PMIC_GPIO_FUNC_NORMAL;
                        power-source = <PM8916_GPIO_VPH>;
                        input-disable;
+                       output-high;
                };
        };
 
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +4 -11
index bd310ac1967a..8f2decf84bbf 100644
@@ -213,16 +213,18 @@
                };
 
                usb@78d9000 {
-                       extcon = <&usb_id>, <&usb_id>;
+                       extcon = <&usb_id>;
                        status = "okay";
                        adp-disable;
                        hnp-disable;
                        srp-disable;
+                       dr_mode = "host";
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usb_sw_sel_pm>;
                        ulpi {
                                phy {
                                        v1p8-supply = <&pm8916_l7>;
                                        v3p3-supply = <&pm8916_l13>;
-                                       extcon = <&usb_id>;
                                };
                        };
                };
@@ -342,14 +344,6 @@
                pinctrl-0 = <&usb_id_default>;
        };
 
-       usb-switch {
-               compatible = "toshiba,tc7usb40mu";
-               switch-gpios = <&pm8916_gpios 4 GPIO_ACTIVE_HIGH>;
-               extcon = <&usb_id>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&usb_sw_sel_pm>;
-       };
-
        hdmi-out {
                compatible = "hdmi-connector";
                type = "a";
 
--

Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

#3 lore raw
Quoted 9 lines · Rob Clark
Quoted 7 lines · Stephen Boyd

Was device mode working on v4.12? I wonder if we could change dr_mode to host and configure the pmic gpio to mux out the right lines to the hub. Then we could retain host mode on db410c (which is probably all that people care about). It would be a smaller fix for this release while we work out the role switch patches. Like this patch? I still need to test it tomorrow, but this may work and allow us to delete the ehci-msm driver sooner.

Quoted 4 lines

yup, was working on v4.12 so this patch that I reverted was a regression. At least for host mode. (I don't really use device mode much outside of android, so never tried that on v4.12, but it did work in the past)

Ok.

Quoted 4 lines

I can try other patches.. although a bit wary of deleting ehci-msm or a big dt change in general since some people seem to think taking dt and kernel from two different places is a sane thing)

I'm fine to leave ehci-msm driver in place for anyone wanting to use DT from somewhere outside the kernel, just hoping to push anybody I can towards the chipidea driver, which is a cleaner solution in the long run. It's scary that we have two usb drivers operating the same hardware with the DT in v4.12.

I tested out my patch and it works well enough to get host mode working for me so I'll send it out as a proper regression fix. When we add role switching support we'll have to adjust the DT to support it and people who care to gain support for gadgets can use the updated DT.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
author
#4 lore raw
Quoted 28 lines · Stephen Boyd
Quoted 9 lines · Rob Clark
Quoted 7 lines · Stephen Boyd

Was device mode working on v4.12? I wonder if we could change dr_mode to host and configure the pmic gpio to mux out the right lines to the hub. Then we could retain host mode on db410c (which is probably all that people care about). It would be a smaller fix for this release while we work out the role switch patches. Like this patch? I still need to test it tomorrow, but this may work and allow us to delete the ehci-msm driver sooner.

Quoted 4 lines

yup, was working on v4.12 so this patch that I reverted was a regression. At least for host mode. (I don't really use device mode much outside of android, so never tried that on v4.12, but it did work in the past)

Ok.

Quoted 4 lines

I can try other patches.. although a bit wary of deleting ehci-msm or a big dt change in general since some people seem to think taking dt and kernel from two different places is a sane thing)

I'm fine to leave ehci-msm driver in place for anyone wanting to use DT from somewhere outside the kernel, just hoping to push anybody I can towards the chipidea driver, which is a cleaner solution in the long run. It's scary that we have two usb drivers operating the same hardware with the DT in v4.12.

Quoted 6 lines

I tested out my patch and it works well enough to get host mode working for me so I'll send it out as a proper regression fix. When we add role switching support we'll have to adjust the DT to support it and people who care to gain support for gadgets can use the updated DT.

I would mention that robher and jstulz do play with upstream kernel + AOSP.. so I guess some people would care about device mode regressions as well, even though host mode is sufficient for me. So I still lean towards reverting this change for now, and trying again when the mux issues are sorted completely. (I can re-send this revert w/ SoB that I forgot if needed.)

BR,
-R