From 0365e3e471c3df1c0a76d05dde7214d24d3f453d Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sun, 12 Jun 2022 00:43:07 +0800
Subject: [PATCH] Update uboot patch to add camera and extra dtoverlays support

---
 bsp/bootloader/patch/uboot-imx-lf-5.10.52-2.1.0.patch |   54 ++++++++++++++++++++++++++++++++----------------------
 1 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/bsp/bootloader/patch/uboot-imx-lf-5.10.52-2.1.0.patch b/bsp/bootloader/patch/uboot-imx-lf-5.10.52-2.1.0.patch
index c033814..59b6331 100644
--- a/bsp/bootloader/patch/uboot-imx-lf-5.10.52-2.1.0.patch
+++ b/bsp/bootloader/patch/uboot-imx-lf-5.10.52-2.1.0.patch
@@ -1,6 +1,6 @@
 diff -Nuar -x lingyun.bmp uboot-imx/arch/arm/dts/igkboard.dts uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/igkboard.dts
 --- uboot-imx/arch/arm/dts/igkboard.dts	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/igkboard.dts	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/igkboard.dts	2022-06-05 20:35:49.127986610 +0800
 @@ -0,0 +1,19 @@
 +// SPDX-License-Identifier: (GPL-2.0 OR MIT)
 +//
@@ -23,7 +23,7 @@
 +};
 diff -Nuar -x lingyun.bmp uboot-imx/arch/arm/dts/imx6ul-14x14-evk.dtsi uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/imx6ul-14x14-evk.dtsi
 --- uboot-imx/arch/arm/dts/imx6ul-14x14-evk.dtsi	2021-09-06 16:48:23.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/imx6ul-14x14-evk.dtsi	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/imx6ul-14x14-evk.dtsi	2022-06-05 20:35:49.127986610 +0800
 @@ -21,7 +21,6 @@
  		regulator-name = "VSD_3V3";
  		regulator-min-microvolt = <3300000>;
@@ -140,7 +140,7 @@
  
 diff -Nuar -x lingyun.bmp uboot-imx/arch/arm/dts/Makefile uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/Makefile
 --- uboot-imx/arch/arm/dts/Makefile	2021-09-06 16:48:23.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/Makefile	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/dts/Makefile	2022-06-05 20:35:49.127986610 +0800
 @@ -779,6 +779,7 @@
  	imx6ul-pico-pi.dtb
  
@@ -151,7 +151,7 @@
  	imx6ull-14x14-ddr3-val-emmc.dtb \
 diff -Nuar -x lingyun.bmp uboot-imx/arch/arm/mach-imx/mx6/Kconfig uboot-imx-lf-5.10.52-2.1.0/arch/arm/mach-imx/mx6/Kconfig
 --- uboot-imx/arch/arm/mach-imx/mx6/Kconfig	2021-09-06 16:48:23.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/mach-imx/mx6/Kconfig	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/arch/arm/mach-imx/mx6/Kconfig	2022-06-05 20:35:49.131986487 +0800
 @@ -158,6 +158,16 @@
  	prompt "MX6 board select"
  	optional
@@ -178,7 +178,7 @@
  endif
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/igkboard.c uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/igkboard.c
 --- uboot-imx/board/lingyun/igkboard/igkboard.c	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/igkboard.c	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/igkboard.c	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,369 @@
 +// SPDX-License-Identifier: GPL-2.0+
 +/*
@@ -551,7 +551,7 @@
 +}
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/imximage.cfg uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/imximage.cfg
 --- uboot-imx/board/lingyun/igkboard/imximage.cfg	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/imximage.cfg	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/imximage.cfg	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,121 @@
 +/* SPDX-License-Identifier: GPL-2.0+ */
 +/*
@@ -676,7 +676,7 @@
 +#endif
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/imximage_lpddr2.cfg uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/imximage_lpddr2.cfg
 --- uboot-imx/board/lingyun/igkboard/imximage_lpddr2.cfg	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/imximage_lpddr2.cfg	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/imximage_lpddr2.cfg	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,126 @@
 +/*
 + * Copyright (C) 2016 Freescale Semiconductor, Inc.
@@ -806,7 +806,7 @@
 +#endif
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/Kconfig uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/Kconfig
 --- uboot-imx/board/lingyun/igkboard/Kconfig	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/Kconfig	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/Kconfig	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,14 @@
 +if TARGET_LINGYUN_IGKBOARD
 +
@@ -824,7 +824,7 @@
 +endif
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/MAINTAINERS uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/MAINTAINERS
 --- uboot-imx/board/lingyun/igkboard/MAINTAINERS	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/MAINTAINERS	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/MAINTAINERS	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,6 @@
 +LingYun IoT Gateway Board(IGKBoard)
 +M:	Guo Wenxue <guowenxue@gmail.com>
@@ -834,7 +834,7 @@
 +F:	configs/igkboard_defconfig
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/Makefile uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/Makefile
 --- uboot-imx/board/lingyun/igkboard/Makefile	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/Makefile	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/Makefile	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,5 @@
 +# SPDX-License-Identifier: GPL-2.0+
 +# (C) Copyright 2016 Freescale Semiconductor, Inc.
@@ -843,7 +843,7 @@
 +obj-y  += ../../freescale/common/mmc.o
 diff -Nuar -x lingyun.bmp uboot-imx/board/lingyun/igkboard/plugin.S uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/plugin.S
 --- uboot-imx/board/lingyun/igkboard/plugin.S	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/plugin.S	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/board/lingyun/igkboard/plugin.S	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,263 @@
 +/* SPDX-License-Identifier: GPL-2.0+ */
 +/*
@@ -1110,7 +1110,7 @@
 +#include <asm/arch/mx6_plugin.S>
 diff -Nuar -x lingyun.bmp uboot-imx/configs/igkboard_defconfig uboot-imx-lf-5.10.52-2.1.0/configs/igkboard_defconfig
 --- uboot-imx/configs/igkboard_defconfig	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/configs/igkboard_defconfig	2022-06-05 17:28:51.237216727 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/configs/igkboard_defconfig	2022-06-12 00:41:52.657550517 +0800
 @@ -0,0 +1,97 @@
 +CONFIG_ARM=y
 +CONFIG_ARCH_MX6=y
@@ -1211,7 +1211,7 @@
 +CONFIG_OF_LIBFDT_OVERLAY=y
 diff -Nuar -x lingyun.bmp uboot-imx/drivers/fastboot/fb_fsl/fb_fsl_partitions.c uboot-imx-lf-5.10.52-2.1.0/drivers/fastboot/fb_fsl/fb_fsl_partitions.c
 --- uboot-imx/drivers/fastboot/fb_fsl/fb_fsl_partitions.c	2021-09-06 16:48:23.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/drivers/fastboot/fb_fsl/fb_fsl_partitions.c	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/drivers/fastboot/fb_fsl/fb_fsl_partitions.c	2022-06-05 20:35:49.131986487 +0800
 @@ -185,6 +185,12 @@
  			boot_partition = FASTBOOT_MMC_BOOT_PARTITION_ID;
  			user_partition = FASTBOOT_MMC_USER_PARTITION_ID;
@@ -1227,7 +1227,7 @@
  			fastboot_devinfo.type);
 diff -Nuar -x lingyun.bmp uboot-imx/drivers/net/phy/phy.c uboot-imx-lf-5.10.52-2.1.0/drivers/net/phy/phy.c
 --- uboot-imx/drivers/net/phy/phy.c	2021-09-06 16:48:23.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/drivers/net/phy/phy.c	2022-06-04 18:39:14.483032318 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/drivers/net/phy/phy.c	2022-06-05 20:35:49.131986487 +0800
 @@ -182,6 +182,9 @@
  {
  	int result;
@@ -1240,7 +1240,7 @@
  
 diff -Nuar -x lingyun.bmp uboot-imx/include/configs/igkboard.h uboot-imx-lf-5.10.52-2.1.0/include/configs/igkboard.h
 --- uboot-imx/include/configs/igkboard.h	1970-01-01 08:00:00.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/include/configs/igkboard.h	2022-06-05 17:24:46.360263488 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/include/configs/igkboard.h	2022-06-05 20:35:49.131986487 +0800
 @@ -0,0 +1,200 @@
 +/* SPDX-License-Identifier: GPL-2.0+ */
 +/*
@@ -1444,8 +1444,8 @@
 +#endif
 diff -Nuar -x lingyun.bmp uboot-imx/include/configs/igkboard_overlay.h uboot-imx-lf-5.10.52-2.1.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.10.52-2.1.0/include/configs/igkboard_overlay.h	2022-06-05 17:21:55.778465411 +0800
-@@ -0,0 +1,78 @@
++++ uboot-imx-lf-5.10.52-2.1.0/include/configs/igkboard_overlay.h	2022-06-12 00:29:53.640427137 +0800
+@@ -0,0 +1,88 @@
 +/* SPDX-License-Identifier: GPL-2.0+ */
 +/*
 + * Copyright (C) 2022 LingYun IoT System Studio
@@ -1495,7 +1495,7 @@
 +		FDT_APPLY_OVERLAY() \
 +	"fi; "
 +
-+#define CHECK_APPLY_OVERLAYS( name )     \
++#define CHECK_APPLY_OVERLAYS_IDX( name )     \
 +	"if env exists dtoverlay_" name "; then " \
 +    	"for i in ${dtoverlay_" name "}; do " \
 +    		"setenv dtbo_file " name "$i.dtbo; " \
@@ -1503,13 +1503,23 @@
 +		" done;" \
 +	"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 FDT_ENTRY_DEF_SETTINGS          \
 +				CHECK_APPLY_OVERLAY("lcd") \
++				CHECK_APPLY_OVERLAY("cam") \
 +				CHECK_APPLY_OVERLAY("i2c1") \
 +				CHECK_APPLY_OVERLAY("spi1") \
-+				CHECK_APPLY_OVERLAYS("uart") \
-+				CHECK_APPLY_OVERLAYS("can") \
-+				CHECK_APPLY_OVERLAYS("pwm") \
++				CHECK_APPLY_OVERLAYS_IDX("uart") \
++				CHECK_APPLY_OVERLAYS_IDX("can") \
++				CHECK_APPLY_OVERLAYS_IDX("pwm") \
++				CHECK_APPLY_OVERLAYS_DTBO("extra") \
 +
 +#define MMC_FDT_OVERLAY_SETTING                  \
 +	 	"fdt_size=0x10000\0" \
@@ -1526,7 +1536,7 @@
 +#endif
 diff -Nuar -x lingyun.bmp uboot-imx/Makefile uboot-imx-lf-5.10.52-2.1.0/Makefile
 --- uboot-imx/Makefile	2021-09-06 16:48:23.000000000 +0800
-+++ uboot-imx-lf-5.10.52-2.1.0/Makefile	2022-06-05 17:24:50.628209364 +0800
++++ uboot-imx-lf-5.10.52-2.1.0/Makefile	2022-06-12 00:28:21.925275284 +0800
 @@ -263,6 +263,9 @@
  CROSS_COMPILE ?=
  endif

--
Gitblit v1.9.1