OpenWrt support for Vodafone Gigacube (B157)

+ZSWITCH: x
OK

+ZADSET: n
OK

MDMVDFE1C2017

OK

ip link from the OEM firmware:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: rmnet_mhi_sw0: <UP,LOWER_UP> mtu 65535 qdisc hyfi_pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
    link/[530]
    alias rmnet_mhi_sw_0306_00.01.00_0
3: rmnet_mhi0: <UP,LOWER_UP> mtu 65535 qdisc hyfi_pfifo_fast state UNKNOWN mode DEFAULT group default qlen 1000
    link/[530]
    alias rmnet_mhi_0306_00.01.00_0
4: miireg: <> mtu 0 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/generic
5: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc hyfi_pfifo_fast master br-lan1 state DOWN mode DEFAULT group default qlen 1000
    link/ether b4:69:5f:00:00:80 brd ff:ff:ff:ff:ff:ff
6: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc hyfi_pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether b4:69:5f:00:00:7b brd ff:ff:ff:ff:ff:ff
7: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/tunnel6 :: brd ::
8: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/sit 0.0.0.0 brd 0.0.0.0
9: ifb0: <BROADCAST,NOARP> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 32
    link/ether fe:f0:a1:00:00:52 brd ff:ff:ff:ff:ff:ff
10: ifb1: <BROADCAST,NOARP> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 32
    link/ether 36:53:47:00:00:f4 brd ff:ff:ff:ff:ff:ff
11: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/gre 0.0.0.0 brd 0.0.0.0
12: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
13: ip6gre0@NONE: <NOARP> mtu 1448 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/gre6 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 brd 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
14: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 4a:02:1d:00:00:8d brd ff:ff:ff:ff:ff:ff
15: ipsecdummy: <> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/generic
16: teql0: <NOARP> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 100
    link/void
17: wifi0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 2699
    link/ieee802.11 b4:69:5f:00:00:17 brd ff:ff:ff:ff:ff:ff
18: wifi1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 2699
    link/ieee802.11 b4:69:5f:00:00:e5 brd ff:ff:ff:ff:ff:ff
19: soc0: <> mtu 0 qdisc noop state DOWN mode DEFAULT group default qlen 1
    link/ieee802.11
20: br-lan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether b4:69:5f:00:00:80 brd ff:ff:ff:ff:ff:ff
21: br-lan2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 50:9e:5a:00:00:e6 brd ff:ff:ff:ff:ff:ff
22: eth0.1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan2 state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether 50:9e:5a:00:00:e6 brd ff:ff:ff:ff:ff:ff
23: rmnet_data0@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
24: rmnet_data1@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
25: rmnet_data2@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
26: rmnet_data3@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
27: rmnet_data4@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
28: rmnet_data5@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
29: rmnet_data6@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
30: rmnet_data7@rmnet_mhi0: <> mtu 1500 qdisc hyfi_pfifo_fast state DOWN mode DEFAULT group default qlen 1000
    link/[530]
31: ath0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan1 state UP mode DEFAULT group default
    link/ether b4:69:5f:00:00:17 brd ff:ff:ff:ff:ff:ff
32: ath1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan1 state UP mode DEFAULT group default
    link/ether b4:69:5f:00:00:e5 brd ff:ff:ff:ff:ff:ff

My modem reports MDMVDFE1A1007, looks like at least one major revision behind yours. And I'm not sure I can update it, I think OEM uses adb to push the update and I don't have an adb interface.

Anyhow, modem over PCI/MHI did not end up being as complex as I feared. I've pushed a new image, works for me using modemmanager.

Modem has a GPIO reset pin, but does not play nicely on the PCI bus when restarting (PCI errors or even kernel crash). I wanted to implement a reset, but because of this I'm not sure how to safely do it. The reason why I would want us to do it is the modem doesn't appear to restart when performing a reboot, only when the router is power cycled. This is potentially a tricky situation if modem hangs at some point.

In my case, modem cannot detect SIM.

mmcli -m any
  -----------------------------
  General  |              path: /org/freedesktop/ModemManager1/Modem/0
           |         device id: 205e7b794bbb2d98c138a223100f00be2e7ff2ba
  -----------------------------
  Hardware |      manufacturer: TCL
           |             model: MDM
           | firmware revision: MDMVDFE1C2017
           |         supported: gsm-umts
           |           current: gsm-umts
           |      equipment id: 350364000000831
  -----------------------------
  System   |            device: /sys/devices/platform/soc@0/8cf8800.usb/8c00000.usb/xhci-hcd.2.auto/usb3/3-1
           |           physdev: /sys/devices/platform/soc@0/8cf8800.usb/8c00000.usb/xhci-hcd.2.auto/usb3/3-1
           |           drivers: option1
           |            plugin: generic
           |      primary port: ttyUSB2
           |             ports: ttyUSB0 (qcdm), ttyUSB1 (at), ttyUSB2 (at)
  -----------------------------
  Status   |             state: failed
           |     failed reason: sim-missing
           |       power state: on
  -----------------------------
  Modes    |         supported: allowed: any; preferred: none
           |           current: allowed: any; preferred: none
  -----------------------------
  3GPP     |              imei: 350364000000831

modemmanager detects USB and PCI as two separate modems, check with mmcli -L

I've also found that after power cycle the modem may not be up in time for the pci bus to find it, so you can try echo 1 > /sys/bus/pci/rescan if the PCI is not detected.

PCI rescan is needed, and ModemManager gets confused with the PIN SIM, so while unlocks the SIM, it doesn't recognize it.

Anyway, I've been unable to set up the connection neither with the USB nor the PCI modem, and while trying, the kernel crashed.

Try to power cycle before booting openwrt. If OEM firmware initializes the modem via PCI first, then I've seen problems. I think this again is due to modem not being reset by SoC/u-boot on reboot. As for the sim lock, I guess it's a modem manager issue, can you try disabling the sim lock just for testing?

That's what I did (disable PIM) to test. No luck. Even while trying directly with mmcli:

Mon Jun 16 10:28:57 2025 daemon.info [2777]: <inf> [modem1] processing user request to connect modem...
Mon Jun 16 10:28:57 2025 daemon.info [2777]: <inf> [modem1]   apn: internet
Mon Jun 16 10:28:57 2025 daemon.info [2777]: <inf> [modem1]   ip type: ipv4
Mon Jun 16 10:28:57 2025 daemon.notice [2777]: <msg> [modem1] simple connect started...
Mon Jun 16 10:28:57 2025 daemon.notice [2777]: <msg> [modem1] simple connect state (6/10): register
Mon Jun 16 10:28:57 2025 daemon.info [2777]: <inf> [modem1] already registered automatically in network '21403', automatic registration not launched...
Mon Jun 16 10:28:57 2025 daemon.notice [2777]: <msg> [modem1] simple connect state (7/10): wait to get packet service state attached
Mon Jun 16 10:28:57 2025 daemon.notice [2777]: <msg> [modem1] simple connect state (8/10): bearer
Mon Jun 16 10:28:57 2025 daemon.notice [2777]: <msg> [modem1] simple connect state (9/10): connect
Mon Jun 16 10:28:57 2025 daemon.notice [2777]: <msg> [modem1] state changed (registered -> connecting)
Mon Jun 16 10:29:12 2025 daemon.warn [2777]: <wrn> [modem1/bearer4] connection attempt #3 failed: Failure
Mon Jun 16 10:29:12 2025 daemon.notice [2777]: <msg> [modem1] state changed (connecting -> registered)
Mon Jun 16 10:29:12 2025 daemon.notice [2777]: <msg> [modem1/bearer4] connection #3 finished: duration 0s
Mon Jun 16 10:29:12 2025 daemon.warn [2777]: <wrn> [modem1] couldn't connect bearer: Failure

Did you try configuring apn and auth?

Of course! :grinning_face: Same configuration works in other devices.

:blush:
Can you provide mmcli -m any again now that PCI is visible?

mmcli -m any only lists the first one:

  ----------------------------------
  General  |                   path: /org/freedesktop/ModemManager1/Modem/0
           |              device id: 61b071b5471cccb34c424d27d293df98b77a70dc
  ----------------------------------
  Hardware |           manufacturer: TCL
           |                  model: MDM
           |      firmware revision: MDMVDFE1C2017
           |              supported: gsm-umts, lte
           |                current: gsm-umts, lte
           |           equipment id: 350364000000831
  ----------------------------------
  System   |                 device: /sys/devices/platform/soc@0/8cf8800.usb/8c00000.usb/xhci-hcd.2.auto/usb3/3-1
           |                physdev: /sys/devices/platform/soc@0/8cf8800.usb/8c00000.usb/xhci-hcd.2.auto/usb3/3-1
           |                drivers: option1
           |                 plugin: generic
           |           primary port: ttyUSB2
           |                  ports: ttyUSB0 (qcdm), ttyUSB1 (at), ttyUSB2 (at)
  ----------------------------------
  Status   |                  state: disabled
           |            power state: on
  ----------------------------------
  Modes    |              supported: allowed: 2g, 3g, 4g, 5g; preferred: none
           |                current: allowed: 2g, 3g, 4g, 5g; preferred: none
  ----------------------------------
  IP       |              supported: ipv4, ipv6, ipv4v6
  ----------------------------------
  3GPP     |                   imei: 350364000000831
  ----------------------------------
  3GPP EPS |   ue mode of operation: csps-2
           | initial bearer ip type: ipv4v6
  ----------------------------------
  SIM      |       primary sim path: /org/freedesktop/ModemManager1/SIM/0

Here you have the PCI one:

root@OpenWrt:~# mmcli -m 1
  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/1
           |               device id: fbdbb409683385eb6f5a8ac4c194b769e0505e5a
  -----------------------------------
  Hardware |            manufacturer: generic
           |                   model: MDM
           |       firmware revision: SDX55.LE.1.2.r1-00018-NBOOT.CP
           |          carrier config: Spain-Commercial-Orange
           | carrier config revision: 0A010B34
           |            h/w revision: MDM
           |               supported: gsm-umts, lte, 5gnr
           |                 current: gsm-umts, lte, 5gnr
           |            equipment id: 350364000000831
  -----------------------------------
  System   |                  device: /sys/devices/platform/soc@0/20000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0
           |                 physdev: /sys/devices/platform/soc@0/20000000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0
           |                 drivers: mhi-pci-generic
           |                  plugin: generic
           |            primary port: wwan0mbim0
           |                   ports: wwan0 (net), wwan0mbim0 (mbim), wwan0qcdm0 (ignored)
  -----------------------------------
  Status   |                    lock: sim-pin2
           |          unlock retries: sim-pin2 (3)
           |                   state: disabled
           |             power state: on
  -----------------------------------
  Modes    |               supported: allowed: 3g; preferred: none
           |                          allowed: 4g; preferred: none
           |                          allowed: 3g, 4g; preferred: 4g
           |                          allowed: 3g, 4g; preferred: 3g
           |                          allowed: 5g; preferred: none
           |                          allowed: 4g, 5g; preferred: 5g
           |                          allowed: 4g, 5g; preferred: 4g
           |                          allowed: 3g, 5g; preferred: 5g
           |                          allowed: 3g, 5g; preferred: 3g
           |                          allowed: 3g, 4g, 5g; preferred: 5g
           |                          allowed: 3g, 4g, 5g; preferred: 4g
           |                          allowed: 3g, 4g, 5g; preferred: 3g
           |                 current: allowed: 3g, 4g, 5g; preferred: 5g
  -----------------------------------
  Bands    |               supported: utran-1, utran-3, utran-6, utran-5, utran-8, eutran-1,
           |                          eutran-3, eutran-5, eutran-7, eutran-8, eutran-20, eutran-28,
           |                          eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41,
           |                          eutran-42, eutran-43, ngran-1, ngran-3, ngran-7, ngran-8, ngran-20,
           |                          ngran-28, ngran-38, ngran-77, ngran-78
           |                 current: utran-1, utran-3, utran-6, utran-5, utran-8, eutran-1,
           |                          eutran-3, eutran-5, eutran-7, eutran-8, eutran-20, eutran-28,
           |                          eutran-32, eutran-34, eutran-38, eutran-39, eutran-40, eutran-41,
           |                          eutran-42, eutran-43, ngran-1, ngran-3, ngran-7, ngran-8, ngran-20,
           |                          ngran-28, ngran-38, ngran-77, ngran-78
  -----------------------------------
  IP       |               supported: ipv4, ipv6, ipv4v6
  -----------------------------------
  3GPP     |                    imei: 35036000000831
           |           enabled locks: fixed-dialing
  -----------------------------------
  3GPP EPS |  initial bearer ip type: ipv4v6
  -----------------------------------
  SIM      |        primary sim path: /org/freedesktop/ModemManager1/SIM/1
           |          sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/1 (active)

Ok. Full reset (poweroff-poweron), PCI rescan and clean configuration of the PCI modem and now works.

Awesome!

I will try a couple more things to see if I can stabilize the PCI stuff, but I am not that low level to go deeper than that.

Giving up on the modem MHI/PCI details. It's quite low level for me and there is no documentation to go by. I've tried translating OEM DT MHI into drivers/bus/mhi/host/pci-generic.c but that didn't help one bit and I don't know if I did it right. In OEM firmware there is another channel (TIME_SYNC) that's not in the DTS so it's quite possible some bits are hardcoded in the OEM kernel.

I'll work on triggering pci_rescan after boot and if it's stable go for a PR.

Any feedback is welcome.

I don't have the expertise to work on it, but I've kept the connection for a few hours and it looks really stable.

I'd try to hide the USB modem to avoid confusion and leave only the PCI one. If the rescan stuff works, I guess it should look quite good.

I've done some testing and it seems the modem data path is always PCI, regardless of the mode only control channels work over USB. So will make the usb serial module optional. I already have a PR open.

Could you please test one more thing - does rmmod mhi_pci_generic hang followed by a reboot?

It looks fine to me (no crashes):

root@OpenWrt:~# rmmod mhi_pci_generic
[  408.850336] wwan wwan0: port wwan0qcdm0 disconnected
[  408.850880] wwan wwan0: port wwan0mbim0 disconnected
[  408.854646] wwan wwan0: port wwan0at0 disconnected

Ok, that's great news. I assume that something was changed in the updated modem firmware. However that doesn't help me personally, as my modem reports no OEM updates available, and the modem update file from the update you provided appears to be incremental/patch (MDMVDFE1C2011->MDMVDFE1C2017) so I can't use it. Hopefully something comes up in the future.

Firmware download request is an URL starting with https://g2master-eu-west.tclclouds.com/download_request.php?... from what I remember, you specify your current version and it'd provide the required firmware update.

I don't remember the exact details about how it works, but I can try to dig it up in case you're interested in trying to find an useful update for you.

I am, thanks!