After downloading the uboot source code from the Internet, you need to modify the source code accordingly to support your own development board. After changing the source code, you need to configure uboot (make
1. Simple analysis of u-boot-1.1.6/Makefile
2. Detailed analysis of u-boot-1.1.6/mkconfig
3. Summarize what happens after executing the make 100ask24x0_config command
1. Simple analysis of u-boot-1.1.6/Makefile. The simplest rules of Makefile are as follows (extracted from the blog https://blog.csdn.net/haoel/article/details/2886)
target ... : prerequisites ...
command
...
...
target is a target file, which can be an object file or an executable file. It can also be a label.
(Label), the label feature will be described in the subsequent "pseudo target" chapter.
Prerequisites are the files or targets required to generate the target.
command is the command that make needs to execute. (Any Shell command)
Added rules to support jz2440 development board in u-boot-1.1.6/Makefile. This rule first executes the dependency unconfig to clear the files left by the previous configuration; then executes the mkconfig script with mkconfig 100ask24x0 arm arm920t 100ask24x0 NULL s3c24x0.
a. @ before a command means that only the result will be displayed instead of the command itself.
b. $(bar) means referencing the variable bao.
c. The replacement rule is that we can replace the common part of the variable. Its format is "$(var:a=b)" or "${var:a=b}", which means,
Replace all occurrences of "a" in the variable "var" that "end with" a" with the string "b". Here "ends with"
It is "space" or "terminator".
MKCONFIG := $(SRCTREE)/mkconfig
SRCTREE := $(CURDIR) //CURDIR represents the current directory
100ask24x0_config: unconfig
@$(MKCONFIG) $(@:_config=) arm arm920t 100ask24x0 NULL s3c24x0
//$(@:_config=) is the replacement rule that changes 100ask24x0_config to 100ask24x0, where @ represents 100ask24x0_config
//The final command is translated into /work/system/u-boot-1.1.6/mkconfig 100ask24x0 arm arm920t 100ask24x0 NULL s3c24x0,
//Execute the mkconfig script with 6 parameters
100ask24x0_config depends on unconfig, which performs the following steps to delete some things that may be left over from previous configurations.
unconfig:
@rm -f $(obj)include/config.h $(obj)include/config.mk //If the command executed by Makefile is preceded by the @ symbol, the command itself will not be displayed but only the result
$(obj)board/*/config.tmp $(obj)board/*/*/config.tmp //$(obj) indicates the obj variable, and the actual obj is empty
2. Detailed analysis of the u-boot-1.1.6/mkconfig script
Some basic concepts of shell scripts: $0 represents the script file; $1 represents the first parameter; $2 represents the second parameter, and so on; $# represents the number of parameters that follow.
mkconfig 100ask24x0 arm arm920t 100ask24x0 NULL s3c24x0
$0 $1 $2 $3 $4 $5 $6
The script is annotated in detail as follows, excerpted from the blog https://www.cnblogs.com/mylinux/p/5549386.html
vi mkconfig
{
# Parameters: Target Architecture CPU Board [VENDOR] [SOC]
Determine the name of the development board:
{
23 [ "${BOARD_NAME}" ] || BOARD_NAME="$1"
}
Create links to header files related to the platform/development board. The purpose of establishing the connection is to use the same Makefile. After the connection is established, the Makefile has the same name, but in fact it can correspond to different files through configuration.
{
46 cd ./include
47 rm -f asm
48 ln -s asm-$2 asm //Create a soft link ./include/asm to ./include/asm-arm
51 rm -f asm-$2/arch
56 ln -s ${LNPREFIX}arch-$6 asm-$2/arch //Create a soft link ./include/asm-arm/arch to ./include/asm-arm/arch-arm920t
60 rm -f asm-$2/proc
61 ln -s ${LNPREFIX}proc-armv asm-$2/proc //Establish a soft link ./include/asm/arm/proc-armv to ./include/asm-arm/proc
}
Create include/config.mk for Make, and finally determine the variables ARCH=arm;CPU=arm920t;BOARD=100ask24x0;SOC=s3c2440 for the top-level Makefile to call
{
67 echo "ARCH = $2" > config.mk
68 echo "CPU = $3" >> config.mk
69 echo "BOARD = $4" >> config.mk
71 [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
73 [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC = $6" >> config.mk
}
Create the header file include/config.h related to the development board. Include the ./include/configs/100ask24x0.h file. Many configurations of uboot need to change this file.
{
85 echo "#include
}
}
3. Summarize what happens after executing the make 100ask24x0_config command
a. Create a link to the platform/development board //Establish a soft link. Eventually, the main Makefile will call the soft link and finally locate the file
1) Create a soft link ./include/asm to ./include/asm-arm
2) Create a soft link ./include/asm-arm/arch to ./include/asm-arm/arch-arm920t
3) Establish a soft link ./include/asm/arm/proc-armv to connect to ./include/asm-arm/proc
b. Create the include file include/config.mk for Make, and finally determine the variables ARCH=arm;CPU=arm920t;BOARD=100ask24x0;SOC=s3c2440 for the top-level Makefile to call as variables.
c. Create the header file include/config.h related to the development board. The final uboot code will include ./inculde/configs/100ask24x0.h. This file is very important, and many uboot configurations are implemented in this file.
Previous article:Analysis of the execution process of make all in u-boot
Next article:Analysis of start.S of ARM920T in u-boot
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Ghost video sound
- Wire Harness Tester Related Operation & Application Video (Continuously Updated)
- About CPLD
- TMS320C66x dual loop and multiple loop optimization summary
- 【TI recommended course】#TI millimeter wave radar technology introduction#
- Design of multi-channel signal generator based on FPGA+PWM
- 【micropython】STM32 will support arbitrary FS
- Global variables in embedded system programming
- PWM generated voltage calculation table
- Help, I need to exchange an E coin, I still need one