NXP official Linux kernel compilation

1. Introduction to Linux kernel transplantation

The Linux source code provided by NXP can definitely run on its own I.MX6ULL EVK development board. Therefore, we must use the I.MX6ULL EVK development board as a reference and then transplant the Linux kernel to the I.MX6U-ALPHA development board. Up.

Here is a test to see whether the Linux kernel or device tree of the I.MX6ULL EVK officially provided by NXP can be run on the Zhengdian Atom development board.

The premise is: the hardware configuration is the same. That is DDR. For example, the DDR of the development board used by NXP officially is 512MB. Then, the DDR capacity of the development board used here must also be 512MB.

2. Linux kernel transplantation

NXP official Linux kernel source code:

/[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

The uboot and Linux source code packages in the above directory are the uboot and Linux officially provided by NXP.

1. Configure and compile the Linux kernel

(1) First, transfer the Linux source code package officially provided by NXP to the ubuntu system and decompress it.

Use the following command to decompress the Linux source package:

tar -xvf linux-imx-rel_imx_4.1.15_2.1.0_ga.tar.bz2 

(2) Secondly, write the configuration compilation command. Write a shell script here to write configuration and compilation commands into the script file.

Note: You must configure the Linux kernel before compiling the Linux kernel. Each board has its corresponding default configuration file. These default configuration files are saved in arch/arm/configs :

Both imx_v7_defconfig and imx_v7_mfg_defconfig can be used as the default configuration files used by the I.MX6ULL EVK development board. However, it is recommended to use the default configuration file imx_v7_mfg_defconfig . First of all, this configuration file supports the I.MX6UL chip by default , and the important point is that the zImage compiled from this file can be programmed through the MfgTool tool officially provided by NXP ! !

Enter the root directory of the Linux kernel source code and create a shell script file named imx6ull_evk_nand.sh. The above configuration file will be written into the configuration commands here.

Here's how to do it:

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

The imx6ull_evk_nand.sh file command is as follows:

#!/bin/sh

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- imx_v7_mfg_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- all

Change the imx6ull_evk_nand.sh script execution permissions:

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

(3) Finally, compile the Linux kernel.

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/arch/arm/boot/dts$ ./imx6ull_evk_nand.sh

After the Linux kernel is compiled, the zImage image file will be generated in the arch/arm/boot directory . If a device tree is used, the .dtb ( device tree ) file corresponding to the development board will also be generated in the arch/arm/boot/dts directory.
For example, imx6ull-14x14-evk.dtb is the device tree file corresponding to NXP 's official I.MX6ULL EVK development board.
So far we have two files:
①  Linux kernel image file: zImage .
②  The device tree file corresponding to the NXP official I.MX6ULL EVK development board: imx6ull-14x14-evk.dtb .

The next article verifies whether the zImage and device tree files can successfully start the development board.

Guess you like

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