uboot 移植

vi doc/README.kconfig
以上README中有大致的流程

 

Conversion from boards.cfg to Kconfig
-------------------------------------

Prior to Kconfig, boards.cfg was a primary database that contained Arch, CPU,
SoC, etc. of all the supported boards.  It was deleted when switching to
Kconfig.  Each field of boards.cfg was converted as follows:

 Status      ->  "S:" entry of MAINTAINERS
 Arch        ->  CONFIG_SYS_ARCH defined by Kconfig  
 CPU         ->  CONFIG_SYS_CPU defined by Kconfig
 SoC         ->  CONFIG_SYS_SOC defined by Kconfig
 Vendor      ->  CONFIG_SYS_VENDOR defined by Kconfig
 Board       ->  CONFIG_SYS_BOARD defined by Kconfig
 Target      ->  File name of defconfig (configs/<target>_defconfig)
 Options     ->  CONFIG_SYS_EXTRA_OPTIONS defined by Kconfig
 Maintainers ->  "M:" entry of MAINTAINERS

################# tips ####################

1.Arch       arm

arch/arm/Kconfig中

config SYS_ARCH
    default "arm"

 

2.CPU        armv7

arch/arm/Kconfig

config SYS_CPU
    default "armv7" if CPU_V7A

3.SoC        fmql10

Define CONFIG_SYS_SOC="soc" to compile arch/<arch>/cpu/<cpu>/<soc> 其实并没有这个目录

4.Vendor     fmxx

Define CONFIG_SYS_VENDOR="vendor" to compile board/<vendor>/common/*
         and board/<vendor>/<board>/*

5.Board      ql10_demo

Define CONFIG_SYS_BOARD="board" to compile board/<board>/*
         (or board/<vendor>/<board>/* if CONFIG_SYS_VENDOR is defined)

6.Target     ql10_demo

Define CONFIG_SYS_CONFIG_NAME="target" to include
         include/configs/<target>.h

Add configs/<target>_defconfig



Tips to add/remove boards
-------------------------

When adding a new board, the following steps are generally needed:

 [1] Add a header file include/configs/<target>.h
 [2] Make sure to define necessary CONFIG_SYS_* in Kconfig:
       Define CONFIG_SYS_CPU="cpu" to compile arch/<arch>/cpu/<cpu>
       Define CONFIG_SYS_SOC="soc" to compile arch/<arch>/cpu/<cpu>/<soc>
       Define CONFIG_SYS_VENDOR="vendor" to compile board/<vendor>/common/*
         and board/<vendor>/<board>/*
       Define CONFIG_SYS_BOARD="board" to compile board/<board>/*
         (or board/<vendor>/<board>/* if CONFIG_SYS_VENDOR is defined)
       Define CONFIG_SYS_CONFIG_NAME="target" to include
         include/configs/<target>.h
 [3] Add a new entry to the board select menu in Kconfig.
     The board select menu is located in arch/<arch>/Kconfig or
     arch/<arch>/*/Kconfig.
 [4] Add a MAINTAINERS file
     It is generally placed at board/<board>/MAINTAINERS or
     board/<vendor>/<board>/MAINTAINERS
 [5] Add configs/<target>_defconfig

When removing an obsolete board, the following steps are generally needed:

 [1] Remove configs/<target>_defconfig
 [2] Remove include/configs/<target>.h if it is not used by any other boards
 [3] Remove board/<vendor>/<board>/* or board/<board>/* if it is not used
     by any other boards
 [4] Update MAINTAINERS if necessary
 [5] Remove the unused entry from the board select menu in Kconfig
 [6] Add an entry to doc/README.scrapyard

 

根据README的描述,定义上述配置项之后,u-boot会编译如下的目录:

Define CONFIG_SYS_CPU="cpu" to compile arch//cpu/
        arch/arm/cpu/armv8
        Q:并没有看到CONFIG_SYS_CPU的定义?
        A:在“arm/Kconfig”中定义,“default "armv8" if ARM64”,这就是为什么在上面Target定义中“select ARM64”的原因。

Define CONFIG_SYS_SOC="soc" to compile arch//cpu//
        arch/arm/cpu/armv8/s900
        Q:如果该目录不存在,是否还会编译?
        A:应该不会。

Define CONFIG_SYS_VENDOR="vendor" to compile board//common/* and board///*
        board/actions/common/*
        board/actions/bubblegum/*

Define CONFIG_SYS_CONFIG_NAME="target" to include include/configs/.h
        include/configs/bubblegum.h

 4)创建该板子有关的配置头文件

include/configs/ql10_demo.h

#ifndef __QL10_DEMO_H
#define __QL10_DEMO_H

#endif
 

5)使用menuconfig,生成.config,并保存为ql10_demo_defconfig

cd ~/work/x_project/u-boot

make menuconfig

配置Architecture和Target:

Architecture select (ARM architecture)  --->

ARM architecture  --->
    Target select (Support Bubblegum 96Board)  --->

关闭Command line interface配置项下面所有的内容:

Command line interface  --->

其它暂时用默认值,保存退出,得到.config文件,然后另存为ql10_demo_defconfig

cp .config configs/ql10_demo_defconfig

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值