[U-Boot] [PATCH] sunxi: axp221: Use vbus-available rather then vbus-usable for vbus-detect

Hans de Goede hdegoede at redhat.com
Fri Mar 27 21:37:35 CET 2015


Hi,

On 23-03-15 17:38, Hans de Goede wrote:
> Hi,
>
> On 23-03-15 17:33, Paul Kocialkowski wrote:
>> Le lundi 23 mars 2015 à 17:28 +0100, Hans de Goede a écrit :
>>> vbus-usable does not get set if power is provided through the power barrel
>>> connector, even if external 5v is also present on the otg connector.
>>>
>>> vbus-available correctly always reflects if there is 5v present on the otg
>>> connector.
>>
>> You (or I) could submit the very same change for the AXP209. It's the
>> same bit for available (1 << 5).
>
> Yes I was about to mail you about that when I noticed that this seems to
> break actual host mode support on the otg connector, it seems that
> plugging in a micro-b to usb-a receptacle (aka host) convertor + a device
> plugged into the usb-a receptacle also causes bit 5 to get set :|
>
> So my patch is no good, but powering the otg port while external 5v is present
> also is not good (one side effect is that the tablet will power up immediately
> after sending a power-off command to the axp221).
>
> If you've some time to tinker with this I would appreciate any ideas
> you may have (assuming the same problem exists on the axp209)
> simply plug in 5v power into the power barrel, as well as 5v power
> (e.g. simply from your pc) and boot up the tablet, at least in my
> case then it does not properly give the charger plugged in error.

Ok, so it took me a while but here is a follow up to this:

1) My original patch is correct, but it took me a while to reproduce the
original problem, I'll send an updated patch with the reproducer clearly
spelled out in the commit msg as it is non obvious

2) My original patch does introduce a *new* problem, or rather exposes
an existing problem when turning of vusb to the otg port (when in hostmode,
so vusb coming from the board) it takes a while for vusb to discharge and
if we are to quick with reading vusb-detect after a reset when the vusb
was on we see the residual charge and assume we've an external vusb, this is
worse when vbus gets not only sensed, but also controller by the pmic,
as then it does not get turned of on reset at all. I've patches fixing all
of this now, which I will include in the patch-set which I'm about to send
out. I'll put the fixes before this patch in the patch set so that the
bug it exposes gets fixed before it is exposed.

I think this all does not have much influence on the axp209, because AFAICT
we only ever do vbus sense through the pmic there and never vbus control.

Regards,

Hans





More information about the U-Boot mailing list