I.MX6ULL study notes (2) - uboot transplantation

The development board used is the Punctual Atomic I.MX6ULL Alpha Development Board. Here, the entire uboot process is experienced by transplanting the official uboot of NXP, mainly by modifying the official related configuration files and file names to their own names.
First, send the official NXP uboot to ubuntu, decompress the file, rename the decompressed folder, and generate the folder as follows.
insert image description here
Use the cd command to enter the uboot folder. First, you can compile the official uboot and do a verification.

shell script

Create a new shell script. Enter the following.

 #!/bin/bash
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihfmx6ull_14x14_evk_emmc_defconfig
 make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 

Use command to give shell script executable permission

chmod 777 mx6ull_qhy_emmc.sh

insert image description here
Run the shell script, and the compilation result is shown in the following figure.
insert image description here

Modify the makefile

Since the first line of the shell command clears the files generated by compilation, if you modify the kernel and execute the shell script again, the content you set will be cleared. Therefore, after modifying the kernel, you cannot use the cleanup command. To recompile, you can only execute the last two commands. You can block the first command in the shell script, or you can directly enter make in the terminal to compile, but when you enter, repeatedly Requires input specifying system architecture ARCH and compiler CROSS_COMPILE values. For convenience, it can be added to MakeFile.
insert image description hereNext, you can use the make command to compile.

Use your own shell script

Copy the shell script, after renaming it, modify the contents as shown below. The main modification here is deconfig, in preparation for adding your own files later.
insert image description hereAfter the modification is completed, save and exit.

Copy the default configuration file

Copy mx6ull_14x14_evk_emmc_deconfig from the configs folder and rename it to mx6ull_qhy_emmc_deconfig, as shown in the following figure:

insert image description here

Modify the configuration file

Mainly modify the first and fourth lines of the file path, and modify them to the files that you want to configure later.

insert image description here

board file

Next, enter board/freescale, copy and modify mx6ullevk to mx6ull_qhy_emmc

insert image description here

rename the .c file

Modify the .c file to mx6ull_qhy_emmc.c
insert image description here

Modify makefile

Modify obj-y to mx6ull_qhy_emmc.o
insert image description here

Modify the imximage.cfg configuration file

Modify the original file path of line 34 to your own file path
insert image description here

Modify Kconfig

The same modification Kconfig file configuration. First row, fourth row, tenth row.
insert image description here

Modify the MAINTAINERS file

Modify the path and header file of the folder to
insert image description here
add the header file

Go to the include/configs folder, copy the mx6ullevk.h file and rename it. and modify the conditional compilation file
insert image description here

Modify U-Boot GUI configuration file

Enter the /arch/arm/cpu/armv7/mx6 folder to modify Kconfig
207 to add your own board information.
insert image description here
Add the following path on the last line:
insert image description here

Compile UBoot

Then you can use the shell script to compile the Uboot file.
insert image description here
The result is as follows:
insert image description here
a lot of header files are referenced. Indicates that the transplant was successful.
insert image description here

Modify LCD driver

Open the board/freescale/mx6ull_qhy_emmc/mx6ull_qhy_emmc.c file and
modify it as follows:
insert image description here
Modify the mx6ull_qhy_emmc.h file
insert image description here

Modify the network driver

It mainly includes three points:
1. Initialization of ENETx reset pin
2. Device ID of LAN8720A
3. Drive of LAN8720 The
modification results are as follows:
insert image description here

Add pin definition

Add pin definitions in mx6ull_qhy_emmc.c and block many useless codes.
insert image description here

Add reset pin definition

Add reset pin macro definitions in fec_pads1[] and fec_pad2[].
insert image description here

Add initialization code

Add reset network code:
insert image description here
open driver/net/phy/phy.c and add the following code:
insert image description here

At this point, the network driver modification is completed, uboot is recompiled, and the SD card is programmed, and the development board is restarted.
insert image description here
On the serial terminal, the network is normal.

Modify the name of the development board


insert image description here
Save, compile, and download in the board/freescale/mx6ull_qhy_emmc.c file , you can see that the board name has also been modified.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324132023&siteId=291194637