Hi,

On Thursday, 22.03.2018 at 20:47, André Przywara wrote:
> > Ok, I just measured both ports (via a cannibalised USB cable + OTG for the
> > micro-USB) and there's no power on either of them. Cross-checked the
> > measurement setup against an old Thinkpad to be sure.

One more data point which I did not notice before: After ATF runs but
before the kernel boots I get 5V (well, 4.85V but close enough) on the
USB-A port. Once the kernel has booted the voltage drops to zero.

> OK, remote debugging!
> 
> Can you please try to play around with GPIO PG9 from Linux? Basically:
> # cd /sys/class/gpio
> # echo 201 > export
> # cd gpio201
> # echo out > direction
> # echo 1 > value
> 
> And then try to measure the USB voltage again? Try 0 for "value" as
> well. If the export complains, try to remove the DT parts I gave you
> (switch back to the normal mainline DT). 201 is ('G'-'A') * 32 + 9.
> Something like that should enable the voltage on the USB-A socket
> (regardless of the DT used).

I seem to be missing some driver for the GPIOs as I have no
/sys/class/gpio and nothing that looks suitable in /lib/modules; what do I
need to add to the arm64 defconfig to enable this?

> For the micro-B port: Can you try to add the following line to the ATF
> source, into plat/sun50iw1p1/sunxi_power.c, somewhere in the
> pmic_setup() function:
>       sunxi_pmic_write(0x30, sunxi_pmic_read(0x30) | BIT(2));
> 
> That should power the DRIVEVBUS/N_VBUSEN pin, ideally turning on the
> power of the OTG port.
> If that works, I can make a Linux patch to do this there as well.

When I add that line to ATF I get 5V on the micro-B port after
initialisation and it stays powered up even after the kernel has booted.

Cheers,

-mato

-- 
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 linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to