Porting OpenWRT to the Zyxel LTE3302

Hello valued OpenWRT Community,

i am trying to make OpenWRT run on an Zyxel LTE3302. Initially I thought, the LTE3302 might be closely related to the Zyxel LTE3301 which is supported by OpenWRT. However it turns out that the LTE3302 has a completely different hardware from the LTE3301 in terms of SOC used, flash and so on.
Well then, I thought, challenge accepted - lets port the LTE3302 to make it use OpenWRT.

The device uses a MediaTek MT7620N, a 16M SPI flash, a couple of GPIOs for LEDs/buttons and USB for the internal LTE modem. So far so good. Bootloader is Amit Jboot - not uboot which would be really nice...
This adds a little bit more complexity but still, I thought this should be doable...

So my first try was to desolder the SPI flash, get a backup and try to get uboot running on the device. ... I am speeding things up a little bit here: In the end I haven't been successful to get a running uboot on the device. So yeah, then I need to stay a Jboot...

Luckily Jboot is supported through a loader in OpenWRT. I figured out the the hardware seems to be quite the same as in the DLink DWR-921-c1 in terms of soc, flash, count of buttons, leds and so on. The loader has some sort of crappy html recovery like the Dlink. I was able to create a working firmware of OpenWRT by basically using the definitions from the dlink device combined with some observations and information taken from my flash dump.

This is my local addon to the mt7620.mk file:

define Device/zyxel_lte3302
  $(Device/amit_jboot)
  SOC := mt7620n
  IMAGE_SIZE := 16064k
  DEVICE_VENDOR := ZyXEL
  DEVICE_MODEL := LTE3302
  DLINK_ROM_ID := ZXL6E2431002
  DLINK_FAMILY_MEMBER := 0x6E24
  DLINK_FIRMWARE_SIZE := 0xFB0000
  DEVICE_PACKAGES += kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
endef
TARGET_DEVICES += zyxel_lte3302

using this in combination with a more or less dummy dts and some addings to the leds and network config, i got a firmware image and was able to flash that to the device.

this is the dts i am using:

#include "mt7620n.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mtd/partitions/uimage.h>

/ {
	compatible = "zyxel,lte3302", "ralink,mt7620n-soc";
	model = "Zyxel LTE3302-M432";
};

&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>;

			partition@0 {
				label = "jboot";
				reg = <0x0 0x10000>;
				read-only;
			};

			partition@10000 {
				compatible = "openwrt,uimage", "denx,uimage";
				openwrt,ih-magic = <IH_MAGIC_OKLI>;
				openwrt,offset = <0x10000>;
				label = "firmware";
				reg = <0x10000 0xfd0000>;
			};
			
			config: partition@ff0000 {
				label = "config";
				reg = <0xfeffff 0x10000>;
				read-only;
			};
		};
	};
};

&ehci {
	status = "okay";
};

&ohci {
	status = "okay";
};

&state_default {
	default {
		groups = "spi refclk", "i2c", "ephy", "wled";
		function = "gpio";
	};
};


I am not really good at writing dts code, to be honest i don't even understand parts of what is there...
But, to my surprise the image was booting, which is really great.

Since I don't already know the correct dts definitions regarding flash, leds, network (mac data) and so on and the original firmware which came with the device was build on kernel 2.6 and has no usable /dev or /sys information my initial goal was to get my OpenWRT image running on the initial ramdisk / initramfs in failsafe mode and then try to poke around and find out things. However I was not able to get the image to work due to some issue with the busybox init...

This is my current bootlog status:

CDG562ZY_0T3 Jboot B1204
JRecovery Version R1.2 2017/05/25 20:17
spi device id: ef 40 18 0 0 (40180000)
SPI FLASH: W25Q128FV 16M
.
...
Starting kernel @80000000...


OpenWrt kernel loader for MIPS based SoC
Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
Looking for OpenWrt image... found at 0xbc020000
Decompressing kernel... done!
Starting kernel at 80000000...

[    0.000000] Linux version 5.15.167 (compile@phoebe) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24106-10cc5fcd00) 12.3.0, GNU ld (GNU Binutils)
 2.40.0) #0 Mon Sep 23 12:34:46 2024
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620N ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Zyxel LTE3302-M432
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=0007fff0
[    0.000000] Readback ErrCtl register=0007fff0
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 56100K/65536K available (5506K kernel code, 602K rwdata, 1180K rodata, 1216K init, 213K bss, 9436K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000002] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015556] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087773] pid_max: default: 32768 minimum: 301
[    0.098087] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.112511] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.135534] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.155043] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.168745] pinctrl core: initialized pinctrl subsystem
[    0.180410] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.212382] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.223425] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.238243] clocksource: Switched to clocksource systick
[    0.250435] NET: Registered PF_INET protocol family
[    0.260338] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.275508] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.292277] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.307595] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.322839] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.336857] TCP: Hash tables configured (established 1024 bind 1024)
[    0.349687] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.362622] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.376909] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.388146] PCI: CLS 0 bytes, default 32
[    0.396086] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.413285] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.432802] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.444336] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.467476] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.481369] printk: console [ttyS0] disabled
[    0.489905] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.509553] printk: console [ttyS0] enabled
[    0.509553] printk: console [ttyS0] enabled
[    0.526120] printk: bootconsole [early0] disabled
[    0.526120] printk: bootconsole [early0] disabled
[    0.560634] spi spi0.0: force spi mode3
[    0.569692] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.579392] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.592114] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.606746] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.621640] Creating 3 MTD partitions on "spi0.0":
[    0.631238] 0x000000000000-0x000000010000 : "jboot"
[    0.643897] 0x000000010000-0x000000fe0000 : "firmware"
[    0.778786] 2 uimage-fw partitions found on MTD device firmware
[    0.790641] Creating 2 MTD partitions on "firmware":
[    0.800546] 0x000000000000-0x00000023c38e : "kernel"
[    0.810441] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.828468] 0x00000023c38e-0x000000fd0000 : "rootfs"
[    0.838419] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.859947] mtd: setting mtd3 (rootfs) as root device
[    0.870347] 1 squashfs-split partitions found on MTD device rootfs
[    0.882709] 0x000000340000-0x000000fd0000 : "rootfs_data"
[    0.894905] 0x000000feffff-0x000000ffffff : "config"
[    0.936983] gsw: setting port4 to ephy mode
[    0.945549] mtk_soc_eth 10100000.ethernet: generated random MAC address 8a:4e:af:28:ec:15
[    0.961890] mtk_soc_eth 10100000.ethernet: no mdio-bus child node found
[    0.975072] mtk_soc_eth 10100000.ethernet: mdio-bus disabled
[    0.986564] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    0.999188] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.016473] rt2880_wdt 10000120.watchdog: Initialized
[    1.028526] NET: Registered PF_INET6 protocol family
[    1.045779] Segment Routing with IPv6
[    1.053274] In-situ OAM (IOAM) with IPv6
[    1.061303] NET: Registered PF_PACKET protocol family
[    1.071484] 8021q: 802.1Q VLAN Support v1.8
[    1.082074] clk: Disabling unused clocks
[    1.113212] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.134019] Freeing unused kernel image (initmem) memory: 1216K
[    1.145848] This architecture does not have kernel memory protection.
[    1.158709] Run /sbin/init as init process
[    1.177247] Run /etc/init as init process
[    1.185653] Run /bin/init as init process
[    1.193982] Run /bin/sh as init process
[    1.201891] Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[    1.230151] Rebooting in 1 seconds..


I went through the whole build process and verified that the initramfs is there and contains the busybox init. I even binwalked the binary to see if it is there. It is definitely there! I tried passing kernel cmdline parameters via the dts but that did not help. I tried changing the dts partition layout also without any luck. I tried to flash the initramfs-kernel image, which succeeds after some modifications using the mkdlinkfw tool. However then the kernel complains that the initramfs is not there or empty... damn...

So, either I figure out, why there the kernel does not find the init binary or I try to get the initramfs working. For both possible solutions I need your community support, cause I have no idea as of why both errors occur. Thanks in advance for looking at and reading through this very long forum post....

I suspect the OpenWRT JBoot loader might not be extracting kernel + initramfs from the flash, but I was not able to find something...

Does anybody have an idea what I can do make the device use the initramfs?

just as an addon to my own post:

when flashing the initramfs-kernel.bin firmware, after modifying it with the mkdlinkfw binary, this is the bootlog output:

CDG562ZY_0T3 Jboot B1204
JRecovery Version R1.2 2017/05/25 20:17
spi device id: ef 40 18 0 0 (40180000)
SPI FLASH: W25Q128FV 16M
.
...
Starting kernel @80000000...


OpenWrt kernel loader for MIPS based SoC
Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
Looking for OpenWrt image... found at 0xbc020000
Decompressing kernel... done!
Starting kernel at 80000000...

[    0.000000] Linux version 5.15.167 (compile@phoebe) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24106-10cc5fcd00) 12.3.0, GNU ld (GNU Binutils)
 2.40.0) #0 Mon Sep 23 12:34:46 2024
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620N ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Zyxel LTE3302-M432
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=0007fff0
[    0.000000] Readback ErrCtl register=0007fff0
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 55204K/65536K available (5506K kernel code, 602K rwdata, 1180K rodata, 2112K init, 213K bss, 10332K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000002] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015555] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087790] pid_max: default: 32768 minimum: 301
[    0.098105] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.112530] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.135553] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.155060] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.168760] pinctrl core: initialized pinctrl subsystem
[    0.180428] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.212348] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.223384] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.238212] clocksource: Switched to clocksource systick
[    0.250410] NET: Registered PF_INET protocol family
[    0.260313] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.275484] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.292251] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.307571] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.322813] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.336830] TCP: Hash tables configured (established 1024 bind 1024)
[    0.349662] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.362595] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.376880] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.388120] PCI: CLS 0 bytes, default 32
[    0.396056] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.948042] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.967532] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.979074] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.002130] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    1.016001] printk: console [ttyS0] disabled
[    1.024518] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    1.044178] printk: console [ttyS0] enabled
[    1.044178] printk: console [ttyS0] enabled
[    1.060740] printk: bootconsole [early0] disabled
[    1.060740] printk: bootconsole [early0] disabled
[    1.087103] spi spi0.0: force spi mode3
[    1.095732] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    1.105423] 3 fixed-partitions partitions found on MTD device spi0.0
[    1.118139] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    1.132760] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    1.147641] Creating 3 MTD partitions on "spi0.0":
[    1.157318] 0x000000000000-0x000000010000 : "jboot"
[    1.168986] 0x000000010000-0x000000fe0000 : "firmware"
[    2.034794] 0x000000feffff-0x000000ffffff : "config"
[    2.058673] gsw: setting port4 to ephy mode
[    2.067179] mtk_soc_eth 10100000.ethernet: generated random MAC address d2:d4:74:f5:39:e9
[    2.083516] mtk_soc_eth 10100000.ethernet: no mdio-bus child node found
[    2.096699] mtk_soc_eth 10100000.ethernet: mdio-bus disabled
[    2.108213] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    2.120798] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    2.138105] rt2880_wdt 10000120.watchdog: Initialized
[    2.150056] NET: Registered PF_INET6 protocol family
[    2.165345] Segment Routing with IPv6
[    2.172830] In-situ OAM (IOAM) with IPv6
[    2.180800] NET: Registered PF_PACKET protocol family
[    2.190961] 8021q: 802.1Q VLAN Support v1.8
[    2.201478] clk: Disabling unused clocks
[    2.941397] Warning: unable to open an initial console.
[    2.963654] Freeing unused kernel image (initmem) memory: 2112K
[    2.975486] This architecture does not have kernel memory protection.
[    2.988335] Run /init as init process
[    3.018360] Failed to execute /init (error -2)
[    3.027246] Run /sbin/init as init process
[    3.035732] Run /etc/init as init process
[    3.044003] Run /bin/init as init process
[    3.052308] Run /bin/sh as init process
[    3.060231] Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.
[    3.088491] Rebooting in 1 seconds..

so it is basically failing at the same stage. the interesting messag in the log to me is this one:

[    0.000000] Initrd not found or empty - disabling initrd

does anybody have any ideas?

MAC is not read from SPI, try to netboot kernel images to get spi driver rigjt, first try would be snapshot/24.10 for more flash drivers

hope you didn't actually flash it ...

you should add the device to master, not current stable, new device PRs are only accepted towards master.

I am aware of that. Supposedly MAC must be read later on from the config partition using jboot_eeprom_extract, which is why i patched the
./base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom script to include my model in that.
However in any case, this should not affect the init process. It generates a random MAC, which is ok for now...

Can you be a little bit more precise on what you mean by "get spi driver right"?
As well as I am aware, SPI does not require a special "driver" on a MT7020. the
W25Q128FV should be compatible to the JEDEC spec...

I can't netboot as the bootloader does not offer any option like that.
This is a list of the bootloader commands:

CDG562ZY_0T3 Jboot B1204
JRecovery Version R1.2 2017/05/25 20:17
spi device id: ef 40 18 0 0 (40180000)
SPI FLASH: W25Q128FV 16M
.E:-100
IP=192.168.123.254 NA=60:31:97:84:5F:EC

#
# help
command list...
reboot
info
load <adr>
go <adr>
dm <adr>
wm <adr> <val>
rm <adr>
copy <src> <dst> <size>
ip [ip]
mac [mac]
ping <ip>
areacode

the copy command does not allow copy from tftp for example...

by writing "flash it" I meant using the bootloader to copy the binary to the internal SPI flash. Whenever the device is working stable, i will add my changes to the apropriate git branch

Ok, i figured it out by myself. there was an error in my build .config, which did not package busybox into the image...

Got the device up and running with OpenWRT.
This is the recent bootlog:

[    0.000000] Linux version 5.15.167 (compile@phoebe) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24106-10cc5fcd00) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Mon Sep 23 12:34:46 2024
[    0.000000] Board has DDR2
[    0.000000] Analog PMU set to hw control
[    0.000000] Digital PMU set to hw control
[    0.000000] SoC Type: MediaTek MT7620N ver:2 eco:6
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019650 (MIPS 24KEc)
[    0.000000] MIPS: machine is Zyxel LTE3302-M432
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=0007c550
[    0.000000] Readback ErrCtl register=0007c550
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 56092K/65536K available (5539K kernel code, 601K rwdata, 1188K rodata, 1176K init, 215K bss, 9444K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 580MHz
[    0.000000] clocksource: systick: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 583261500 ns
[    0.000000] systick: enable autosleep mode
[    0.000000] systick: running - mult: 214748, shift: 32
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
[    0.000002] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
[    0.015557] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.087795] pid_max: default: 32768 minimum: 301
[    0.098108] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.112536] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.136104] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.155611] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.169312] pinctrl core: initialized pinctrl subsystem
[    0.181086] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.215467] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.226538] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.239321] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.250356] rt2880_gpio 10000638.gpio: registering 16 irq handlers
[    0.262971] rt2880_gpio 10000660.gpio: registering 32 gpios
[    0.274040] rt2880_gpio 10000660.gpio: registering 32 irq handlers
[    0.286648] rt2880_gpio 10000688.gpio: registering 1 gpios
[    0.297502] rt2880_gpio 10000688.gpio: registering 1 irq handlers
[    0.312052] clocksource: Switched to clocksource systick
[    0.324283] NET: Registered PF_INET protocol family
[    0.334219] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.349394] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.366167] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.381485] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.396728] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.410745] TCP: Hash tables configured (established 1024 bind 1024)
[    0.423578] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.436518] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.450819] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.462076] PCI: CLS 0 bytes, default 32
[    0.469978] rt-timer 10000100.timer: maximum frequency is 1220Hz
[    0.487210] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.506952] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.518486] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.542293] gpio-export gpio_export: 1 gpio(s) exported
[    0.553430] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.567303] printk: console [ttyS0] disabled
[    0.575823] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.595470] printk: console [ttyS0] enabled
[    0.612043] printk: bootconsole [early0] disabled
[    0.648136] spi spi0.0: force spi mode3
[    0.657178] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.666875] 3 fixed-partitions partitions found on MTD device spi0.0
[    0.679604] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.694230] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
[    0.709110] Creating 3 MTD partitions on "spi0.0":
[    0.718777] 0x000000000000-0x000000010000 : "jboot"
[    0.731456] 0x000000010000-0x000000ff0000 : "firmware"
[    0.789775] 2 uimage-fw partitions found on MTD device firmware
[    0.801638] Creating 2 MTD partitions on "firmware":
[    0.811608] 0x000000000000-0x00000023f4cd : "kernel"
[    0.821515] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.839429] 0x00000023f4cd-0x000000fe0000 : "rootfs"
[    0.849420] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.870927] mtd: setting mtd3 (rootfs) as root device
[    0.881210] 1 squashfs-split partitions found on MTD device rootfs
[    0.893638] 0x000000760000-0x000000fe0000 : "rootfs_data"
[    0.906753] 0x000000ff0000-0x000001000000 : "config"
[    0.942436] gsw: setting port4 to ephy mode
[    0.950958] mtk_soc_eth 10100000.ethernet: generated random MAC address 0a:64:17:66:06:1a
[    0.967296] mtk_soc_eth 10100000.ethernet: no mdio-bus child node found
[    0.980487] mtk_soc_eth 10100000.ethernet: mdio-bus disabled
[    0.991988] mtk_soc_eth 10100000.ethernet: loaded mt7620 driver
[    1.004626] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.021930] rt2880_wdt 10000120.watchdog: Initialized
[    1.033966] NET: Registered PF_INET6 protocol family
[    1.057235] Segment Routing with IPv6
[    1.064781] In-situ OAM (IOAM) with IPv6
[    1.072772] NET: Registered PF_PACKET protocol family
[    1.082998] 8021q: 802.1Q VLAN Support v1.8
[    1.093737] clk: Disabling unused clocks
[    1.114359] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    1.134990] Freeing unused kernel image (initmem) memory: 1176K
[    1.146830] This architecture does not have kernel memory protection.
[    1.159677] Run /sbin/init as init process
[    1.167836]   with arguments:
[    1.167842]     /sbin/init
[    1.167849]   with environment:
[    1.167854]     HOME=/
[    1.167860]     TERM=linux
[    1.978820] init: Console is alive
[    1.986446] init: - watchdog -
[    2.682281] mtk_soc_eth 10100000.ethernet eth0: port 0 link up (100Mbps/Full duplex)
[    3.588062] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.690623] usbcore: registered new interface driver usbfs
[    3.701797] usbcore: registered new interface driver hub
[    3.712555] usbcore: registered new device driver usb
[    3.731585] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.758343] SCSI subsystem initialized
[    3.773737] fsl-ehci: Freescale EHCI Host controller driver
[    3.788333] ehci-platform: EHCI generic platform driver
[    3.809336] phy phy-usbphy.0: remote usb device wakeup disabled
[    3.821168] phy phy-usbphy.0: UTMI 16bit 30MHz
[    3.830026] ehci-platform 101c0000.ehci: EHCI Host Controller
[    3.841510] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    3.857514] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    3.877892] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    3.891643] hub 1-0:1.0: USB hub found
[    3.900133] hub 1-0:1.0: 1 port detected
[    3.926584] usbcore: registered new interface driver usb-storage
[    3.940350] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.959345] init: - preinit -
[    5.626178] random: jshn: uninitialized urandom read (4 bytes read)
[    5.826170] random: jshn: uninitialized urandom read (4 bytes read)
[    6.083206] random: jshn: uninitialized urandom read (4 bytes read)
[    6.927340] 8021q: adding VLAN 0 to HW filter on device eth0
[    7.050141] random: procd: uninitialized urandom read (4 bytes read)
[    8.087930] jffs2: notice: (315) jffs2_build_xattr_subsystem: complete building xattr subsystem, 8 of xdatum (0 unchecked, 1 orphan) and 10 of xref (1 dead, 0 orphan) found.
[    8.122126] mount_root: switching to jffs2 overlay
[    8.138172] overlayfs: upper fs does not support tmpfile.
[    8.157389] urandom-seed: Seeding with /etc/urandom.seed
[    8.315769] procd: - early -
[    8.322070] procd: - watchdog -
[    8.838187] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    9.069386] procd: - watchdog -
[    9.086128] procd: - ubus -
[    9.113932] usb-storage 1-1:1.5: USB Mass Storage device detected
[    9.159694] scsi host0: usb-storage 1-1:1.5
[    9.428282] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.451771] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.478768] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.511670] procd: - init -
[   10.240562] scsi 0:0:0:0: Direct-Access     Linux    File-Stor Gadget 0318 PQ: 0 ANSI: 2
[   10.295437] sd 0:0:0:0: Power-on or device reset occurred
[   10.318268] sd 0:0:0:0: [sda] Media removed, stopped polling
[   10.342952] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   10.520922] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.534104] random: ubus: uninitialized urandom read (4 bytes read)
[   11.050171] random: jshn: uninitialized urandom read (4 bytes read)
[   11.385963] kmodloader: loading kernel modules from /etc/modules.d/*
[   12.028604] usbcore: registered new interface driver cdc_acm
[   12.039967] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   12.089762] usbcore: registered new interface driver cdc_wdm
[   12.119821] Loading modules backported from Linux version v6.1.110-0-g5f55cad62cc9d
[   12.135179] Backport generated by backports.git v6.1.110-1-0-g965f73fc
[   12.234241] usbcore: registered new interface driver usbserial_generic
[   12.247455] usbserial: USB Serial support registered for generic
[   12.988824] PPP generic driver version 2.4.2
[   13.010353] NET: Registered PF_PPPOX protocol family
[   13.041423] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
[   13.052885] qmi_wwan 1-1:1.4 wwan0: register 'qmi_wwan' at usb-101c0000.ehci-1, WWAN/QMI device, b2:7a:c3:43:2b:7f
[   13.074042] usbcore: registered new interface driver qmi_wwan
[   13.266486] wireguard: WireGuard 1.0.0 loaded. See www.wireguard.com for information.
[   13.282215] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   13.389623] usbcore: registered new interface driver option
[   13.400918] usbserial: USB Serial support registered for GSM modem (1-port)
[   13.530378] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'soc_wmac.eeprom'.
[   13.594612] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 6352, rev 0500 detected
[   13.610191] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 7620 detected
[   13.625708] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   13.728526] kmodloader: done loading kernel modules from /etc/modules.d/*
[   29.548072] random: crng init done
[   29.554874] random: 91 urandom warning(s) missed due to ratelimiting
[   59.248122] 8021q: adding VLAN 0 to HW filter on device eth0
[   59.328777] device eth0 entered promiscuous mode
[   59.358900] br-lan: port 1(eth0.1) entered blocking state
[   59.369766] br-lan: port 1(eth0.1) entered disabled state
[   59.380964] device eth0.1 entered promiscuous mode
[   59.558454] br-lan: port 1(eth0.1) entered blocking state
[   59.569297] br-lan: port 1(eth0.1) entered forwarding state
[   60.318534] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  146.579195] urngd: v1.0.2 started.

Network interfaces with correct MAC adresses as stated in the label on the device are also created:

root@OpenWrt:~# ifconfig -a
br-lan    Link encap:Ethernet  HWaddr 60:31:97:84:5F:EC
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fdad:f155:c111::1/60 Scope:Global
          inet6 addr: fe80::6231:97ff:fe84:5fec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7326 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6282 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:783829 (765.4 KiB)  TX bytes:683259 (667.2 KiB)

eth0      Link encap:Ethernet  HWaddr 0A:64:17:66:06:1A
          inet6 addr: fe80::864:17ff:fe66:61a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7354 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6311 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:918186 (896.6 KiB)  TX bytes:712907 (696.1 KiB)
          Interrupt:5

eth0.1    Link encap:Ethernet  HWaddr 60:31:97:84:5F:EC
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7326 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6282 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:783829 (765.4 KiB)  TX bytes:683259 (667.2 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1472 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1472 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:114816 (112.1 KiB)  TX bytes:114816 (112.1 KiB)

wlan0     Link encap:Ethernet  HWaddr 60:31:97:84:5F:ED
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wwan0     Link encap:Ethernet  HWaddr B2:7A:C3:43:2B:7F
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


I'd like to submit a patch to add the device support to OpenWRT. How do I do that?

Thanks

1 Like

Hi perrin,
I have LTE3301-M209 which is not supported by OpenWrt but platform is very much as your LTE3302.
Can you share your upgrade files?
Thank you

Yep sure. I've published my work to github and created a PR to Openwrt

Everything is working in my case except for the LTE, which seems to be having a custom firmware which is not fully compatible with qmi.

Let me know if it works on your device as well and if LTE is working fine...

1 Like

This is a Qualcomm modem which doesn't work with qmi_wwan? Then let's fix that. Details please. /sys/kernel/debug/usb/devices and a description of what you've tried and how it fails.

have same problem with Zyxel LTE3301-M209, modem chip is Qualcomm MDM9225
all other works fine and upgrade to 24.10.0-rc6 without problem.

glad to provide the information. let's start with dmesg:

[   15.602162] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
[   15.613695] qmi_wwan 1-1:1.4 wwan0: register 'qmi_wwan' at usb-101c0000.ehci-1, WWAN/QMI device, 7a:98:c4:5b:89:f0
[   15.634715] usbcore: registered new interface driver qmi_wwan
...
[   16.091810] usbcore: registered new interface driver option
[   16.103178] usbserial: USB Serial support registered for GSM modem (1-port)
...
[   49.738928] option 1-1:1.0: GSM modem (1-port) converter detected
[   49.751467] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   49.765721] option 1-1:1.1: GSM modem (1-port) converter detected
[   49.778232] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   49.792444] option 1-1:1.2: GSM modem (1-port) converter detected
[   49.804965] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   49.819184] option 1-1:1.3: GSM modem (1-port) converter detected
[   49.831704] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3

so, from dmesg it all looks good. however i noted that the modem MAC does change on every reboot. Don't know if that is supposed to be like this.

the ttyUSB ports show up by binding the option driver like so:

echo "1435 3185" > /sys/bus/usb-serial/drivers/option1/new_id

sys/kernel/usb/devices looks well (after binding usb_option)

root@OpenWrt:~# 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=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.15
S:  Manufacturer=Linux 5.15.167 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= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1435 ProdID=3185 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
S:  SerialNumber=WNC_ADB
C:* #Ifs= 6 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= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=option
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=82(I) 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=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=83(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=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=85(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=88(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12   MxCh= 1
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0001 Rev= 5.15
S:  Manufacturer=Linux 5.15.167 ohci_hcd
S:  Product=Generic Platform OHCI controller
S:  SerialNumber=101c1000.ohci
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=   2 Ivl=255ms

i can talk to the modem via ttyUSB2:

root@OpenWrt:~# microcom /dev/ttyUSB2
ati
Manufacturer: WNC
Model: M18QW
Revision: MPSS: M18QW_v07.05.170941_02.07.164741 APSS: WNC_v0.0.170950T CUSTAPP: WNC_v0.0.170950T-custapp

SVN: 02
IMEI: 359092080026192
+GCAP: +CGSM,+DS

OK

but that is about all that is working. whenever i do a qmi command like

uqmi -d /dev/cdc-wdm0  --get-signal-info

it would just hang and never return anything. consequently i cannot start any network connection.

do you have any idea what can be tried?

Have you tried ModemManager instead of uqmi?

OK, that entry should be added to the driver. But the workaround is not a problem for now.

OK, would be good to see more debugging from that request to confirm. But it sounds a lot like a firmware which needs DTR to wake up.

Could you try changing

{QMI_FIXED_INTF(0x1435, 0x3185, 4)}, /* Wistron NeWeb M18Q5 */

into

{QMI_QUIRK_SET_DTR(0x1435, 0x3185, 4)}, /* Wistron NeWeb M18Q5 */

in drivers/net/usb/qmi_wwan.c? Sorry, I don't think there is any way to do that without rebuilding the driver.

Thanks very much guys for the valuable information!
I will try that later on today and keep you updated with the results.

Hi,
Zyxel LTE3301-M209 modem was BroadMobi BM806U-E1 modem working fine.

root@OpenWrt:~# opkg update && opkg install luci luci-proto-qmi kmod-usb-net-cdc-ether kmod-mppe kmod-usb-net kmod-usb-net-rndis kmod-usb-net-qmi-wwan

Edit /etc/config/network and add following lines. Note change apn and others match your system.

config interface '4g'
option proto 'qmi'
option device '/dev/cdc-wdm0'
option apn 'internet'
option auth 'none'
option ipv6 '1'
option pdptype 'ipv4'

config device
option name 'wwan0'


root@OpenWrt:~# 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= 5.15
S: Manufacturer=Linux 5.15.167 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= 0
D: Ver= 2.01 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=2020 ProdID=2033 Rev= 2.28
S: Manufacturer=Mobile Connect
S: Product=Mobile Connect
S: SerialNumber=3fc0a6d93cf5
C:* #Ifs= 5 Cfg#= 1 Atr=80 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

T: Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 1
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1d6b ProdID=0001 Rev= 5.15
S: Manufacturer=Linux 5.15.167 ohci_hcd
S: Product=Generic Platform OHCI controller
S: SerialNumber=101c1000.ohci
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= 2 Ivl=255ms

root@OpenWrt:~# picocom /dev/ttyUSB2
at
OK
ati
Manufacturer: BroadMobi
Model: BM806U-E1
Revision: M1.0.0_E1.0.1_A1.2.2
IMEI: 356934070226006
+GCAP: +CGSM

OK

and uqmi works too with this modem?

BusyBox v1.36.1 (2024-09-23 12:34:46 UTC) built-in shell (ash)


| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || || |
|
_____|| |
||||___||| |____|
|
| W I R E L E S S F R E E D O M

OpenWrt 23.05.5, r24106-10cc5fcd00

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-signal-inf
{
"type": "lte",
"rssi": -63,
"rsrq": -13,
"rsrp": -99,
"snr": -1.800000
}
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-serving-system
{
"registration": "registered",
"plmn_mcc": 244,
"plmn_mnc": 5,
"plmn_description": "",
"roaming": false
}
root@OpenWrt:~#

yes it does, there is something with network lines, if option pdptype is 'ipv4v6' connection fails? Also needs that config device lines?

it is working!!!

root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
{
        "type": "gsm",
        "signal": -96
}

I've created a kernel patch to accomplish the task:

861-qmi_wwan_fix_wnc_m18q5_init.patch

Index: linux-6.6.73/drivers/net/usb/qmi_wwan.c
===================================================================
--- linux-6.6.73.orig/drivers/net/usb/qmi_wwan.c
+++ linux-6.6.73/drivers/net/usb/qmi_wwan.c
@@ -1235,7 +1235,7 @@ static const struct usb_device_id produc
 	{QMI_FIXED_INTF(0x1435, 0x0918, 3)},	/* Wistron NeWeb D16Q1 */
 	{QMI_FIXED_INTF(0x1435, 0x0918, 4)},	/* Wistron NeWeb D16Q1 */
 	{QMI_FIXED_INTF(0x1435, 0x0918, 5)},	/* Wistron NeWeb D16Q1 */
-	{QMI_FIXED_INTF(0x1435, 0x3185, 4)},	/* Wistron NeWeb M18Q5 */
+	{QMI_QUIRK_SET_DTR(0x1435, 0x3185, 4)},	/* Wistron NeWeb M18Q5 */
 	{QMI_FIXED_INTF(0x1435, 0xd111, 4)},	/* M9615A DM11-1 D51QC */
 	{QMI_FIXED_INTF(0x1435, 0xd181, 3)},	/* Wistron NeWeb D18Q1 */
 	{QMI_FIXED_INTF(0x1435, 0xd181, 4)},	/* Wistron NeWeb D18Q1 */

I think it makes sense to add this patch to the PR I created to add the hardware...
Is that the correct way of doing this?

Great!

The patch should go upstream to mainline Linux.

FWIW, I've thought about making this quirk the default for all devices for many years.Just wanted to test on as many devices as possible first, but never found the time or energy to actually do it. Should probably just do it. Your testing here is yet another example where this appears to have changed over time for the same device ID, presumably due to firmware updates.