I built openwrt v22.03.0-rc5 for my gl-ar300m16 and it works except for the power to the USB port.
It seems like mainline openwrt needs a patch to connect the USB GPIO power supply to the USB port for the GL-AR300M16 target?
Searching these forums i see there was a similar issue a few years ago between gl-inet firmware 2.26 and 2.27 USB devices not recognized - #8 by patchmaster
I suspect the same patch is required for mainline openwrt?
alzhao
August 2, 2022, 11:02am
2
I didnāt test openwrt 22.03 on AR300M16.
But if the USB is powered off by default, a simple solution is to enable it in /etc/rc.local
Just write a command to enable the USB, e.g. writing 0 or 1 to the gpio control.
Yes i tried that but couldnāt export GPIO 2 (i suspect with the new 5x kernel its not actually gpio 2 but called something else)
Anyway i managed to get it to work by creating this patch:
diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
index d64ffa7115..5aaa149940 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-ar300m.dtsi
@@ -43,8 +43,7 @@
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
- gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
- enable-active-high;
+ gpio = <&gpio 2 GPIO_ACTIVE_LOW>;
};
leds {
3 Likes
EKNYESE
December 1, 2022, 10:37am
4
Did you already mentioned this on github for openwrt, so this bug can be fixed in the next bulids?
No, i didnt, you will need to submit a patch to openwrt mainline
Could you please post the link here to your corresponding pull-request as soon as created?
ā I urgent need a fixed firmware and would be happy, when this bug is fixed in the next openwrt release (>22.03.2).
Thanks in advance!
1 Like
alzhao
December 5, 2022, 5:00am
8
Developer will post link of pull request after submit.
Please give a little time.
alzhao
December 15, 2022, 10:55am
9
Problem finally solved. Pls check the patch.
It is due to a driver issue actually.
openwrt:master
ā luochongjun:master
opened 10:06AM - 15 Dec 22 UTC
glinet forum users reported the problem at
https://forum.gl-inet.com/t/gl-ar300⦠m16-openwrt-22-03-0-rc5-usb-port-power-off-by-default/23199
The current code uses the regulator framework to control the USB power supply. Although usb0 described in DTS refers to the regulator by vbus-supply, but there is no code related to regulator implemented in the USB driver of QCA953X, so the USB of the device cannot work.
Under the regulator framework, adding the regulator-always-on attribute fixes this problem, but it means that USB power will not be able to be turned off. Since we need to control the USB power supply in user space, I didn't find any other better way under the regulator framework of Linux, so I directly export gpio.
Signed-off-by: gl-luochongjun <luochongjun@gl-inet.com>
Thanks for your contribution to OpenWrt!
To help keep the codebase consistent and readable,
and to help people review your contribution,
we ask you to follow the rules you find in the wiki at this link
https://openwrt.org/submitting-patches
Please remove this message before posting the pull request.
1 Like
alzhao
January 16, 2023, 6:47am
10
Openwrt merged the patch to master.
1 Like