From 7dfdcc706eec5617ee1bb18a1f66387286492269 Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Tue, 25 Jul 2023 21:52:27 +0800
Subject: [PATCH] Update uboot-imx-lf-5.15.71-2.2.0.patch, fix eMMC not work bug
---
bootloader/patches/igkboard-6ull/uboot-imx-lf-5.15.71-2.2.0.patch | 326 ++++++++++++++++++++++++++----------------------------
1 files changed, 156 insertions(+), 170 deletions(-)
diff --git a/bootloader/patches/igkboard-6ull/uboot-imx-lf-5.15.71-2.2.0.patch b/bootloader/patches/igkboard-6ull/uboot-imx-lf-5.15.71-2.2.0.patch
index e63e66a..2a3bb9d 100644
--- a/bootloader/patches/igkboard-6ull/uboot-imx-lf-5.15.71-2.2.0.patch
+++ b/bootloader/patches/igkboard-6ull/uboot-imx-lf-5.15.71-2.2.0.patch
@@ -1,7 +1,7 @@
diff -Nuar -x tools uboot-imx/arch/arm/dts/igkboard-6ull.dts uboot-imx-lf-5.15.71-2.2.0/arch/arm/dts/igkboard-6ull.dts
--- uboot-imx/arch/arm/dts/igkboard-6ull.dts 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/arch/arm/dts/igkboard-6ull.dts 2023-07-19 16:26:51.047476885 +0800
-@@ -0,0 +1,316 @@
++++ uboot-imx-lf-5.15.71-2.2.0/arch/arm/dts/igkboard-6ull.dts 2023-07-25 21:36:12.607782484 +0800
+@@ -0,0 +1,377 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+//
+// Copyright (C) 2023 LingYun IoT System Studio
@@ -32,11 +32,6 @@
+ off-on-delay-us = <20000>;
+ enable-active-high;
+ };
-+};
-+
-+&clks {
-+ assigned-clocks = <&clks IMX6UL_CLK_PLL3_PFD2>;
-+ assigned-clock-rates = <320000000>;
+};
+
+&fec1 {
@@ -155,6 +150,16 @@
+ wakeup-source;
+ vmmc-supply = <®_sd1_vmmc>;
+ status = "okay";
++};
++
++&usdhc2 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_usdhc2>;
++ no-1-8-v;
++ broken-cd;
++ keep-power-in-suspend;
++ wakeup-source;
++ status = "okay";
+};
+
+&wdog1 {
@@ -312,6 +317,62 @@
+ >;
+ };
+
++ pinctrl_usdhc2: usdhc2grp {
++ fsl,pins = <
++ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x17059
++ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059
++ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059
++ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059
++ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059
++ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059
++ >;
++ };
++
++ pinctrl_usdhc2_8bit: usdhc2grp_8bit {
++ fsl,pins = <
++ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x10069
++ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059
++ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059
++ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059
++ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059
++ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059
++ MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x17059
++ MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x17059
++ MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x17059
++ MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x17059
++ >;
++ };
++
++ pinctrl_usdhc2_8bit_100mhz: usdhc2grp_8bit_100mhz {
++ fsl,pins = <
++ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x100b9
++ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x170b9
++ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x170b9
++ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x170b9
++ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x170b9
++ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x170b9
++ MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x170b9
++ MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x170b9
++ MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x170b9
++ MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x170b9
++ >;
++ };
++
++ pinctrl_usdhc2_8bit_200mhz: usdhc2grp_8bit_200mhz {
++ fsl,pins = <
++ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x100f9
++ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x170f9
++ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x170f9
++ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x170f9
++ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x170f9
++ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x170f9
++ MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x170f9
++ MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x170f9
++ MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x170f9
++ MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x170f9
++ >;
++ };
++
+ pinctrl_wdog: wdoggrp {
+ fsl,pins = <
+ MX6UL_PAD_LCD_RESET__WDOG1_WDOG_ANY 0x30b0
@@ -320,7 +381,7 @@
+};
diff -Nuar -x tools uboot-imx/arch/arm/dts/Makefile uboot-imx-lf-5.15.71-2.2.0/arch/arm/dts/Makefile
--- uboot-imx/arch/arm/dts/Makefile 2023-03-01 18:01:20.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/arch/arm/dts/Makefile 2023-07-19 16:22:02.327542742 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/arch/arm/dts/Makefile 2023-07-25 21:12:57.452322005 +0800
@@ -871,6 +871,7 @@
imx6ull-kontron-n641x-s.dtb
@@ -331,7 +392,7 @@
imx6ull-14x14-ddr3-val-emmc.dtb \
diff -Nuar -x tools uboot-imx/arch/arm/mach-imx/mx6/Kconfig uboot-imx-lf-5.15.71-2.2.0/arch/arm/mach-imx/mx6/Kconfig
--- uboot-imx/arch/arm/mach-imx/mx6/Kconfig 2023-03-01 18:01:20.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/arch/arm/mach-imx/mx6/Kconfig 2023-07-19 16:21:20.553833849 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/arch/arm/mach-imx/mx6/Kconfig 2023-07-25 21:12:57.452322005 +0800
@@ -157,6 +157,16 @@
prompt "MX6 board select"
optional
@@ -358,8 +419,8 @@
endif
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/igkboard-6ull.c uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/igkboard-6ull.c
--- uboot-imx/board/lingyun/igkboard-6ull/igkboard-6ull.c 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/igkboard-6ull.c 2023-07-19 16:18:02.800518843 +0800
-@@ -0,0 +1,376 @@
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/igkboard-6ull.c 2023-07-25 21:51:08.994194694 +0800
+@@ -0,0 +1,362 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
@@ -693,20 +754,6 @@
+ env_set("tee", "yes");
+#endif
+
-+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
-+ env_set("board_name", "EVK");
-+
-+ if (is_mx6ull_9x9_evk())
-+ env_set("board_rev", "9X9");
-+ else
-+ env_set("board_rev", "14X14");
-+
-+ if (is_cpu_type(MXC_CPU_MX6ULZ)) {
-+ env_set("board_name", "ULZ-EVK");
-+ env_set("usb_net_cmd", "usb start");
-+ }
-+#endif
-+
+ setup_lcd();
+
+#ifdef CONFIG_ENV_IS_IN_MMC
@@ -738,7 +785,7 @@
+}
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/imximage.cfg uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/imximage.cfg
--- uboot-imx/board/lingyun/igkboard-6ull/imximage.cfg 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/imximage.cfg 2023-07-19 16:14:20.424101683 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/imximage.cfg 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,120 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
@@ -862,7 +909,7 @@
+#endif
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/imximage_lpddr2.cfg uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/imximage_lpddr2.cfg
--- uboot-imx/board/lingyun/igkboard-6ull/imximage_lpddr2.cfg 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/imximage_lpddr2.cfg 2023-07-19 16:27:22.905684619 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/imximage_lpddr2.cfg 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
@@ -991,7 +1038,7 @@
+#endif
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/Kconfig uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/Kconfig
--- uboot-imx/board/lingyun/igkboard-6ull/Kconfig 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/Kconfig 2023-07-19 16:31:27.087858672 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/Kconfig 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,14 @@
+if TARGET_LINGYUN_IGKBOARD_6ULL
+
@@ -1009,7 +1056,7 @@
+endif
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/MAINTAINERS uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/MAINTAINERS
--- uboot-imx/board/lingyun/igkboard-6ull/MAINTAINERS 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/MAINTAINERS 2023-07-19 16:28:05.531281866 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/MAINTAINERS 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,7 @@
+LingYun i.MX6ULL IoT Gateway Board(IGKBoard-6ULL)
+M: Guo Wenxue <guowenxue@gmail.com>
@@ -1020,7 +1067,7 @@
+
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/Makefile uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/Makefile
--- uboot-imx/board/lingyun/igkboard-6ull/Makefile 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/Makefile 2023-07-19 16:18:11.184072127 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/Makefile 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0+
+# (C) Copyright 2016 Freescale Semiconductor, Inc.
@@ -1029,7 +1076,7 @@
+obj-y += ../../freescale/common/mmc.o
diff -Nuar -x tools uboot-imx/board/lingyun/igkboard-6ull/plugin.S uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/plugin.S
--- uboot-imx/board/lingyun/igkboard-6ull/plugin.S 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/plugin.S 2023-07-19 16:14:20.428101479 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/board/lingyun/igkboard-6ull/plugin.S 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,263 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
@@ -1296,7 +1343,7 @@
+#include <asm/arch/mx6_plugin.S>
diff -Nuar -x tools uboot-imx/configs/igkboard-6ull_defconfig uboot-imx-lf-5.15.71-2.2.0/configs/igkboard-6ull_defconfig
--- uboot-imx/configs/igkboard-6ull_defconfig 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/configs/igkboard-6ull_defconfig 2023-07-19 16:23:36.958317520 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/configs/igkboard-6ull_defconfig 2023-07-25 21:12:57.452322005 +0800
@@ -0,0 +1,113 @@
+CONFIG_ARM=y
+CONFIG_ARCH_MX6=y
@@ -1413,7 +1460,7 @@
+CONFIG_DM_SERIAL=y
diff -Nuar -x tools uboot-imx/drivers/fastboot/fb_fsl/fb_fsl_partitions.c uboot-imx-lf-5.15.71-2.2.0/drivers/fastboot/fb_fsl/fb_fsl_partitions.c
--- uboot-imx/drivers/fastboot/fb_fsl/fb_fsl_partitions.c 2023-03-01 18:01:21.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/drivers/fastboot/fb_fsl/fb_fsl_partitions.c 2023-07-19 16:14:20.428101479 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/drivers/fastboot/fb_fsl/fb_fsl_partitions.c 2023-07-25 21:12:57.452322005 +0800
@@ -188,6 +188,11 @@
user_partition = FASTBOOT_MMC_USER_PARTITION_ID;
boot_loader_psize = mmc->capacity_boot;
@@ -1428,7 +1475,7 @@
fastboot_devinfo.type);
diff -Nuar -x tools uboot-imx/drivers/net/phy/phy.c uboot-imx-lf-5.15.71-2.2.0/drivers/net/phy/phy.c
--- uboot-imx/drivers/net/phy/phy.c 2023-03-01 18:01:21.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/drivers/net/phy/phy.c 2023-07-19 16:14:20.428101479 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/drivers/net/phy/phy.c 2023-07-25 21:12:57.452322005 +0800
@@ -182,6 +182,8 @@
{
int result;
@@ -1440,18 +1487,16 @@
diff -Nuar -x tools uboot-imx/include/configs/igkboard-6ull.h uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard-6ull.h
--- uboot-imx/include/configs/igkboard-6ull.h 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard-6ull.h 2023-07-19 16:29:43.889718995 +0800
-@@ -0,0 +1,172 @@
++++ uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard-6ull.h 2023-07-25 21:31:04.746971120 +0800
+@@ -0,0 +1,135 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
-+ * Copyright (C) 2016 Freescale Semiconductor, Inc.
-+ * Copyright 2017 NXP
++ * Copyright (C) 2023 LingYun IoT System Studio
+ *
-+ * Configuration settings for the Freescale i.MX6UL 14x14 EVK board.
++ * Configuration settings for LingYun IGKBoard(IoT Gateway Kits Board) based on i.MX6ULL
+ */
+#ifndef __IGKBOARD_6ULL_CONFIG_H
+#define __IGKBOARD_6ULL_CONFIG_H
-+
+
+#include <asm/arch/imx-regs.h>
+#include <linux/sizes.h>
@@ -1459,6 +1504,7 @@
+#include "mx6_common.h"
+#include <asm/mach-imx/gpio.h>
+#include "imx_env.h"
++#include "igkboard-dtoverlay.h"
+
+#define is_mx6ull_9x9_evk() CONFIG_IS_ENABLED(TARGET_MX6ULL_9X9_EVK)
+
@@ -1508,63 +1554,36 @@
+ "mtdparts=" MFG_NAND_PARTITION \
+ "\0"\
+
-+#if defined(CONFIG_NAND_BOOT)
+#define CONFIG_EXTRA_ENV_SETTINGS \
-+ CONFIG_MFG_ENV_SETTINGS \
-+ TEE_ENV \
-+ "splashimage=0x8c000000\0" \
-+ "fdt_addr=0x83000000\0" \
-+ "fdt_high=0xffffffff\0" \
-+ "tee_addr=0x84000000\0" \
+ "console=ttymxc0\0" \
-+ "bootargs=console=ttymxc0,115200 ubi.mtd=nandrootfs " \
-+ "root=ubi0:rootfs rootfstype=ubifs " \
-+ BOOTARGS_CMA_SIZE \
-+ MFG_NAND_PARTITION \
-+ "\0" \
-+ "bootcmd=nand read ${loadaddr} 0x4000000 0xc00000;"\
-+ "nand read ${fdt_addr} 0x5000000 0x100000;"\
-+ "if test ${tee} = yes; then " \
-+ "nand read ${tee_addr} 0x6000000 0x400000;"\
-+ "bootm ${tee_addr} - ${fdt_addr};" \
-+ "else " \
-+ "bootz ${loadaddr} - ${fdt_addr};" \
-+ "fi\0"
-+
-+#else
-+#include "igkboard_overlay.h"
-+
-+#define CONFIG_EXTRA_ENV_SETTINGS \
-+ "env_conf=config.txt\0" \
++ "upmode=fastboot 0\0" \
++ "envconf=config.txt\0" \
+ "image=zImage\0" \
-+ "console=ttymxc0\0" \
-+ "fdt_file=igkboard-6ull.dtb\0" \
++ "board=igkboard-6ull\0" \
++ "fdt_file=${board}.dtb\0" \
++ "fdt_size=0x10000\0" \
+ "fdt_addr=0x83000000\0" \
++ "dtbo_addr=0x83010000\0" \
++ "dtbo_dir=overlays\0" \
+ "splashimage=0x8c000000\0" \
+ "ipaddr=192.168.2.22\0" \
+ "serverip=192.168.2.2\0" \
+ "mmcpart=1\0" \
+ "mmcargs=setenv bootargs console=${console},${baudrate} root=/dev/mmcblk${mmc_no}p2 rootwait rw net.ifnames=0\0" \
-+ "loadenvconf=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${env_conf};env import -t ${loadaddr} ${filesize}\0" \
++ "loadenvconf=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${envconf};env import -t ${loadaddr} ${filesize}\0" \
+ "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+ "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
++ "bootos=bootz ${loadaddr} - ${fdt_addr}\0" \
++ "mmcboot=mmc dev ${mmcdev};run mmcargs;run loadimage;run loadfdt;run bootos\0" \
++ "netboot=tftp $loadaddr $image; tftp $fdt_addr ${fdt_file}; run mmcargs; run bootos\0" \
++ "bbl=tftp ${loadaddr} u-boot-${board}.imx && mmc dev ${mmcdev} 1 && mmc write ${loadaddr} 2 0x500\0" \
+ "bdtb=tftp $fdt_addr $fdt_file && fatwrite mmc 1:1 $fdt_addr $fdt_file $filesize\0" \
+ "bker=tftp $loadaddr $image&& fatwrite mmc 1:1 $loadaddr $image $filesize\0" \
-+ "bsys=run bdtb && run bker\0" \
-+ "mmcboot=echo Booting from mmc ...; " \
-+ "mmc dev ${mmcdev}; " \
-+ "run mmcargs; run loadenvconf;" \
-+ "run loadimage; run loadfdt; " \
-+ "bootz ${loadaddr} - ${fdt_addr}\0" \
-+ "netboot=echo Booting from net ...; " \
-+ "tftp $loadaddr $image; tftp $fdt_addr ${fdt_file};" \
-+ "run mmcargs; " \
-+ "bootz ${loadaddr} - ${fdt_addr}\0" \
-+ "upmode=fastboot 0\0" \
-+ "bbl=tftp ${loadaddr} u-boot-igkboard-6ull.imx && mmc dev ${mmcdev} 1 && mmc write ${loadaddr} 2 0x500\0" \
-+ MMC_FDT_OVERLAY_SETTING \
-+ "bootcmd=run mmcbootdto\0" \
-+ "author=linke\0"
++ "bsys=run bdtb && run bker\0"
++
++#ifdef IGKBOARD_DTOVERLAY_SUPPORT
++#undef CONFIG_BOOTCOMMAND
++#define CONFIG_BOOTCOMMAND MMC_BOOT_WITH_FDT_OVERLAY
+#endif
+
+/* Miscellaneous configurable options */
@@ -1587,15 +1606,6 @@
+
+#define CONFIG_IOMUX_LPSR
+
-+/* NAND stuff */
-+#ifdef CONFIG_NAND_MXS
-+#define CONFIG_SYS_MAX_NAND_DEVICE 1
-+#define CONFIG_SYS_NAND_BASE 0x40000000
-+#define CONFIG_SYS_NAND_USE_FLASH_BBT
-+
-+/* DMA stuff, needed for GPMI/MXS NAND support */
-+#endif
-+
+/* USB Configs */
+#ifdef CONFIG_CMD_USB
+#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
@@ -1614,95 +1624,71 @@
+#endif
+
+#endif
-diff -Nuar -x tools uboot-imx/include/configs/igkboard_overlay.h uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard_overlay.h
---- uboot-imx/include/configs/igkboard_overlay.h 1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard_overlay.h 2023-07-19 16:14:20.428101479 +0800
-@@ -0,0 +1,88 @@
+diff -Nuar -x tools uboot-imx/include/configs/igkboard-dtoverlay.h uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard-dtoverlay.h
+--- uboot-imx/include/configs/igkboard-dtoverlay.h 1970-01-01 08:00:00.000000000 +0800
++++ uboot-imx-lf-5.15.71-2.2.0/include/configs/igkboard-dtoverlay.h 2023-07-25 21:12:57.452322005 +0800
+@@ -0,0 +1,64 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
-+ * Copyright (C) 2022 LingYun IoT System Studio
++ * Copyright (C) 2023 LingYun IoT System Studio
+ *
-+ * Device Tree overlay env for the LingYun IoT Gateway Board.
+ */
-+#ifndef __IGKBOARD_OVERLAY_H
-+#define __IGKBOARD_OVERLAY_H
++#ifndef __IGKBOARD_DTOVERLAY_H
++#define __IGKBOARD_DTOVERLAY_H
+
-+#if 0
-+ dtoverlay_xxx is set in uEnv.txt, then load the corresponding dtbo file
-+
-+ if env exists dtoverlay_lcd && test ${dtoverlay_lcd} = 1 -o ${dtoverlay_lcd} = yes ; then
-+ dtbo_file=lcd.dtbo;
-+ echo "Applying DT overlay: $dtbo_file";
-+ fatload mmc ${mmcdev}:${mmcpart} ${dtbo_addr} ${dtbo_dir}/${dtbo_file};
-+ fdt addr ${fdt_addr};
-+ fdt resize ${fdt_size};
-+ fdt apply ${dtbo_addr};
-+ fi;
-+
-+
-+ if env exists dtoverlay_uart ; then
-+ for i in ${dtoverlay_uart};
-+ do
-+ dtbo_file=uart$i.dtbo;
-+ echo "Applying DT overlay: $dtbo_file";
-+ fatload mmc ${mmcdev}:${mmcpart} ${dtbo_addr} ${dtbo_dir}/${dtbo_file};
-+ fdt addr ${fdt_addr};
-+ fdt apply ${dtbo_addr};
-+ done;
-+ fi;
-+
-+#endif
-+
++#define IGKBOARD_DTOVERLAY_SUPPORT
+
+#define FDT_APPLY_OVERLAY() \
-+ "echo Applying DT overlay ==> ${dtbo_file}; " \
-+ "fatload mmc ${mmcdev}:${mmcpart} ${dtbo_addr} ${dtbo_dir}/${dtbo_file}; " \
-+ "fdt addr ${fdt_addr}; " \
-+ "fdt resize ${fdt_size}; " \
-+ "fdt apply ${dtbo_addr}; "
++ "echo Applying DT overlay => ${dtbo_file}; " \
++ "fatload mmc ${mmcdev}:${mmcpart} ${dtbo_addr} ${dtbo_dir}/${dtbo_file}; " \
++ "fdt addr ${fdt_addr}; " \
++ "fdt resize ${fdt_size}; " \
++ "fdt apply ${dtbo_addr}; "
+
-+#define CHECK_APPLY_OVERLAY( name ) \
-+ "if env exists dtoverlay_" name " && test ${dtoverlay_" name "} = 1 -o ${dtoverlay_" name "} = yes ; then " \
-+ "setenv dtbo_file " name ".dtbo; " \
-+ FDT_APPLY_OVERLAY() \
-+ "fi; "
++#define CHECK_APPLY_OVERLAY_VAL( name ) \
++ "if env exists dtoverlay_" name " ; then " \
++ "setenv dtbo_file " name "-${dtoverlay_" name "}.dtbo; " \
++ FDT_APPLY_OVERLAY() \
++ "fi; "
+
-+#define CHECK_APPLY_OVERLAYS_IDX( name ) \
-+ "if env exists dtoverlay_" name "; then " \
-+ "for i in ${dtoverlay_" name "}; do " \
-+ "setenv dtbo_file " name "$i.dtbo; " \
-+ FDT_APPLY_OVERLAY() \
-+ " done;" \
-+ "fi; "
++#define CHECK_APPLY_OVERLAY_EXT( name ) \
++ "if env exists dtoverlay_" name " && test ${dtoverlay_" name "} = 1 -o ${dtoverlay_" name "} = yes ; then " \
++ "setenv dtbo_file ext-" name ".dtbo; " \
++ FDT_APPLY_OVERLAY() \
++ "fi; "
+
-+#define CHECK_APPLY_OVERLAYS_DTBO( name ) \
-+ "if env exists dtoverlay_" name "; then " \
-+ "for f in ${dtoverlay_" name "}; do " \
-+ "setenv dtbo_file $f.dtbo; " \
-+ FDT_APPLY_OVERLAY() \
-+ " done;" \
-+ "fi; "
++#define CHECK_APPLY_OVERLAY_IDX( name ) \
++ "if env exists dtoverlay_" name "; then " \
++ "for i in ${dtoverlay_" name "}; do " \
++ "setenv dtbo_file ext-" name "$i.dtbo; " \
++ FDT_APPLY_OVERLAY() \
++ " done;" \
++ "fi; "
++
++#define CHECK_APPLY_OVERLAY_DTBO( name ) \
++ "if env exists dtoverlay_" name "; then " \
++ "for f in ${dtoverlay_" name "}; do " \
++ "setenv dtbo_file $f; " \
++ FDT_APPLY_OVERLAY() \
++ " done;" \
++ "fi; "
+
+#define FDT_ENTRY_DEF_SETTINGS \
-+ CHECK_APPLY_OVERLAY("lcd") \
-+ CHECK_APPLY_OVERLAY("cam") \
-+ CHECK_APPLY_OVERLAY("i2c1") \
-+ CHECK_APPLY_OVERLAY("spi1") \
-+ CHECK_APPLY_OVERLAYS_IDX("uart") \
-+ CHECK_APPLY_OVERLAYS_IDX("can") \
-+ CHECK_APPLY_OVERLAYS_IDX("pwm") \
-+ CHECK_APPLY_OVERLAYS_DTBO("extra") \
++ CHECK_APPLY_OVERLAY_VAL("camera") \
++ CHECK_APPLY_OVERLAY_VAL("display") \
++ CHECK_APPLY_OVERLAY_IDX("pwm") \
++ CHECK_APPLY_OVERLAY_IDX("i2c") \
++ CHECK_APPLY_OVERLAY_IDX("spi") \
++ CHECK_APPLY_OVERLAY_IDX("uart") \
++ CHECK_APPLY_OVERLAY_IDX("can") \
++ CHECK_APPLY_OVERLAY_DTBO("extra") \
+
-+#define MMC_FDT_OVERLAY_SETTING \
-+ "fdt_size=0x10000\0" \
-+ "dtbo_addr=0x83010000\0" \
-+ "dtbo_dir=overlays\0" \
-+ "mmcbootdto=echo Booting from mmc with overlay...; " \
-+ "mmc dev ${mmcdev}; run mmcargs; run loadenvconf; " \
-+ "run loadimage; run loadfdt; " \
-+ FDT_ENTRY_DEF_SETTINGS \
-+ "bootz ${loadaddr} - ${fdt_addr}\0"
+
-+#define ENABLE_UENV_FDTO_SUPPORT
++#define MMC_BOOT_WITH_FDT_OVERLAY \
++ "mmc dev ${mmcdev};" \
++ "run mmcargs; run loadenvconf;" \
++ "run loadimage; run loadfdt; " \
++ FDT_ENTRY_DEF_SETTINGS \
++ "run bootos; " \
+
-+#endif
++#endif /* __IGKBOARD_DTOVERLAY_H */
--
Gitblit v1.9.1