PCIE mode on VIM4 fails with new quectel firmware

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Please provide the version of the system here:

5.15.119 #1.6.9.1 SMP PREEMPT Thu Jun 20 09:22:43 CST 2024

(server)

Please describe your issue below:

Quectel RM520 with R03 firmware does not work in PCIE mode.
Dmesg shows the message below and the /dev/mhi_DUN etc devices are not created.

The same config works on older Quectel R01 firmware.
Quectel say the R03 works in PCIE mode on other boards.
Is there anything I can do to change the driver config to work around this error ?

Thanks.

@numbqq (perhaps?)

Post a console log of your issue below:


[   43.907416] mhi_init Quectel_Linux_PCIE_MHI_Driver_V1.3.7
[   43.908037] Failed to set up IOMMU for device 0000:01:00.0; retaining platform DMA ops
[   43.908078] mhi_pci_probe pci_dev->name = 0000:01:00.0, domain=0, bus=1, slot=0, vendor=17CB, device=0308

Any ideas here ?
It looks like the driver partially loads then fails to map the MMU.
Is there a timing problem here (power up sequence?).

If I blacklist the driver, then manually insmod it I can sometimes get it to load correctly.

I’d stick with the old firmware except that it doesn’t support e-sims correctly and the new firmware does.

Clues? Help? Please…

@numbqq

@numbqq Hi, I have sent logs to the Quectel R+D team and they say that the Khadas PCIE behaviour is wrong

  1. I have checked the logsFromModule.txt file,the log shows PCIe link training failed;
  2. The link training fail reason is the host set PCIe PERST pin to low when the host and module execute PCIe link training, below is the log:
  3. Please check host PCIe PERST pin timing, why host PCIe set PERST pin to high and then set to low;

I can send you the associated logs etc by DM if you need them.

Is there a way to change this behaviour on the PCIE driver in the 5.15 kernel ?

Thanks.
Tim.

Hello @steely-glint

Could you check with latest image 1.7.1-240930? You can install with oowow online.

Hi @numbqq I hope you had a good {short} holiday!.

I installed the 1.7.1-240930 image - exactly the same results - only /dev/mhi_BHI is present none of the other mhi_* devices. Also the same message in dmesg.

I can give you ssh access to a VIM4 with the RM520 if that helps - or I can DM you the detailed comments from Quectel.

Or let me know how I can help debug this.

Thanks.

Tim.

Not sure about this, but it works for our 5G NR module add-on RM500Q, we can’t reproduce this issue as we don’t have same module you used.

@numbqq Have you upgraded to the latest firmware on the RM500 ? It used to work on the older firmware on the RM520 then stopped working when I upgraded to get the e-sim functionality.

I will DM you the notes from Quectel.

Hello @steely-glint

We will check on our side. How you upgrade the firmeware?

@numbqq I bought a new one direct from Quectel!

(backstory:
On an older module with a damaged antenna connector I ran
QFirehose -f /mnt/sdb1/firmware
to do the upgrade with the correct firmware from Quectel.
I assumed I’d bricked it because the interfaces didn’t come up, and bought a new one.
Turns out that the upgrade was fine but it doesn’t get on with your pcie kernel driver…)

Hello @steely-glint

We have reproduced this issue with RM500 to upgrade the firmware, we will check this issue on our side.

1 Like

Hello @steely-glint

We have checked that RM500 can’t use R03 firmware so we broken the RM500 module on our side.

Are you sure your Quectel RM520 can work with R03 firmware? You bought a new module RM520 from Quectel by default? Are you sure this module is PCIe module and not USB ?

I would be surprised if you can’t re-install the R01 firmware. You may need to install the quectel serial option driver to be able to do that.
I thought that I had bricked one of our RM520s because the serial devices didn’t appear, but the device ID has changed so it isn’t recognised by the older drivers. Updating the driver restored the devices and allowed me to re-install older firmware. (This is all on the RM520 so your experience may be different)

Yes. I have 2 devices with the R03 firmware. One I have upgraded myself and one I bought from Quectel with R03 pre-installed. Both support PCIE (the /dev/mhi_BHI device exists). If I downgrade the firmware the other devices appear.

To switch to PCIE mode I use

AT+QCFG="data_interface",1,0

We are told by quectel that we can’t downgrade the firmware to R01.

We need to try to find Quectel RM520 with R03 firmware to reproduce this issue.

I can probably give you remote access to a VIM4 with an RM520. DM me if that would be useful.