Add ALPHA development board to NXP official website Linux kernel

1. Linux kernel transplantation

 After studying and verifying in previous articles, the Linux kernel officially provided by NXP can start the development board. Therefore, we refer to the settings of the I.MX6ULL EVK development board and add the punctual atomic I.MX6U-ALPHA development board to the Linux kernel.

The previous article verified whether the official NXP Linux kernel is bootable. The address is as follows:

NXP official Linux kernel compilation-CSDN blog

NXP official Linux kernel startup test-CSDN Blog

2.    Add ALPHA development board to Linux

The Linux kernel source code used here: NXP official Linux kernel source code. The directory is as follows:

/[Punctual Atom] Alpha Linux Development Board (A Disk)-Basic Information-2022 /[Punctual Atom] Alpha Linux Development Board (A Disk)-Basic Information/Routine Source Code/NXP Official Original Uboot and Linux

To add your own development board in Linux, there are roughly three parts. as follows:

(1) Add the development board default configuration file

(2) Add the device tree file corresponding to the development board

(3) Change the Makefile in the directory where the device tree is located, specifically add the device tree file corresponding to the compiled development board.

 

1. Add the development board default configuration file

Copy imx_v7_mfg_defconfig in the arch/arm/configs directory and name it imx_v7_alientek_nand_defconfig. The command is as follows:

wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga$ cd ./arch/arm/configs/

wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga/arch/arm/configs$ cp imx_v7_mfg_defconfig imx_v7_alientek_nand_defconfig

From now on, imx_v7_alientek_nand_defconfig will be the default configuration file for the Nand-Flash version of Atomic's development board.

2. Add the device tree file corresponding to the development board

Add the device tree file suitable for the Zhengdian Atomic EMMC version development board, enter the directory arch/arm/boot/dts , copy a copy of imx6ull-14x14-evk.dts , and then rename it to imx6ull-alientek-nand.dts , command as follows:

wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga$ cd ./arch/arm/boot/dts

wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga/arch/arm/boot/dts$ cp imx6ull-14x14-evk.dts imx6ull-alientek-nand.dts

Note: .dts is the device tree source code file, which will be compiled into a .dtb file when compiling Linux .

3. Change the Makefile in the directory where the device tree is located

After imx6ull-alientek-nand.dts is created, we still need to modify the file arch/arm/boot/dts/Makefile , find the " dtb- $(CONFIG_SOC_IMX6ULL) " configuration item, and add " imx6ull-alientek-nand. dtb ” as shown below:

Note: When adding the line "imx6ull-alientek-nand.dtb \", there cannot be a space after "\", otherwise a compilation error will occur.

4. Change the running script file imx6ull_evk_nand.sh in the Linux source code root directory.

To specifically change the configuration file name in the script (because we copied a new configuration file and renamed it earlier), the operation is as follows:

wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga$ gedit imx6ull_evk_nand.sh

Change as follows:

3. Compile the Linux kernel

Enter the Linux source code root directory and run the imx6ull_evk_nand.sh script to compile:

wangtian@wangtian-virtual-machine:~/zhengdian_Linux/linux/kernel/linux-imx-rel_imx_4.1.15_2.1.0_ga$ ./imx6ull_evk_nand.sh

Finally, after the compilation is successful, the Linux kernel file zImage and device tree file are generated. Then download these two files to the development board for verification. Whether the Linux kernel can boot successfully.

If the compilation is successful, you will get two files here:

① Linux kernel image file: ./arm/arm/boot/zImage.

② The device tree file corresponding to the ALPHA development board: ./arch/arm/boot/dts/imx6ull-alientek-nand.dtb.

Guess you like

Origin blog.csdn.net/wojiaxiaohuang2014/article/details/133307349