Re: Programmatically switching a USB port from Host to Device mode (not OTG)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 24 Oct 2019 at 11:01, Rogan Dawes <rogan@xxxxxxxxxxxx> wrote:
>
> Hi folks
>
> I am using a GL.Inet AR750S (Slate) travel router, which is based on
> the QCA9563 SoC.
>
> I am trying to see if there is any way that I can get it to operate in
> a USB Gadget mode.
>
> According to twitter support
> (https://twitter.com/GLiNetWiFi/status/1187190831746179073), the
> router's external port is connected directly to USB1 on the SoC, and
> the internal port is connected via a USB hub to USB2.
>
> According to the datasheet which I found at
> https://github.com/Deoptim/atheros/QCA9563_July_2014.pdf, USB1 should
> be a Host-only port, while USB2 should be device-capable.
> Unfortunately, the hub chip makes it impossible to test USB2.
>
> So, my question is, is it possible to modify the device tree to
> configure USB1 in gadget mode (even though according to the datasheet,
> this is a reserved configuration) ?
>
> Is it possible that a pure software configuration change may be
> sufficient to change the role of the port, or would I need to remove
> pull-up/down resistors as well to see if this could work?
>
> Many thanks!
>
> Rogan

I've been trawling the Internet, and trying to understand if there is
any prior art indicating the feasibility of the QCA9563 actually
supporting USB Gadget or Peripheral mode, and I came across what
appears to be a copy of an official tree
(https://gfiber.googlesource.com/kernel/windcharger/+/ca3986b4fd425176662f005cc996d61dd439d1f2/drivers/usb/gadget/Kconfig)
provided by Qualcomm to Google for their "windcharger" fibre router.

It contains commits like:

  commit d95f9bd73fd3a4ebabf7c524941f6b6095388c55
  Author: Allan Zhang <allanzhang@xxxxxxxxxx>
  Date:   Wed Jan 21 17:00:47 2015 -0800

      Initial WindCharger Linux Kernel Ver

      This for record purpose. It's the QCA-provided AP143/board953x linux
      kernel, based on linux 2.6.31.

      This version targets for no code change and reflects qca code snapshot.
      Any enhancement will be in individual CL for review.

      Change-Id: I7252866c2f87f8ffd26ee64976dd4dccc955e739

Which contains a file arch/mips/configs/board956x-wrap_defconfig

which sets

+CONFIG_USB_GADGET_ATH=y

So, I'm wondering how realistic it would be to try to get the
CONFIG_USB_GADGET_ATH driver ported from this kernel version to
mainline, or perhaps if someone might take a quick look at it and
indicate whether the current mainline actually already includes this
functionality? I do know that AR9331 USB GADGET support does exist in
mainline via the chipidea driver, and from what I can see, the rest of
the Qualcomm chips seems to use the same chipset, so perhaps it is as
simple as configuring the device tree appropriately to use the
chipidea driver on the appropriate port?

I'm completely happy to try and figure this out myself, but would
obviously appreciate any pointers from anyone familiar with the
Qualcomm USB drivers.

Many thanks!

Regards,

Rogan



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux