diff mbox series

[U-Boot,4/9] sunxi: Switch MUSB to gadget mode on the Bananapi M3

Message ID 20170922072635.32105-5-wens@csie.org
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series sunxi: A83T improvements | expand

Commit Message

Chen-Yu Tsai Sept. 22, 2017, 7:26 a.m. UTC
The Bananapi M3 has a micro-USB OTG port. It supports both host and
gadget mode. Having the OTG port operate in gadget mode is more useful,
as we can use it for fastboot or Ethernet over USB.

The board has 2 other USB host ports that are supported. These can be
used for connecting peripherals.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 configs/Sinovoip_BPI_M3_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Ripard Sept. 22, 2017, 8:14 a.m. UTC | #1
On Fri, Sep 22, 2017 at 07:26:30AM +0000, Chen-Yu Tsai wrote:
> The Bananapi M3 has a micro-USB OTG port. It supports both host and
> gadget mode. Having the OTG port operate in gadget mode is more useful,
> as we can use it for fastboot or Ethernet over USB.
> 
> The board has 2 other USB host ports that are supported. These can be
> used for connecting peripherals.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  configs/Sinovoip_BPI_M3_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
> index f321d94e04eb..e48983fc3310 100644
> --- a/configs/Sinovoip_BPI_M3_defconfig
> +++ b/configs/Sinovoip_BPI_M3_defconfig
> @@ -27,5 +27,5 @@ CONFIG_AXP_DCDC5_VOLT=1200
>  CONFIG_AXP_DLDO3_VOLT=2500
>  CONFIG_AXP_SW_ON=y
>  CONFIG_USB_EHCI_HCD=y
> -CONFIG_USB_MUSB_HOST=y
> +CONFIG_USB_MUSB_GADGET=y

I wonder whether this could become the default.

As far as I can see, having it as host can only be useful on the
tablets we support.

Maybe we can add a config option for tablets device, and if it's set,
enable in host mode, and if not defaults to gadget.

Eventually, we could move all the options that are not really useful
on anything but a tablet that we currently select, like USB_KEYBOARD

Maxime
Chen-Yu Tsai Sept. 22, 2017, 11:20 a.m. UTC | #2
On Fri, Sep 22, 2017 at 4:14 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Fri, Sep 22, 2017 at 07:26:30AM +0000, Chen-Yu Tsai wrote:
>> The Bananapi M3 has a micro-USB OTG port. It supports both host and
>> gadget mode. Having the OTG port operate in gadget mode is more useful,
>> as we can use it for fastboot or Ethernet over USB.
>>
>> The board has 2 other USB host ports that are supported. These can be
>> used for connecting peripherals.
>>
>> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
>> ---
>>  configs/Sinovoip_BPI_M3_defconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
>> index f321d94e04eb..e48983fc3310 100644
>> --- a/configs/Sinovoip_BPI_M3_defconfig
>> +++ b/configs/Sinovoip_BPI_M3_defconfig
>> @@ -27,5 +27,5 @@ CONFIG_AXP_DCDC5_VOLT=1200
>>  CONFIG_AXP_DLDO3_VOLT=2500
>>  CONFIG_AXP_SW_ON=y
>>  CONFIG_USB_EHCI_HCD=y
>> -CONFIG_USB_MUSB_HOST=y
>> +CONFIG_USB_MUSB_GADGET=y
>
> I wonder whether this could become the default.
>
> As far as I can see, having it as host can only be useful on the
> tablets we support.
>
> Maybe we can add a config option for tablets device, and if it's set,
> enable in host mode, and if not defaults to gadget.
>
> Eventually, we could move all the options that are not really useful
> on anything but a tablet that we currently select, like USB_KEYBOARD

There are also the cases where the OTG controller is routed to a USB
host port. These are likely set top boxes. It would probably be better
to have the user be able to explicitly set it to gadget mode if they
want to do development, but otherwise be in host mode by default.

ChenYu
Maxime Ripard Sept. 22, 2017, 2:40 p.m. UTC | #3
On Fri, Sep 22, 2017 at 11:20:10AM +0000, Chen-Yu Tsai wrote:
> On Fri, Sep 22, 2017 at 4:14 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Fri, Sep 22, 2017 at 07:26:30AM +0000, Chen-Yu Tsai wrote:
> >> The Bananapi M3 has a micro-USB OTG port. It supports both host and
> >> gadget mode. Having the OTG port operate in gadget mode is more useful,
> >> as we can use it for fastboot or Ethernet over USB.
> >>
> >> The board has 2 other USB host ports that are supported. These can be
> >> used for connecting peripherals.
> >>
> >> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> >> ---
> >>  configs/Sinovoip_BPI_M3_defconfig | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
> >> index f321d94e04eb..e48983fc3310 100644
> >> --- a/configs/Sinovoip_BPI_M3_defconfig
> >> +++ b/configs/Sinovoip_BPI_M3_defconfig
> >> @@ -27,5 +27,5 @@ CONFIG_AXP_DCDC5_VOLT=1200
> >>  CONFIG_AXP_DLDO3_VOLT=2500
> >>  CONFIG_AXP_SW_ON=y
> >>  CONFIG_USB_EHCI_HCD=y
> >> -CONFIG_USB_MUSB_HOST=y
> >> +CONFIG_USB_MUSB_GADGET=y
> >
> > I wonder whether this could become the default.
> >
> > As far as I can see, having it as host can only be useful on the
> > tablets we support.
> >
> > Maybe we can add a config option for tablets device, and if it's set,
> > enable in host mode, and if not defaults to gadget.
> >
> > Eventually, we could move all the options that are not really useful
> > on anything but a tablet that we currently select, like USB_KEYBOARD
> 
> There are also the cases where the OTG controller is routed to a USB
> host port. These are likely set top boxes. It would probably be better
> to have the user be able to explicitly set it to gadget mode if they
> want to do development, but otherwise be in host mode by default.

I don't know, maybe I'm heavily (confirmation) biased, but I've seen
far more people using the micro USB as a gadget (or at least, not as a
host, just powering the board), than people using it as hosts.

Actually, apart from the boards that are wiring it to an USB-A
connector, I haven't seen anyone use that kind of setup, ever.

For the tablets where it's your only option to interact with the
device since you don't have any UARTs, it makes sense. Same thing for
the ones that wire it to a USB-A connector. But for all the boards out
there with a micro or mini USB connector that can power them, I really
feel like the default should be to a gadget.

Maxime
diff mbox series

Patch

diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig
index f321d94e04eb..e48983fc3310 100644
--- a/configs/Sinovoip_BPI_M3_defconfig
+++ b/configs/Sinovoip_BPI_M3_defconfig
@@ -27,5 +27,5 @@  CONFIG_AXP_DCDC5_VOLT=1200
 CONFIG_AXP_DLDO3_VOLT=2500
 CONFIG_AXP_SW_ON=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_MUSB_HOST=y
+CONFIG_USB_MUSB_GADGET=y
 CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y