Request support to detect the 5G/4G modem as PCie

Greetings All

I using 5G/4G modem on BPI-R4 Board (OpenWRT System)....
I feel the system is using the network through USB not PCIe mode ... I apperiate if you can guide me how to let the system detect the modem as PCIe not USB

I runed some commands

root@OpenWrt:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.43 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 2109:2822 VIA Labs, Inc.          USB2.0 Hub
Bus 001 Device 003: ID 2109:8822 VIA Labs, Inc.          USB Billboard Device
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.43 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc.          USB3.1 Hub
Bus 002 Device 003: ID 2cb7:0104 QCOM SDXPINN-IDP _SN:EA9B91F5
root@OpenWrt:~# lspci
root@OpenWrt:~# mmcli -m 0
  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/0
           |               device id: 6ffdd572aa27054028fc93288415acc80059ad89
  -----------------------------------
  Hardware |            manufacturer: Fibocom Wireless Inc.
           |                   model: FM190W-GL-01-00 5G Module
           |       firmware revision: 99103.1000.00.01.06.10
           |          carrier config: ROW_Commercial
           | carrier config revision: 0A010809
           |            h/w revision: 10000
           |               supported: gsm-umts, lte, 5gnr
           |                 current: gsm-umts, lte, 5gnr
           |            equipment id: 351064272748410
  -----------------------------------
  System   |                  device: /sys/devices/platform/soc/11200000.usb/usb                                                               2/2-1/2-1.1
           |                 physdev: /sys/devices/platform/soc/11200000.usb/usb                                                               2/2-1/2-1.1
           |                 drivers: option1, qmi_wwan
           |                  plugin: fibocom
           |            primary port: cdc-wdm0
           |                   ports: cdc-wdm0 (qmi), ttyUSB1 (at), ttyUSB2 (at)                                                               ,
           |                          ttyUSB3 (ignored), wwan0 (net)
  -----------------------------------
  Numbers  |                     own:
  -----------------------------------
  Status   |                    lock: sim-pin2
           |          unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), s                                                               im-puk2 (10)
           |                   state: connected
           |             power state: on
           |             access tech: lte, 5gnr
           |          signal quality: 100% (recent)
  -----------------------------------
  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-4, utran-6, utran-5, utran-                                                               8, utran-2,
           |                          eutran-1, eutran-2, eutran-3, eutran-4, eu                                                               tran-5, eutran-7, eutran-8,
           |                          eutran-12, eutran-13, eutran-14, eutran-17                                                               , eutran-18, eutran-19,
           |                          eutran-20, eutran-25, eutran-26, eutran-28                                                               , eutran-29, eutran-30,
           |                          eutran-32, eutran-34, eutran-38, eutran-39                                                               , eutran-40, eutran-41,
           |                          eutran-42, eutran-43, eutran-46, eutran-48                                                               , eutran-53, eutran-66,
           |                          eutran-70, eutran-71, utran-19, ngran-1, n                                                               gran-2, ngran-3, ngran-5,
           |                          ngran-7, ngran-8, ngran-12, ngran-13, ngra                                                               n-14, ngran-18, ngran-20,
           |                          ngran-25, ngran-26, ngran-28, ngran-29, ng                                                               ran-30, ngran-38, ngran-40,
           |                          ngran-41, ngran-48, ngran-66, ngran-70, ng                                                               ran-71, ngran-75, ngran-77,
           |                          ngran-78, ngran-79, ngran-91, ngran-92, ng                                                               ran-93, ngran-94
           |                 current: utran-1, utran-4, utran-6, utran-5, utran-                                                               8, utran-2,
           |                          eutran-1, eutran-3, eutran-40, utran-19, n                                                               gran-40, ngran-41,
           |                          ngran-77, ngran-78
  -----------------------------------
  IP       |               supported: ipv4, ipv6, ipv4v6
  -----------------------------------
  3GPP     |                    imei: 351064272748410
           |           enabled locks: fixed-dialing
           |             operator id: 42001
           |           operator name: stc
           |            registration: home
           |    packet service state: attached
  -----------------------------------
  3GPP EPS |    ue mode of operation: csps-2
           |     initial bearer path: /org/freedesktop/ModemManager1/Bearer/0
           |      initial bearer apn: Jawalnet.com.sa
           |  initial bearer ip type: ipv4v6
  -----------------------------------
  SIM      |        primary sim path: /org/freedesktop/ModemManager1/SIM/0
           |          sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM                                                               /0 (active)
           |                          slot 2: none
  -----------------------------------
  Bearer   |                   paths: /org/freedesktop/ModemManager1/Bearer/1


root@OpenWrt:~# dmesg | grep -i modem
[    8.975299] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[    9.153751] usbserial: USB Serial support registered for GSM modem (1-port)
[    9.168571] usbserial: USB Serial support registered for Qualcomm USB modem
[   40.215822] option 2-1.1:1.0: GSM modem (1-port) converter detected
[   40.222312] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[   40.229826] option 2-1.1:1.1: GSM modem (1-port) converter detected
[   40.236355] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[   40.243889] option 2-1.1:1.2: GSM modem (1-port) converter detected
[   40.250368] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[   40.257688] option 2-1.1:1.3: GSM modem (1-port) converter detected
[   40.264224] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB3

Modem is IRQ 116


**Note my modem is Fibocom FM190W **
using AT+GTUSBMODE=32 (from below list)

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
cat /etc/config/irqbalance

@anon63541380
Thank you for fast respond

root@OpenWrt:~# ubus call system board
{
        "kernel": "6.6.43",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 0",
        "model": "Bananapi BPI-R4",
        "board_name": "bananapi,bpi-r4",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "SNAPSHOT",
                "revision": "r27044-249b949a26",
                "target": "mediatek/filogic",
                "description": "OpenWrt SNAPSHOT r27044-249b949a26"
        }
}
root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd7c:d678:386d::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'eth1'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.2.2'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device
        option name 'br-wan'
        option type 'bridge'
        list ports 'wan'
        list ports 'eth2'

config device
        option name 'wan'
        option macaddr '42:64:0e:ab:d3:9e'

config device
        option name 'eth2'
        option macaddr '42:64:0e:ab:d3:9e'

config interface 'wan'
        option device 'br-wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'br-wan'
        option proto 'dhcpv6'

config interface 'Modem'
        option proto 'modemmanager'
        option device '/sys/devices/platform/soc/11200000.usb/usb2/2-1/2-1.1'
        option apn 'Jawalnet.com.sa'
        option auth 'none'
        option iptype 'ipv4v6'
        option loglevel 'ERR'

root@OpenWrt:~# cat /etc/config/wireless
root@OpenWrt:~# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

root@OpenWrt:~# cat /etc/config/firewall

config defaults
        option syn_flood '1'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        list network 'lan'

config zone
        option name 'wan'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'
        list network 'wan'
        list network 'wan6'
        list network 'Modem'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

root@OpenWrt:~# cat /etc/config/irqbalance
config irqbalance 'irqbalance'
        option enabled '0'

        # Level at which irqbalance partitions cache domains.
        # Default is 2 (L2$).
        #option deepestcache '2'

        # The default value is 10 seconds
        #option interval '10'

        # Specify excluded cpulist
        #option banned_cpulist '0'

        # List of IRQ's to ignore
        #list banirq '36'
        #list banirq '69'

Helps to enable irqbalance if you expect it to do anything?

Dear Sir @anon63541380

the issue is the system getting the network from usb ...
so how I can let it to get it from PCIe ...because most of parameters are saying i'm using the network through USB not PCIe ... where the modem is supporting both PCIe and USB

Quectel M.2 is PCIE USB-C adapter + USB modem soldered on same PCB together. Likely others are not any different.
Enable irqbalance editing /etc/config/irqbalance and check the result.

root@OpenWrt:~# cat /etc/config/irqbalance

config irqbalance 'irqbalance'
        option enabled '1'


As I know ,,, OpenWRT team said PCie connection for network modems are better than USB ....

Post

cat /proc/interrupts

in 24h
So far it is minimal load (comparing to timers)

Can you clarify?

It's not possible to modify a hardware USB device into a hardware PCIe device. If your device is USB, that's it. You can't "make" a USB device become a PCIe.

Yes, but the PCIE 5G modems hide USB controller, note the connection part, it is kind of easy to damage free hanging USB stick.

Dear @lleachii
My modem is supporting PCIe ... and my board also Supporting PCIe
but on interface of data is showing USB connection

Boss
Here we go

root@OpenWrt:~# cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
 11:      58600      74822      78157      71638     GICv3  30 Level     arch_timer
 16:          0          0          0          0   mt-eint   1 Edge      sfp2-tx-fault
 17:          0          0          0          0   mt-eint   2 Edge      sfp2-los
 27:          0          0          0          0   mt-eint  12 Edge      11230000.mmc cd
 29:          0          0          0          0   mt-eint  14 Edge      gpio-keys
 69:          0          0          0          0   mt-eint  54 Edge      sfp1-los
 84:          0          0          0          0   mt-eint  69 Edge      sfp1-tx-fault
 97:          0          0          0          0   mt-eint  82 Edge      sfp1-mod-def0
 98:          0          0          0          0   mt-eint  83 Edge      sfp2-mod-def0
 99:         16          0          0          0     GICv3 155 Level     ttyS0
102:      14308          0          0          0     GICv3 172 Level     11007000.spi
104:     102128      12935          0          0     GICv3 229 Level     15100000.ethernet
105:      65690          0          0      10149     GICv3 230 Level     15100000.ethernet
106:         31          0          0          0     GICv3 168 Level     11003000.i2c
107:         17          0          0          0     GICv3 177 Level     11005000.i2c
108:          0          0          0          0     GICv3 170 Level     1100a000.lvts
109:          0          0          0          0     GICv3 142 Level     wdt_bark
110:       6295          0          0          0     GICv3 175 Level     11230000.mmc
111:          9          0          0          0     GICv3 241 Level     mt7530
112:          0          0          0          0    mt7530   0 Edge      mt7530-0:00
113:          5          0          0          0    mt7530   1 Edge      mt7530-0:01
114:          4          0          0          0    mt7530   2 Edge      mt7530-0:02
115:          0          0          0          0    mt7530   3 Edge      mt7530-0:03
116:     209329          0          0          0     GICv3 204 Level     xhci-hcd:usb1
IPI0:      2936       2985       3015       2894       Rescheduling interrupts
IPI1:     35529      27914      90201      79652       Function call interrupts
IPI2:         0          0          0          0       CPU stop interrupts
IPI3:         0          0          0          0       CPU stop (for crash dump) interrupts
IPI4:         0          0          0          0       Timer broadcast interrupts
IPI5:         0          0          0          0       IRQ work interrupts
IPI6:         0          0          0          0       CPU wake-up interrupts

1 Like

Yes, it is like that, it has own USB controller and all USB wiring printed between chips on PCB.

1 Like

OK, it balances, seeing numbers 104 and 116 are on different CPUs, so behaviour is correct. There is no other high CPU user on CPU0, so it is fine now.

1 Like

As @brada4 stated:

The Modem is likely connected in the following manner:

modem <-> USB <-> USB_Bus <-> PCIe

And nonetheless, the following statement is still true:

1 Like

@lleachii @brada4 (Your advise)
is it fine ? CPU 1


This point Dear/Sir @lleachii Its clear now about USB and PCIe ... because the low CPU utilization is making me thinking there is something wrong with connection maybe .... People on other post advised me to use PCie not USB

BTW you can do that on some modems, see for example page 26 https://files.waveshare.com/upload/7/7f/Quectel_RM520N-GL_Hardware_Design_V1.0.pdf

The module supports to communicate through both USB and PCIe interfaces, respectively referring to the USB mode and the PCIe mode as described below

Once the modem is in PCIe mode, you need to add MHI PCI drivers:

CONFIG_PACKAGE_kmod-mhi-bus=y
CONFIG_PACKAGE_kmod-mhi-net=y
CONFIG_PACKAGE_kmod-mhi-pci-generic=y
CONFIG_PACKAGE_kmod-mhi-wwan-ctrl=y
CONFIG_PACKAGE_kmod-mhi-wwan-mbim=y
2 Likes

Yes, this is an exception.

I failed to note that in the unique case the device interface IS dual and indeed connected to a dual bus.

This is a remote possibility, I'm not familiar enough with the make/model of modem, nor the router board itself.

This is pretty common for 4G/5G modems. AFAIK, all highend Qualcomm modem SoCs have supported both usb3 and pcie interfaces for at least 10 years.

But the choice is completely up to the modem device. It's not something the host system can change, unless the modem vendor decided to expose some switching method.

And the vendors doing that have chosen widely different designs. Using everything from factory blown fuses to vendor AT commands. Some modems even use non-standard pin configurations to select interface, requiring very specific host system hardware support.

So the answer will be modem vendor specific and the question should therefore be directed to the modem vendor support. In this case Fibocom support.

This is not OpenWrt related. OpenWrt will use and support whatever bus interface the modem is configured for.

3 Likes

@lleachii @ynezz

So can I understand the reason behind low utilization of CPUs due to USB mode or System issue ...

Because the system is look like focusing on core 0 and leaving the others

How we can solve this