u-boot 2016.05 Add your own board and config.h uboot transplant

  18 CONFIG_SYS_ARCH="arm"
  19 CONFIG_SYS_CPU="armv8"
  20 CONFIG_SYS_SOC="zynqmp"
  21 CONFIG_SYS_VENDOR="xilinx"
  22 CONFIG_SYS_BOARD="zynqmp"
  23 CONFIG_SYS_CONFIG_NAME="xilinx_zynqmp_xxxx"    单板头文件xilinx_zynqmp_xxxx.h(位于include/configs/)
177 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-xxxx"         设备树在arch/arm/dts/下(zynqmp-xxxx.dts)

149 CONFIG_IDENT_STRING=" Xilinx ZynqMP XGPU"                                                       banner when uboot starts

/include/version.h

 

 

---------------------------------------------------------------------------------

Modify the CONFIG_SYS_CONFIG_NAME in the configs/$(boardname)_defconfig file ,

CONFIG_SYS_CONFIG_NAME="xilinx_zynqmp_xxxx", include xilinx_zynqmp_xxxx.h (located in include/configs/) into uboot

---------------------------------------------------------------------------------------------------------------

mkboot: $(BOOT_CONF) $(VERSION_FILE)
    echo "mkboot"
    $(MAKE) -j8 -C $(SRC_PATH) CROSS_COMPILE=$(CROSS_COMPILE) O=$(BUILD_DIR)

 

# To locate output files

# O =

# Use "make O=dir/to/store/output/files/"

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

What are the similarities and differences between "include/configs/$(boardname).h" and "configs/$(boardname)_defconfig" in uboot source code

Answer: The biggest difference is that the options in "configs/boardname_defconfig" can all be configured in make menuconfig, and the options in "include/configs/boardname.h" are some features related to the development board, which are in make menuconfig. Can't find these options

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

After getting a uboot, I want to add my own board file and include/configs/*.h file.

How to add these files, let’s record today.


Copy a board-level file you refer to, for example, board/vscom/baltos/ Copy as board/sbc7109 folder and modify the contents in 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


After modifying this file, add board/sbc7109/Kconfig to arch/arm/Kconfig and add the following content:

    source "board/sbc7109/Kconfig"

Add before the last endmenu.


Add in 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                                                              


Copy include/configs/baltos.h to include/configs/am335x_sbc7109.h

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


Modify a content in 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     }                                                                           


Copy configs/am335x_baltos_defconfig to configs/am335x_sbc7109_defconfig

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

Modify the content in the corresponding board/sbc7109/MAINTAINERS

    BALTOS BOARD
    M:  Yegor Yefremov <[email protected]>
    S:  Maintained
    F:  board/sbc7109/
    F:  include/configs/am335x_sbc7109.h
    F:  configs/am335x_sbc7109_defconfig


ok, after doing the above actions, perform make am335x_sbc7109_defconfig
cat .config in the u-boot root directory 

     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"      


Compile again

    make -j2    


carry out

Read The Fucking Source Code

Guess you like

Origin blog.csdn.net/u014426028/article/details/111029724