From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Tue, 10 Feb 2015 09:24:47 +0100 Subject: [U-Boot] [PATCH 17/17] sunxi: Hookup OTG USB controller support In-Reply-To: References: <1421004895-10896-1-git-send-email-hdegoede@redhat.com> <1421004895-10896-18-git-send-email-hdegoede@redhat.com> <20150131045447.26e1eebc@i7> <20150209055404.1d09f14a@i7> Message-ID: <54D9C04F.2020201@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 09-02-15 23:10, Michal Suchanek wrote: > On 9 February 2015 at 04:54, Siarhei Siamashka > wrote: >> On Sat, 31 Jan 2015 04:54:47 +0200 >> Siarhei Siamashka wrote: >> >>> On Sun, 11 Jan 2015 20:34:55 +0100 >>> Hans de Goede wrote: >>> >>>> Hookup OTG USB controller support and enable the otg controller + USB-keyb >>>> on various tablets. >>>> >>>> This allows tablet owners to interact with u-boot without needing to solder >>>> a serial console onto their tablet PCB. >>> >>> Thanks. Works great on my Primo73 and Primo81 tablets. However I have >>> just one naive question before happily taking it into use by default. >>> >>> Is the hardcoded otg host mode (without checking the id pin) always >>> safe? For example, what happens if somebody connects a charger instead >>> of a usb keyboard to the tablet? >> >> So, does anyone have any idea if it is theoretically safe to have two >> USB hosts connected to each other and both driving VBUS at +5V? >> >> A somewhat realistic scenario is booting an Allwinner tablet over >> USB using the FEL mode. Is it a good idea for such tablet to have >> CONFIG_USB_MUSB_SUNXI=y and CONFIG_USB0_VBUS_PIN="axp_drivebus" >> in defconfig? >> > > From my past experiments with some non-standard-compliant cables which > allow connecting a tablet with a PC without telling the tablet to go > OTG mode it seems the tablet battery is drained really quick in this > case. > > There is a protocol for telling the tablet not to power the bus (or > telling the PC not to power it for that matter) but both sides have to > support matching part of the protocol. Either way, ideal case is that > tablet gets power form PC or powered hub even in host mode which is > not standards-compliant and obviously does not work with stuff like > keyboards. > > However, it should be possible to detect that there is bus power at > the moment a device is connected and not power the device in that case > regardless of usb mode negotiated after the connection. Right, I've fixing this on my todo list, the plan is to add vbus_det support, and first check if there is an external vbus before enabling vbus. Regards, Hans