I'm porting a device driver from a T4240 platform to an LS2160 platform. I'm compiling it using the(Yocto 3.1.1 - Dunfell) fsl-toolchain environment set by: /opt/fsl-qoriq/aarch64/3.1.1/environment-setup-aarch64-fsl-linux
The first issue I came across is that the source code includes <asm/pci-bridge.h> header file and such file is located in /build_lx2160ardb/tmp/work-shared/lx2160ardb/kernel-source/arch/powerpc/include/asm/pci-bridge.h
Are header files under /arch/powerpc directory still valid for LS2160 platforms? If not, which header file would provide definitions such as: pci_bus_to_host()?
The .ko module built with the header above produces errors when I load it.
Any advice?
Thanks.
Solved! Go to Solution.
Header files under /arch/powerpc directory are invalid for LX2160A platforms.
The function pci_bus_to_host is also invalid for LX2160A platforms, you could use similar function "pci_find_host_bridge" defined in include/linux/pci.h for ARM64 platforms.
Thank you for the response. It was very helpful.
I went ahead and modified the code to include <linux/pci.h> and call "pci_find_host_bridge" instead but I'm getting a linker error:
ERROR: "pci_find_host_bridge" [fsl_c29x_sec.ko] undefined!
Is that function reserved for built-in kernel modules or can it be used for loadable ones too?
Thanks.
pci_find_host_bridge() isn't exported for loadable modules.