[I.MX6UL] U-Boot移植(四) 添加开发板对应的板级文件夹+修改 U-Boot 图形界面配置文件

终端输入:cd board/freescale/
cp mx6ullevk/ -r mx6ull_mybsp_emmc
在这里插入图片描述
进 入 mx6ull_alientek_emmc 目 录 中 , 将 其 中 的 mx6ullevk.c 文 件 重 命 名 为
mx6ull_alientek_emmc.c,命令如下:

cd mx6ull_mybsp_emmc
mv mx6ullevk.c mx6ull_mybsp_emmc.c

1、修改 mx6ull_mybsp_emmc 目录下的 Makefile 文件
gedit Makefile
在这里插入图片描述
将 mx6ull_mybsp_emmc 下的 Makefile 文件内容改为如下所示:

# (C) Copyright 2015 Freescale Semiconductor, Inc. 
# 
# SPDX-License-Identifier:   GPL-2.0+ 
# 
 
obj-y  := mx6ull_mybsp_emmc.o 
 
extra-$(CONFIG_USE_PLUGIN) :=  plugin.bin 
$(obj)/plugin.bin: $(obj)/plugin.o 

$(OBJCOPY) -O binary --gap-fill 0xff $< $@

重点是第 6 行的 obj-y, 改为 mx6ull_mybsp_emmc.o, 这样才会编译 mx6ull_mybsp_emmc.c
这个文件。
2、修改 mx6ull_mybsp_emmc 目录下的 imximage.cfg 文件
gedit imximage.cfg

将 imximage.cfg 中的下面一句:
PLUGIN board/freescale/mx6ullevk/plugin.bin 0x00907000
改为:
PLUGIN board/freescale/mx6ull_mybsp_emmc /plugin.bin 0x00907000

3、修改 mx6ull_mybsp_emmc 目录下的 Kconfig 文件
gedit Kconfig
原:

if TARGET_MX6ULL_14X14_EVK || TARGET_MX6ULL_9X9_EVK

config SYS_BOARD
	default "mx6ullevk"

config SYS_VENDOR
	default "freescale"

config SYS_CONFIG_NAME
	default "mx6ullevk"

endif

改为:

if TARGET_MX6ULL_MYBSP_EMMC 

config SYS_BOARD 
	default "mx6ull_mybsp_emmc" 

config SYS_VENDOR 
	default "freescale" 

config SYS_SOC 
	default "mx6" 

config SYS_CONFIG_NAME 
	default "mx6ull_mybsp_emmc" 

endif 

4、修改 mx6ull_mybsp_emmc 目录下的 MAINTAINERS 文件
gedit MAINTAINERS
修改 MAINTAINERS 文件,修改后的内容如下:

MX6ULL_MYBSP_EMMC BOARD 
M:    Peng Fan <peng.fan@nxp.com> 
S:    Maintained 
F:    board/freescale/mx6ull_mybsp_emmc/ 
F:    include/configs/mx6ull_mybsp_emmc.h 

修改 U-Boot 图形界面配置文件

在这里插入图片描述
如果是 I.MX6UL的芯片路径应为: arch/arm/Kconfig,
但是我们是uboot自定义,所以路径为:arch/arm/cpu/armv7/mx6/Kconfig。

终端输入:gedit arch/arm/cpu/armv7/mx6/Kconfig
在 207 行加入如下内容:

config TARGET_MX6ULL_MYBSP_EMMC
	bool "Support mx6ull_mybsp_emmc"
	select MX6ULL
	select DM
	select DM_THERMAL

config TARGET_MX6ULL_MYBSP_NAND
	bool "Support mx6ull_mybsp_nand"
	select MX6ULL
	select DM
	select DM_THERMAL

在这里插入图片描述
在最后一行的 endif 的前一行添加如下内容:
source “board/freescale/mx6ull_mybsp_emmc/Kconfig”
在这里插入图片描述

使用新添加的板子配置编译 uboot

在 uboot 根目录下新建一个名为 mx6ull_mybsp_emmc.sh 的 shell 脚本,在这个 shell 脚本
里面输入如下内容:
gedit mx6ull_mybsp_emmc.sh

#!/bin/bash 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_mybsp_emmc_defconfig 
make V=1  ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 
chmod 777 mx6ull_mybsp_emmc.sh  
//给予可执行权限,一次即可 
./mx6ull_mybsp_emmc.sh  
 
 
//运行脚本编译 uboot 

在这里插入图片描述

等待编译完成,编译完成以后输入如下命令,查看一下添加的mx6ull_mybsp_emmc.h 这个头文件有没有被引用。
grep -nR “mx6ull_mybsp_emmc.h”
在这里插入图片描述
大部分文件都成功引用,证明我们刚刚的修改是成立的。到此移植完毕。

下载烧录验证:

chmod 777 imxdownload  

//给予 imxdownload 可执行权限 
./imxdownload u-boot.bin /dev/sdg 
 
//烧写 u-boot.bin 到 SD 卡中

烧写完成以后将 SD 卡插入 I.MX6U-ALPHA 开发板的 TF 卡槽中,最后设置开发板从 SD卡启动。打开 SecureCRT,设置好开发板所使用的串口并打开,复位开发板,SecureCRT 接收到如下图 所示信息:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_29246181/article/details/106251060