How do I add support for a Quectel EC25 Modem to vanilla OpenWRT?

I'm creating an OpenWRT image for the GL.iNet GL-X300B from the openwrt-23.05 git branch. I'm able to successfully create the image but it only has support for the two on-board ethernet ports, and the Quectel EC25 cellular modem doesn't work (WiFi doesn't work either but that's another story).

I followed the instructions in How to use LTE modem in QMI mode for WAN connection but that didn't work.

This is what I can see in the console:

[    0.000000] Linux version 5.15.134 (m4l490n@Precision7710) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r23499-86e852bcd0) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Wed Oct 11 21:06:34 2023
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is GL.iNet GL-X300B
[    0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0
[    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, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 120836K/131072K available (5665K kernel code, 587K rwdata, 1244K rodata, 1200K init, 207K bss, 10236K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 650.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5880801374 ns
[    0.000002] sched_clock: 32 bits at 325MHz, resolution 3ns, wraps every 6607641598ns
[    0.008316] Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
[    0.074935] pid_max: default: 32768 minimum: 301
[    0.080844] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.088562] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.103586] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.114032] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.121452] pinctrl core: initialized pinctrl subsystem
[    0.128847] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.154040] clocksource: Switched to clocksource MIPS
[    0.160839] NET: Registered PF_INET protocol family
[    0.166346] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.174795] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.183659] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.191887] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.199993] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.207454] TCP: Hash tables configured (established 1024 bind 1024)
[    0.214339] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.221263] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.229125] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.235201] PCI: CLS 0 bytes, default 32
[    0.243283] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.256099] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.262264] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.278547] pinctrl-single 1804002c.pinmux: 576 pins, size 72
[    0.285590] gpio-export gpio-export: 3 gpio(s) exported
[    0.292154] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.299755] printk: console [ttyS0] disabled
[    0.304413] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.313531] printk: console [ttyS0] enabled
[    0.313531] printk: console [ttyS0] enabled
[    0.322610] printk: bootconsole [early0] disabled
[    0.322610] printk: bootconsole [early0] disabled
[    0.348838] spi-nor spi0.0: w25q128 (16384 Kbytes)
[    0.353878] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.360551] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.367442] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.374910] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.381797] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    0.388914] Creating 4 MTD partitions on "spi0.0":
[    0.393882] 0x000000000000-0x000000040000 : "u-boot"
[    0.405078] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.411718] 0x000000050000-0x000000060000 : "art"
[    0.419868] 0x000000060000-0x000001000000 : "firmware"
[    0.426696] 2 uimage-fw partitions found on MTD device firmware
[    0.432847] Creating 2 MTD partitions on "firmware":
[    0.438050] 0x000000000000-0x000000240000 : "kernel"
[    0.446109] 0x000000240000-0x000000fa0000 : "rootfs"
[    0.452350] mtd: setting mtd5 (rootfs) as root device
[    0.458693] 1 squashfs-split partitions found on MTD device rootfs
[    0.465184] 0x000000700000-0x000000fa0000 : "rootfs_data"
[    0.865138] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.559424] switch0: Atheros AR8229 rev. 1 switch registered on mdio.0
[    1.616779] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.626873] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.633659] i2c_dev: i2c /dev entries driver
[    1.640809] NET: Registered PF_INET6 protocol family
[    1.657541] Segment Routing with IPv6
[    1.661428] In-situ OAM (IOAM) with IPv6
[    1.665707] NET: Registered PF_PACKET protocol family
[    1.671014] 8021q: 802.1Q VLAN Support v1.8
[    2.016146] ag71xx 19000000.eth: connected to PHY at mdio.0:1f:04 [uid=004dd042, driver=Generic PHY]
[    2.026708] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    2.043720] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    2.058311] Freeing unused kernel image (initmem) memory: 1200K
[    2.064473] This architecture does not have kernel memory protection.
[    2.071136] Run /sbin/init as init process
[    2.790723] init: Console is alive
[    2.794967] init: - watchdog -
[    4.302303] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.389722] usbcore: registered new interface driver usbfs
[    4.395560] usbcore: registered new interface driver hub
[    4.401131] usbcore: registered new device driver usb
[    4.416064] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.435898] SCSI subsystem initialized
[    4.446957] fsl-ehci: Freescale EHCI Host controller driver
[    4.456218] ehci-platform: EHCI generic platform driver
[    4.462052] ehci-platform 1b000000.usb: EHCI Host Controller
[    4.468020] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[    4.476270] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[    4.504062] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    4.511565] hub 1-0:1.0: USB hub found
[    4.516472] hub 1-0:1.0: 1 port detected
[    4.531621] usbcore: registered new interface driver usb-storage
[    4.541253] usbcore: registered new interface driver uas
[    4.548311] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.566487] init: - preinit -
[    4.904148] usb 1-1: new full-speed USB device number 2 using ehci-platform
[    5.154129] usb 1-1: device descriptor read/64, error -71
[    5.567765] usb 1-1: device descriptor read/64, error -71
[    5.740615] random: jshn: uninitialized urandom read (4 bytes read)
[    5.834129] usb 1-1: new full-speed USB device number 3 using ehci-platform
[    6.037003] random: jshn: uninitialized urandom read (4 bytes read)
[    6.094131] usb 1-1: device descriptor read/64, error -71
[    6.163114] random: jshn: uninitialized urandom read (4 bytes read)
[    6.454144] usb 1-1: device descriptor read/64, error -71
[    6.574185] usb usb1-port1: attempt power cycle
[    6.913736] eth0: link up (1000Mbps/Full duplex)
[    6.921890] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.995728] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[    7.032596] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter fails[    7.114255] usb 1-1: new full-speed USB device number 4 using ehci-platform
afe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    7.624043] usb 1-1: device not accepting address 4, error -71
[    7.774040] usb 1-1: new full-speed USB device number 5 using ehci-platform
[    8.284049] usb 1-1: device not accepting address 5, error -71
[    8.290175] usb usb1-port1: unable to enumerate USB device
[    9.303485] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[    9.315472] urandom-seed: Seed file not found (/etc/urandom.seed)
[    9.397809] eth0: link down
[    9.427467] procd: - early -
[    9.430851] procd: - watchdog -
[   10.005636] random: jshn: uninitialized urandom read (4 bytes read)
Failed to connect to ubus
[   10.145180] procd: - watchdog -
[   10.214984] procd: - ubus -
[   10.355111] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.368335] random: ubusd: uninitialized urandom read (4 bytes read)
[   10.380328] procd: - init -
Please press Enter to activate this console.
[   11.270644] random: jshn: uninitialized urandom read (4 bytes read)
[   11.375421] random: ubusd: uninitialized urandom read (4 bytes read)
[   11.382423] random: ubus: uninitialized urandom read (4 bytes read)
[   11.514267] kmodloader: loading kernel modules from /etc/modules.d/*
[   12.086151] usbcore: registered new interface driver cdc_wdm
[   12.105068] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   12.112829] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   12.192283] usbcore: registered new interface driver usbserial_generic
[   12.199257] usbserial: USB Serial support registered for generic
[   12.739580] PPP generic driver version 2.4.2
[   12.755404] NET: Registered PF_PPPOX protocol family
[   12.776674] usbcore: registered new interface driver qmi_wwan
[   12.860728] usbcore: registered new interface driver qcserial
[   12.866898] usbserial: USB Serial support registered for Qualcomm USB modem
[   12.950261] ieee80211 phy0: Atheros AR9531 Rev:2 mem=0xb8100000, irq=12
[   13.016887] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.804642] urngd: v1.0.2 started.
[   18.761467] random: crng init done
[   18.765069] random: 34 urandom warning(s) missed due to ratelimiting
[   68.084318] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   68.091503] jffs2_build_filesystem(): unlocking the mtd device... 
[   68.091510] done.
[   68.099902] jffs2_build_filesystem(): erasing all blocks after the end marker... 
[   75.519660] eth0: link up (1000Mbps/Full duplex)
[   75.555896] br-lan: port 1(eth0.1) entered blocking state
[   75.561508] br-lan: port 1(eth0.1) entered disabled state
[   75.567504] device eth0.1 entered promiscuous mode
[   75.572473] device eth0 entered promiscuous mode
[   75.595499] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   75.650705] br-lan: port 1(eth0.1) entered blocking state
[   75.656385] br-lan: port 1(eth0.1) entered forwarding state
[   76.584142] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   77.868010] eth1: link up (100Mbps/Full duplex)
[   77.872757] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[  115.156572] done.
[  115.158612] jffs2: notice: (1659) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  115.346840] overlayfs: upper fs does not support tmpfile.

As you can see, the modem is not working and I see some USB 1-1 errors that I don't know if are relevant.

These are the packages I have:

base-files - 1546-r23499-86e852bcd0
busybox - 1.36.1-1
ca-bundle - 20230311-1
dnsmasq - 2.89-4
dropbear - 2022.82-5
firewall4 - 2023-03-23-04a06bd7-1
fstools - 2023-02-28-bfe882d5-1
fwtool - 2019-11-12-8f7fe925-1
getrandom - 2022-08-13-4c7b720b-2
hostapd-common - 2023-09-08-e5ccbfc6-4
iw - 5.19-1
iwinfo - 2023-07-01-ca79f641-1
jansson4 - 2.14-3
jshn - 2023-05-23-75a3b870-1
jsonfilter - 2018-02-04-c7e938d6-1
kernel - 5.15.134-1-b33f769b2ea0375052269f12162a7003
kmod-ath - 5.15.134+6.1.24-3
kmod-ath9k - 5.15.134+6.1.24-3
kmod-ath9k-common - 5.15.134+6.1.24-3
kmod-cfg80211 - 5.15.134+6.1.24-3
kmod-crypto-acompress - 5.15.134-1
kmod-crypto-aead - 5.15.134-1
kmod-crypto-ccm - 5.15.134-1
kmod-crypto-cmac - 5.15.134-1
kmod-crypto-crc32c - 5.15.134-1
kmod-crypto-ctr - 5.15.134-1
kmod-crypto-gcm - 5.15.134-1
kmod-crypto-gf128 - 5.15.134-1
kmod-crypto-ghash - 5.15.134-1
kmod-crypto-hash - 5.15.134-1
kmod-crypto-hmac - 5.15.134-1
kmod-crypto-manager - 5.15.134-1
kmod-crypto-null - 5.15.134-1
kmod-crypto-rng - 5.15.134-1
kmod-crypto-seqiv - 5.15.134-1
kmod-crypto-sha512 - 5.15.134-1
kmod-gpio-button-hotplug - 5.15.134-3
kmod-lib-crc-ccitt - 5.15.134-1
kmod-lib-crc32c - 5.15.134-1
kmod-lib-lzo - 5.15.134-1
kmod-mac80211 - 5.15.134+6.1.24-3
kmod-mii - 5.15.134-1
kmod-nf-conntrack - 5.15.134-1
kmod-nf-conntrack6 - 5.15.134-1
kmod-nf-flow - 5.15.134-1
kmod-nf-log - 5.15.134-1
kmod-nf-log6 - 5.15.134-1
kmod-nf-nat - 5.15.134-1
kmod-nf-reject - 5.15.134-1
kmod-nf-reject6 - 5.15.134-1
kmod-nfnetlink - 5.15.134-1
kmod-nft-core - 5.15.134-1
kmod-nft-fib - 5.15.134-1
kmod-nft-nat - 5.15.134-1
kmod-nft-offload - 5.15.134-1
kmod-nls-base - 5.15.134-1
kmod-phy-ath79-usb - 5.15.134-1
kmod-ppp - 5.15.134-1
kmod-pppoe - 5.15.134-1
kmod-pppox - 5.15.134-1
kmod-random-core - 5.15.134-1
kmod-scsi-core - 5.15.134-1
kmod-slhc - 5.15.134-1
kmod-usb-core - 5.15.134-1
kmod-usb-ehci - 5.15.134-1
kmod-usb-net - 5.15.134-1
kmod-usb-net-qmi-wwan - 5.15.134-1
kmod-usb-serial - 5.15.134-1
kmod-usb-serial-qualcomm - 5.15.134-1
kmod-usb-serial-wwan - 5.15.134-1
kmod-usb-storage - 5.15.134-1
kmod-usb-storage-uas - 5.15.134-1
kmod-usb-wdm - 5.15.134-1
kmod-usb2 - 5.15.134-1
libatomic1 - 12.3.0-4
libblobmsg-json20230523 - 2023-05-23-75a3b870-1
libc - 1.2.4-4
libgcc1 - 12.3.0-4
libiwinfo-data - 2023-07-01-ca79f641-1
libiwinfo20230701 - 2023-07-01-ca79f641-1
libjson-c5 - 0.16-3
libjson-script20230523 - 2023-05-23-75a3b870-1
libmbedtls12 - 2.28.4-1
libmnl0 - 1.0.5-1
libnftnl11 - 1.2.6-1
libnl-tiny1 - 2023-07-27-bc92a280-1
libopenssl3 - 3.0.11-1
libpthread - 1.2.4-4
librt - 1.2.4-4
libstdcpp6 - 12.3.0-4
libubox20230523 - 2023-05-23-75a3b870-1
libubus20230605 - 2023-06-05-f787c97b-1
libuci20130104 - 2023-08-10-5781664d-1
libuclient20201210 - 2023-04-13-007d9454-1
libucode20220812 - 2023-06-06-c7d84aae-1
libusb-1.0-0 - 1.0.26-3
libustream-mbedtls20201210 - 2023-02-25-498f6e26-1
logd - 2022-08-13-4c7b720b-2
luci-proto-qmi - git-23.285.27691-e23911e
mtd - 26
netifd - 2023-09-19-7a58b995-1
nftables-json - 1.0.8-1
odhcp6c - 2023-05-12-bcd28363-20
odhcpd-ipv6only - 2023-06-24-52112643-1
openwrt-keyring - 2022-03-25-62471e69-2
opkg - 2022-02-24-d038e5b6-2
ppp - 2.4.9.git-2021-01-04-4
ppp-mod-pppoe - 2.4.9.git-2021-01-04-4
procd - 2023-06-25-2db83655-2
procd-seccomp - 2023-06-25-2db83655-2
procd-ujail - 2023-06-25-2db83655-2
swconfig - 12
uboot-envtools - 2023.04-1
ubox - 2022-08-13-4c7b720b-2
ubus - 2023-06-05-f787c97b-1
ubusd - 2023-06-05-f787c97b-1
uci - 2023-08-10-5781664d-1
uclient-fetch - 2023-04-13-007d9454-1
ucode - 2023-06-06-c7d84aae-1
ucode-mod-fs - 2023-06-06-c7d84aae-1
ucode-mod-nl80211 - 2023-06-06-c7d84aae-1
ucode-mod-rtnl - 2023-06-06-c7d84aae-1
ucode-mod-ubus - 2023-06-06-c7d84aae-1
ucode-mod-uci - 2023-06-06-c7d84aae-1
ucode-mod-uloop - 2023-06-06-c7d84aae-1
uqmi - 2022-05-04-56cb2d40-5
urandom-seed - 3
urngd - 2023-07-25-7aefb47b-1
usb-modeswitch - 2022-02-24-3c8595a4-1
usign - 2020-05-23-f1f65026-1
wireless-regdb - 2023.09.01-1
wpad-basic-mbedtls - 2023-09-08-e5ccbfc6-4
wwan - 2019-04-29-6

As you can see I have all the packages suggested in How to use LTE modem in QMI mode for WAN connection.

If I take another GL.iNet GL-X300B board I have here with stock firmware and look into the console logs I see the following:

[    0.000000] Linux version 4.14.241 (glinet@glinet) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11257-5090152ae3)) #0 Thu Jul 29 19:50:28 2021
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] MIPS: machine is GL.iNet GL-X300B (NOR)
[    0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    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, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x98/0x494 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 122404K/131072K available (4427K kernel code, 156K rwdata, 1008K rodata, 1244K init, 218K bss, 8668K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 650.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5880801374 ns
[    0.000008] sched_clock: 32 bits at 325MHz, resolution 3ns, wraps every 6607641598ns
[    0.008254] Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
[    0.074862] pid_max: default: 32768 minimum: 301
[    0.079933] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.086901] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.098680] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.109103] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.115630] pinctrl core: initialized pinctrl subsystem
[    0.122354] NET: Registered protocol family 16
[    0.152956] clocksource: Switched to clocksource MIPS
[    0.159309] NET: Registered protocol family 2
[    0.164144] IP idents hash table entries: 2048 (order: 2, 16384 bytes)
[    0.171708] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.179117] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.185840] TCP: Hash tables configured (established 1024 bind 1024)
[    0.192691] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.198902] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.205801] NET: Registered protocol family 1
[    0.213444] Crashlog allocated RAM at address 0x3f00000
[    0.220285] workingset: timestamp_bits=30 max_order=15 bucket_order=0
[    0.232243] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.238434] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.259531] io scheduler noop registered
[    0.263724] io scheduler deadline registered (default)
[    0.271285] pinctrl-single 1804002c.pinmux: 576 pins at pa b804002c size 72
[    0.279339] gpio-export gpio-export: 3 gpio(s) exported
[    0.285617] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.294573] Serial port to 485 enable,rs485txen_gpio = gpio1 
[    0.300777] console [ttyS0] disabled
[    0.304627] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.313738] console [ttyS0] enabled
[    0.313738] console [ttyS0] enabled
[    0.321282] bootconsole [early0] disabled
[    0.321282] bootconsole [early0] disabled
[    0.348467] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.353401] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.359963] Creating 4 MTD partitions on "spi0.0":
[    0.364939] 0x000000000000-0x000000040000 : "u-boot"
[    0.370879] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.377222] 0x000000050000-0x000000060000 : "art"
[    0.382792] 0x000000060000-0x000001000000 : "firmware"
[    0.391549] 2 uimage-fw partitions found on MTD device firmware
[    0.397726] Creating 2 MTD partitions on "firmware":
[    0.402866] 0x000000000000-0x0000001d0000 : "kernel"
[    0.408758] 0x0000001d0000-0x000000fa0000 : "rootfs"
[    0.414654] mtd: device 5 (rootfs) set to be root filesystem
[    0.421890] 1 squashfs-split partitions found on MTD device rootfs
[    0.428349] 0x000000b80000-0x000000fa0000 : "rootfs_data"
[    0.435892] spi-nand: unknown raw ID 00000000
[    0.440398] spi-nand: Failed to detect a SPI NAND (err = -19).
[    0.447134] libphy: Fixed MDIO Bus: probed
[    0.794055] ag71xx 19000000.eth: Could not connect to PHY device. Deferring probe.
[    1.473339] libphy: ag71xx_mdio: probed
[    1.763422] mdio-bus.0:1f: Found an AR934X built-in switch
[    1.769265] libphy: ar7240sw_mdio: probed
[    1.830582] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    1.840528] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    1.848838] NET: Registered protocol family 10
[    1.858107] Segment Routing with IPv6
[    1.861984] NET: Registered protocol family 17
[    1.866688] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.880089] 8021q: 802.1Q VLAN Support v1.8
[    2.225151] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:1f:04 [uid=004dd042, driver=Generic PHY]
[    2.235831] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    2.250045] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    2.264979] Freeing unused kernel memory: 1244K
[    2.269662] This architecture does not have kernel memory protection.
[    2.532967] random: fast init done
[    3.235317] init: Console is alive
[    3.239071] init: - watchdog -
[    5.788603] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.201558] usbcore: registered new interface driver usbfs
[    6.207382] usbcore: registered new interface driver hub
[    6.212980] usbcore: registered new device driver usb
[    6.224249] hw_wdt enter probe
[    6.227412] feed dog gpio = gpio2 
[    6.231080] watchdog enable gpio = gpio12 
[    6.235445] feed watchdog interval 100000000 ns
[    6.246960] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.263529] SCSI subsystem initialized
[    6.273054] ehci-platform: EHCI generic platform driver
[    6.278718] ehci-platform 1b000000.usb: EHCI Host Controller
[    6.284649] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[    6.292833] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[    6.322998] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    6.330258] hub 1-0:1.0: USB hub found
[    6.334573] hub 1-0:1.0: 1 port detected
[    6.342301] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    6.350805] ohci-platform: OHCI generic platform driver
[    6.358853] uhci_hcd: USB Universal Host Controller Interface driver
[    6.370524] usbcore: registered new interface driver usb-storage
[    6.379221] usbcore: registered new interface driver uas
[    6.385595] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.403588] init: - preinit -
[    7.003060] usb 1-1: new high-speed USB device number 2 using ehci-platform
[    7.249421] random: procd: uninitialized urandom read (4 bytes read)
[    7.601609] random: jshn: uninitialized urandom read (4 bytes read)
[    7.752622] random: jshn: uninitialized urandom read (4 bytes read)
[    8.769874] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.854216] eth1: link up (1000Mbps/Full duplex)
[    9.859027] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   12.049111] mount_root: loading kmods from internal overlay
[   12.133526] kmodloader: loading kernel modules from //etc/modules-boot.d/*
[   12.145346] kmodloader: done loading kernel modules from //etc/modules-boot.d/*
[   12.546670] block: attempting to load /etc/config/fstab
[   12.554134] block: unable to load configuration (fstab: Entry not found)
[   12.561149] block: no usable configuration
[   12.566267] mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   12.647710] urandom-seed: Seed file not found (/etc/urandom.seed)
[   12.755877] eth1: link down
[   12.770763] procd: - early -
[   12.774629] procd: - watchdog -
[   13.505883] urandom_read: 5 callbacks suppressed
[   13.505891] random: jshn: uninitialized urandom read (4 bytes read)
Failed to connect to ubus
[   13.608456] procd: - watchdog -
[   13.612020] procd: - ubus -
[   14.029216] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.199719] procd: - init -
[   16.373541] kmodloader: loading kernel modules from /etc/modules.d/*
[   16.713521] urngd: v1.0.2 started.
[   16.765955] tun: Universal TUN/TAP device driver, 1.6
[   16.812720] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   16.862923] nf_conntrack version 0.5.0 (2048 buckets, 8192 max)
[   17.150874] Netfilter messages via NETLINK v0.30.
[   17.175831] ip_set: protocol 6
[   17.276590] random: crng init done
[   17.294688] Mirror/redirect action on
[   17.332256] u32 classifier
[   17.335144]     input device check on
[   17.338928]     Actions configured
[   17.415770] GACT probability on
[   17.444097] Simple TC action Loaded
[   17.552544] usbcore: registered new interface driver cdc_acm
[   17.558458] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   17.605005] usbcore: registered new interface driver cdc_wdm
[   17.622841] Loading modules backported from Linux version v4.19.193-0-g1722257b8ece
[   17.630819] Backport generated by backports.git v4.19.193-1-0-gaa2cc8ea
[   17.716523] Ebtables v2.0 registered
[   17.726271] ip_tables: (C) 2000-2006 Netfilter Core Team
[   17.754784] usbcore: registered new interface driver ipheth
[   18.109665] ctnetlink v0.93: registering with nfnetlink.
[   18.480325] usbcore: registered new interface driver usbserial
[   18.486521] usbcore: registered new interface driver usbserial_generic
[   18.493387] usbserial: USB Serial support registered for generic
[   18.561237] wireguard: WireGuard 1.0.20200611 loaded. See www.wireguard.com for information.
[   18.570027] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   18.774100] xt_time: kernel timezone is -0000
[   18.796266] usbcore: registered new interface driver cdc_ether
[   18.827904] usbcore: registered new interface driver cdc_ncm
[   19.006850] usbcore: registered new interface driver cp210x
[   19.012676] usbserial: USB Serial support registered for cp210x
[   19.064674] usbcore: registered new interface driver huawei_cdc_ncm
[   19.270017] PPP generic driver version 2.4.2
[   19.294643] PPP MPPE Compression module registered
[   19.324586] NET: Registered protocol family 24
[   19.352756] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
[   19.358169] qmi_wwan 1-1:1.4: QuectelEC25&EC21&EG91&EG95&EG06&EP06&EM06&BG96&AG35 work on RawIP mode
[   19.403940] qmi_wwan 1-1:1.4 wwan0: register 'qmi_wwan' at usb-1b000000.usb-1, WWAN/QMI device, 0a:fe:91:af:bd:f0
[   19.414832] usbcore: registered new interface driver qmi_wwan
[   19.451809] usbcore: registered new interface driver rndis_host
[   19.546440] usbcore: registered new interface driver sierra
[   19.552267] usbserial: USB Serial support registered for Sierra USB modem
[   19.595753] usbcore: registered new interface driver sierra_net
[   19.765844] usbcore: registered new interface driver option
[   19.771675] usbserial: USB Serial support registered for GSM modem (1-port)
[   19.779227] option 1-1:1.0: GSM modem (1-port) converter detected
[   19.785822] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   19.793067] option 1-1:1.1: GSM modem (1-port) converter detected
[   19.799651] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   19.806892] option 1-1:1.2: GSM modem (1-port) converter detected
[   19.813518] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   19.820692] option 1-1:1.3: GSM modem (1-port) converter detected
[   19.827342] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[   20.055955] usbcore: registered new interface driver rt2800usb
[   20.165025] ieee80211 phy0: Atheros AR9531 Rev:2 mem=0xb8100000, irq=12
[   20.223659] kmodloader: done loading kernel modules from /etc/modules.d/*

You can see that it successfully creates the /dev/cdc-wdm0 as well as the ttyUSB0, ttyUSB1, ttyUSB2, and ttyUSB3 the modem uses. It also doesn't have the USB 1-1 errors which leads me to believe that they are related to the modem. I just don't know how.

Has anyone done an integration from scratch like this before that can help me solve this?

These errors, ending up with

is a show-stopper. This is not a USB driver issue.

Normally I'd say "check your USB cable", but I assume this is a device with a modem in an internal PCIe slot? And the modem hasn't been out of the socket since it working on OEM firmware?

The errors point to either a power issue or a modem firmware crash. I don't think the latter is likely at this point given that it works on OEM. So we're lefte with a power issue, which cannot be caused by a bad cable. Some GPIO switch you need to toggle to provide power to the modem, maybe?

Hmm, I see that the DTS has

               minipcie {
                        gpio-export,name = "minipcie";
                        gpio-export,output = <0>;
                        gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
                };

Is this enabled?

2 Likes

What do you mean by "is this enabled"?

My interpretation here is, you have to set this GPIO to HIGH, to power the pcie/modem. Which makes sense to me, having another device, for which I have to do the same.