i.mx6 U-boot Mkconfig Hacking

Source: Internet
Author: User

/**************************************************************************** * I.MX6 U-Boot MKCONFI G Hacking * Disclaimer: * This article is primarily to know how mkconfig works in U-boot, how to summarize the contents of the configuration *, and where to put the content. * 2015-12-19 Zengjianfeng *******************************************************, Ping Shan Village, Nanshan District, Shenzhen ********************/                    \\\\\\\\\-*-Directory-*-//////////|First, reference documents:|Second, Makefile|Third, Mkconfig| Iv. include/config.h| Wu, include/config.mk------------------------------First, reference documents:1. $ (@:_config=What do you mean? http://blog.csdn.net/zbffff/article/details/18991145    2. U-BOOT Makefile Comment http://wenku.baidu.com/view/ff14f319227916888486d7cb.html    3. Makefile in the @ http://www.cnblogs.com/lihaiping/archive/2013/03/20/makefile.html    4. Functions commonly used in Makefile http://linux.chinaunix.net/techdoc/develop/2009/07/09/1122854.shtml    5. U-boot Transplant (ii)--U-BOOT compilation Process Analysis (2) http://blog.csdn.net/wafx1314/article/details/11260041    6Please consult the specific usage of the Linux make do clean do all http://zhidao.baidu.com/question/129692720.htmlSecond, 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_,[email protected])"] ||{echo"text_base = 0x00907000">$ (obj) board/freescale/mx6q_sabresd/config.tmp; Echo"... with Iram configuration" ; } @$ (Mkconfig) $ (@:_config=arm arm_cortexa8 mx6q_sabresd Freescale mx6 ... Three, Mkconfig #!/bin/sh-e # Script to the Create header files and links to configure # U-boot fora specific board. # # Parameters:target Architecture CPU Board [VENDOR] [SOC] # # (C)2002-2006DENX software Engineering, Wolfgang Denk <[email protected]># APPEND=no # Default:createNewConfig file # Development Board name Board_name=""# Name to printinchmake output # uses the while loop and case for command-line parameter extraction, which is a good way to handle while[$#-GT0] ; Do         Case " $" inch--) shift; Break ;; -a) shift; Append=yes;; -N) Shift; Board_name="${1%%_config}";   shift; # %%remove _config in a string*) Break ;; Esac Done # If none of the above command-line arguments, then $ $ is the name of the Development Board ["${board_name}"] || Board_name=" $"# The number of parameters is less than 4 or more than 6, the direct exit, it is strange, why not put in front to judge it [$#-lt4] && exit1    [ $# -gt6] && exit1# show Message Echo"Configuring for ${board_name} BOARD ..."# # Create link to architecture specific headers # # If the compiled directory is different from the source code directory, do the followingif["$SRCTREE"!="$OBJTREE" ] ; Then mkdir-P ${objtree}/include # Creating an include directory mkdir-P ${objtree}/Include2 # Create include2 directory CD ${objtree}/Include2 # Enter Include2 directory RM-F ASM # prevents ASM already exists ln-S ${srctree}/include/asm-$2ASM # re-flex the link to a fixed location $2(ARM) platform Lnprefix=".. /.. /include2/asm/"CD../include RM-RF asm-$2RM-F ASM mkdir ASM-$2LN-S asm-$2ASMElseCD./include RM-F ASM Ln-S asm-$2ASM # $2=Arm fi # delete include/asm-arm/Arch This soft link rm-F asm-$2/Arch # $6 equals mx6if[-Z"$6"-O"$6"="NULL" ] ; Then ln-S ${lnprefix}arch-$3asm-$2/ArchElseLN-S ${lnprefix}arch-$6asm-$2/Arch fiif[" $"="Arm" ] ; Then RM-F asm-$2/Proc LN-S ${LNPREFIX}PROC-ARMV asm-$2/proc Fi # # Create include file forMake # echo"ARCH = $"> Config.mk # $2=Arm Echo"CPU = $ $">> CONFIG.MK # $3=Arm_cortexa8 Echo"BOARD = $4">> CONFIG.MK # $4=MX6Q_SABRESD # $5=Freescale [" $"] && [" $"!="NULL"] && Echo"VENDOR = $">>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 file then echo>>config.hElse> Config.h # CreateNewConfig file fi # It turns out that we can view config files in this file echo"/ * Automatically generated-do not edit * /">>Config.h # $1=mx6dl_sabresd_android Echo"#include <configs/$1.h>">>config.h Echo"#include <asm/config.h>">>Config.h Exit0Iv. include/config.h/*automatically generated-do not edit*/#include<configs/mx6dl_sabresd_android.h>#include<asm/config.h>v. include/config.mk ARCH=Arm CPU=arm_cortexa8 BOARD=mx6q_sabresd VENDOR=Freescale SOC=mx6 Six, Summary: from the above situation, if you want to create a new development Board in the Board directory<board_name> directory, in the Include/configs directory also to establish a corresponding <board_name> file, which is stored in the Development Board <board_name> configuration information. There is no validation at this time.

i.mx6 U-boot Mkconfig Hacking

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.