How to add a driver in lsdk1909

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

How to add a driver in lsdk1909

跳至解决方案
2,483 次查看
kai_wu
Contributor III

Hi,

I am going to add a driver in lsdk1909 linux reporostory(under this directory   .../flexbuild_lsdk1909_update_221019_5.2-rc3/packages/linux/linux/drivers). I put the driver folder under a specific folder already, I modified the corresponding Kconfig and Makefile, use configuration fragments to enable this module already. 

When I compiled this kernel,  the driver is compiled successfully, I can see the ko file, I installed it onto the target board, But when I tried to modprobe the driver, there is no response at all and the return value is 0. I tried to rmmod it and morprobe it again, same, no response and output. I added the printk debug information in to the driver source code and recompiled it. I got the same result, the printk info is not printed at al.    

It seems that the driver is not loaded at all. Do I need to do extra steps to add the driver for lsdk1909??

Thank you

Kai 

标签 (1)
标记 (4)
0 项奖励
回复
1 解答
2,356 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Kai Wu,

Please refer to fsl_ppfe Kernel module as example.

After run "flex-builder -c linux -a arm64" to get Linux Kernel source in packages/linux/linux.

Add fsl_ppfe Kernel driver folder in drivers/staging/, add the following in drivers/staging/Makefile.

obj-$(CONFIG_FSL_PPFE)          += fsl_ppfe/

Go to Linux Kernel build foler build/linux/linux/arm64/LS/output/LSDK-19.09-V4.19, configure CONFIG_FSL_PPFE

Please execute the following commands, 

make ARCH=arm64 menuconfig

and configure Linux Kernel module as the following

[*]   Freescale PPFE Drive

Run "flex-builder -c linux -a arm64" to rebuild Linux Kernel with Kernel module compiled.

You will find Linux Kernel image in build/linux/linux/arm64/LS/Image and Kernel module in 

build/linux/linux/arm64/LS/lib/modules/4.19.68-dirty/kernel/drivers/staging/fsl_ppfe/pfe.ko

Boot up the target board with build/linux/linux/arm64/LS/Image copy pfe.ko to the target board and execute the following command.

insmod pfe.ko

Thanks,

Yiping

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,357 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Kai Wu,

Please refer to fsl_ppfe Kernel module as example.

After run "flex-builder -c linux -a arm64" to get Linux Kernel source in packages/linux/linux.

Add fsl_ppfe Kernel driver folder in drivers/staging/, add the following in drivers/staging/Makefile.

obj-$(CONFIG_FSL_PPFE)          += fsl_ppfe/

Go to Linux Kernel build foler build/linux/linux/arm64/LS/output/LSDK-19.09-V4.19, configure CONFIG_FSL_PPFE

Please execute the following commands, 

make ARCH=arm64 menuconfig

and configure Linux Kernel module as the following

[*]   Freescale PPFE Drive

Run "flex-builder -c linux -a arm64" to rebuild Linux Kernel with Kernel module compiled.

You will find Linux Kernel image in build/linux/linux/arm64/LS/Image and Kernel module in 

build/linux/linux/arm64/LS/lib/modules/4.19.68-dirty/kernel/drivers/staging/fsl_ppfe/pfe.ko

Boot up the target board with build/linux/linux/arm64/LS/Image copy pfe.ko to the target board and execute the following command.

insmod pfe.ko

Thanks,

Yiping

0 项奖励
回复
2,356 次查看
kai_wu
Contributor III

Hi yipingwang‌    

Thanks for your reply, I followed these steps and also modified the device tree to include the PFE node, I loaded the compiled Linux 5.4 on LS1012ardb and the ping works.    

0 项奖励
回复