You might find 4G modem (wwan0) on debian11 not working - #17 by Dot_Brian useful, I have it working with the same modem and the Quectel MHI PCI driver.
Looks like my issue is not with the MHI driver but with the 11280000.pcie slot not discovering at all the device… This ( [BPI-R4] how to activate key B PCIe2 @ 11280000? [solved] - Banana Pi Router design / BPI-R4(MT7988) - banana pi single board computer open source project official forum BPI team) seems to be the case but not sure how to apply it to openwrt-24.10 ToT.
which OS and kernel do you use?
I’m building my snapshot of OpenWRT from ToT of openwrt-24.10. Uses kernel 6.6.83 atm.
have you tried applying the patch you’ve linked above? do you have same errors in dmesg?
clockpatch should be already applied:
Uhm, now that you point me to it, that patch is already in openwrt-24.10 as well.
Now I clueless… ![]()
the clock-patch yes, but not the one you’ve linked…
…? I’m lost here, the only patch I’m aware for pcie is the clock one. What other patch are you referring to?
What I can see in the logs, now is:
[ 2.401071] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[ 2.408424] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[ 2.414701] mtk-pcie-gen3 11280000.pcie: IO 0x0020000000..0x00201fffff -> 0x0020000000
[ 2.423149] mtk-pcie-gen3 11280000.pcie: MEM 0x0020200000..0x0027ffffff -> 0x0020200000
and
[ 2.763058] mtk-pcie-gen3 11280000.pcie: PCIe link down, current LTSSM state: polling.compliance (0x3000003)
[ 2.772897] mtk-pcie-gen3: probe of 11280000.pcie failed with error -110
Rereading the whole post, for some reasons, it appears that a reboot is not enough for this to be recognized (???). This does really not add up to me but… ![]()
I powered down the r4 and now I get the device in lspci (no need for the timeout patch).
I patched the generic MHI driver to recognize the QCOM device ID or the RM520-GL and (not sure why, but…) it works.
it is possible that modem is recognized after reboot, but not on cold boot without this ready_timeout-patch
Looks like rebooting is working fine, with the exception of the modem pluging bouncing from “quectel” to “generic”, but still works. It could also be related only to that specific 5g module?
You know if it is normal to get this in the kernel log every 2 seconds (and how to turn it off)?
[ 746.246180] mhi-pci-generic 0003:01:00.0: save config 0x00: 0x030817cb
[ 746.252725] mhi-pci-generic 0003:01:00.0: save config 0x04: 0x00100402
[ 746.259258] mhi-pci-generic 0003:01:00.0: save config 0x08: 0xff000000
[ 746.265801] mhi-pci-generic 0003:01:00.0: save config 0x0c: 0x00000010
[ 746.272318] mhi-pci-generic 0003:01:00.0: save config 0x10: 0x20200004
[ 746.278850] mhi-pci-generic 0003:01:00.0: save config 0x14: 0x00000000
[ 746.285371] mhi-pci-generic 0003:01:00.0: save config 0x18: 0x20201004
[ 746.291889] mhi-pci-generic 0003:01:00.0: save config 0x1c: 0x00000000
[ 746.298411] mhi-pci-generic 0003:01:00.0: save config 0x20: 0x00000000
[ 746.304939] mhi-pci-generic 0003:01:00.0: save config 0x24: 0x00000000
[ 746.311464] mhi-pci-generic 0003:01:00.0: save config 0x28: 0x00000000
[ 746.317990] mhi-pci-generic 0003:01:00.0: save config 0x2c: 0x520117cb
[ 746.324514] mhi-pci-generic 0003:01:00.0: save config 0x30: 0x00000000
[ 746.331031] mhi-pci-generic 0003:01:00.0: save config 0x34: 0x00000040
[ 746.337553] mhi-pci-generic 0003:01:00.0: save config 0x38: 0x00000000
[ 746.344068] mhi-pci-generic 0003:01:00.0: save config 0x3c: 0x00000000
[ 746.350651] mhi-pci-generic 0003:01:00.0: PME# enabled
[ 747.019686] mhi-pci-generic 0003:01:00.0: PME# disabled
[ 747.024936] mhi-pci-generic 0003:01:00.0: enabling bus mastering
You may find this thread on the GL.inet forum useful, I certainly did!
I think you might be right.
Without the ready_delay the modem starts but… flaps between being recognized as “quectel” or “generic”. With the ready_delay in place, it’s stably “quectel”.
DEFINITELY useful! ![]()
Hello All,
I have a problem with my BPI-R4 and Quectel RM520N-EU. have connected the modem to B key port directly to BPI-R4, 12V swich position “ON”. The problem is that the modem doesn’t show up in PCI. All time stays in USB. Check below:
AT+QCFG="pcie/mode"
+QCFG: "pcie/mode",1
OK
AT+QCFG="data_interface"
+QCFG: "data_interface",1,0
OK
root@OpenWrt:~# dmesg | grep -i pci
[ 0.000000] Kernel command line: console=ttyS0,115200n1 pci=pcie_bus_perf root=/dev/fit0 rootwait
[ 0.018414] /soc/pcie@11280000: Fixed dependency cycle(s) with /soc/pcie@11280000/interrupt-controller
[ 0.018525] /soc/pcie@11290000: Fixed dependency cycle(s) with /soc/pcie@11290000/interrupt-controller
[ 0.018616] /soc/pcie@11300000: Fixed dependency cycle(s) with /soc/pcie@11300000/interrupt-controller
[ 0.018712] /soc/pcie@11310000: Fixed dependency cycle(s) with /soc/pcie@11310000/interrupt-controller
[ 0.036391] PCI: CLS 0 bytes, default 64
[ 0.073370] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[ 0.073386] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[ 0.073400] mtk-pcie-gen3 11280000.pcie: IO 0x0020000000..0x00201fffff -> 0x0020000000
[ 0.073415] mtk-pcie-gen3 11280000.pcie: MEM 0x0020200000..0x0027ffffff -> 0x0020200000
[ 0.073509] mtk-pcie-gen3 11290000.pcie: host bridge /soc/pcie@11290000 ranges:
[ 0.073520] mtk-pcie-gen3 11290000.pcie: Parsing ranges property...
[ 0.073531] mtk-pcie-gen3 11290000.pcie: IO 0x0028000000..0x00281fffff -> 0x0028000000
[ 0.073542] mtk-pcie-gen3 11290000.pcie: MEM 0x0028200000..0x002fffffff -> 0x0028200000
[ 0.073560] /soc/pcie@11290000: Failed to get clk index: 0 ret: -517
[ 0.073569] mtk-pcie-gen3 11290000.pcie: failed to get clocks
[ 0.073631] mtk-pcie-gen3 11300000.pcie: host bridge /soc/pcie@11300000 ranges:
[ 0.073641] mtk-pcie-gen3 11300000.pcie: Parsing ranges property...
[ 0.073652] mtk-pcie-gen3 11300000.pcie: IO 0x0030000000..0x00301fffff -> 0x0030000000
[ 0.073663] mtk-pcie-gen3 11300000.pcie: MEM 0x0030200000..0x0037ffffff -> 0x0030200000
[ 0.073679] /soc/pcie@11300000: Failed to get clk index: 0 ret: -517
[ 0.073688] mtk-pcie-gen3 11300000.pcie: failed to get clocks
[ 0.073760] mtk-pcie-gen3 11310000.pcie: host bridge /soc/pcie@11310000 ranges:
[ 0.073770] mtk-pcie-gen3 11310000.pcie: Parsing ranges property...
[ 0.073780] mtk-pcie-gen3 11310000.pcie: IO 0x0038000000..0x00381fffff -> 0x0038000000
[ 0.073791] mtk-pcie-gen3 11310000.pcie: MEM 0x0038200000..0x003fffffff -> 0x0038200000
[ 0.073807] /soc/pcie@11310000: Failed to get clk index: 0 ret: -517
[ 0.073816] mtk-pcie-gen3 11310000.pcie: failed to get clocks
[ 2.007888] mtk-pcie-gen3 11280000.pcie: host bridge /soc/pcie@11280000 ranges:
[ 2.042411] mtk-pcie-gen3 11280000.pcie: Parsing ranges property...
[ 2.048680] mtk-pcie-gen3 11280000.pcie: IO 0x0020000000..0x00201fffff -> 0x0020000000
[ 2.057122] mtk-pcie-gen3 11280000.pcie: MEM 0x0020200000..0x0027ffffff -> 0x0020200000
[ 2.390811] mtk-pcie-gen3 11280000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
[ 2.399609] mtk-pcie-gen3 11280000.pcie: probe with driver mtk-pcie-gen3 failed with error -110
[ 2.408641] mtk-pcie-gen3 11290000.pcie: host bridge /soc/pcie@11290000 ranges:
[ 2.415958] mtk-pcie-gen3 11290000.pcie: Parsing ranges property...
[ 2.422228] mtk-pcie-gen3 11290000.pcie: IO 0x0028000000..0x00281fffff -> 0x0028000000
[ 2.430660] mtk-pcie-gen3 11290000.pcie: MEM 0x0028200000..0x002fffffff -> 0x0028200000
[ 2.750809] mtk-pcie-gen3 11290000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
[ 2.759590] mtk-pcie-gen3 11290000.pcie: probe with driver mtk-pcie-gen3 failed with error -110
[ 2.768458] mtk-pcie-gen3 11300000.pcie: host bridge /soc/pcie@11300000 ranges:
[ 2.775769] mtk-pcie-gen3 11300000.pcie: Parsing ranges property...
[ 2.782035] mtk-pcie-gen3 11300000.pcie: IO 0x0030000000..0x00301fffff -> 0x0030000000
[ 2.790465] mtk-pcie-gen3 11300000.pcie: MEM 0x0030200000..0x0037ffffff -> 0x0030200000
[ 3.110808] mtk-pcie-gen3 11300000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
[ 3.119586] mtk-pcie-gen3 11300000.pcie: probe with driver mtk-pcie-gen3 failed with error -110
[ 3.128452] mtk-pcie-gen3 11310000.pcie: host bridge /soc/pcie@11310000 ranges:
[ 3.135763] mtk-pcie-gen3 11310000.pcie: Parsing ranges property...
[ 3.142029] mtk-pcie-gen3 11310000.pcie: IO 0x0038000000..0x00381fffff -> 0x0038000000
[ 3.150458] mtk-pcie-gen3 11310000.pcie: MEM 0x0038200000..0x003fffffff -> 0x0038200000
[ 3.470808] mtk-pcie-gen3 11310000.pcie: PCIe link down, current LTSSM state: detect.quiet (0x1)
[ 3.479588] mtk-pcie-gen3 11310000.pcie: probe with driver mtk-pcie-gen3 failed with error -110
root@OpenWrt:~# dmesg | grep -i mhi
root@OpenWrt:~# lspci
root@OpenWrt:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
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 Foundation 3.0 root hub
Bus 002 Device 002: ID 2109:0822 VIA Labs, Inc. USB3.1 Hub
Bus 002 Device 003: ID 2c7c:0801 Quectel Wireless Solutions Co., Ltd. RM520N-EU
Any recommendations? I have tested many images like ekoone or immortalwrt. All time same problem.
I’m not sure but 12V applies only to the Wi-Fi card (Mini-PCIe), not to M.2
Mtk pci controller is afaik not hot-pluggable. So if you change interface of card after pci detection and card does not store this setting (to be set after reboot) you cannot use pci mode here. And yes 12v is only for mpcie slots (be14).
I have moved the 12v swich to off position disconnected bpi-r4 from power for 20min, connected back and the modem still stays in usb mode and don’t show up in pci devices.
Ok,maybe there is a way to make this setting persistent on your card to be set on reboot. If not you have to stay at usb mode