I’m trying to build a custom kernel for my TX1, where the PCIe host controller driver is broken out as a dynamically loadable module.
Using menuconfig, I’ve set the option for NVIDIA Tegra PCIe Host Controller from <*> to (found under Bus Support from the main menu). As far as I can tell, this should compile as a module instead of being built-in.
Following the kernel compilation instructions from the NVIDIA documentation, building the zImage and dtb’s works fine, but when I try to build the kernel modules (make O=$TEGRA_KERNEL_OUT modules), I get the following error:
ERROR: "disable_scx_states" [drivers/pci/host/pci-tegra.ko] undefined!
Doing a little digging, the disable_scx_states() function is being called from drivers/pci/host/pci-tegra.c. The function is defined in the kernel sources, in drivers/platform/tegra/pm_domains.c, which appears to be properly compiled to $TEGRA_KERNEL_OUT/drivers/platform/tegra/pm_domains.o. The function (and it’s signature in header file include/linux/tegra_pm_domains.h) is contained in an #ifdef, but after a little poking around it appears the macro is defined and the code should be executed.
Is this a linking problem? I looked at the Makefile in the kernel sources and found the build rule for modules, but I’m no make expert and it’s tough to understand what’s going on. For now, I’ve been able to get around this by commenting out the offending call, but it seems like a hack. Any ideas on how to fix this?