RM505Q-AE and Linux 22.04

Hi
I have problem with installation RM505Q-AE into my Linux device. I don’t understand why it is not listed with command lsusb. My goal is to integrate it with modem manager. Here i have some logs:
awlodarczyk@ubuntu:/sys/bus/usb/drivers$ sudo dmesg | grep mhi
[ 2.298686] mhi-pci-generic 0000:2c:00.0: BAR 0: assigned [mem 0x82401000-0x82401fff 64bit]
[ 2.310501] mhi-pci-generic 0000:2c:00.0: enabling device (0000 → 0002)
[ 2.320947] mhi mhi0: Requested to power ON
[ 2.323509] mhi mhi0: Power on setup success

awlodarczyk@ubuntu:/sys/class/net$ ls
eth0 eth1 lo mhi_hwip0 wlan0

awlodarczyk@ubuntu:/sys/bus/usb/drivers$ lspci
00:00.0 Host bridge: Intel Corporation Device 9a12 (rev 01)
00:02.0 VGA compatible controller: Intel Corporation Device 9a40 (rev 01)
00:04.0 Signal processing controller: Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant (rev 01)
00:05.0 Multimedia controller: Intel Corporation Device 9a19 (rev 01)
00:07.0 PCI bridge: Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #0 (rev 01)
00:08.0 System peripheral: Intel Corporation GNA Scoring Accelerator module (rev 01)
00:0a.0 Signal processing controller: Intel Corporation Tigerlake Telemetry Aggregator Driver (rev 01)
00:0d.0 USB controller: Intel Corporation Tiger Lake-LP Thunderbolt 4 USB Controller (rev 01)
00:0d.2 USB controller: Intel Corporation Tiger Lake-LP Thunderbolt 4 NHI #0 (rev 01)
00:12.0 Serial controller: Intel Corporation Tiger Lake-LP Integrated Sensor Hub (rev 20)
00:14.0 USB controller: Intel Corporation Tiger Lake-LP USB 3.2 Gen 2x1 xHCI Host Controller (rev 20)
00:14.2 RAM memory: Intel Corporation Tiger Lake-LP Shared SRAM (rev 20)
00:15.0 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #0 (rev 20)
00:15.1 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #1 (rev 20)
00:15.2 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #2 (rev 20)
00:15.3 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #3 (rev 20)
00:16.0 Communication controller: Intel Corporation Tiger Lake-LP Management Engine Interface (rev 20)
00:19.0 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #4 (rev 20)
00:19.1 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO I2C Controller #5 (rev 20)
00:1c.0 PCI bridge: Intel Corporation Device a0bb (rev 20)
00:1c.7 PCI bridge: Intel Corporation Tiger Lake-LP PCI Express Root Port #8 (rev 20)
00:1d.0 PCI bridge: Intel Corporation Tiger Lake-LP PCI Express Root Port #9 (rev 20)
00:1e.0 Communication controller: Intel Corporation Tiger Lake-LP Serial IO UART Controller #0 (rev 20)
00:1e.3 Serial bus controller: Intel Corporation Tiger Lake-LP Serial IO SPI Controller #1 (rev 20)
00:1f.0 ISA bridge: Intel Corporation Device a087 (rev 20)
00:1f.3 Multimedia audio controller: Intel Corporation Tiger Lake-LP Smart Sound Technology Audio Controller (rev 20)
00:1f.4 SMBus: Intel Corporation Tiger Lake-LP SMBus Controller (rev 20)
00:1f.5 Serial bus controller: Intel Corporation Tiger Lake-LP SPI Controller (rev 20)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (13) I219-LM (rev 20)
2c:00.0 Unassigned class [ff00]: Qualcomm Device 0306
2d:00.0 Network controller: Intel Corporation Wi-Fi 6 AX210/AX211/AX411 160MHz (rev 1a)
2e:00.0 Non-Volatile memory controller: Phison Electronics Corporation PS5013 E13 NVMe Controller (rev 01)

awlodarczyk@ubuntu:/sys/bus/usb/drivers$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 010: ID 13d3:5275 IMC Networks Integrated_Webcam_FHD
Bus 003 Device 008: ID 8087:0032 Intel Corp. AX210 Bluetooth
Bus 003 Device 005: ID 0424:2517 Microchip Technology, Inc. (formerly SMSC) Hub
Bus 003 Device 003: ID 03f0:354a HP, Inc Slim Keyboard
Bus 003 Device 007: ID 03f0:046b HP, Inc HP USB-C Dock G5
Bus 003 Device 012: ID 05e0:1200 Symbol Technologies Bar Code Scanner
Bus 003 Device 011: ID 03f0:0941 HP, Inc X500 Optical Mouse
Bus 003 Device 009: ID 04f2:3f41 Chicony Electronics Co., Ltd HP Wired Desktop 320K Keyboard
Bus 003 Device 006: ID 03f0:086b HP, Inc USB2734
Bus 003 Device 004: ID 03f0:056b HP, Inc USB Audio
Bus 003 Device 002: ID 03f0:036b HP, Inc HP USB-C Dock G5
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter
Bus 002 Device 003: ID 03f0:076b HP, Inc USB5734
Bus 002 Device 002: ID 03f0:066b HP, Inc HP USB-C Dock G5
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
awlodarczyk@ubuntu:/sys/bus/usb/drivers$

awlodarczyk@ubuntu:/sys/bus/usb/drivers$ ls /dev/
acpi_thermal_rel i2c-0 shm ttyS1
autofs i2c-1 snapshot ttyS10
block i2c-10 snd ttyS11
btrfs-control i2c-11 stderr ttyS12
bus i2c-12 stdin ttyS13
char i2c-13 stdout ttyS14
console i2c-14 tpm0 ttyS15
core i2c-15 tpmrm0 ttyS16
cpu i2c-16 tty ttyS17
cpu_dma_latency i2c-17 tty0 ttyS18
cuse i2c-18 tty1 ttyS19
disk i2c-19 tty10 ttyS2
dm-0 i2c-2 tty11 ttyS20
dm-1 i2c-20 tty12 ttyS21
dma_heap i2c-21 tty13 ttyS22
dri i2c-3 tty14 ttyS23
drm_dp_aux0 i2c-4 tty15 ttyS24
drm_dp_aux1 i2c-5 tty16 ttyS25
drm_dp_aux2 i2c-6 tty17 ttyS26
drm_dp_aux3 i2c-7 tty18 ttyS27
drm_dp_aux4 i2c-8 tty19 ttyS28
drm_dp_aux5 i2c-9 tty2 ttyS29
ecryptfs iio:device0 tty20 ttyS3
fb0 iio:device1 tty21 ttyS30
fd iio:device10 tty22 ttyS31
full iio:device2 tty23 ttyS4
fuse iio:device3 tty24 ttyS5
gpiochip0 iio:device4 tty25 ttyS6
hidraw0 iio:device5 tty26 ttyS7
hidraw1 iio:device6 tty27 ttyS8
hidraw2 iio:device7 tty28 ttyS9
hidraw3 iio:device8 tty29 ubuntu-vg
hidraw4 iio:device9 tty3 udmabuf
hidraw5 initctl tty30 uhid
hidraw6 input tty31 uinput
hidraw7 kmsg tty32 urandom
hidraw8 kvm tty33 usb
HID-SENSOR-2000e1.12.auto log tty34 userio
HID-SENSOR-2000e1.13.auto loop0 tty35 v4l
HID-SENSOR-2000e1.14.auto loop1 tty36 vcs
HID-SENSOR-2000e1.15.auto loop2 tty37 vcs1
HID-SENSOR-2000e1.16.auto loop3 tty38 vcs2
HID-SENSOR-2000e1.17.auto loop4 tty39 vcs3
HID-SENSOR-2000e1.19.auto loop5 tty4 vcs4
HID-SENSOR-2000e1.20.auto loop6 tty40 vcs5
HID-SENSOR-2000e1.21.auto loop7 tty41 vcs6
HID-SENSOR-2000e1.22.auto loop-control tty42 vcsa
HID-SENSOR-2000e1.23.auto mapper tty43 vcsa1
HID-SENSOR-2000e1.24.auto mcelog tty44 vcsa2
HID-SENSOR-2000e1.25.auto media0 tty45 vcsa3
HID-SENSOR-2000e1.26.auto media1 tty46 vcsa4
HID-SENSOR-2000e1.28.auto mei0 tty47 vcsa5
HID-SENSOR-2000e1.29.auto mem tty48 vcsa6
HID-SENSOR-2000e1.2.auto mqueue tty49 vcsu
HID-SENSOR-2000e1.30.auto mtd0 tty5 vcsu1
HID-SENSOR-2000e1.31.auto mtd0ro tty50 vcsu2
HID-SENSOR-2000e1.32.auto net tty51 vcsu3
HID-SENSOR-2000e1.34.auto ng0n1 tty52 vcsu4
HID-SENSOR-2000e1.35.auto null tty53 vcsu5
HID-SENSOR-2000e1.37.auto nvme0 tty54 vcsu6
HID-SENSOR-2000e1.38.auto nvme0n1 tty55 vfio
HID-SENSOR-2000e1.39.auto nvme0n1p1 tty56 vga_arbiter
HID-SENSOR-2000e1.3.auto nvme0n1p2 tty57 vhci
HID-SENSOR-2000e1.40.auto nvme0n1p3 tty58 vhost-net
HID-SENSOR-2000e1.41.auto nvram tty59 vhost-vsock
HID-SENSOR-2000e1.43.auto port tty6 video0
HID-SENSOR-2000e1.47.auto ppp tty60 video1
HID-SENSOR-2000e1.4.auto psaux tty61 video2
HID-SENSOR-2000e1.5.auto ptmx tty62 video3
HID-SENSOR-2000e1.6.auto ptp0 tty63 wwan0mbim0
HID-SENSOR-2000e1.8.auto pts tty7 wwan0qcdm0
HID-SENSOR-2000e1.9.auto random tty8 wwan0qmi0
hpet rfkill tty9 zero
hugepages rtc ttyprintk zfs
hwrng rtc0 ttyS0
awlodarczyk@ubuntu:/sys/bus/usb/drivers$

Thanks in advance for your support!

  • When i am compiling qmi_wwan_q.c i got this errors:
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1176:21: warning: passing argument 1 of ‘__builtin_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    1176 | memcpy (qmap_net->dev_addr, real_dev->dev_addr, ETH_ALEN);
    | ^~
    ./include/linux/fortify-string.h:379:27: note: in definition of macro ‘__fortify_memcpy_chk’
    379 | _underlying##op(p, q, __fortify_size);
    | ^
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1176:5: note: in expansion of macro ‘memcpy’
    1176 | memcpy (qmap_net->dev_addr, real_dev->dev_addr, ETH_ALEN);
    | ^~~~~~
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1176:21: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
    1176 | memcpy (qmap_net->dev_addr, real_dev->dev_addr, ETH_ALEN);
    | ^~
    ./include/linux/fortify-string.h:379:27: note: in definition of macro ‘__fortify_memcpy_chk’
    379 | _underlying##op(p, q, __fortify_size);
    | ^
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1176:5: note: in expansion of macro ‘memcpy’
    1176 | memcpy (qmap_net->dev_addr, real_dev->dev_addr, ETH_ALEN);
    | ^~~~~~
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c: In function ‘qmi_wwan_bind’:
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1893:39: error: assignment of read-only location ‘dev->net->dev_addr’
    1893 | dev->net->dev_addr[0] |= 0x02; /
    set local assignment bit */
    | ^~
    /home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1894:39: error: assignment of read-only location ‘dev->net->dev_addr’
    1894 | dev->net->dev_addr[0] &= 0xbf; /
    clear “IP” bit */

Dear Customer,

As described
2c:00.0 Unassigned class [ff00]: Qualcomm Device 0306
Please check whether you have set the RM505Q to pcie mode.

If the modem works in PCIe EP mode, please compile the pcie_mhi but not the qmi_wwan_q.

The gcc on Ubuntu 22.04 is over 11 and it is high so you failed to compile the qmi_wwan_q.

error: assignment of read-only location ‘<em>dev->net->dev_addr’
1893 | dev->net->dev_addr[0] |= 0x02; /</em> set local assignment bit */
| ^~
/home/awlodarczyk/qmi_wwan_q/qmi_wwan_q.c:1894:39: error: assignment of read-only location ‘<em>dev->net->dev_addr’
1894 | dev->net->dev_addr[0] &= 0xbf; /</em> clear “IP” bit */

We could use memcpy instead of the operators.