Hi,

On 05/04/18 11:01, Martin Lucina wrote:
> Hi,
> 
> On Wednesday, 04.04.2018 at 14:07, Andre Przywara wrote:
>> Ah, interesting, but would make some sense: PG9 is pulled high on the
>> board, so you have to actively drive it *low* to *disable* the power.
>> Do you have some nodes for the WiFi/BT module in the DT? The UART1 CTS
>> is also on PG9, and we bundle it with the RTS pin in one group. RTS is
>> used by the BT module, but CTS is not.
>> So as soon as we initialise UART1, we might accidentally pull that line
>> low and disable USB power.
> 
> I've since upgraded to mainline v4.16.0 with the DT changes from your
> olinuxino Github branch, plus the additional change adding dr_mode = "otg" to 
> the
> &usb_otg node. In the DT [1] there are some nodes referring to
> "wifi_pwrseq" (L61, L117), a "wifi@1" (L122) and a "vcc-wifi-io" (L225). I
> don't understand enough of the syntax to know if these are what you're
> asking about?

That's Wifi, which uses SDIO only.
The same chip has a Bluetooth module, which uses UART1, but that's not
in the DT at the moment.
But:

> [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.

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.

>> Ah, yes, you need CONFIG_GPIO_SYSFS in your .config. You can use any
>> other userland tool to manipulate GPIOs, though.
>> You may also try to use U-Boot's "gpio" command, though I am not sure
>> that works on the A64 at the moment. Possibly today's sunxi/master
>> U-Boot branch would fix this.
> 
> Adding CONFIG_GPIO_SYSFS gives me the sysfs directory, but the "export"
> does not work:
> 
> root@olinuxino:/# cd /sys/class/gpio
> root@olinuxino:/sys/class/gpio# ls -l
> total 0
> --w------- 1 root root 4096 Nov  3 17:17 export
> lrwxrwxrwx 1 root root    0 Nov  3 17:16 gpiochip0 -> 
> ../../devices/platform/soc/1c20800.pinctrl/gpio/gpiochip0
> lrwxrwxrwx 1 root root    0 Nov  3 17:16 gpiochip352 -> 
> ../../devices/platform/soc/1f02c00.pinctrl/gpio/gpiochip352
> --w------- 1 root root 4096 Nov  3 17:16 unexport
> 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.

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

Reply via email to