From: Paul Kocialkowski <contact@paulk.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] sunxi: Avoid any assumption between musb gadget and host but fallback to host
Date: Sat, 04 Apr 2015 16:02:55 +0200 [thread overview]
Message-ID: <1428156175.2418.13.camel@collins> (raw)
In-Reply-To: <551FEBA2.4090600@redhat.com>
Le samedi 04 avril 2015 ? 15:48 +0200, Hans de Goede a ?crit :
> Hi,
>
> On 04-04-15 15:42, Paul Kocialkowski wrote:
> > Le dimanche 29 mars 2015 ? 13:18 +0200, Hans de Goede a ?crit :
> >> Hi,
> >>
> >> On 28-03-15 18:26, Paul Kocialkowski wrote:
> >>> musb might be used in gadget mode on sunxi, so we don't want to assume anything
> >>> related to host mode, especially USB keyboard support. Thus, there is no reason
> >>> to keep USB_KEYBOARD always enabled and in Kconfig: it is much better fit to
> >>> enable it in the common sunxi config header, when needed (some devices also have
> >>> no USB support at all).
> >>>
> >>> In case gadget mode is not explicitly enabled, this will fallback to host mode.
> >>>
> >>> Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> >>
> >> Nack, I'm not going to take any patch which removes config USB_KEYBOARD,
> >> having USB_KEYBOARD always enabled on devices with usb host capability
> >> causes a significant penalty in boot time, and some people may want to turn
> >> it off because of that.
> >
> > Actually, I said I would give up on this, but there are still parts of
> > that patch that I need for USB gadget (not related to USB keyboard).
> >
> > Regarding USB keyboard, the best solution IMO would be to set it
> > disabled by default in board/sunxi/Kconfig (both because of the boot
> > time penality and because it's not relevant when using gadget mode) and
> > have it enabled individually in each configs/*_defconfig that uses USB
> > in host mode.
>
> We try to offer the best ootb experience with the defconfigs and many
> users will not have serial consoles attached, so we really want
> usb-keyboard by default. Actually we can currently already use
> host mode on ehci and gadget mode on musb and then we still want
> usb-keyboard and that is how I expect the majority of the boards
> to eventually be configured ootb.
I hadn't thought of that, it makes sense.
> The only time when we do not want USB_KEYBOARD is when we've no
> usb hosts at all because that will cause linking errors, this
> should go away once we move over usb to the device model which
> will happen soon.
Of course, the best solution would be to have USB keyboard enabled but
not used at run-time when there is no host available at all.
> I'm happy to take patches you need to enable gadget mode, but I
> do not think it is a good idea to flip the the default and then
> add CONFIG_USB_KEYBOARD=y to pretty much every one of our 55
> defconfig files.
Well, the long way to do it without modifying each board would be to:
* switch USB_EHCI to Kconfig
* switch MUSB_HOST and MUSB_GADGET to Kconfig
* default MUSB_GADGET to n
* default MUSB_HOST to y if !MUSB_GADGET
* default USB_KEYBORAD to y if USB_EHCI || MUSB_HOST
That way, we don't have to change the defconfigs and my problem is
solved. What do you think?
This would also be one more step to eliminating
CONFIG_SYS_EXTRA_OPTIONS, which is not a bad thing.
--
Paul Kocialkowski, Replicant developer
Replicant is a fully free Android distribution running on several
devices, a free software mobile operating system putting the emphasis on
freedom and privacy/security.
Website: http://www.replicant.us/
Blog: http://blog.replicant.us/
Wiki/tracker/forums: http://redmine.replicant.us/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150404/7bf71ad9/attachment.sig>
next prev parent reply other threads:[~2015-04-04 14:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-28 17:26 [U-Boot] [PATCH v2] sunxi: Avoid any assumption between musb gadget and host but fallback to host Paul Kocialkowski
2015-03-29 11:18 ` Hans de Goede
2015-03-29 12:06 ` Paul Kocialkowski
2015-04-04 13:42 ` Paul Kocialkowski
2015-04-04 13:48 ` Hans de Goede
2015-04-04 14:02 ` Paul Kocialkowski [this message]
2015-04-04 14:14 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428156175.2418.13.camel@collins \
--to=contact@paulk.fr \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox