/*****************************************************************************                     I.MX6 U-Boot mkconfig hacking* 声明:*     本文主要是为了知道U-Boot中的mkconfig是如何工作的,是如何将配置* 中的内容进行汇总,同时又将这些内容放在了什么地方。**                                       2015-12-19 深圳 南山区平山村 曾剑锋***************************************************************************/\\\\\\\\\-*- 目录 -*-//|  一、参考文档:|  二、Makefile|  三、mkconfig|  四、include/config.h|  五、include/config.mk------------------------------一、参考文档:1. $(@:_config=)什么意思?http://blog.csdn.net/zbffff/article/details/189911452. U-BOOT Makefile注释http://wenku.baidu.com/view/ff14f319227916888486d7cb.html3. makefile中的@http://www.cnblogs.com/lihaiping/archive/2013/03/20/makefile.html4. Makefile中常用的函数http://linux.chinaunix.net/techdoc/develop/2009/07/09/1122854.shtml5. U-Boot移植(二)——U-Boot编译过程分析(2)http://blog.csdn.net/wafx1314/article/details/112600416. 请教linux make make clean make all 的具体用法http://zhidao.baidu.com/question/129692720.html

二、Makefile......SRCTREE    := $(CURDIR)    ......    MKCONFIG   := $(SRCTREE)/mkconfig    export MKCONFIG......mx6solo_sabresd_config            \mx6solo_sabresd_mfg_config        \mx6solo_sabresd_android_config        \mx6dl_sabresd_config            \mx6dl_sabresd_mfg_config        \mx6dl_sabresd_android_config            \mx6q_sabresd_config            \mx6q_sabresd_android_config             \mx6q_sabresd_mfg_config            \mx6q_sabresd_iram_config    : unconfig@[ -z "$(findstring iram_,$@)" ] || \{ echo "TEXT_BASE = 0x00907000" >$(obj)board/freescale/mx6q_sabresd/config.tmp ; \echo "... with iram configuration" ; \}@$(MKCONFIG) $(@:_config=) arm arm_cortexa8 mx6q_sabresd freescale mx6......三、mkconfig#!/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 <wd@denx.de>#APPEND=no    # Default: Create new config file# 开发板的名字BOARD_NAME=""    # Name to print in make output# 使用while循环和case进行命令行参数提取,很不错的处理方式while [ $# -gt 0 ] ; docase "$1" in--) shift ; break ;;-a) shift ; APPEND=yes ;;-n) shift ; BOARD_NAME="${1%%_config}" ; shift ;;   # %%去除$1字符串中的_config*)  break ;;esacdone# 如果上面的命令行参数都没有,那么$1就是开发板的名字[ "${BOARD_NAME}" ] || BOARD_NAME="$1"# 参数个数小于4个或者大于6个,直接退出,比较奇怪的是,为什么不放在前面进行判断呢[ $# -lt 4 ] && exit 1[ $# -gt 6 ] && exit 1# 显示提示信息echo "Configuring for ${BOARD_NAME} board..."## Create link to architecture specific headers## 如果编译出来的目录和源代码目录不一样,那么执行以下内容if [ "$SRCTREE" != "$OBJTREE" ] ; thenmkdir -p ${OBJTREE}/include         # 创建include目录mkdir -p ${OBJTREE}/include2        # 创建include2目录cd ${OBJTREE}/include2              # 进入include2目录rm -f asm                           # 防止asm已经存在ln -s ${SRCTREE}/include/asm-$2 asm # 重新软链接到固定的位置$2(arm)平台LNPREFIX="../../include2/asm/"       cd ../includerm -rf asm-$2rm -f asmmkdir asm-$2ln -s asm-$2 asmelsecd ./includerm -f asmln -s asm-$2 asm        # $2=armfi# 删除include/asm-arm/arch这个软链接rm -f asm-$2/arch# $6等于mx6if [ -z "$6" -o "$6" = "NULL" ] ; thenln -s ${LNPREFIX}arch-$3 asm-$2/archelseln -s ${LNPREFIX}arch-$6 asm-$2/archfiif [ "$2" = "arm" ] ; thenrm -f asm-$2/procln -s ${LNPREFIX}proc-armv asm-$2/procfi## Create include file for Make#echo "ARCH   = $2" >  config.mk     # $2=armecho "CPU    = $3" >> config.mk     # $3=arm_cortexa8echo "BOARD  = $4" >> config.mk     # $4=mx6q_sabresd# $5=freescale[ "$5" ] && [ "$5" != "NULL" ] && echo "VENDOR = $5" >> config.mk# $6=mx6[ "$6" ] && [ "$6" != "NULL" ] && echo "SOC    = $6" >> config.mk## Create board specific header file# APPEND=noif [ "$APPEND" = "yes" ]    # Append to existing config filethenecho >> config.helse> config.h        # Create new config filefi# 原来我们可以在在这个文件里查看config文件echo "/* Automatically generated - do not edit */" >>config.h# $1=mx6dl_sabresd_androidecho "#include <configs/$1.h>" >>config.hecho "#include <asm/config.h>" >>config.hexit 0四、include/config.h/* Automatically generated - do not edit */#include <configs/mx6dl_sabresd_android.h>#include <asm/config.h>五、include/config.mkARCH   = armCPU    = arm_cortexa8BOARD  = mx6q_sabresdVENDOR = freescaleSOC    = mx6六、总结:从上面的情况可知,如果要在board目录下新建一个开发板<board_name>目录,则在include/configs目录下也要建立一个对应的<board_name>文件,里面存放的就是开发板<board_name>的配置信息。这里目前没有验证。

转载于:https://www.cnblogs.com/zengjfgit/p/5058754.html

I.MX6 U-Boot mkconfig hacking相关推荐

  1. I.MX6 Power off register hacking

    /************************************************************************ I.MX6 Power off register h ...

  2. java VM argument_java vm args

    这个问题主要还是由这个问题 java.lang.OutOfMemoryError: Java heap space 引起的.第一次出现这样的的问题以后,引发了其他的问题.在网上一查可能是JAVA的堆栈 ...

  3. I.MX6 bq27441 driver hacking

    /************************************************************************** I.MX6 bq27441 driver hac ...

  4. I.MX6 ar1020 SPI device driver hacking

    /************************************************************************************* I.MX6 ar1020 ...

  5. I.MX6 GPS JNI HAL register init hacking

    /************************************************************************************ * I.MX6 GPS JN ...

  6. I.MX6 boot from Micro SD

    /****************************************************************************** I.MX6 boot from Micr ...

  7. I.MX6 mkuserimg.sh hacking

    /************************************************************************ I.MX6 mkuserimg.sh hacking ...

  8. I.MX6 Linux Serial Baud Rate hacking

    /********************************************************************************* I.MX6 Linux Seria ...

  9. I.MX6 gpio-keys driver hacking

    /***************************************************************************** I.MX6 gpio-keys drive ...

最新文章

  1. Oracle 10g OCP认证资料(官方教材与考试题库)下载
  2. 第二十七篇、使用MVVM布局页面
  3. 阿里摩酷实验室计算机视觉团队校园招聘
  4. 练习图200例图纸讲解_实物图+电气图纸讲解:教你学会看配电系统图,不收藏,可惜了...
  5. Docker部署Redis容器
  6. Centos7快速安装docker
  7. 计算机报名中的照片审核总不过,软考报名时,照片审核难通过怎么办?
  8. 卧槽!AI 质检竟然还能这么玩???
  9. 【渝粤题库】陕西师范大学201901 中国古代文学(二) 作业(高起专)
  10. isolation cell、levelshifter
  11. 腾讯课堂视频回放下载(Edge浏览器+猫抓+夸克浏览器)
  12. 举个栗子~Tableau 技巧(208):使用“显示/隐藏”按钮,快速切换图表
  13. 修改window本地hosts文件,修改域名指向
  14. [读书总结]大数据时代
  15. 通道(channel)
  16. 微PE工具箱v1.0 维护版本64位(0913)
  17. Vue星级评分(为自己做个笔记)
  18. 苹果开发者账号申请的问题
  19. 计算机毕业设计Java课程资源管理平台(源码+mysql数据库+系统+lw文档)
  20. vector模拟实现【c++】

热门文章

  1. Exchange2007 中Send as 与Send on behalf of 讲解
  2. 深圳人均GDP过一万美元随想
  3. activeRecord 绑定属性的属性
  4. css3 text-shadow
  5. Resteasy集成Spring
  6. linux 命令行(给自己看的)
  7. keepalived介绍
  8. 抽象语法树 Abstract syntax tree
  9. 区块链学习路线及资料索引
  10. 好书推荐系列之:你在为谁工作