How to build my own device driver in LSDK 21.08

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

How to build my own device driver in LSDK 21.08

Jump to solution
319 Views
vincent841
Contributor I
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 Kudos
Reply
1 Solution
280 Views
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

View solution in original post

1 Reply
281 Views
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