How to add a driver in lsdk1909

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

How to add a driver in lsdk1909

Jump to solution
1,873 Views
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 

Labels (1)
0 Kudos
1 Solution
1,746 Views
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

View solution in original post

0 Kudos
2 Replies
1,747 Views
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 Kudos
1,746 Views
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 Kudos