IMX6ULL移植U-Boot 2022.04

本文详细记录了IMX6ULL芯片移植U-Boot 2022.04的过程,包括编译环境搭建、默认编译测试、开发板配置、编译验证以及烧录测试。通过修改板级文件、配置文件及源码,成功实现了U-Boot在IMX6ULL上的运行。
摘要由CSDN通过智能技术生成

目录

目录

1.编译环境以及uboot版本

2.默认编译测试

3.uboot中新增自己的开发板

3.编译测试

4.烧录测试

5.patch文件


1.编译环境以及uboot版本

宿主机 Debian12
u-boot版本 lf_v2022.04 ; git 连接GitHub - nxp-imx/uboot-imx: i.MX U-Boot
交叉编译工具 gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf

2.默认编译测试

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- distclean

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- mx6ull_14x14_evk_emmc_defconfig

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf-

3.uboot中新增自己的开发板

#创建自己的config文件
cp configs/mx6ull_14x14_evk_emmc_defconfig  configs/mx6ull_xing_emmc_defconfig

cp include/configs/mx6ullevk.h  include/configs/mx6ull_xing_emmc.h

复制自己的板级文件夹

cd board/freescale

cp -rf mx6ullevk  mx6ull_xing_emmc

修改 mx6ull_xing_emmc 文件夹下的Makefile

修改mx6ull_xing_emmc 文件下的imximage.cfg

修改mx6ull_xing_emmc下的Kconfig文件

修改mx6ull_xing_emmc.c

修改MAINTAINERS

修改arch/arm/mach-imx/mx6/Kconfig

3.编译测试

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- distclean


make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- mx6ull_xing_emmc_defconfig


make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- 

4.烧录测试

sudo dd if=u-boot-dtb.imx of=/dev/sdc bs=1k seek=1 conv=fsync

5.patch文件

From 8a36c3ca95ab8c8338eebe68a607cb575451be0c Mon Sep 17 00:00:00 2001
From: xingpeng89 <xingpeng8889@126.com>
Date: Thu, 15 Feb 2024 17:24:34 +0800
Subject: [PATCH] add mx6ull_xing_emmc board in uboot

---
 uboot-imx/.binman_stamp                       |   0
 uboot-imx/arch/arm/mach-imx/mx6/Kconfig       |  11 +
 .../board/freescale/mx6ull_xing_emmc/Kconfig  |  17 +
 .../freescale/mx6ull_xing_emmc/MAINTAINERS    |   8 +
 .../board/freescale/mx6ull_xing_emmc/Makefile |   4 +
 .../freescale/mx6ull_xing_emmc/imximage.cfg   | 120 ++++++
 .../mx6ull_xing_emmc/imximage_lpddr2.cfg      | 125 ++++++
 .../mx6ull_xing_emmc/mx6ull_xing_emmc.c       | 376 ++++++++++++++++++
 .../board/freescale/mx6ull_xing_emmc/plugin.S | 263 ++++++++++++
 uboot-imx/configs/mx6ull_xing_emmc_defconfig  | 109 +++++
 uboot-imx/include/configs/mx6ull_xing_emmc.h  | 244 ++++++++++++
 uboot-imx/tools/boot/bootm.c                  |   1 +
 uboot-imx/tools/boot/fdt_region.c             |   1 +
 uboot-imx/tools/boot/image-cipher.c           |   1 +
 uboot-imx/tools/boot/image-fit-sig.c          |   1 +
 uboot-imx/tools/boot/image-fit.c              |   1 +
 uboot-imx/tools/boot/image-host.c             |   1 +
 uboot-imx/tools/boot/image.c                  |   1 +
 18 files changed, 1284 insertions(+)
 create mode 100644 uboot-imx/.binman_stamp
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/Kconfig
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/MAINTAINERS
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/Makefile
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/imximage.cfg
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/imximage_lpddr2.cfg
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/mx6ull_xing_emmc.c
 create mode 100644 uboot-imx/board/freescale/mx6ull_xing_emmc/plugin.S
 create mode 100644 uboot-imx/configs/mx6ull_xing_emmc_defconfig
 create mode 100644 uboot-imx/include/configs/mx6ull_xing_emmc.h
 create mode 100644 uboot-imx/tools/boot/bootm.c
 create mode 100644 uboot-imx/tools/boot/fdt_region.c
 create mode 100644 uboot-imx/tools/boot/image-cipher.c
 create mode 100644 uboot-imx/tools/boot/image-fit-sig.c
 create mode 100644 uboot-imx/tools/boot/image-fit.c
 create mode 100644 uboot-imx/tools/boot/image-host.c
 create mode 100644 uboot-imx/tools/boot/image.c

diff --git a/uboot-imx/.binman_stamp b/uboot-imx/.binman_stamp
new file mode 100644
index 00000000..e69de29b
diff --git a/uboot-imx/arch/arm/mach-imx/mx6/Kconfig b/uboot-imx/arch/arm/mach-imx/mx6/Kconfig
index 8954278c..7e9cb8bf 100644
--- a/uboot-imx/arch/arm/mach-imx/mx6/Kconfig
+++ b/uboot-imx/arch/arm/mach-imx/mx6/Kconfig
@@ -622,6 +622,16 @@ config TARGET_MX6ULL_14X14_EVK
 	select OF_SYSTEM_SETUP
 	imply CMD_DM
 
+config TARGET_MX6ULL_XING_EMMC
+	bool "Support mx6ull_xing_emmc"
+	depends on MX6ULL
+	select BOARD_LATE_INIT
+	select DM
+	select DM_THERMAL
+	select IMX_MODULE_FUSE
+	select OF_SYSTEM_SETUP
+	imply CMD_DM
+
 config TARGET_MYS_6ULX
 	bool "MYiR MYS-6ULX"
 	depends on MX6ULL
@@ -858,6 +868,7 @@ source "board/freescale/mx6sxsabreauto/Kconfig"
 source "board/freescale/mx6sx_17x17_val/Kconfig"
 source "board/freescale/mx6sx_19x19_val/Kconfig"
 source "board/freescale/mx6ul_14x14_evk/Kconfig"
+source "board/freescale/mx6ull_xing_emmc/Kconfig"
 source "board/freescale/mx6ul_14x14_ddr3_val/Kconfig"
 source "board/freescale/mx6ul_14x14_lpddr2_val/Kconfig"
 source "board/freescale/mx6ullevk/Kconfig"
diff --git a/uboot-imx/board/freescale/mx6ull_xing_emmc/Kconfig b/uboot-imx/board/freescale/mx6ull_xing_emmc/Kconfig
new file mode 100644
index 00000000..a21cef6c
--- /dev/null
+++ b/uboot-imx/board/freescale/mx6ull_xing_emmc/Kconfig
@@ -0,0 +1,17 @@
+if TARGET_MX6ULL_XING_EMMC
+
+config SYS_BOARD
+	default "mx6ull_xing_emmc"
+
+config SYS_VENDOR
+	default "freescale"
+
+config SYS_CONFIG_NAME
+	default "mx6ull_xing_emmc"
+
+config IMX_CONFIG
+	default "board/freescale/mx6ull_xing_emmc/imximage.cfg"
+
+config SYS_TEXT_BASE
+	default 0x87800000
+endif
diff --git a/uboot-imx/board/freescale/mx6ull_xing_emmc/MAINTAINERS b/uboot-imx/board/freescale/mx6ull_xing_emmc/MAINTAINERS
new file mode 100644
index 00000000..352405c0
--- /dev/null
+++ b/uboot-imx/board/freescale/mx6ull_xing_emmc/MAINTAINERS
@@ -0,0 +1,8 @@
+MX6ULLEVK BOARD
+M:	Peng Xing <peng.xing@quectel.com>
+S:	Maintained
+F:	board/freescale/mx6ull_xing_emmc/
+F:	include/configs/mx6ull_xing_emmc.h
+F:	configs/mx6ull_xing_emmc_defconfig
+F:	configs/mx6ull_14x14_evk_plugin_defconfig
+F:	configs/mx6ulz_14x14_evk_defconfig
diff --git a/uboot-imx/board/freescale/mx6ull_xing_emmc/Makefile b/uboot-imx/board/freescale/mx6ull_xing_emmc/Makefile
new file mode 100644
index 00000000..438b1794
--- /dev/null
+++ b/uboot-imx/board/freescale/mx6ull_xing_emmc/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0+
+# (C) Copyright 2016 Freescale Semiconductor, Inc.
+
+obj-y  := mx6ull_xing_emmc.o
diff --git a/uboot-imx/board/freescale/mx6ull_xing_emmc/imximage.cfg b/uboot-imx/board/freescale/mx6ull_xing_emmc/imximage.cfg
new file mode 100644
index 00000000..c380a3e8
--- /dev/null
+++ b/uboot-imx/board/freescale/mx6ull_xing_emmc/imximage.cfg
@@ -0,0 +1,120 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
+ *
+ * Refer doc/imx/mkimage/imximage.txt for more details about how-to configure
+ * and create imximage boot image
+ *
+ * The syntax is taken as close as possible with the kwbimage
+ */
+
+#include <config.h>
+
+/* image version */
+
+IMAGE_VERSION 2
+
+/*
+ * Boot Device : one of
+ * spi/sd/nand/onenand, qspi/nor
+ */
+
+#ifdef CONFIG_QSPI_BOOT
+BOOT_FROM	qspi
+#elif defined(CONFIG_NOR_BOOT)
+BOOT_FROM	nor
+#else
+BOOT_FROM	sd
+#endif
+
+#ifdef CONFIG_USE_IMXIMG_PLUGIN
+/*PLUGIN    plugin-binary-file    IRAM_FREE_START_ADDR*/
+PLUGIN	board/freescale/mx6ull_xing_emmc/plugin.bin 0x00907000
+#else
+
+#ifdef CONFIG_IMX_HAB
+CSF CONFIG_CSF_SIZE
+#endif
+
+/*
+ * Device Configuration Data (DCD)
+ *
+ * Each entry must have the format:
+ * Addr-type           Address    
  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值