1 #!/bin/bash
2 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
3 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_evk_emmc_defconfig
4 make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
执行脚本文件后,下载至开发板。重启开发板出现以下提示:
U-Boot 2016.03 (Dec 30 2019 - 23:38:14 +0800)
CPU: Freescale i.MX6ULL rev1.1 69 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 36C
Reset cause: POR
Board: MX6ULL 14x14 EVK
I2C: ready
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
unsupported panel ATK-LCD-7-1024x600
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc0 is current device
Net: Board Net Initialization Failed
No ethernet found.
Normal Boot
Hit any key to stop autoboot: 0
CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ull_glen_emmc/imximage.cfg,MX6ULL_EVK_EMMC_REWORK"
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6ULL_GLEN_EMMC=y
CONFIG_CMD_GPIO=y
2.2 添加开发板对应的头文件
复制开发板的mx6ullevk.h头文件,并重命名为mx6ull_glen_emmc.h,并把
#ifndef __MX6ULLEVK_CONFIG_H
#define __MX6ULLEVK_CONFIG_H
改为
#ifndef __MX6ULLEVK_CONFIG_H
#define __MX6ULLEVK_CONFIG_H
mx6ull_glen_emmc.h里面的宏定义基本用于配置 uboot,也有一些I.MX6ULL 的配置项目。如果我们自己要想使能或者禁止 uboot 的某些功能,那就在mx6ull_glen_emmc.h 里面做修改即可。
2.3 添加开发板对应的板级文件夹
mx6ull_glen_emmc
├── imximage.cfg
├── imximage_lpddr2.cfg
├── Kconfig
├── MAINTAINERS
├── Makefile
├── mx6ull_glen_emmc.c
├── plugin.S
└── README
# (C) Copyright 2015 Freescale Semiconductor, Inc.
#
# SPDX-License-Identifier: GPL-2.0+
#
obj-y := mx6ull_glen_emmc.o
extra-$(CONFIG_USE_PLUGIN) := plugin.bin
$(obj)/plugin.bin: $(obj)/plugin.o
$(OBJCOPY) -O binary --gap-fill 0xff $< $@
/*PLUGIN plugin-binary-file IRAM_FREE_START_ADDR*/
PLUGIN board/freescale/mx6ull_glen_emmc/plugin.bin 0x00907000
if TARGET_MX6ULL_GLEN_EMMC
config SYS_BOARD
default "mx6ull_glen_emmc"
config SYS_VENDOR
default "freescale"
config SYS_CONFIG_NAME
default "mx6ull_glen_emmc"
endif
MX6ULL_GLEN_EMMC BOARD
M: Peng Fan
S: Maintained
F: board/freescale/mx6ull_glen_emmc/
F: include/configs/mx6ull_glen_emmc.h
F: configs/mx6ull_glen_emmc_defconfig
2.4 修改U-BOOT图形界面配置文件
在文件arch/arm/cpu/armv7/mx6/Kconfig的内容基础上添加如下代码:
config TRAGET_MX6ULL_GLEN_EMMC
bool "Support mx6ull_glen_emmc"
select MX6ULL
select DM
select DM_THERMAL
source "board/freescale/mx6ull_glen_emmc/Kconfig"
至此,开发板信息已经添加到uboot中了,接下来就是编译这个新添加的开发板。
2.5 使用新添加的板子配置编译uboot
在uboot根目录下创建一个用于编译的shell脚本,其内容如下 :
1 #!/bin/bash
2 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
3 make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_glen_emmc_defconfig
4 make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4
烧写开发板,重启,显示如下:
U-Boot 2016.03 (Jan 02 2020 - 00:03:38 +0800)
CPU: Freescale i.MX6ULL rev1.1 69 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 41C
Reset cause: POR
Board: MX6ULL 14x14 EVK
I2C: ready
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc0 is current device
Net: Board Net Initialization Failed
No ethernet found.
Normal Boot
Hit any key to stop autoboot: 0