Skip to contentSkip to conversation

bus: mhi: host: pci_generic: add support for Quectel RM520N-GL 0x5201 variant

PATCH In review Petr Štetiar 3 participants 4 messages May 12, 2025 – Aug 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus: mhi: host: pci_generic: add support for Quectel RM520N-GL 0x5201 variant

From: Chris Webb <[email protected]>

I have a router board with a Quectel RM520N-GL 5G module that speaks either USB or PCIe. When switched to PCIe mode, the modem present itself on PCI bus with following IDs:

0003:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device [17cb:0308]
Subsystem: Qualcomm Technologies, Inc Device [17cb:5201]

and is currently being wrongly detected by the kernel as:

mhi-pci-generic 0000:01:00.0: MHI PCI device found: qcom-sdx65m

which results into wrong modem configuration and thus missing wwanX netdev. So lets fix it by adding a new device entry for this 0x5201 variant.

Fixes 1cad976a1be9 ("bus: mhi: host: pci_generic: Add support for Quectel RM520N-GL modem")
---
 drivers/bus/mhi/host/pci_generic.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/bus/mhi/host/pci_generic.c +3 -0
index 03aa88795209..0db9543a7edc 100644
@@ -818,6 +818,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn980_hw_v1_info },
 	{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0306),
 		.driver_data = (kernel_ulong_t) &mhi_qcom_sdx55_info },
+	/* RM520N-GL variant with Qualcomm vendor and subvendor ID */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_QCOM, 0x5201),
+		.driver_data = (kernel_ulong_t) &mhi_quectel_rm5xx_info },
 	/* Telit FN990 */
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2010),
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
#1 lore raw

Hi, gentle ping :-) Thanks! Cheers, Petr

Petr Štetiar <[email protected]> [2025-05-12 11:26:31]:

Quoted 38 lines

From: Chris Webb <[email protected]>

I have a router board with a Quectel RM520N-GL 5G module that speaks either USB or PCIe. When switched to PCIe mode, the modem present itself on PCI bus with following IDs:

0003:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device [17cb:0308]
Subsystem: Qualcomm Technologies, Inc Device [17cb:5201]

and is currently being wrongly detected by the kernel as:

mhi-pci-generic 0000:01:00.0: MHI PCI device found: qcom-sdx65m

which results into wrong modem configuration and thus missing wwanX netdev. So lets fix it by adding a new device entry for this 0x5201 variant.

Fixes 1cad976a1be9 ("bus: mhi: host: pci_generic: Add support for Quectel RM520N-GL modem")
---
 drivers/bus/mhi/host/pci_generic.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/bus/mhi/host/pci_generic.c +3 -0
index 03aa88795209..0db9543a7edc 100644
@@ -818,6 +818,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn980_hw_v1_info },
 	{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0306),
 		.driver_data = (kernel_ulong_t) &mhi_qcom_sdx55_info },
+	/* RM520N-GL variant with Qualcomm vendor and subvendor ID */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_QCOM, 0x5201),
+		.driver_data = (kernel_ulong_t) &mhi_quectel_rm5xx_info },
 	/* Telit FN990 */
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2010),
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
Signature · 1 line
ynezz
#2 lore raw
Quoted 20 lines · Petr Štetiar

Hi, gentle ping :-) Thanks! Cheers, Petr

Petr Štetiar <[email protected]> [2025-05-12 11:26:31]:

Quoted 16 lines

From: Chris Webb <[email protected]>

I have a router board with a Quectel RM520N-GL 5G module that speaks either USB or PCIe. When switched to PCIe mode, the modem present itself on PCI bus with following IDs:

0003:01:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device [17cb:0308]
Subsystem: Qualcomm Technologies, Inc Device [17cb:5201]

and is currently being wrongly detected by the kernel as:

mhi-pci-generic 0000:01:00.0: MHI PCI device found: qcom-sdx65m

which results into wrong modem configuration and thus missing wwanX netdev. So lets fix it by adding a new device entry for this 0x5201 variant.

All Quectel modems have the vendor ID of 0x1eac. But here, both Vendor and Sub-vendor IDs are QCOM. This usually happens if the modem doesn't properly reset and we end up seeing the default QCOM IDs and not the ones programmed by the vendor. Or the vendor deliberately didn't program the Vendor ID for some reason.

We saw a similar issue with another Quectel modem [1], but we didn't get any response from Quectel (Duke Xin). I believe both are related.

But unfortunately, we cannot use 'mhi_quectel_rm5xx_info' for these IDs as the IDs belong to QCOM and the config belongs to Quectel.

@Duke Xin: Could you please let us know why the Quectel modems are using the QCOM Vendor IDs?

- Mani

[1] https://lore.kernel.org/mhi/CAHCJQqFdDRz7ZyxoeDd1FLu-yjCCHy=Y1Sq2wMDFFH12G1625Q@mail.gmail.com

Quoted 25 lines
Quoted 22 lines
Fixes 1cad976a1be9 ("bus: mhi: host: pci_generic: Add support for Quectel RM520N-GL modem")
---
 drivers/bus/mhi/host/pci_generic.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/bus/mhi/host/pci_generic.c +3 -0
index 03aa88795209..0db9543a7edc 100644
@@ -818,6 +818,9 @@ static const struct pci_device_id mhi_pci_id_table[] = {
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn980_hw_v1_info },
 	{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0306),
 		.driver_data = (kernel_ulong_t) &mhi_qcom_sdx55_info },
+	/* RM520N-GL variant with Qualcomm vendor and subvendor ID */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_QCOM, 0x5201),
+		.driver_data = (kernel_ulong_t) &mhi_quectel_rm5xx_info },
 	/* Telit FN990 */
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2010),
 		.driver_data = (kernel_ulong_t) &mhi_telit_fn990_info },
Signature · 1 line
ynezz
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw
Quoted 2 lines · Manivannan Sadhasivam

@Duke Xin: Could you please let us know why the Quectel modems are using the QCOM Vendor IDs?

In particular, I wonder if there's a way to reconfigure the modem to permanently set the correct IDs so it doesn't need a patch at all? That would be a nicer fix than adding to the giant list of variants.

PS While the tiny diff here is mine, the commit message isn't, so it probably should be attributed as From: Petr rather than From: me. But this doesn't matter if my hack is not correct anyway! ;-)

Best wishes,

Chris.