TQ210——S5PV210 uboot top-level mkconfig analysis

Publisher:咖啡狐狸Latest update time:2020-12-17 Source: eefocusKeywords:TQ210 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#################################################################################################

# Common internal parameters of SHELL:  

# $# - the total number of arguments passed to the program

# $? —— The exit situation of the previous code or shell program in the shell. If it exits normally, it returns 0, otherwise it returns a non-zero value.

# $* - A string consisting of all the arguments passed to the program.

# $n —— represents the number of parameters, $1 represents the first parameter, $2 represents the second parameter... 

# $0 - the name of the current program

# $@ - save all parameters in the form of "parameter 1" "parameter 2" ...

# $$ —— The (process ID number) PID of this program

# $! —— PID of the previous command 

# Here is some more explanation about $?, which can be used as additional shell knowledge

# Remember: $? always represents the exit status of the last shell command. When the function is executed, if other commands are executed

# command, then $? no longer indicates the status after the function is executed, but indicates the exit status of other commands.

#-a means (and) both conditions are true at the same time

# -eq means two values ​​are equal

# -gt means n1 is greater than n2, that is, the front is greater than the back

# -lt means n1 is less than n2, that is, the former is less than the latter

# "(" ")" is the escape of parentheses, which are converted into ordinary parentheses "()" to wrap the conditional expression

# The expression in if[...] means: If the number of parameters passed to mkconfig ($#) is equal to 2 and the first variable is

# "-A"($1), an error message will be displayed. What are $0, $1, $2,...? Let's see how the pseudo target make TQ210_config is executed in Makefile.

###########################################################################

# Specify the interpreter, using -e is equivalent to #!/bin/bash

#!/bin/sh -e

 

# Script to create header files and links to configure

# U-Boot for a specific board.

#

# Parameters:  Target  Architecture  CPU  Board [VENDOR] [SOC]

#

# (C) 2002-2006 DENX Software Engineering, Wolfgang Denk

#

############################################################################

# Create a new configuration file by default

# When executing make TQ210_config, print out the board name TQ210

APPEND=no # Default: Create new config file

BOARD_NAME="" # Name to print in make output

 

# Some internal parameters of SHELL are described at the beginning, and no more will be said later!

############################################################################

# When executing make TQ210_config, this process will call the mkconfig file in the uboot root directory.

# There will be 6 parameters passed in, as follows

#   $0        $1     $2   $3 $4       $5    $6 $# 

# mkconfig TQ210    arm s5pv210 TQ210 samsung s5pv210 6

#         BOARD_NAME   ARCH   CPU BOARD VENDOR   SOC

# $# -gt 0 means execution when $# is not 0. Obviously, it will not be executed here.

# The effect of shift is to make $1=$2, $2=$3, $3=$4..., and the original $1 will be lost. Therefore, the effect of the while loop is,

# Process the options passed to the mkconfig script in sequence (--, -a, -n, -t, *). Since we did not pass any options to mkconfig,

# items, so the code in the while loop has no effect.

while [ $# -gt 0 ] ; do

case "$1" in

--) shift ; break ;;

-a) shift ; APPEND=yes ;;

-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;

*)  break ;;

esac

done

 

###########################################################################

# If BOARD_NAME is empty, do nothing; otherwise, assign it to $1, i.e. TQ210

# This sentence assigns BOARD_NAME = TQ210

[ "${BOARD_NAME}" ] || BOARD_NAME="$1"

###########################################################################

# Check the number of variables passed in, if less than 4 then exit, if more than 6 then also exit

[ $# -lt 4 ] && exit 1

[ $# -gt 6 ] && exit 1

 

###########################################################################

# The shell prints "Configuring for TQ210 board..."

echo "Configuring for ${BOARD_NAME} board..."

 

#

# Create link to architecture specific headers

#

###########################################################################

# If the source top-level directory (SRCTREE) and the directory storing the compiled files (OBJTREE) are different,

# The directory (OBJTREE) where the compiled files are stored creates two files include and include2

# Enter the include2 directory and delete the asm folder

# Create a soft link asm, link to ${SRCTREE}/include/asm-arm

# Then go to the parent directory of the current directory and enter the include folder

# Delete asm-arm and asm folders

# Create an asm-arm folder in the current directory and create a soft link asm pointing to asm-arm

if [ "$SRCTREE" != "$OBJTREE" ] ; then

mkdir -p ${OBJTREE}/include

mkdir -p ${OBJTREE}/include2

cd ${OBJTREE}/include2

rm -f asm

ln -s ${SRCTREE}/include/asm-$2 asm

LNPREFIX="../../include2/asm/"

cd ../include

rm -rf asm-$2

rm -f asm

mkdir asm-$2

ln -s asm-$2 asm

###########################################################################

# If the source top-level directory (SRCTREE) is the same as the directory storing the compiled files (OBJTREE),

# Enter the include directory, delete the asm directory, and create a soft link asm pointing to asm-arm in the current directory

else

cd ./include

rm -f asm

ln -s asm-$2 asm

be

 

###########################################################################

# Delete asm-arm/arch. Establishing a soft link actually operates on the target of the link.

rm -f asm-$2/arch

 

###########################################################################

#

if [ -z "$6" -o "$6" = "NULL" ] ; then

ln -s ${LNPREFIX}arch-$3 asm-$2/arch

else

ln -s ${LNPREFIX}arch-$6 asm-$2/arch

be

 

# create link for s3c24xx SoC

if [ "$3" = "s3c24xx" ] ; then

rm -f regs.h

ln -s $6.h regs.h

rm -f asm-$2/arch

ln -s arch-$3 asm-$2/arch

be

 

# create link for s3c64xx SoC

if [ "$3" = "s3c64xx" ] ; then

rm -f regs.h

ln -s $6.h regs.h

rm -f asm-$2/arch

ln -s arch-$3 asm-$2/arch

be

 

# create link for s5pc1xx SoC

if [ "$3" = "s5pc1xx" ] ; then

        rm -f regs.h

        ln -s $6.h regs.h

        rm -f asm-$2/arch

        ln -s arch-$3 asm-$2/arch

be

 

# create link for s5pc11x SoC

if [ "$3" = "s5pc11x" ] ; then

        rm -f regs.h

        ln -s $6.h regs.h

        rm -f asm-$2/arch

        ln -s arch-$3 asm-$2/arch

be

 

# create link for s5pv210 SoC

########################################################

# TQ210 uses s5pv210, so this code will be executed

# Delete the regs.h file,

# Create a link file regs.h pointing to s5pv210.h

# Delete asm-arm/arch,

# Create a soft link asm-arm/arch pointing to arch-s5pv210

if [ "$3" = "s5pv210" ] ; then

        rm -f regs.h

        ln -s $6.h regs.h

        rm -f asm-$2/arch

        ln -s arch-$3 asm-$2/arch

be

 

# create link for s5p64xx SoC

if [ "$3" = "s5p64xx" ] ; then

rm -f regs.h

ln -s $6.h regs.h

rm -f asm-$2/arch

ln -s arch-$3 asm-$2/arch

be

 

# create link for s5p644x SoC

if [ "$3" = "s5p644x" ] ; then

rm -f regs.h

ln -s $6.h regs.h

rm -f asm-$2/arch

ln -s arch-$3 asm-$2/arch

be

 

###########################################################################

# If the architecture is arm architecture, delete the current directory (the current directory is the top-level directory of U-boot source code/include)

# Create a soft link in the asm-arm/proc directory ln -s proc-armv asm-arm/proc

if [ "$2" = "arm" ] ; then

rm -f asm-$2/proc

ln -s ${LNPREFIX}proc-armv asm-$2/proc

be

 

# create link for s3c64xx-mp SoC

if [ "$3" = "s3c64xx-mp" ] ; then

rm -f regs.h

ln -s $6.h regs.h

rm -f asm-$2/arch

ln -s arch-$3 asm-$2/arch

be

 

#

# Create include file for Make

#

###########################################################################

# Generate make header file config.mk

# ARCH=arm,CPU=s5pv210,BOARD=TQ210, add to config.h

# > config.mk is forcibly overwritten to create config.mk and then import the data into config.mk

# Add VENDOR=samsung,SOC=s5pv210 to config.mk

echo "ARCH   = $2" >  config.mk

echo "CPU    = $3" >> config.mk

echo "BOARD  = $4" >> config.mk

 

[ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk

 

[ "$6" ] && [ "$6" != "NULL" ] && echo "SOC    = $6" >> config.mk

 

#

# Create board specific header file

#

###################################################################

# Create the specified configuration header file, default APPEND=no (there is an assignment at the beginning of this file)

# Execute else and create a new config.h file

if [ "$APPEND" = "yes" ] # Append to existing config file

then

echo >> config.h

else

> config.h # Create new config file

be

###################################################################

# In config it will show /* Automatically generated - do not edit */

# #include Add to config.h

echo "/* Automatically generated - do not edit */" >>config.h

echo "#include " >>config.h

 

# Return success status

exit 0


Keywords:TQ210 Reference address:TQ210——S5PV210 uboot top-level mkconfig analysis

Previous article:TQ210——S5PV210 uboot top-level config.mk analysis
Next article:TQ210 —— S5PV210 uboot top-level Makefile analysis

Recommended ReadingLatest update time:2024-11-16 11:53

ARM-Linux S5PV210 UART driver (3) ----Serial port core layer, key structures, interface relationships
Although a specific UART device driver can be designed according to the design method of tty driver, that is, defining tty_driver and implementing the member functions of tty_operations, Linux has implemented a general tty driver layer for UART devices in the file serial_core.c, called the serial port core layer. In
[Microcontroller]
ARM-Linux S5PV210 UART driver (3) ----Serial port core layer, key structures, interface relationships
S5PV210 SD card boot practice 1~2
Study notes for "Teacher Zhu's Internet of Things Lecture" Study address: www.zhulaoshi.org   The bin program to be burned is larger than 16kb. bl1 16kb, The part after 16kb is bl2. Copy bl2 from sd card to a specific location in ddr and jump to execute bl2.   BL1 needs to do the following: turn off the watchdog, set
[Microcontroller]
S5PV210 SD card boot practice 1~2
S5PV210 (TQ210) study notes - 8-bit HWECC and YAFFS2 OOB layout
Recently, I re-debugged the 8-bit HWECC and found that the 8-bit HWECC of S5PV210 can indeed be used. However, problems still occur when using the yaffs2 file system. This is due to the conflict between the oob layout of the yaffs2 file system and the mtd layer. When we use 8-bit HWECC, 52 bytes of ECC check data wi
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号