Porting device driver from T4240RDB to LS2160ARDB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Porting device driver from T4240RDB to LS2160ARDB

Jump to solution
776 Views
bernardo
Contributor II

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.

 

0 Kudos
1 Solution
749 Views
yipingwang
NXP TechSupport
NXP TechSupport

pci_find_host_bridge() isn't exported for loadable modules.

 

View solution in original post

0 Kudos
3 Replies
766 Views
yipingwang
NXP TechSupport
NXP TechSupport

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.

0 Kudos
755 Views
bernardo
Contributor II

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.

0 Kudos
750 Views
yipingwang
NXP TechSupport
NXP TechSupport

pci_find_host_bridge() isn't exported for loadable modules.

 

0 Kudos