如果是ubuntu24.04识别RM530n-GL的接口模块

我在Rasberry Pi5上安装了ubuntu 24.04,并且通过pcie链接了RM530n-GL. 现在我可以识别出来这个模组. 但是我不能通过 ip a 找到端口. 我现在有如下驱动,需要帮忙看看如何安装这些驱动使ubuntu可以到RM530n-GL的端口. 我的需求是把RM530n-GL当作网卡模式来使用

Quectel_QConnectManager_Linux_V1.6.7.zip/QFirehose_Linux_and_Android_V1.5.zip/Quectel_Linux_PCIE_MHI_Driver_V1.3.8.zip/Quectel_Linux_Android_GobiNet_Driver_V1.6.5.zip/Quectel_Linux_Android_QMI_WWAN_Driver_V1.2.9.zip, but I don’t know how to install that driver.

lspci
0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0000:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge

root@local:~/driver# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 2c:cf:67:31:e3:cb brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 2c:cf:67:31:e3:cc brd ff:ff:ff:ff:ff:ff
inet 100.64.40.210/24 brd 100.64.40.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::2ecf:67ff:fe31:e3cc/64 scope link
valid_lft forever preferred_lft forever

英文论坛上你是否也提了对应的问题?
可以发下dmesg 日志。

那个可能是我同事,我只在这里提问过.
dmesg提示文件太大不能上传, 有没有可以加的过滤条件来减少一些输出

可以参考看。
ls /dev/ww* -al

root@local:~/driver/pcie_mhi# ls -l /dev/ww*
ls: cannot access ‘/dev/ww*’: No such file or directory

我这边都没有这个文件

sudo lspci -vvv 看看

抓取了中间两个
root@local:~/driver/pcie_mhi# sudo lspci
0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0000:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge

0000:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308
Subsystem: Qualcomm Technologies, Inc Device 5301
!!! Unknown header type 7f
Region 0: Memory at 1b00000000 (64-bit, non-prefetchable) [size=4K]
Region 2: Memory at 1b00001000 (64-bit, non-prefetchable) [size=4K]
Kernel modules: mhi_pci_generic

0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21) (prog-if 00 [Normal decode])
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 44
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
Memory behind bridge: 00000000-005fffff [size=6M] [32-bit]
Prefetchable memory behind bridge: 00000000fff00000-00000000000fffff [disabled] [64-bit]
Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- Reset- FastB2B-
PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [ac] Express (v2) Root Port (Slot-), MSI 00
DevCap: MaxPayload 512 bytes, PhantFunc 0
ExtTag- RBE+
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr+ NoSnoop+
MaxPayload 256 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
LnkCap: Port #0, Speed 5GT/s, Width x4, ASPM L1, Exit Latency L1 <2us
ClockPM+ Surprise- LLActRep- BwNot+ ASPMOptComp+
LnkCtl: ASPM Disabled; RCB 64 bytes, Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s, Width x4
TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt+
RootCap: CRSVisible+
RootCtl: ErrCorrectable- ErrNon-Fatal- ErrFatal- PMEIntEna+ CRSVisible+
RootSta: PME ReqID 0000, PMEStatus- PMEPending-
DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ NROPrPrP- LTR+
10BitTagComp- 10BitTagReq- OBFF Via WAKE#, ExtFmt- EETLPPrefix-
EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
FRS- LN System CLS Not Supported, TPHComp- ExtTPHComp- ARIFwd+
AtomicOpsCap: Routing- 32bit- 64bit- 128bitCAS-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- 10BitTagReq- OBFF Disabled, ARIFwd-
AtomicOpsCtl: ReqEn- EgressBlck-
LnkCap2: Supported Link Speeds: 2.5-5GT/s, Crosslink- Retimer- 2Retimers- DRS+
LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance Preset/De-emphasis: -6dB de-emphasis, 0dB preshoot
LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
Retimer- 2Retimers- CrosslinkRes: unsupported, DRS-
DownstreamComp: Link Up - Present
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr-
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
HeaderLog: 00000000 00000000 00000000 00000000
RootCmd: CERptEn+ NFERptEn+ FERptEn+
RootSta: CERcvd- MultCERcvd- UERcvd- MultUERcvd-
FirstFatal- NonFatalMsg- FatalMsg- IntMsg 0
ErrorSrc: ERR_COR: 0000 ERR_FATAL/NONFATAL: 0000
Capabilities: [160 v1] Virtual Channel
Caps: LPEVC=0 RefClk=100ns PATEntryBits=1
Arb: Fixed- WRR32- WRR64- WRR128-
Ctrl: ArbSelect=Fixed
Status: InProgress-
VC0: Caps: PATOffset=00 MaxTimeSlots=1 RejSnoopTrans-
Arb: Fixed- WRR32- WRR64- WRR128- TWRR128- WRR256-
Ctrl: Enable+ ID=0 ArbSelect=Fixed TC/VC=ff
Status: NegoPending- InProgress-
Capabilities: [180 v1] Vendor Specific Information: ID=0000 Rev=0 Len=028 <?>
Capabilities: [240 v1] L1 PM Substates
L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
PortCommonModeRestoreTime=8us PortTPowerOnTime=10us
L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
T_CommonMode=1us LTR1.2_Threshold=0ns
L1SubCtl2: T_PwrOn=10us
Capabilities: [300 v1] Secondary PCI Express
LnkCtl3: LnkEquIntrruptEn- PerformEqu-
LaneErrStat: 0
Kernel driver in use: pcieport

直接编译下pcie_mhi 吧,同时要把pcie_mhi_generic 卸载掉。

可能遇到的编译报错。

diff --git a/kernel/native_q/pcie_mhi/devices/mhi_netdev_quectel.c b/kernel/native_q/pcie_mhi/devices/mhi_netdev_quectel.c
index a423779..bd92640 100644
--- a/kernel/native_q/pcie_mhi/devices/mhi_netdev_quectel.c
+++ b/kernel/native_q/pcie_mhi/devices/mhi_netdev_quectel.c
@@ -2590,8 +2590,9 @@ static void mhi_netdev_get_drvinfo (struct net_device *ndev, struct ethtool_drvi
 {
        //struct mhi_netdev *mhi_netdev = ndev_to_mhi(ndev);

-       strlcpy (info->driver, "pcie_mhi", sizeof info->driver);
-       strlcpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
+//     strlcpy (info->driver, "pcie_mhi", sizeof info->driver);
+       strscpy(info->driver, "pcie_mhi", sizeof(info->driver));
+       strscpy (info->version, PCIE_MHI_DRIVER_VERSION, sizeof info->version);
 }

怎么编译和卸载这两个驱动. 有文档可以share么. bradleywang@outlook.com

这里有log 目录可以看看。怎么编译,直接make 就可以。

进入目录make的时候报错

root@local:~/driver/pcie_mhi# make
make ARCH=aarch64 CROSS_COMPILE= -C /lib/modules/6.8.0-1038-raspi/build M=/root/driver/pcie_mhi clean
make[1]: *** /lib/modules/6.8.0-1038-raspi/build: No such file or directory. Stop.
make: *** [Makefile:29: clean] Error 2

不确定是否是同一个板子。

这个树莓派的系统是你直接网上下载的吧,不是自己编译的内核.

对,就是用树莓派提供的软件装的标准的24.04的ubuntu的系统

下载的镜像可能不知道或者也就编译不了内核。
可以试试,先安装下内核头文件,具体怎么做自己搜下吧。

sudo apt update
sudo apt install -y build-essential bc bison flex libssl-dev libncurses-dev \
                    git raspberrypi-kernel-headers

sudo modprobe configs          # 确保 /proc/config.gz 存在
zcat /proc/config.gz > /tmp/config-running
uname -r                       # 例如 6.6.31-v8+
ls -d /lib/modules/$(uname -r)/build  # 应该指向 headers 目录

然后再试试在pcie_mhi 里make

另外再问一下, Quectel_Linux_PCIE_MHI_Driver_V1.3.8在 Ubuntu 24.04 6.8.0-1038-raspi是否兼容

make之后,已经不是unknown状态了, 但是在/dev下还是没有mhi的驱动. 也无法识别接口.

root@raspberrypi:/home/admin# ls -l /dev/mhi*
ls: cannot access ‘/dev/mhi*’: No such file or directory

root@raspberrypi:/home/admin# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 2c:cf:67:31:e3:cb brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
link/ether 2c:cf:67:31:e3:cc brd ff:ff:ff:ff:ff:ff

lspci -v
0000:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308
Subsystem: Qualcomm Technologies, Inc Device 5301
Flags: fast devsel
Memory at 1b00000000 (64-bit, non-prefetchable) [size=4K]
Memory at 1b00001000 (64-bit, non-prefetchable) [size=4K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/32 Maskable+ 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Secondary PCI Express
Capabilities: [168] Physical Layer 16.0 GT/s <?> Capabilities: [18c] Lane Margining at the Receiver <?>
Capabilities: [19c] Transaction Processing Hints
Capabilities: [228] Latency Tolerance Reporting
Capabilities: [230] L1 PM Substates
Capabilities: [240] Data Link Feature <?>
Kernel modules: mhi_pci_generic

这个驱动要卸载掉。及其依赖的wwan等ko.

admin@raspberrypi:~$ lsmod | grep mhi
admin@raspberrypi:~$

这个generic没有了以后, lspci都识别不出来模组了

admin@raspberrypi:~$ lspci
00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge

与mhi_pci_generic无关的。正常就算没有加载驱动,lspci 也能识别到。