How to Add Driver Support to Kernel with Menuconfig for Jetson Orin Nano [JetPack 6
Issue Overview
Users are experiencing difficulties adding driver support, specifically for a 5G module, to the kernel on a Jetson Orin Nano running JetPack 6. The main symptoms include:
- Compilation errors when building drivers that previously worked on JetPack 5
- Undefined symbols during module compilation, such as "rmnet_nss_callbacks" and "usb_cdc_wdm_register"
- Confusion about enabling necessary kernel configurations using menuconfig
- Challenges in modifying device tree configurations for custom carrier boards
The issue primarily occurs during the kernel configuration and compilation process when upgrading from JetPack 5 to JetPack 6. This problem impacts users’ ability to add new hardware support, particularly for 5G modules, and make necessary modifications for custom carrier boards.
Possible Causes
-
Kernel configuration mismatches: The default kernel configuration in JetPack 6 may not include necessary options for certain drivers.
-
Dependency issues: Some required kernel features or symbols may be disabled or not properly configured, leading to compilation errors.
-
Platform-specific configurations: Unnecessary platform support options may be enabled, causing conflicts or confusion during the build process.
-
Changes in kernel structure: The transition from embedded kernel to mainline kernel in JetPack 6 may require different approaches to kernel configuration and module building.
-
Device tree modifications: Custom carrier boards may require specific device tree changes, which can be challenging to implement correctly.
-
Misunderstanding of kernel symbol dependencies: Users may not fully grasp the relationships between various kernel symbols and their impact on compilation.
Troubleshooting Steps, Solutions & Fixes
-
Start with the correct kernel configuration:
- For JetPack 6.x/L4T R36.x, use the "defconfig" target as a starting point.
- Alternatively, copy the running kernel’s configuration from
/proc/config.gz
:cp /proc/config.gz . gunzip config.gz mv config .config
-
Set the correct CONFIG_LOCALVERSION:
- For adding modules only: Use "-tegra"
- For changing integrated features: Use a custom value like "-new"
- Edit the .config file and set
CONFIG_LOCALVERSION="=-tegra"
(for module-only changes)
-
Use menuconfig to add necessary features:
make menuconfig
- Navigate to the relevant sections and enable required features
- Menuconfig will automatically handle dependencies
-
Address specific compilation errors:
- For the "rmnet_nss_callbacks" and "usb_cdc_wdm_register" errors, check and enable the following configs:
CONFIG_USB_NET_QMI_WWAN=m CONFIG_USB_WDM=m
- For the "rmnet_nss_callbacks" and "usb_cdc_wdm_register" errors, check and enable the following configs:
-
Handle platform-specific configurations:
- Review and disable unnecessary platform support options in the kernel configuration
- For the specific issue mentioned, consider removing or modifying the following code block:
#if defined(CONFIG_PINCTRL_IPQ807x) || defined(CONFIG_PINCTRL_IPQ5018) || defined(CONFIG_PINCTRL_IPQ8074) // ... (remove or modify this block) #endif
-
Modify device tree for custom carrier boards:
- Identify the specific changes needed for your custom board (e.g., USB 2.0 companion for USB 3.0 port)
- Edit the appropriate device tree file (usually found in the
arch/arm64/boot/dts/nvidia
directory) - Recompile the device tree:
make dtbs
-
For PCIe-connected 5G modules:
- Ensure the module is recognized using
lspci
- If additional configuration is needed, add it to the appropriate PCIe section in the device tree
- Ensure the module is recognized using
-
Build the kernel and modules:
make -j$(nproc) make modules_install
-
Install the new kernel and device tree:
sudo cp arch/arm64/boot/Image /boot/Image sudo cp arch/arm64/boot/dts/nvidia/<your_board>.dtb /boot/dtb/kernel_tegra234-p3767-0000.dtb
-
If issues persist, consider removing unused symbols and features to optimize the kernel:
- Use menuconfig to disable unnecessary features
- Be cautious not to remove dependencies of required features
-
For JetPack 6 and mainline kernel adjustments:
- Expect to make more configuration changes compared to earlier JetPack versions
- Be prepared to both add and remove features as needed
-
If you encounter persistent issues, consult the Jetson developer forums or NVIDIA support for more specific guidance.
Remember to backup your original kernel and device tree files before making any changes, and always test thoroughly after modifications.