Hi,

thanks for doing the experiments!

On 05/04/18 14:17, Martin Lucina wrote:
> Hi,
> 
> On Thursday, 05.04.2018 at 12:20, Andre Przywara wrote:
>>> [1]
>>> https://github.com/apritzel/linux/blob/f1827ce503ca19e6873847128f86849788cfc7db/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
>>>
>>> For reference, I've uploaded a full dmesg of this kernel booting, here:
>>> https://gist.github.com/mato/96bfaf3a99a824024c0f27e76d99bc63
>>
>> So something is explicitly turning this off:
>> [ 1.820315] usb0-vbus: disabling
>>
>> Can you try to add "regulator-always-on;" to the reg_usb0_vbus node in
>> the beginning of the .dts? That should leave it on for now, as a hack,
>> just for confirmation.
> 
> That works, I get 5V on the USB-A, and the port appears to work with a
> flash drive.

OK, good. At least we have verified all power sources now.

>> But I just see that there seems to be a glaring mismatch between the PHY
>> driver and the DT binding doc (and most .dts, actually):
>> So can you please replace the last line in the olinuxino.dts:
>>
>> -    usb0_vbus-supply = <&reg_usb0_vbus>;
>> +    usb0_vbus_power-supply = <&reg_usb0_vbus>;
>>
>> Then you should not need the regulator-always-on hack above.
> 
> This does not work, I still see the same "disabling" message in dmesg and

Mmh, too bad. I was hoping to have found our culprit.
Maybe it's an initialization ordering issue, because the pinctrl driver
- which virtually everyone depends on - gets actually initialized quite
late, so many drivers bail out with -EPROBE_DEFER on their first try. I
I need to check if the USB PHY and the regulator drivers can cope with
that properly.
With that change, can you dump the output of:
/sys/kernel/debug/regulator/regulator_summary
Ideally even without that change. Would be curious to know what's
actually going on with those regulators.

Or I am missing some generic DT parsing code which actually constructs
"usb0_vbus-supply" and initializes this - but I can't find that string
anywhere in the kernel code.
It seems that I could do experiments with my BananaPi M1, which also
uses a GPIO based regulator - but that looks even more brok^Wconfusing
over there.

> additionally lose most of the USB buses -- normally the kernel sees 5 buses
> (2x 1.1 and 3x 2.0), with this change it only sees one of each.
> Additionally, this change in combination with the regulator-always-on-hack
> removes the "disabling" message, gives 5V power on both ports, but the
> kernel does not see either of them.
> 
>>> root@olinuxino:/sys/class/gpio# echo 201 > export
>>> -bash: echo: write error: Device or resource busy
>>
>> Yeah, this is now somewhat expected with the reg_usb0_vbus regulator,
>> which snatches the GPIO. If the above doesn't work, try to disable or
>> remove this node and try again.
> 
> Should I try this approach separately? Have not done so yet.

I don't think this is needed, as we now know that it's indeed PG9
driving this.

Cheers,
Andre.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to