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.
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
Run the shell script, and the compilation result is shown in the following figure.
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.
Next, 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.
After 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:
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.
board file
Next, enter board/freescale, copy and modify mx6ullevk to mx6ull_qhy_emmc
rename the .c file
Modify the .c file to mx6ull_qhy_emmc.c
Modify makefile
Modify obj-y to mx6ull_qhy_emmc.o
Modify the imximage.cfg configuration file
Modify the original file path of line 34 to your own file path
Modify Kconfig
The same modification Kconfig file configuration. First row, fourth row, tenth row.
Modify the MAINTAINERS file
Modify the path and header file of the folder to
add the header file
Go to the include/configs folder, copy the mx6ullevk.h file and rename it. and modify the conditional compilation file
Modify U-Boot GUI configuration file
Enter the /arch/arm/cpu/armv7/mx6 folder to modify Kconfig
207 to add your own board information.
Add the following path on the last line:
Compile UBoot
Then you can use the shell script to compile the Uboot file.
The result is as follows:
a lot of header files are referenced. Indicates that the transplant was successful.
Modify LCD driver
Open the board/freescale/mx6ull_qhy_emmc/mx6ull_qhy_emmc.c file and
modify it as follows:
Modify the mx6ull_qhy_emmc.h file
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:
Add pin definition
Add pin definitions in mx6ull_qhy_emmc.c and block many useless codes.
Add reset pin definition
Add reset pin macro definitions in fec_pads1[] and fec_pad2[].
Add initialization code
Add reset network code:
open driver/net/phy/phy.c and add the following code:
At this point, the network driver modification is completed, uboot is recompiled, and the SD card is programmed, and the development board is restarted.
On the serial terminal, the network is normal.
Modify the name of the development board
Save, compile, and download in the board/freescale/mx6ull_qhy_emmc.c file , you can see that the board name has also been modified.