Confused about L4T kernel source organization (source/public/kernel/nvidia)

We’ve been trying to bring up Orin running on a custom carrier board. We’re having various issues with PCI Express, but that’s a whole separate topic. During this process, I’ve repeatedly rebuilt the kernel, dtbs, and modules, and reflashed my Orin, following these instructions

That works fine – but looking through the kernel sources in Linux_for_Tegra has left me a bit confused. The Linux kernel is in source/public/kernel/kernel-5.10. Some important dts files are in source/public/hardware/nvidia. But there’s a whole subdirectory of drivers and such in source/public/kernel/nvidia/ that seems to be unused in the kernel build.

For example, there’s source/public/kernel/nvidia/drivers/pci/host/pcie-tegra-dw.c and source/public/kernel/nvidia/drivers/pci/dwc/pcie-tegra.c as well as some other code related to PCI express on tegra. As far as I can tell, these files aren’t used at all when you run

What is the role of the sources in that directory? How do they relate to the “regular” kernel sources in kernel-5.10?

hello user56916,

kernel/kernel-5.10 for standard k-5.10 kernel sources.
kernel/nvidia/for nvidia specific drivers, such as camera drivers.

you may see-also Makefile for the detail kernel version,
for example,


Trivia: Some content will be built using relative directory paths with “.” meaning current directory, and “..” meaning parent directory. If you see “out of tree” content configured from within the kernel source, then the result would mean seeing enough “../../../something” that it actually descends out of the kernel “$TOP”, and into one of those other subdirectories. Not all configured code would do this, but in some configurations you’ll see that relative path descend below the actual kernel source, and then reascend into the nvidia or bootloader directory. Similar if you build bootloader code where it might look at headers in the kernel source.

Thanks – but what about drivers that are in both places?

Specifically, right now, I’m trying to force a PCIE RP configuration to be gen 1 at startup. I found docs on nvidia,max-speed and nvidia,init-speed, but it looks like only the code in source/public/kernel/nvidia/drivers/pci/dwc/pcie-tegra.c uses those, and that code isn’t being built.

The driver code that seems to be running (source/public/kernel/kernel-5.10/drivers/pci/controller/dwc/pcie-tegra194.c doesn’t read that setting from the dtb.

“nvidia,max-speed” is legacy, not used anymore. Only max-link-speed would take effect.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.