Driver Request For EM120

I need em120r-gl driver on ubuntu, i can see Modem device via lspci but it returns " error : couldn’t find modem" when typing " mmcli -v -m 0" command and no related devices found on /dev(such as /dev/mhi* or /dev/ttyUSB*)

I guess you need a standard mhi_pci_generic driver for Linux and probably some other standard drivers like mhi_wwan_mbim.

not sure, pls sent it to me and then would try that

also need for PCIE drivers like this: Quectel_Linux_PCIE_MHI_Driver_Vx.xx.x.zip

All you need are standard Linux drivers, if you don’t know how to load them - ask in Ubuntu forum.

After some troubleshooting, the standard drivers didn’t work. and still need quectel to provide those drivers, especially for MHI, thoes links seems dead

What is your kernel version?

the current kernel version is 6.8.0

EM-120 is supported by the standard Linux PCI driver in 6.8:

I suggest you run dmesg | grep pci and see if you have any errors.

It’s also worth checking with lspci -v

I have told you that standard drivers never works(parts of at lease), the PCI hardware shows up, but MHI device is missing, guess driver problems(note Quectel_Linux_PCIE_MHI_Driver)

This does not mean anything. You need to provide something more technical if you’re looking for help.

# lspci | grep -i modem

Quectel Wireless Solutions Co., Ltd. EM120 LTE Modem

and then

# ls /dev/mhi*
ls: cannot access '/dev/mhi*': No such file or directory

old MHI driver is not compatible for current kernel, thats why i need latest driver:

./include/linux/init.h:184:22: error: passing argument 1 of ‘class_create’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  184 | #define THIS_MODULE (&__this_module)
      |                     ~^~~~~~~~~~~~~~~
      |                      |
      |                      struct module *

./include/linux/device/class.h:228:54: note: expected ‘const char *’ but argument is of type ‘struct module *’
  228 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~

I’ve been trying to get this working on Linux.

Should there be an AT interface? I have all obvious drivers loaded.
Only able to communicate with the module via qmicli and mbimcli

  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/3
           |               device id: a5e10aece25ff56a9be3df57fe3cbb55fc8fdf0d
  -----------------------------------
  Hardware |            manufacturer: generic
           |                   model: EM120R_GL
           |       firmware revision: EM120RGLAPR02A07M4G
           |          carrier config: ROW_Commercial
           | carrier config revision: 08010809
           |            h/w revision: EM120R_GL
           |               supported: lte
           |                 current: lte
           |            equipment id: 015930000026865
  -----------------------------------
  System   |                  device: /sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0
           |                 physdev: /sys/devices/platform/soc/11280000.pcie/pci0003:00/0003:00:00.0/0003:01:00.0
           |                 drivers: mhi-pci-generic, mhi_net
           |                  plugin: generic
           |            primary port: wwan0mbim0
           |                   ports: mhi_hwip0 (net), mhi_swip0 (net), wwan0mbim0 (mbim), 
           |                          wwan0qcdm0 (ignored)

Missing mhi_wwan_ctrl driver?

@jfrog

It’s included in the build. Is there something else I need to include?

root@OpenWrt:~# lsmod | grep mhi
mhi                    61440  4 mhi_wwan_mbim,mhi_wwan_ctrl,mhi_pci_generic,mhi_net
mhi_net                12288  0 
mhi_pci_generic        16384  0 
mhi_wwan_ctrl          12288  0 
mhi_wwan_mbim          12288  0 
wwan                   20480  6 mhi_wwan_mbim,mhi_wwan_ctrl

I don’t think so, @baadaye. Do you have any MHI related errors in dmesg output?

No errors as far as I can tell.
I had to try a patch on the mhi driver to get the module detected without a power up error.

[  140.853048] mhi-pci-generic 0003:01:00.0: save config 0x00: 0x10011eac
[  140.859575] mhi-pci-generic 0003:01:00.0: save config 0x04: 0x00100402
[  140.866101] mhi-pci-generic 0003:01:00.0: save config 0x08: 0xff000000
[  140.872622] mhi-pci-generic 0003:01:00.0: save config 0x0c: 0x00000000
[  140.879138] mhi-pci-generic 0003:01:00.0: save config 0x10: 0x20200004
[  140.885658] mhi-pci-generic 0003:01:00.0: save config 0x14: 0x00000000
[  140.892177] mhi-pci-generic 0003:01:00.0: save config 0x18: 0x20201004
[  140.898693] mhi-pci-generic 0003:01:00.0: save config 0x1c: 0x00000000
[  140.905212] mhi-pci-generic 0003:01:00.0: save config 0x20: 0x00000000
[  140.911730] mhi-pci-generic 0003:01:00.0: save config 0x24: 0x00000000
[  140.918245] mhi-pci-generic 0003:01:00.0: save config 0x28: 0x00000000
[  140.924764] mhi-pci-generic 0003:01:00.0: save config 0x2c: 0x20011eac
[  140.931285] mhi-pci-generic 0003:01:00.0: save config 0x30: 0x00000000
[  140.937808] mhi-pci-generic 0003:01:00.0: save config 0x34: 0x00000040
[  140.944327] mhi-pci-generic 0003:01:00.0: save config 0x38: 0x00000000
[  140.950842] mhi-pci-generic 0003:01:00.0: save config 0x3c: 0x00000000
[  140.957410] mhi-pci-generic 0003:01:00.0: PME# enabled
[  158.579562] mhi-pci-generic 0003:01:00.0: PME# disabled
[  158.584852] mhi-pci-generic 0003:01:00.0: enabling bus mastering

my situation is different:
my modem is unstable, it’s showing up sometime, but still miss USB or MHI devices

           |                 drivers: mhi-pci-generic
           |                  plugin: quectel
           |            primary port: wwan0mbim0
           |                   ports: wwan0 (net), wwan0at0 (at), wwan0mbim0 (mbim), 
           |                          wwan0qcdm0 (ignored)

Do you have any ttyUSBx or mhi_xxx device?

and it will be auto failed sometime, log as follow:

ERROR LINE -> [   31.886496] mhi mhi0: Did not enter M0 state, MHI state: M3, PM state: M3->M0
ERROR LINE -> [   31.886515] mhi-pci-generic 0000:xx:00.0: failed to resume device: -5
WARN:[   31.886537] mhi-pci-generic 0000:xx:00.0: device recovery started
WARN:[   31.886567] mhi_wwan_mbim: probe of mhi0_IP_HW0_MBIM failed with error -5
WARN:[   31.886597] mhi_wwan_ctrl: probe of mhi0_DIAG failed with error -5
WARN:[   31.886685] mhi_wwan_ctrl: probe of mhi0_MBIM failed with error -5
WARN:[   31.886705] mhi_wwan_ctrl: probe of mhi0_DUN failed with error -5
[   31.949688] mhi-pci-generic 0000:xx:00.0: reset
WARN:[  107.664490] mhi-pci-generic 0000:xx:00.0: not ready 65535ms after bus reset; giving up
ERROR LINE -> [  107.729419] mhi-pci-generic 0000:xx:00.0: reset failed
ERROR LINE -> [  107.729423] mhi-pci-generic 0000:xx:00.0: Recovery failed

or like this:

mhi-pci-generic: Unable to change power state from D3hot to D0, device inaccessible
mhi-pci-generic: not ready 8191ms after bus reset; waiting
mhi-pci-generic: not ready 16383ms after bus reset; waiting
mhi-pci-generic: not ready 32767ms after bus reset; waiting
mhi-pci-generic: not ready 65535ms after bus reset; giving up
mhi-pci-generic: reset failed
mhi-pci-generic: Recovery failed