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
已解决! 转到解答。
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
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