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