Building OpenWRT for Teltonika RUT956

Hi,

I have been trying to get OpenWRT running on the RUT956 for a while now. I took the dts file from the SDK that Teltonika releases, modified it slightly, added the device to the Makefile, and to my surprise after some debugging it actually compiled and is running now.

Other than the similar RUT955 they use the mt7628an SoC now, with the MeiGLink SLM750 modem.

Once I added the mt76x2 wifi driver, even WLAN started working... nice.

But now I am stuck at getting the modem to work. The control pins (modem_power, modem_reset...) are connected to the shift register 74hc595. Somehow it needs to be activated, but I don't see the shift register with the "normal" GPIOs. I am assuming that the dts needs to be modified to match more what OpenWRT expects, but I am still struggling to understand what is going on there. I tried looking at the ar9344_teltonika_rut955-h7v3c0.dts file, but so far could not transfer what I see there into the dts I am using, without breaking everything.

The DTS I am currently using:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include "mt7628an.dtsi"

/ {
	compatible = "teltonika,rut9m", "mediatek,mt7628an-soc";
	model = "Teltonika RUT9M";

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	ext_io {
		compatible = "spi-gpio";
		#address-cells = <1>;
		#size-cells = <0>;

		gpio-sck = <&gpio 3 GPIO_ACTIVE_HIGH>;  // SRCLK
		gpio-mosi = <&gpio 1 GPIO_ACTIVE_HIGH>; // SER
		cs-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;  // RCLK
		num-chipselects = <1>;

		shift_io: shift_io@0 {
			compatible = "fairchild,74hc595";
			reg = <0>;
			gpio-controller;
			#gpio-cells = <2>;
			registers-number = <2>;
			spi-max-frequency = <10000000>;
		};
	};

	gpio-export {
		compatible = "gpio-export";
		#size-cells = <0>;

		sd_enable {
			gpio-export,name = "sd_enable";
			gpio-export,output = <1>;
			gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
		};

		gpio_modem_reset {
			gpio-export,name = "modem_reset";
			gpio-export,output = <0>;
			gpios = <&shift_io 11 GPIO_ACTIVE_HIGH>;
		};

		gpio_modem_power {
			gpio-export,name = "modem_power";
			gpio-export,output = <0>;
			gpios = <&shift_io 10 GPIO_ACTIVE_HIGH>;
		};

		gpio_sim_select {
			gpio-export,name = "sim_sel";
			gpio-export,output = <1>;
			gpios = <&shift_io 7 GPIO_ACTIVE_HIGH>;
		};

		gpio_modem_status { // From v5
			gpio-export,name = "modem_status";
			gpio-export,input = <0>;
			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
		};

		gpio_rs485_rx_en {
			gpio-export,name = "rs485_rx_en";
			gpio-export,output = <0>;
			gpios = <&shift_io 13 GPIO_ACTIVE_HIGH>;
		};

		gpio_dcd {
			gpio-export,name = "dcd";
			gpio-export,output = <0>;
			gpios = <&shift_io 14 GPIO_ACTIVE_HIGH>;
		};
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};
	};

	leds {
		compatible = "gpio-leds";

		eth1_led {
			label = "eth1_led";
			gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
		};

		eth2_led {
			label = "eth2_led";
			gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
		};

		eth3_led {
			label = "eth3_led";
			gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
		};

		wan_led {
			label = "wan_led";
			gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
		};

		led_gen_2_3 {
			label = "mob_gen_2_3";
			gpios = <&shift_io 5 GPIO_ACTIVE_HIGH>;
		};

		led_gen_4_3 {
			label = "mob_gen_4_3";
			gpios = <&shift_io 6 GPIO_ACTIVE_HIGH>;
		};

		led_ssid_1 {
			label = "mob_ssid_1";
			gpios = <&shift_io 0 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "timer";
		};

		led_ssid_2 {
			label = "mob_ssid_2";
			gpios = <&shift_io 1 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "timer";
		};

		led_ssid_3 {
			label = "mob_ssid_3";
			gpios = <&shift_io 2 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "timer";
		};

		led_ssid_4 {
			label = "mob_ssid_4";
			gpios = <&shift_io 3 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "timer";
		};

		led_ssid_5 {
			label = "mob_ssid_5";
			gpios = <&shift_io 4 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "timer";
		};

		led_power {
			label = "power";
			gpios = <&shift_io 15 GPIO_ACTIVE_LOW>;
			default-state = "on";
		};
	};

	tlt_gpios { // Modify according to wiki page "DTS syntax with Libgpiod changes"
		gpiochip_info {
			hw_0 {
				hwver = <0>;
				gpiochip_count = <4>;

				gpiochip_0 = <32>; // Built-in
				gpiochip_1 = <32>; // Built-in
				gpiochip_2 = <32>; // Built-in
				gpiochip_3 = <16>; // Shift Register
			};
		};

		ioman {
			GPIO_40 {
				line_name = "GPIO_IN_1";
			};
			GPIO_108 {
				line_name = "GPIO_OUT_1";
			};
			GPIO_11 {
				compatible_model = "RUT956";
				line_name = "GPIO_ISOLATED_INPUT";
			};
			GPIO_37 {
				compatible_model = "RUT956";
				line_name = "GPIO_IN_2";
			};
			GPIO_104 {
				compatible_model = "RUT956";
				line_name = "GPIO_OUT_2";
			};
			GPIO_105 {
				compatible_model = "RUT956";
				line_name = "GPIO_RELAY_CLOSE_1";
			};
		};

		ledman {
			GPIO_43 {
				line_name = "LED_ETH_GREEN_1";
				active_low;
			};
			GPIO_42 {
				line_name = "LED_ETH_GREEN_2";
				active_low;
			};
			GPIO_41 {
				line_name = "LED_ETH_GREEN_3";
				active_low;
			};
			GPIO_39 {
				line_name = "LED_ETH_GREEN_4";
				active_low;
			};
			GPIO_101 {
				line_name = "LED_TECH_GEN_23";
			};
			GPIO_102 {
				line_name = "LED_TECH_GEN_43";
			};
			GPIO_96 {
				line_name = "LED_SSID_1";
			};
			GPIO_97 {
				line_name = "LED_SSID_2";
			};
			GPIO_98 {
				line_name = "LED_SSID_3";
			};
			GPIO_99 {
				line_name = "LED_SSID_4";
			};
			GPIO_100 {
				line_name = "LED_SSID_5";
			};
			GPIO_111 { // Exists in ioman as GPIO_RELAY_OPEN_1, but not used
				compatible_model = "RUT956";
				compatible_versions = <5 99>;
				line_name = "LED_POWER";
				active_low;
			};
		};

		misc {
			GPIO_0 {
				compatible_versions = <5 99>;
				line_name = "GPIO_MODEM_STATUS";
				active_low;
			};
			GPIO_106 {
				line_name = "GPIO_MODEM_POWER_1";
			};
			GPIO_107 {
				line_name = "GPIO_MODEM_RESET_1";
			};
			GPIO_103 {
				line_name = "GPIO_SIM_SELECT";
			};
			GPIO_44 {
				line_name = "GPIO_SD_ENABLE"; // Duplicates as rts, fix in the future
			};
			GPIO_109 {
				line_name = "GPIO_RS458_RX_EN";
			};
			GPIO_110 {
				line_name = "GPIO_DCD";
			};
		};
	};
};

&state_default {
	gpio {
		groups = "i2s", "p4led_an", "p3led_an", "p2led_an", "p1led_an", "p0led_an", "gpio", "wled_an", "perst", "refclk", "spi cs1";
		function = "gpio";
	};
};

&pcie {
	status = "okay";
};

&pcie0 {
	mt76@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&factory 0x28000>;
		ieee80211-freq-limit = <5000000 6000000>;
		mtd-mac-address = <&factory 0xf100>;
		mtd-mac-address-increment = <(-1)>;
	};
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <10000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			boot: boot: partition@0 {
				label = "u-boot";
				reg = <0x0 0x20000>;
				read-only;
			};

			config: partition@20000 {
				label = "config";
				reg = <0x020000 0x010000>;
				read-only;
			};

			factory: partition@30000 {
				label = "factory";
				reg = <0x030000 0x030000>;
				read-only;
			};

			partition@60000 {
				compatible = "denx,uimage";
				label = "firmware";
				reg = <0x060000 0xf10000>;
			};

			partition@f70000 {
				label = "event-log";
				reg = <0xf70000 0x90000>;
			};
		};
	};
};

&wmac {
	status = "okay";
	mtd-mac-address = <&config 0x0>;
	mtd-mac-address-increment = <2>;
	mediatek,mtd-eeprom = <&factory 0x20000>;
};

&ethernet {
	mtd-mac-address = <&config 0x0>;
};

&esw {
	mediatek,portmap = <0x2f>;
};

&i2c {
	status = "okay";
	hwmon@0x4d {
		compatible = "mcp3221";
		reg = <0x4d>;
		reference-voltage-microvolt = <3300000>;
	};

	hwmon@0x48 {
		compatible = "ti,tla2021";
		reg = <0x48>;
	};
};

&uart1 {
	linux,rs485-enabled-at-boot-time;
	rs485-rts-delay = <0 0>;
	rs485-rx-during-tx;
	rts-gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
	status = "okay";
};

I guess my question is, do I even have to modify the dts or can somehow activate the modem from the running OpenWRT?

1 Like

Well, turns out I don't need to modify the DTS (unless I want to check this in, which is eventually the goal)

All I was missing was the kmod-gpio-nxp-74hc164 kernel module, with that /sys/class/gpio/modem_power/ appeared and I can turn the modem on now. Yay!

1 Like

Hello! [moobsen]I need your help, I messed up my bootloader and I can’t find it anywhere, could you share yours? I have RUT950 them the same!!!! Thank you in advance !

Moobsen can you share your openwrt to this rut956?

As far as I am aware I have not touched the bootloader and I am not sure how to extract it.

1 Like

Do you mean the built image? Sure. But be aware, that not everything works. I have two RUT956, and they seem to have internal differences. For me the modem only works in one of them (so far). The difference seems to be that one uses the 74hc595 shift register to control the modem, and the other does not. ( the so far not working one)

Also be aware that in that build there is no luci (the web interface). But ssh, wifi and opkg should work, so it should be fairly easy to install, if needed.

https://moobsen.com/openwrt-ramips-mt76x8-teltonika_rut9m-squashfs-sysupgrade.bin

That's exactly what I asked you to share: the bootloader was damaged! Maybe someone here can tell you how to make a backup of the bootloader through the terminal without a programmer! Because I already searched everything and couldn’t find the bootloader!!!!

root@:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00010000 "u-boot"
mtd1: 00010000 00010000 "config"
mtd2: 00030000 00010000 "factory"
mtd3: 00f10000 00010000 "firmware"
mtd4: 001b0000 00010000 "kernel"
mtd5: 00d60000 00010000 "rootfs"
mtd6: 00270000 00010000 "rootfs_data"
mtd7: 00090000 00010000 "event-log"
root@:~# cat /dev/mtd0 > /tmp/mtd0

And you have a copy of each partition. However, you still have to give it boot via an external programmer, having previously desoldered the flash. Well, unless it can be done somehow through this connector on the PCB

If moobsen has a simple programmer like ch341a and he agrees, I will give the pinout for the programmer!!!

If I restore mine, I will try to help you; I am an electronics engineer; I can help you with the electrical part, but I am not very familiar with the software.....

Sorry that it took a while, busy times... but here is the first mtd partition from my "working" RUT956, copied with dd:
https://moobsen.com/uboot-rut956.bin
Meanwhile I am still stuck with one router doing just fine with the above image, while I can not turn on the modem in the other. There must be some hardware differences with how the GPIOs are controlled, but so far I could not figure out what those are exactly.
Did anyone try the above openwrt image?

1 Like

So, status update (not that anyone asked, but for my sanity):

it turns out, there are different rut956 variants with different modems. Similiar to the rut955 series it seems. The one which has been working fine for me contains the MeiGLink SLM750. Where a simple
echo 1 > /sys/class/gpio/modem_power/value
turns on the modem.
Now the variant I am struggling with contains a Quectel EC25. Just setting the (suspected) GPIO power pin to high does nothing there. I took a look at the Modem doc and saw that it actually needs a pulse to turn on. So I have been spending my days bombarding the modem with different high/low pulses on different GPIO pins, without success thus far. The darn thing will not turn on, no matter what I do.
I know that there is a variant of the rut955 containing the same modem, which works... but since I assume the internal GPIOs are different, it does only help me a little. I also tried figuring out what GPIO "magic" the stock firmware does, but it takes me a long time to figure out what is going on there.
Running low on motivation at this point... but thanks for reading and any hints, if any, are very appreciated.

I maintain a fleet of the 955 with EC25, which work. There are 2 Pins for the EC25, a Power and a Reset. I even use the Reset GPIO to restart the modem in error situations. You are correct with the Pulse for Power. May be, you check the GPIO manipulation in the 955 against your device. In worst case, you will need to follow the GPIO lines to the modem.

I have taken the oscilloscope and looked at various pins of the modem. Everything looks good, I see the pulse and the modem immediately reacts by pulling up VDD_EXT. I also put a SIM in the modem and see a PDP context being created. So the modem is powering up, but it does not appear on the USB bus.

From my RUT955, /etc/config/system:
...
config gpio_switch 'modem_vbus'
option name 'Modem enable'
option gpio_pin '506'
option value '1'

config gpio_switch 'modem_rst'
option name 'Modem reset'
option gpio_pin '507'
option value '0'

echo '1' > /sys/class/gpio/gpio507/value
seems to reset the modem, as the ttyUSB2/3 disappear.
To re-appear, I simply run /etc/init.d/gpio_switch reload.

It might be a good idea, to look into Teltonikas /etc/init.d/gpio_switch, if there is any.

I am not sure if it is a GPIO problem at this point, as I know the modem turns on, but it is not visible on the USB. I took a closer look at the USB devices in the stock firmware:

root@RUT956:~# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  2, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.159 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=101c0000.ehci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0610 Rev=60.60
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=01 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=04b4 ProdID=0006 Rev= 0.00
S:  Manufacturer=Cypress Semiconductor
S:  Product=USB-UART LP
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=00 Driver=cypress_serial
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=10ms
I:* If#= 1 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=05 Prot=00 Driver=(none)

T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  4 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=0125 Rev= 3.18
S:  Manufacturer=Quectel
S:  Product=EC25-EUX
S:  SerialNumber=0123456789ABCDEF
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

And this is how things look in my current image:

root@OpenWrt:/etc/init.d# cat /sys/kernel/debug/usb/devices 

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 6.06
S:  Manufacturer=Linux 6.6.44 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=101c0000.ehci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

One thing is that I am missing the cypress_serial driver, which is a usb-serial driver written by teltonika. I'll try to integrate it in my image, but I don't think this is relevant for the modem, as the EC25 seems to work in the RUT955 without this.

Then there shows up a second USB2.0 Hub in the stock firmware. Maybe this is what I am missing, but I am no expert on USB and am trying to understand what this means and what I can possibly do to activate this.

From my running RUT955:


lsusb
Bus 001 Device 004: ID 2c7c:0125 Android Android
Bus 001 Device 003: ID 04b4:0003 Cypress Semiconductor USB-UART LP
Bus 001 Device 002: ID 05e3:0610  USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller

lsusb -s 001:004 -v

Bus 001 Device 004: ID 2c7c:0125 Android Android
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239
  bDeviceSubClass         2
  bDeviceProtocol         1
  bMaxPacketSize0        64
  idVendor           0x2c7c #QUECTEL
  idProduct          0x0125 #EC25
  bcdDevice            3.18
  iManufacturer           1 Android
  iProduct                2 Android
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00d1
    bNumInterfaces          5
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255
      bInterfaceSubClass    255
      bInterfaceProtocol    255
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass    255
      bInterfaceProtocol    255
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x89  EP 9 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x88  EP 8 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239
  bDeviceSubClass         2
  bDeviceProtocol         1
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)
root@PCS-2EE377:/etc/config#

Regarding GPIO: When I set gpio_pin '507' to '1', my /dev/ttyUSB2/3 disappear. When I set the pin to 0 again, the /dev/ttyUSB2/3/ appear again.

Can you show me the output of

cat /sys/kernel/debug/usb/devices

so I can see what drivers are used per usb device?

Actually, I have only custom built openwrt firmware running, without debug. Will rebuild soon. Hang on.

Got it:

root@~# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.162 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=1b000000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=02 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0610 Rev=32.98
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=01 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms
I:* If#= 0 Alt= 1 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=02 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=256ms

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=04b4 ProdID=0003 Rev= 0.00
S:  Manufacturer=Cypress Semiconductor
S:  Product=USB-UART LP
C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=100mA
A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=02 Prot=01
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=10ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 0 Cls=ff(vend.) Sub=05 Prot=00 Driver=(none)

T:  Bus=01 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#=  5 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=2c7c ProdID=0125 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E:  Ad=89(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms


 lsusb
Bus 001 Device 005: ID 2c7c:0125 Android Android
Bus 001 Device 003: ID 04b4:0003 Cypress Semiconductor USB-UART LP
Bus 001 Device 002: ID 05e3:0610  USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.162 ehci_hcd EHCI Host Controller


lsusb -v

Bus 001 Device 005: ID 2c7c:0125 Android Android
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239
  bDeviceSubClass         2
  bDeviceProtocol         1
  bMaxPacketSize0        64
  idVendor           0x2c7c
  idProduct          0x0125
  bcdDevice            3.18
  iManufacturer           1 Android
  iProduct                2 Android
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x00d1
    bNumInterfaces          5
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255
      bInterfaceSubClass    255
      bInterfaceProtocol    255
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      ** UNRECOGNIZED:  05 24 00 10 01
      ** UNRECOGNIZED:  05 24 01 00 00
      ** UNRECOGNIZED:  04 24 02 02
      ** UNRECOGNIZED:  05 24 06 00 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x87  EP 7 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        4
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255
      bInterfaceSubClass    255
      bInterfaceProtocol    255
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x89  EP 9 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               9
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x88  EP 8 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          239
  bDeviceSubClass         2
  bDeviceProtocol         1
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)