码迷,mamicode.com
首页 > 其他好文 > 详细

U-Boot--配置过程分析

时间:2014-12-20 18:08:24      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:

arm核:arm920t    2410

uboot版本:u-boot1.1.6

 

通过readme可以知道配置执行make smdk2410_config命令。

顶层Makefile :

1 smdk2410_config    :    unconfig
2     @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 NULL s3c24x0

上面将smdk2410   arm   arm920t   smdk2410   null   s3c2x0 六个参数穿个mkconfig.下面看顶层mkconfig文件:

 1 #!/bin/sh -e
 2 
 3 # Script to create header files and links to configure
 4 # U-Boot for a specific board.
 5 #
 6 # Parameters:  Target  Architecture  CPU  Board [VENDOR] [SOC]
 7 #
 8 # (C) 2002-2006 DENX Software Engineering, Wolfgang Denk <wd@denx.de>
 9 #
10 
11 APPEND=no    # Default: Create new config file
12 BOARD_NAME=""    # Name to print in make output
13 
14 while [ $# -gt 0 ] ; do          @@$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 NULL s3c24x0
15     case "$1" in             @因为上面的$(@:_config=)把smdk2410_config的_config替换为空,所以不存在_
16     --) shift ; break ;;     @所以这个循环不动作
17     -a) shift ; APPEND=yes ;;
18     -n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;      
19     *)  break ;;
20     esac
21 done
22 
23 [ "${BOARD_NAME}" ] || BOARD_NAME="$1"     @BOARD_NAME=smdk2410
24 
25 [ $# -lt 4 ] && exit 1
26 [ $# -gt 6 ] && exit 1
27 
28 echo "Configuring for ${BOARD_NAME} board..."
29 
30 #
31 # Create link to architecture specific headers
32 #
33 if [ "$SRCTREE" != "$OBJTREE" ] ; then
34     mkdir -p ${OBJTREE}/include
35     mkdir -p ${OBJTREE}/include2
36     cd ${OBJTREE}/include2
37     rm -f asm
38     ln -s ${SRCTREE}/include/asm-$2 asm
39     LNPREFIX="../../include2/asm/"
40     cd ../include
41     rm -rf asm-$2
42     rm -f asm
43     mkdir asm-$2
44     ln -s asm-$2 asm
45 else
46     cd ./include
47     rm -f asm
48     ln -s asm-$2 asm
49 fi                               @@上面是建立或者删除一些目录
50 
51 rm -f asm-$2/arch                @rm -f asm-arm/arch
52 
53 if [ -z "$6" -o "$6" = "NULL" ] ; then          @$6=s3c24x0  不为空  所以执行else
54     ln -s ${LNPREFIX}arch-$3 asm-$2/arch
55 else
56     ln -s ${LNPREFIX}arch-$6 asm-$2/arch    @LNPREFIX为空 所以相当于ln -s arch-s3c24x0 asm-arm/arch
57 fi
58 
59 if [ "$2" = "arm" ] ; then
60     rm -f asm-$2/proc
61     ln -s ${LNPREFIX}proc-armv asm-$2/proc
62 fi
63 
64 #
65 # Create include file for Make
66 #
67 echo "ARCH   = $2" >  config.mk
68 echo "CPU    = $3" >> config.mk
69 echo "BOARD  = $4" >> config.mk
70 
71 [ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk
72 
73 [ "$6" ] && [ "$6" != "NULL" ] && echo "SOC    = $6" >> config.mk
74 
75 #
76 # Create board specific header file
77 #
78 if [ "$APPEND" = "yes" ]    # Append to existing config file
79 then                @APPEND维持原值,所以config.h被重建
80     echo >> config.h
81 else
82     > config.h        # Create new config file
83 fi
84 echo "/* Automatically generated - do not edit */" >>config.h
85 echo "#include <configs/$1.h>" >>config.h
86 
87 exit 0

这样在执行make smdk2410_config后,在include下面主要添改了四个文件(夹)分别是config.h,   config.mk,   asm-arm/ ,  asm/

其中config.h全部内容如下:

#include<configs/smdk2410.h>

其中config.mk文件内容如下四行

ARCH           =arm

CPU             =arm920t

BOARD        =smdk2410

SOC            =s3c24x0

 

 

由此总结执行make  smdk2410_config配置的结果:

1》开发板名称BOARD_NAME=$1

2》建立asm-arm/ ,  asm/和指向到链接

3》创建config.h,定向到开发板smdk2410.h

4》创建config.mk  

 

 

注意config/下的头文件(包含smdk2410.h)等有两种

1》选项   前缀是CONFIG_

2》参数   前缀是CFG_

 

U-Boot--配置过程分析

标签:

原文地址:http://www.cnblogs.com/hulig7/p/4175687.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!