How to add a driver in lsdk1909

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to add a driver in lsdk1909

ソリューションへジャンプ
2,520件の閲覧回数
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,393件の閲覧回数
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,394件の閲覧回数
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,393件の閲覧回数
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 件の賞賛
返信