diff mbox

[V3,RFT,3/5] ARM64: dts: bcm283x: Use dtsi for USB host mode

Message ID 1471792204-21908-4-git-send-email-stefan.wahren@i2se.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Wahren Aug. 21, 2016, 3:10 p.m. UTC
In case dr_mode isn't passed via DT, the dwc2 driver defaults
to OTG mode. But the Raspberry Pi 3 is designed only for host mode.
So fix this issue by linking to the dtsi file which set the dr_mode
to host.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts   |    1 +
 .../boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi    |    1 +
 2 files changed, 2 insertions(+)
 create mode 120000 arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi

Comments

Stefan Wahren Aug. 31, 2016, 7:59 a.m. UTC | #1
Hi Gerd,

Am 21.08.2016 um 17:10 schrieb Stefan Wahren:
> In case dr_mode isn't passed via DT, the dwc2 driver defaults
> to OTG mode. But the Raspberry Pi 3 is designed only for host mode.
> So fix this issue by linking to the dtsi file which set the dr_mode
> to host.

this patch is pending and the rest has been merged. Since i don't have a
RPi 3 it's only compile tested.

Could you please test it (requires patch 1 and 2 of this series) on your
RPi 3?

Regards
Stefan

>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
>  arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts   |    1 +
>  .../boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi    |    1 +
>  2 files changed, 2 insertions(+)
>  create mode 120000 arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi
>
> diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
> index 7841b72..7625e57 100644
> --- a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
> +++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
> @@ -2,6 +2,7 @@
>  #include "bcm2837.dtsi"
>  #include "bcm2835-rpi.dtsi"
>  #include "bcm283x-rpi-smsc9514.dtsi"
> +#include "bcm283x-rpi-usb-host.dtsi"
>  
>  / {
>  	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
> diff --git a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi
> new file mode 120000
> index 0000000..cbeebe3
> --- /dev/null
> +++ b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi
> @@ -0,0 +1 @@
> +../../../../arm/boot/dts/bcm283x-rpi-usb-host.dtsi
> \ No newline at end of file
Gerd Hoffmann Sept. 7, 2016, 10:59 a.m. UTC | #2
On Mi, 2016-08-31 at 09:59 +0200, Stefan Wahren wrote:
> Hi Gerd,
> 
> Am 21.08.2016 um 17:10 schrieb Stefan Wahren:
> > In case dr_mode isn't passed via DT, the dwc2 driver defaults
> > to OTG mode. But the Raspberry Pi 3 is designed only for host mode.
> > So fix this issue by linking to the dtsi file which set the dr_mode
> > to host.
> 
> this patch is pending and the rest has been merged. Since i don't have a
> RPi 3 it's only compile tested.
> 
> Could you please test it (requires patch 1 and 2 of this series) on your
> RPi 3?

Have a git tree to test?  Patch doesn't apply cleanly (using 4.8-rc5
with eric's for-next branch which already has 1+2), seems to depend on
more device tree changes.

Also usb is working fine for me on the rpi3 even without this, so why is
this needed?  Is dwc2 defaulting to otg mode a recent change?

cheers,
  Gerd
Stefan Wahren Sept. 7, 2016, 12:02 p.m. UTC | #3
Hi Gerd,

Am 07.09.2016 um 12:59 schrieb Gerd Hoffmann:
> On Mi, 2016-08-31 at 09:59 +0200, Stefan Wahren wrote:
>> Hi Gerd,
>>
>> Am 21.08.2016 um 17:10 schrieb Stefan Wahren:
>>> In case dr_mode isn't passed via DT, the dwc2 driver defaults
>>> to OTG mode. But the Raspberry Pi 3 is designed only for host mode.
>>> So fix this issue by linking to the dtsi file which set the dr_mode
>>> to host.
>> this patch is pending and the rest has been merged. Since i don't have a
>> RPi 3 it's only compile tested.
>>
>> Could you please test it (requires patch 1 and 2 of this series) on your
>> RPi 3?
> Have a git tree to test?  Patch doesn't apply cleanly (using 4.8-rc5
> with eric's for-next branch which already has 1+2), seems to depend on
> more device tree changes.

as i wrote in the changelog the patch series based on Ian Campbell's patches

ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm

Unfortunately i don't have a repo well prepared with this patch series.
My development repo doesn't contain the final series V3 [1], but the
master already has the necessary DT patches above.

> Also usb is working fine for me on the rpi3 even without this, so why is
> this needed? 

In case of a multiplatform config with following settings the driver
isn't able to "detect" the role:

CONFIG_USB=y
CONFIG_USB_OTG=y
CONFIG_USB_DWC2=y
CONFIG_USB_DWC2_DUAL_ROLE=y
CONFIG_USB_PHY=y
CONFIG_NOP_USB_XCEIV=y
CONFIG_USB_GADGET=y
CONFIG_USB_ZERO=y

Also please refer to my answer here [2] and this bug [3].

> Is dwc2 defaulting to otg mode a recent change?

No, it's a default for all OTG host controller in case no dr_mode is
defined.

Regards
Stefan

[1] - https://github.com/lategoodbye/rpi-zero
[2] -
http://lists.infradead.org/pipermail/linux-rpi-kernel/2016-August/004242.html
[3] - http://marc.info/?l=linux-usb&m=147169822213074&w=2

>
> cheers,
>   Gerd
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Gerd Hoffmann Sept. 7, 2016, 2:17 p.m. UTC | #4
Hi,

> ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
> ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm

Picked them up.

> In case of a multiplatform config with following settings the driver
> isn't able to "detect" the role:
> 
> CONFIG_USB=y
> CONFIG_USB_OTG=y
> CONFIG_USB_DWC2=y
> CONFIG_USB_DWC2_DUAL_ROLE=y
> CONFIG_USB_PHY=y
> CONFIG_NOP_USB_XCEIV=y
> CONFIG_USB_GADGET=y
> CONFIG_USB_ZERO=y

Configured my kernel that way so the test actually tests something ;)

And ... everything looks fine.  usb ethernet works, and so does the usb
keyboard.  /proc/device-tree/soc/usb@7e980000/dr_mode exists and
contains "host".

Tested-by: Gerd Hoffmann <kraxel@redhat.com>

cheers,
  Gerd
Stefan Wahren Sept. 23, 2016, 7:33 a.m. UTC | #5
Am 07.09.2016 um 16:17 schrieb Gerd Hoffmann:
>   Hi,
>
>> ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
>> ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm
> Picked them up.
>
>> In case of a multiplatform config with following settings the driver
>> isn't able to "detect" the role:
>>
>> CONFIG_USB=y
>> CONFIG_USB_OTG=y
>> CONFIG_USB_DWC2=y
>> CONFIG_USB_DWC2_DUAL_ROLE=y
>> CONFIG_USB_PHY=y
>> CONFIG_NOP_USB_XCEIV=y
>> CONFIG_USB_GADGET=y
>> CONFIG_USB_ZERO=y
> Configured my kernel that way so the test actually tests something ;)
>
> And ... everything looks fine.  usb ethernet works, and so does the usb
> keyboard.  /proc/device-tree/soc/usb@7e980000/dr_mode exists and
> contains "host".
>
> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
>

This patch hasn't been merged yet. Is there something wrong?

Stefan
Eric Anholt Sept. 23, 2016, 8:15 a.m. UTC | #6
Stefan Wahren <stefan.wahren@i2se.com> writes:

> Am 07.09.2016 um 16:17 schrieb Gerd Hoffmann:
>>   Hi,
>>
>>> ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
>>> ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm
>> Picked them up.
>>
>>> In case of a multiplatform config with following settings the driver
>>> isn't able to "detect" the role:
>>>
>>> CONFIG_USB=y
>>> CONFIG_USB_OTG=y
>>> CONFIG_USB_DWC2=y
>>> CONFIG_USB_DWC2_DUAL_ROLE=y
>>> CONFIG_USB_PHY=y
>>> CONFIG_NOP_USB_XCEIV=y
>>> CONFIG_USB_GADGET=y
>>> CONFIG_USB_ZERO=y
>> Configured my kernel that way so the test actually tests something ;)
>>
>> And ... everything looks fine.  usb ethernet works, and so does the usb
>> keyboard.  /proc/device-tree/soc/usb@7e980000/dr_mode exists and
>> contains "host".
>>
>> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
>>
>
> This patch hasn't been merged yet. Is there something wrong?

I hadn't bumped it back to todo from RFT.  Also, is this a priority
patch, since submitting merges is a pain?  Does USB break in some way
without it?
Stefan Wahren Sept. 23, 2016, 8:23 a.m. UTC | #7
Am 23.09.2016 um 10:15 schrieb Eric Anholt:
> Stefan Wahren <stefan.wahren@i2se.com> writes:
>
>> Am 07.09.2016 um 16:17 schrieb Gerd Hoffmann:
>>>   Hi,
>>>
>>>> ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
>>>> ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm
>>> Picked them up.
>>>
>>>> In case of a multiplatform config with following settings the driver
>>>> isn't able to "detect" the role:
>>>>
>>>> CONFIG_USB=y
>>>> CONFIG_USB_OTG=y
>>>> CONFIG_USB_DWC2=y
>>>> CONFIG_USB_DWC2_DUAL_ROLE=y
>>>> CONFIG_USB_PHY=y
>>>> CONFIG_NOP_USB_XCEIV=y
>>>> CONFIG_USB_GADGET=y
>>>> CONFIG_USB_ZERO=y
>>> Configured my kernel that way so the test actually tests something ;)
>>>
>>> And ... everything looks fine.  usb ethernet works, and so does the usb
>>> keyboard.  /proc/device-tree/soc/usb@7e980000/dr_mode exists and
>>> contains "host".
>>>
>>> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
>>>
>> This patch hasn't been merged yet. Is there something wrong?
> I hadn't bumped it back to todo from RFT.  Also, is this a priority
> patch, since submitting merges is a pain? 
No
> Does USB break in some way
> without it?

No. I only want know if this is still in queue and does someone care
about this patch.

Thanks
Stefan
Eric Anholt Sept. 23, 2016, 11:55 a.m. UTC | #8
Stefan Wahren <stefan.wahren@i2se.com> writes:

> Am 23.09.2016 um 10:15 schrieb Eric Anholt:
>> Stefan Wahren <stefan.wahren@i2se.com> writes:
>>
>>> Am 07.09.2016 um 16:17 schrieb Gerd Hoffmann:
>>>>   Hi,
>>>>
>>>>> ARM: dts: Remove use of skeleton.dtsi from bcm283x.dtsi
>>>>> ARM64: dts: bcm: Use a symlink to R-Pi dtsi files from arch=arm
>>>> Picked them up.
>>>>
>>>>> In case of a multiplatform config with following settings the driver
>>>>> isn't able to "detect" the role:
>>>>>
>>>>> CONFIG_USB=y
>>>>> CONFIG_USB_OTG=y
>>>>> CONFIG_USB_DWC2=y
>>>>> CONFIG_USB_DWC2_DUAL_ROLE=y
>>>>> CONFIG_USB_PHY=y
>>>>> CONFIG_NOP_USB_XCEIV=y
>>>>> CONFIG_USB_GADGET=y
>>>>> CONFIG_USB_ZERO=y
>>>> Configured my kernel that way so the test actually tests something ;)
>>>>
>>>> And ... everything looks fine.  usb ethernet works, and so does the usb
>>>> keyboard.  /proc/device-tree/soc/usb@7e980000/dr_mode exists and
>>>> contains "host".
>>>>
>>>> Tested-by: Gerd Hoffmann <kraxel@redhat.com>
>>>>
>>> This patch hasn't been merged yet. Is there something wrong?
>> I hadn't bumped it back to todo from RFT.  Also, is this a priority
>> patch, since submitting merges is a pain? 
> No
>> Does USB break in some way
>> without it?
>
> No. I only want know if this is still in queue and does someone care
> about this patch.

It's in my queue now.  Sorry for missing it!
Eric Anholt Oct. 17, 2016, 5:29 p.m. UTC | #9
Stefan Wahren <stefan.wahren@i2se.com> writes:

> In case dr_mode isn't passed via DT, the dwc2 driver defaults
> to OTG mode. But the Raspberry Pi 3 is designed only for host mode.
> So fix this issue by linking to the dtsi file which set the dr_mode
> to host.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Applied Gerd's Tested-by and merged to bcm2835-dt-64-next.
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
index 7841b72..7625e57 100644
--- a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
+++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts
@@ -2,6 +2,7 @@ 
 #include "bcm2837.dtsi"
 #include "bcm2835-rpi.dtsi"
 #include "bcm283x-rpi-smsc9514.dtsi"
+#include "bcm283x-rpi-usb-host.dtsi"
 
 / {
 	compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
diff --git a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi
new file mode 120000
index 0000000..cbeebe3
--- /dev/null
+++ b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi
@@ -0,0 +1 @@ 
+../../../../arm/boot/dts/bcm283x-rpi-usb-host.dtsi
\ No newline at end of file