zoukankan      html  css  js  c++  java
  • u-boot 2016.05 添加自己的board 以及config.h

    拿到一个uboot 后,我都想添加一个属于自己的board文件以及include/configs/*.h 文件。

    如何添加这个些文件,今天来记录一下。


    复制一份你所参考的板级文件,比如说board/vscom/baltos/ 复制为board/sbc7109 文件夹 修改board/sbc7109/Kconfig 里面的内容
        if TARGET_AM335X_SBC7109   // 这个是等下make menuconfig 指定的一个宏
    
        config SYS_BOARD            //指定你的board 文件
        	default "sbc7109"
        
        config SYS_SOC              //指定你的 soc 文件
           	default "am33xx"
    
        config SYS_CONFIG_NAME        //指定你的 include/configs/am335x_sbc7109.h 为配置头文件
    	default "am335x_sbc7109"
    
        config CONS_INDEX
    	int "UART used for console"
    	range 1 6
    	default 1
    	help
    	  The AM335x SoC has a total of 6 UARTs (UART0 to UART5 as referenced
    	  in documentation, etc) available to it.  Depending on your specific
    	  board you may want something other than UART0.
    
        endif
    

    修改完这个文件之后,将board/sbc7109/Kconfig 添加到arch/arm/Kconfig 添加如下内容:
        source "board/sbc7109/Kconfig"
    

    在最后面endmenu 之前添加。


    在arch/arm/Kconfig 里面添加:
        377 config TARGET_AM335X_SBC7109        //这个宏就是上面那个 if TARGET_AM335X_SBC7109 的前置条件                                          
        378     bool "Support am335x_sbc7109"                                               
        379     select CPU_V7                                                               
        380     select SUPPORT_SPL                                                          
        381     select DM                                                                   
        382     select DM_SERIAL                                                            
        383     select DM_GPIO                                                              
    

    复制 include/configs/baltos.h 为include/configs/am335x_sbc7109.h
        修改include/configs/am335x_sbc7109.h 里面的一个宏定义:
        #define CONFIG_SYS_LDSCRIPT     "board/sbc7109/u-boot.lds"
    

    修改board/sbc7109/u-boot.lds 里面的一个内容
         34     .text :                                                                     
         35     {                                                                           
         36         *(.__image_copy_start)                                                  
         37         *(.vectors)                                                             
         38         CPUDIR/start.o (.text*)                                                 
         39         board/sbc7109/built-in.o (.text*)                                       
         40         *(.text*)                                                               
         41     }                                                                           
    

    复制 configs/am335x_baltos_defconfig 为 configs/am335x_sbc7109_defconfig
        修改configs/am335x_sbc7109_defconfig 里面的内容,如下:
        将 CONFIG_TARGET_AM335X_BALTOS=y  替换为:
        CONFIG_TARGET_AM335X_SBC7109=y
    

    修改对应board/sbc7109/MAINTAINERS 里面的内容

        BALTOS BOARD
        M:  Yegor Yefremov <yegorslists@googlemail.com>
        S:  Maintained
        F:  board/sbc7109/
        F:  include/configs/am335x_sbc7109.h
        F:  configs/am335x_sbc7109_defconfig
    

    ok ,做完上面的动作,在u-boot 根目录进行 make am335x_sbc7109_defconfig
    cat .config
         23 CONFIG_SYS_ARCH="arm"                                                           
         24 CONFIG_SYS_CPU="armv7"                                                          
         25 CONFIG_SYS_SOC="am33xx"                                                         
         26 CONFIG_SYS_BOARD="sbc7109"                                                      
         27 CONFIG_SYS_CONFIG_NAME="am335x_sbc7109"      
    

    再进行编译
        make -j2    
    

    完成
  • 相关阅读:
    登入界面的创建
    什么是IO流 以及文件输入输出
    java 的面向对象
    Mac 终端命令大全
    jQuery 的属性
    商城管理系统
    Java IO学习第二天部分详解
    Java IO学习第一天部分详解
    用JAVA描述一个车与修车厂两个事物
    JAVA基础(数组)数组排序和查找数组中是否还有某一个数
  • 原文地址:https://www.cnblogs.com/chenfulin5/p/6393415.html
Copyright © 2011-2022 走看看