* [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node"
@ 2017-07-12 12:50 Rob Clark
2017-07-13 6:09 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Rob Clark @ 2017-07-12 12:50 UTC (permalink / raw)
To: linux-arm-msm; +Cc: Stephen Boyd, Andy Gross, Rob Clark
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(-)
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
index bd310ac1967a..f326f4fb4d72 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
@@ -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";
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 5c36a0934989..a4de94f9fecb 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -566,40 +566,44 @@
status = "disabled";
};
- otg: usb@78d9000 {
+ usb_dev: usb@78d9000 {
compatible = "qcom,ci-hdrc";
- reg = <0x78d9000 0x200>,
- <0x78d9200 0x200>;
+ reg = <0x78d9000 0x400>;
+ dr_mode = "peripheral";
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+ usb-phy = <&usb_otg>;
+ status = "disabled";
+ };
+
+ usb_host: ehci@78d9000 {
+ compatible = "qcom,ehci-host";
+ reg = <0x78d9000 0x400>;
+ interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+ usb-phy = <&usb_otg>;
+ status = "disabled";
+ };
+
+ usb_otg: phy@78d9000 {
+ compatible = "qcom,usb-otg-snps";
+ reg = <0x78d9000 0x400>;
interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+
+ qcom,vdd-levels = <500000 1000000 1320000>;
+ qcom,phy-init-sequence = <0x44 0x6B 0x24 0x13>;
+ dr_mode = "peripheral";
+ qcom,otg-control = <2>; // PMIC
+ qcom,manual-pullup;
+
clocks = <&gcc GCC_USB_HS_AHB_CLK>,
- <&gcc GCC_USB_HS_SYSTEM_CLK>;
- clock-names = "iface", "core";
- assigned-clocks = <&gcc GCC_USB_HS_SYSTEM_CLK>;
- assigned-clock-rates = <80000000>;
- resets = <&gcc GCC_USB_HS_BCR>;
- reset-names = "core";
- phy_type = "ulpi";
- dr_mode = "otg";
- ahb-burst-config = <0>;
- phy-names = "usb-phy";
- phys = <&usb_hs_phy>;
- status = "disabled";
- #reset-cells = <1>;
+ <&gcc GCC_USB_HS_SYSTEM_CLK>,
+ <&gcc GCC_USB2A_PHY_SLEEP_CLK>;
+ clock-names = "iface", "core", "sleep";
- ulpi {
- usb_hs_phy: phy {
- compatible = "qcom,usb-hs-phy-msm8916",
- "qcom,usb-hs-phy";
- #phy-cells = <0>;
- clocks = <&xo_board>, <&gcc GCC_USB2A_PHY_SLEEP_CLK>;
- clock-names = "ref", "sleep";
- resets = <&gcc GCC_USB2A_PHY_BCR>, <&otg 0>;
- reset-names = "phy", "por";
- qcom,init-seq = /bits/ 8 <0x0 0x44
- 0x1 0x6b 0x2 0x24 0x3 0x13>;
- };
- };
+ resets = <&gcc GCC_USB2A_PHY_BCR>,
+ <&gcc GCC_USB_HS_BCR>;
+ reset-names = "phy", "link";
+ status = "disabled";
};
intc: interrupt-controller@b000000 {
--
2.13.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node"
2017-07-12 12:50 [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node" Rob Clark
@ 2017-07-13 6:09 ` Stephen Boyd
2017-07-13 9:35 ` Rob Clark
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2017-07-13 6:09 UTC (permalink / raw)
To: Rob Clark; +Cc: linux-arm-msm, Andy Gross
On 07/12, Rob Clark wrote:
> 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<----
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
index d94640812194..790b7775b901 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
@@ -17,6 +17,7 @@
function = PMIC_GPIO_FUNC_NORMAL;
power-source = <PM8916_GPIO_VPH>;
input-disable;
+ output-high;
};
};
diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
index bd310ac1967a..8f2decf84bbf 100644
--- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
@@ -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
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node"
2017-07-13 6:09 ` Stephen Boyd
@ 2017-07-13 9:35 ` Rob Clark
2017-07-13 22:02 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Rob Clark @ 2017-07-13 9:35 UTC (permalink / raw)
To: Stephen Boyd; +Cc: linux-arm-msm, Andy Gross
On Thu, Jul 13, 2017 at 2:09 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 07/12, Rob Clark wrote:
>> 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
> 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
> ----8<----
> diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
> index d94640812194..790b7775b901 100644
> --- a/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
> +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc-pmic-pins.dtsi
> @@ -17,6 +17,7 @@
> function = PMIC_GPIO_FUNC_NORMAL;
> power-source = <PM8916_GPIO_VPH>;
> input-disable;
> + output-high;
> };
> };
>
> diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> index bd310ac1967a..8f2decf84bbf 100644
> --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi
> @@ -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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node"
2017-07-13 9:35 ` Rob Clark
@ 2017-07-13 22:02 ` Stephen Boyd
2017-07-13 22:17 ` Rob Clark
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Boyd @ 2017-07-13 22:02 UTC (permalink / raw)
To: Rob Clark; +Cc: linux-arm-msm, Andy Gross
On 07/13, Rob Clark wrote:
> On Thu, Jul 13, 2017 at 2:09 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> > 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)
Ok.
>
> 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.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node"
2017-07-13 22:02 ` Stephen Boyd
@ 2017-07-13 22:17 ` Rob Clark
0 siblings, 0 replies; 5+ messages in thread
From: Rob Clark @ 2017-07-13 22:17 UTC (permalink / raw)
To: Stephen Boyd; +Cc: linux-arm-msm, Andy Gross, Rob Herring, John Stultz
On Thu, Jul 13, 2017 at 6:02 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
> On 07/13, Rob Clark wrote:
>> On Thu, Jul 13, 2017 at 2:09 AM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> > 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)
>
> Ok.
>
>>
>> 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.
>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-13 22:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-12 12:50 [PATCH] Revert "arm64: dts: qcom: Collapse usb support into one node" Rob Clark
2017-07-13 6:09 ` Stephen Boyd
2017-07-13 9:35 ` Rob Clark
2017-07-13 22:02 ` Stephen Boyd
2017-07-13 22:17 ` Rob Clark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox