Hi.
I’m trying to statically add to the kernel two different drivers for 4G and 5G modems.
Previously I had merged the driver code with already existing drivers but since it could lead to future errors and headaches, I decided to install both standalone drivers, statically, I.e. in tree.
After compiling the kernel and flashing a TX2, I do not see the drivers in /lib/modules/$(uname -r)/modules.builtin
.
The steps that I’m taking are as follows:
Inside $DEVDIR/sources/kernel/kernel4-9/drivers/net/usb
I’ve added two files, one for each driver. I will attatch both implementation files.
sim8200_wwan.c (16.8 KB)
sim7500_sim7600_wwan-noprobewarning.c (7.2 KB)
Inside the makefile, in the same directory, I added both drivers to the CONFIG_USB_NET object (which in the config file is set to ‘y’, therefore assigning them as statically built modules). So that line the makefile looks like this:
obj-$(CONFIG_USB_USBNET) += usbnet.o sim7500_sim7600_wwan-noprobewarning.o sim8200_wwan.o
Following the instructions provided by simcom, the driver option
is also set to be built statically, in the config file. Changes to option driver included adding the usb devices to the device table.
#define SIMCOM_VENDOR_ID 0x1E0E
#define SIMCOM_SIM7600_PID 0x9001
#define SIMCOM_SIM8200_PID 0x9002
( ... )
{ USB_DEVICE(SIMCOM_VENDOR_ID, SIMCOM_SIM7600_PID)}, /* SIM7600 */
{ USB_DEVICE(SIMCOM_VENDOR_ID, SIMCOM_SIM8200_PID),
.driver_info = RSVD(5) | RSVD(6)}, /* SIM8200 */
{ USB_DEVICE_INTERFACE_CLASS(SIMCOM_VENDOR_ID, 0x9011, 0xff), /* Simcom SIM8200 RNDIS mode, Reserved the interface for ADB */
.driver_info = RSVD(7) },
After compiling, in the $KERNEL_OUT
directory, I can see the driver exists in modules.builtin
but not in modules.order
(not sure if it’s necessary though). Either way, I will link these modules files inside the compiled $KERNEL_OUT
directory:
modules.order (26.9 KB)
modules.builtin (21.9 KB)
Module.symvers (831.8 KB)
I copied the generated Image and dtbs and flashed the TX2 with sudo ./flash.sh jetson-xavier-nx-devkit-tx2-nx mmcblk0p1
When flashed, inside the TX2, the drivers don’t seem to exist. They don’t show up in modules.builtin (which is what I would expect). Despite this dmesg
does show:
[...] usbcore: registered new interface driver qmi_wwan_simcom7600
[...] usbcore: registered new interface driver qmi_wwan_simcom8200
So I don’t really know what to conclude from this. I would expect the drivers to show up in modules.builtin and be able run modinfo for each.
Also. when we boot the jetson with both modems connected (sim7600 and sim8200), and using lsusb, we see that they both show up with the same ID 9001 (that you can see is defined for the sim7600 modem, in the option driver). I understand that there’s something called udev rules
which maps drivers to the devices, as far as I understand, but have no idea on how to work with it.
So I’m not sure if the drivers are statically built, because they don’t show up in modules.builtin (and I can’t modinfo them), but then both show up with one driver ID which confuses me, is it actually installed? What what happened to the other driver?
Hopefully I’m not being too confusing. Can anyone point something I’m doing / interpreting wrong?
Thank you.