Porting device driver from T4240RDB to LS2160ARDB

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Porting device driver from T4240RDB to LS2160ARDB

跳至解决方案
812 次查看
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 项奖励
1 解答
785 次查看
yipingwang
NXP TechSupport
NXP TechSupport

pci_find_host_bridge() isn't exported for loadable modules.

 

在原帖中查看解决方案

0 项奖励
3 回复数
802 次查看
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 项奖励
791 次查看
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 项奖励
786 次查看
yipingwang
NXP TechSupport
NXP TechSupport

pci_find_host_bridge() isn't exported for loadable modules.

 

0 项奖励