How to build my own device driver in LSDK 21.08

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

How to build my own device driver in LSDK 21.08

跳至解决方案
829 次查看
vincent841
Contributor II
I built bootloaders and the linux kernel using flex-builder in LSDK 21.08 on LS1046A target board. And I need to implement a separate PCI device driver on this board, so I am setting up a driver build environment.
 
My simple makefile is configured as follows:

obj-m := testdrv.o
KDIR := /home/jinwon/nxp-dev/flexbuild_lsdk2108_github/components/linux/linux
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
 
When I perform the build, I encounter the following error:

***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g., "make oldconfig" or
*** "make menuconfig" or "make xconfig").

Fixing the above error causes problems with builds using the flex-builder.

I would appreciate it if you could let me know the general method for building a custom device driver in LSDK 21.08 or any pages for reference.

Or should I create a separate development environment by obtaining a separate kernel, apart from the LSDK build environment? Thanks in advance.
0 项奖励
回复
1 解答
790 次查看
June_Lu
NXP TechSupport
NXP TechSupport

Configuring and building the Linux kernel is controlled by the Kbuild subsystem. You can find documents describing the internal of Kbuild subsystem under the Documentation/kbuild/ folder in the Linux source code tree if you are adding new files or new configure options to the kernel.

INSTALLPATH/flexbuild_lsdk2108_github/components/linux/linux/Documentation/kbuild

More details for LSDK please refer to LSDK21.08, Chapter 7

在原帖中查看解决方案

1 回复
791 次查看
June_Lu
NXP TechSupport
NXP TechSupport

Configuring and building the Linux kernel is controlled by the Kbuild subsystem. You can find documents describing the internal of Kbuild subsystem under the Documentation/kbuild/ folder in the Linux source code tree if you are adding new files or new configure options to the kernel.

INSTALLPATH/flexbuild_lsdk2108_github/components/linux/linux/Documentation/kbuild

More details for LSDK please refer to LSDK21.08, Chapter 7