]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
uboot-mediatek: update to v2025.07
authorShiji Yang <yangshiji66@outlook.com>
Tue, 10 Jun 2025 15:59:39 +0000 (23:59 +0800)
committerDaniel Golle <daniel@makrotopia.org>
Sat, 19 Jul 2025 01:59:15 +0000 (02:59 +0100)
Update to the latest version.

Suppressed patch:
  100-04-env-add-support-for-generic-MTD-device.patch[1]

[1] https://github.com/u-boot/u-boot/commit/03fb08d4aef8c342b583e148d1b5c4d289c5572f

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
23 files changed:
package/boot/uboot-mediatek/Makefile
package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch [deleted file]
package/boot/uboot-mediatek/patches/100-08-common-board_r-add-support-to-initialize-NMBM-after-.patch
package/boot/uboot-mediatek/patches/100-09-cmd-add-nmbm-command.patch
package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch
package/boot/uboot-mediatek/patches/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch
package/boot/uboot-mediatek/patches/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch
package/boot/uboot-mediatek/patches/100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch
package/boot/uboot-mediatek/patches/100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch
package/boot/uboot-mediatek/patches/100-21-mtd-spi-nor-add-more-flash-ids.patch
package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch
package/boot/uboot-mediatek/patches/100-26-env-ubi-add-support-to-create-environment-volume-if-.patch
package/boot/uboot-mediatek/patches/101-03-mtd-spinand-fix-support-for-FORESEE.patch
package/boot/uboot-mediatek/patches/130-fix-mkimage-host-build.patch
package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch
package/boot/uboot-mediatek/patches/250-fix-mmc-erase-timeout.patch
package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch
package/boot/uboot-mediatek/patches/301-mt7622-generic-reset-button-ignore-env.patch
package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch
package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch
package/boot/uboot-mediatek/patches/420-add-support-for-RAVPower-RP-WD009.patch
package/boot/uboot-mediatek/patches/452-add-xiaomi-redmi-ax6s.patch
package/boot/uboot-mediatek/patches/457-initialized-the-watchdog-subsystem-later.patch

index c419bcdbe33a6ee9a9e5d1a56180f1cf0549cebe..0069c557cb2c2ba8283a6dc4afb83dbc543fa0d4 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
-PKG_VERSION:=2025.04
-PKG_HASH:=439d3bef296effd54130be6a731c5b118be7fddd7fcc663ccbc5fb18294d8718
+PKG_VERSION:=2025.07
+PKG_HASH:=0f933f6c5a426895bf306e93e6ac53c60870e4b54cda56d95211bec99e63bec7
 PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host
 
 UBOOT_USE_INTREE_DTC:=1
diff --git a/package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch b/package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch
deleted file mode 100644 (file)
index e0edda8..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-From efc3e6f5d29f87a433b42f15a0b87e04b7cd498d Mon Sep 17 00:00:00 2001
-From: Weijie Gao <weijie.gao@mediatek.com>
-Date: Wed, 3 Mar 2021 10:11:32 +0800
-Subject: [PATCH 38/71] env: add support for generic MTD device
-
-Add an env driver for generic MTD device.
-
-Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
----
- cmd/nvedit.c           |   3 +-
- env/Kconfig            |  37 +++++-
- env/Makefile           |   1 +
- env/env.c              |   3 +
- env/mtd.c              | 256 +++++++++++++++++++++++++++++++++++++++++
- include/env_internal.h |   1 +
- tools/Makefile         |   1 +
- 7 files changed, 299 insertions(+), 3 deletions(-)
- create mode 100644 env/mtd.c
-
---- a/env/Kconfig
-+++ b/env/Kconfig
-@@ -74,7 +74,7 @@ config ENV_IS_DEFAULT
-                    !ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
-                    !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
-                    !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
--                   !ENV_IS_IN_UBI
-+                   !ENV_IS_IN_UBI && !ENV_IS_IN_MTD
-       select ENV_IS_NOWHERE
- config ENV_IS_NOWHERE
-@@ -267,6 +267,27 @@ config ENV_IS_IN_MMC
-         offset: "u-boot,mmc-env-offset", "u-boot,mmc-env-offset-redundant".
-         CONFIG_ENV_OFFSET and CONFIG_ENV_OFFSET_REDUND are not used.
-+config ENV_IS_IN_MTD
-+      bool "Environment in a MTD device"
-+      depends on !CHAIN_OF_TRUST
-+      depends on MTD
-+      help
-+        Define this if you have a MTD device which you want to use for
-+        the environment.
-+
-+        - CONFIG_ENV_MTD_NAME:
-+        - CONFIG_ENV_OFFSET:
-+        - CONFIG_ENV_SIZE:
-+
-+        These three #defines specify the MTD device where the environment
-+        is stored, offset and size of the environment area within the MTD
-+        device. CONFIG_ENV_OFFSET must be aligned to an erase block boundary.
-+
-+        - CONFIG_ENV_SIZE_REDUND:
-+
-+        This #define specify the maximum size allowed for read/write/erase
-+        with skipped bad blocks starting from ENV_OFFSET.
-+
- config ENV_IS_IN_NAND
-       bool "Environment in a NAND device"
-       depends on !CHAIN_OF_TRUST
-@@ -574,10 +595,16 @@ config ENV_ADDR_REDUND
-         Offset from the start of the device (or partition) of the redundant
-         environment location.
-+config ENV_MTD_NAME
-+      string "Name of the MTD device storing the environment"
-+      depends on ENV_IS_IN_MTD
-+      help
-+        Name of the MTD device that stores the environment
-+
- config ENV_OFFSET
-       hex "Environment offset"
-       depends on ENV_IS_IN_EEPROM || ENV_IS_IN_MMC || ENV_IS_IN_NAND || \
--                  ENV_IS_IN_SPI_FLASH
-+                  ENV_IS_IN_SPI_FLASH || ENV_IS_IN_MTD
-       default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
-       default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
-       default 0xF0000 if ARCH_SUNXI
-@@ -635,6 +662,12 @@ config ENV_SECT_SIZE
-       help
-         Size of the sector containing the environment.
-+config ENV_SIZE_REDUND
-+      hex "Redundant environment size"
-+      depends on ENV_IS_IN_MTD
-+      help
-+        The maximum size allowed for read/write/erase with skipped bad blocks.
-+
- config ENV_UBI_PART
-       string "UBI partition name"
-       depends on ENV_IS_IN_UBI
---- a/env/Makefile
-+++ b/env/Makefile
-@@ -24,6 +24,7 @@ obj-$(CONFIG_$(PHASE_)ENV_IS_NOWHERE) +=
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_MMC) += mmc.o
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_FAT) += fat.o
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_EXT4) += ext4.o
-+obj-$(CONFIG_$(PHASE_)ENV_IS_IN_MTD) += mtd.o
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_NAND) += nand.o
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_SPI_FLASH) += sf.o
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_FLASH) += flash.o
---- a/env/env.c
-+++ b/env/env.c
-@@ -46,6 +46,9 @@ static enum env_location env_locations[]
- #ifdef CONFIG_ENV_IS_IN_MMC
-       ENVL_MMC,
- #endif
-+#ifdef CONFIG_ENV_IS_IN_MTD
-+      ENVL_MTD,
-+#endif
- #ifdef CONFIG_ENV_IS_IN_NAND
-       ENVL_NAND,
- #endif
---- /dev/null
-+++ b/env/mtd.c
-@@ -0,0 +1,256 @@
-+/* SPDX-License-Identifier: GPL-2.0 */
-+/*
-+ * Copyright (C) 2021 MediaTek Inc. All Rights Reserved.
-+ *
-+ * Author: Weijie Gao <weijie.gao@mediatek.com>
-+ */
-+
-+#include <command.h>
-+#include <env.h>
-+#include <env_internal.h>
-+#include <errno.h>
-+#include <linux/kernel.h>
-+#include <linux/stddef.h>
-+#include <linux/types.h>
-+#include <linux/mtd/mtd.h>
-+#include <malloc.h>
-+#include <memalign.h>
-+#include <mtd.h>
-+#include <search.h>
-+
-+#if CONFIG_ENV_SIZE_REDUND < CONFIG_ENV_SIZE
-+#undef CONFIG_ENV_SIZE_REDUND
-+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
-+#endif
-+
-+#if defined(ENV_IS_EMBEDDED)
-+env_t *env_ptr = &environment;
-+#else /* ! ENV_IS_EMBEDDED */
-+env_t *env_ptr;
-+#endif /* ENV_IS_EMBEDDED */
-+
-+DECLARE_GLOBAL_DATA_PTR;
-+
-+static int env_mtd_init(void)
-+{
-+#if defined(ENV_IS_EMBEDDED)
-+      int crc1_ok = 0, crc2_ok = 0;
-+      env_t *tmp_env1;
-+
-+      tmp_env1 = env_ptr;
-+      crc1_ok = crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc;
-+
-+      if (!crc1_ok && !crc2_ok) {
-+              gd->env_addr    = 0;
-+              gd->env_valid   = ENV_INVALID;
-+
-+              return 0;
-+      } else if (crc1_ok && !crc2_ok) {
-+              gd->env_valid = ENV_VALID;
-+      }
-+
-+      if (gd->env_valid == ENV_VALID)
-+              env_ptr = tmp_env1;
-+
-+      gd->env_addr = (ulong)env_ptr->data;
-+
-+#else /* ENV_IS_EMBEDDED */
-+      gd->env_addr    = (ulong)&default_environment[0];
-+      gd->env_valid   = ENV_VALID;
-+#endif /* ENV_IS_EMBEDDED */
-+
-+      return 0;
-+}
-+
-+static struct mtd_info *env_mtd_get_dev(void)
-+{
-+      struct mtd_info *mtd;
-+
-+      mtd_probe_devices();
-+
-+      mtd = get_mtd_device_nm(CONFIG_ENV_MTD_NAME);
-+      if (IS_ERR(mtd) || !mtd) {
-+              printf("MTD device '%s' not found\n", CONFIG_ENV_MTD_NAME);
-+              return NULL;
-+      }
-+
-+      return mtd;
-+}
-+
-+static inline bool mtd_addr_is_block_aligned(struct mtd_info *mtd, u64 addr)
-+{
-+      return (addr & mtd->erasesize_mask) == 0;
-+}
-+
-+static int mtd_io_skip_bad(struct mtd_info *mtd, bool read, loff_t offset,
-+                         size_t length, size_t redund, u8 *buffer)
-+{
-+      struct mtd_oob_ops io_op = {};
-+      size_t remaining = length;
-+      loff_t off, end;
-+      int ret;
-+
-+      io_op.mode = MTD_OPS_PLACE_OOB;
-+      io_op.len = mtd->writesize;
-+      io_op.datbuf = (void *)buffer;
-+
-+      /* Search for the first good block after the given offset */
-+      off = offset;
-+      end = (off + redund) | (mtd->erasesize - 1);
-+      while (mtd_block_isbad(mtd, off) && off < end)
-+              off += mtd->erasesize;
-+
-+      /* Reached end position */
-+      if (off >= end)
-+              return -EIO;
-+
-+      /* Loop over the pages to do the actual read/write */
-+      while (remaining) {
-+              /* Skip the block if it is bad */
-+              if (mtd_addr_is_block_aligned(mtd, off) &&
-+                  mtd_block_isbad(mtd, off)) {
-+                      off += mtd->erasesize;
-+                      continue;
-+              }
-+
-+              if (read)
-+                      ret = mtd_read_oob(mtd, off, &io_op);
-+              else
-+                      ret = mtd_write_oob(mtd, off, &io_op);
-+
-+              if (ret) {
-+                      printf("Failure while %s at offset 0x%llx\n",
-+                             read ? "reading" : "writing", off);
-+                      break;
-+              }
-+
-+              off += io_op.retlen;
-+              remaining -= io_op.retlen;
-+              io_op.datbuf += io_op.retlen;
-+              io_op.oobbuf += io_op.oobretlen;
-+
-+              /* Reached end position */
-+              if (off >= end)
-+                      return -EIO;
-+      }
-+
-+      return 0;
-+}
-+
-+#ifdef CONFIG_CMD_SAVEENV
-+static int mtd_erase_skip_bad(struct mtd_info *mtd, loff_t offset,
-+                            size_t length, size_t redund)
-+{
-+      struct erase_info erase_op = {};
-+      loff_t end = (offset + redund) | (mtd->erasesize - 1);
-+      int ret;
-+
-+      erase_op.mtd = mtd;
-+      erase_op.addr = offset;
-+      erase_op.len = length;
-+
-+      while (erase_op.len) {
-+              ret = mtd_erase(mtd, &erase_op);
-+
-+              /* Abort if its not a bad block error */
-+              if (ret != -EIO)
-+                      return ret;
-+
-+              printf("Skipping bad block at 0x%08llx\n", erase_op.fail_addr);
-+
-+              /* Skip bad block and continue behind it */
-+              erase_op.len -= erase_op.fail_addr - erase_op.addr;
-+              erase_op.len -= mtd->erasesize;
-+              erase_op.addr = erase_op.fail_addr + mtd->erasesize;
-+
-+              /* Reached end position */
-+              if (erase_op.addr >= end)
-+                      return -EIO;
-+      }
-+
-+      return 0;
-+}
-+
-+static int env_mtd_save(void)
-+{
-+      ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
-+      struct mtd_info *mtd;
-+      int ret = 0;
-+
-+      ret = env_export(env_new);
-+      if (ret)
-+              return ret;
-+
-+      mtd = env_mtd_get_dev();
-+      if (!mtd)
-+              return 1;
-+
-+      printf("Erasing on MTD device '%s'... ", mtd->name);
-+
-+      ret = mtd_erase_skip_bad(mtd, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-+                               CONFIG_ENV_SIZE_REDUND);
-+
-+      puts(ret ? "FAILED\n" : "OK\n");
-+
-+      if (ret) {
-+              put_mtd_device(mtd);
-+              return 1;
-+      }
-+
-+      printf("Writing to MTD device '%s'... ", mtd->name);
-+
-+      ret = mtd_io_skip_bad(mtd, false, CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
-+                            CONFIG_ENV_SIZE_REDUND, (u8 *)env_new);
-+
-+      puts(ret ? "FAILED\n" : "OK\n");
-+
-+      put_mtd_device(mtd);
-+
-+      return !!ret;
-+}
-+#endif /* CONFIG_CMD_SAVEENV */
-+
-+static int readenv(size_t offset, u_char *buf)
-+{
-+      struct mtd_info *mtd;
-+      int ret;
-+
-+      mtd = env_mtd_get_dev();
-+      if (!mtd)
-+              return 1;
-+
-+      ret = mtd_io_skip_bad(mtd, true, offset, CONFIG_ENV_SIZE,
-+                            CONFIG_ENV_SIZE_REDUND, buf);
-+
-+      put_mtd_device(mtd);
-+
-+      return !!ret;
-+}
-+
-+static int env_mtd_load(void)
-+{
-+#if !defined(ENV_IS_EMBEDDED)
-+      ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
-+      int ret;
-+
-+      ret = readenv(CONFIG_ENV_OFFSET, (u_char *)buf);
-+      if (ret) {
-+              env_set_default("readenv() failed", 0);
-+              return -EIO;
-+      }
-+
-+      return env_import(buf, 1, H_EXTERNAL);
-+#endif /* ! ENV_IS_EMBEDDED */
-+
-+      return 0;
-+}
-+
-+U_BOOT_ENV_LOCATION(mtd) = {
-+      .location       = ENVL_MTD,
-+      ENV_NAME("MTD")
-+      .load           = env_mtd_load,
-+#if defined(CONFIG_CMD_SAVEENV)
-+      .save           = env_save_ptr(env_mtd_save),
-+#endif
-+      .init           = env_mtd_init,
-+};
---- a/include/env_internal.h
-+++ b/include/env_internal.h
-@@ -108,6 +108,7 @@ enum env_location {
-       ENVL_FAT,
-       ENVL_FLASH,
-       ENVL_MMC,
-+      ENVL_MTD,
-       ENVL_NAND,
-       ENVL_NVRAM,
-       ENVL_ONENAND,
---- a/tools/Makefile
-+++ b/tools/Makefile
-@@ -37,6 +37,7 @@ subdir-$(HOST_TOOLS_ALL) += gdb
- ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
- ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
- ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
-+ENVCRC-$(CONFIG_ENV_IS_IN_MTD) = y
- ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y
- ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
- ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
index 381ceb29de9ebf02f4210fc3bed1adfc9abea509..ebaff6a6ab2c050bdf74fcc74602ed147e944cd1 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/common/board_r.c
 +++ b/common/board_r.c
-@@ -378,6 +378,20 @@ static int initr_nand(void)
+@@ -399,6 +399,20 @@ static int initr_nand(void)
  }
  #endif
  
@@ -34,13 +34,13 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  #if defined(CONFIG_CMD_ONENAND)
  /* go init the NAND */
  static int initr_onenand(void)
-@@ -693,6 +707,9 @@ static init_fnc_t init_sequence_r[] = {
- #ifdef CONFIG_CMD_ONENAND
-       initr_onenand,
+@@ -718,6 +732,9 @@ static void initcall_run_r(void)
+ #if CONFIG_IS_ENABLED(CMD_ONENAND)
+       INITCALL(initr_onenand);
  #endif
-+#ifdef CONFIG_NMBM_MTD
-+      initr_nmbm,
++#if CONFIG_IS_ENABLED(NMBM_MTD)
++      INITCALL(initr_nmbm);
 +#endif
- #ifdef CONFIG_MMC
-       initr_mmc,
+ #if CONFIG_IS_ENABLED(MMC)
+       INITCALL(initr_mmc);
  #endif
index 6d89c7480e8aece528f6adb2e886a3a45ba560db..37142edc2315ac64513fa0321f0e7eddfbd7d505 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -1525,6 +1525,12 @@ config CMD_NAND_WATCH
+@@ -1535,6 +1535,12 @@ config CMD_NAND_WATCH
  
  endif # CMD_NAND
  
index a02a59a0579c50127c909b38138734235dc1849c..f85c475d4b6b5a556a6aadc4ab7e16e52ab09ded 100644 (file)
@@ -27,7 +27,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        select ENV_IS_NOWHERE
  
  config ENV_IS_NOWHERE
-@@ -318,6 +318,21 @@ config ENV_IS_IN_NAND
+@@ -297,6 +297,21 @@ config ENV_IS_IN_NAND
          Currently, CONFIG_ENV_OFFSET_REDUND is not supported when
          using CONFIG_ENV_OFFSET_OOB.
  
@@ -49,7 +49,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  config ENV_RANGE
        hex "Length of the region in which the environment can be written"
        depends on ENV_IS_IN_NAND
-@@ -604,7 +619,7 @@ config ENV_MTD_NAME
+@@ -596,7 +611,7 @@ config ENV_ADDR_REDUND
  config ENV_OFFSET
        hex "Environment offset"
        depends on ENV_IS_IN_EEPROM || ENV_IS_IN_MMC || ENV_IS_IN_NAND || \
@@ -60,17 +60,17 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        default 0xF0000 if ARCH_SUNXI
 --- a/env/Makefile
 +++ b/env/Makefile
-@@ -26,6 +26,7 @@ obj-$(CONFIG_$(PHASE_)ENV_IS_IN_FAT) +=
+@@ -25,6 +25,7 @@ obj-$(CONFIG_$(PHASE_)ENV_IS_IN_MMC) +=
+ obj-$(CONFIG_$(PHASE_)ENV_IS_IN_FAT) += fat.o
  obj-$(CONFIG_$(PHASE_)ENV_IS_IN_EXT4) += ext4.o
- obj-$(CONFIG_$(PHASE_)ENV_IS_IN_MTD) += mtd.o
  obj-$(CONFIG_$(PHASE_)ENV_IS_IN_NAND) += nand.o
 +obj-$(CONFIG_$(PHASE_)ENV_IS_IN_NMBM) += nmbm.o
  obj-$(CONFIG_$(PHASE_)ENV_IS_IN_SPI_FLASH) += sf.o
+ obj-$(CONFIG_$(PHASE_)ENV_IS_IN_MTD) += mtd.o
  obj-$(CONFIG_$(PHASE_)ENV_IS_IN_FLASH) += flash.o
 --- a/env/env.c
 +++ b/env/env.c
-@@ -52,6 +52,9 @@ static enum env_location env_locations[]
+@@ -49,6 +49,9 @@ static enum env_location env_locations[]
  #ifdef CONFIG_ENV_IS_IN_NAND
        ENVL_NAND,
  #endif
@@ -240,9 +240,9 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 +};
 --- a/include/env_internal.h
 +++ b/include/env_internal.h
-@@ -110,6 +110,7 @@ enum env_location {
+@@ -109,6 +109,7 @@ enum env_location {
+       ENVL_FLASH,
        ENVL_MMC,
-       ENVL_MTD,
        ENVL_NAND,
 +      ENVL_NMBM,
        ENVL_NVRAM,
@@ -250,9 +250,9 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        ENVL_REMOTE,
 --- a/tools/Makefile
 +++ b/tools/Makefile
-@@ -39,6 +39,7 @@ ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
+@@ -38,6 +38,7 @@ ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
+ ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
  ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
- ENVCRC-$(CONFIG_ENV_IS_IN_MTD) = y
  ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y
 +ENVCRC-$(CONFIG_ENV_IS_IN_NMBM) = y
  ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
index 83a5a3f234dc9d83a3279e2edca1c2f016ff70ca..c07a52fad55cb7373bfdaf53ed5b4acba70d132e 100644 (file)
@@ -26,7 +26,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -1525,6 +1525,14 @@ config CMD_NAND_WATCH
+@@ -1535,6 +1535,14 @@ config CMD_NAND_WATCH
  
  endif # CMD_NAND
  
index 230bbf0fa3c49aa7266259dd2efd10ba65603ac0..a62aee70929a5b7509dc9879c7d6e9ff580cbda8 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mtd/spi/spi-nor-core.c
 +++ b/drivers/mtd/spi/spi-nor-core.c
-@@ -3248,6 +3248,100 @@ static int spi_nor_init_params(struct sp
+@@ -3262,6 +3262,100 @@ static int spi_nor_init_params(struct sp
        return 0;
  }
  
@@ -114,7 +114,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  static int spi_nor_hwcaps2cmd(u32 hwcaps, const int table[][2], size_t size)
  {
        size_t i;
-@@ -4450,6 +4544,7 @@ int spi_nor_scan(struct spi_nor *nor)
+@@ -4486,6 +4580,7 @@ int spi_nor_scan(struct spi_nor *nor)
        nor->write = spi_nor_write_data;
        nor->read_reg = spi_nor_read_reg;
        nor->write_reg = spi_nor_write_reg;
index 68b2eee61e9d7e9fda0453b5e10a47eec3758ba3..8e3e4e395b1f8c071f13656ed3b8c739597dc01a 100644 (file)
@@ -36,14 +36,11 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        else if (IS_ENABLED(CONFIG_CMD_SF_TEST) && !strcmp(cmd, "test"))
                ret = do_spi_flash_test(argc, argv);
        else
-@@ -643,8 +653,9 @@ U_BOOT_LONGHELP(sf,
+@@ -638,6 +648,7 @@ U_BOOT_LONGHELP(sf,
+       "sf update addr offset|partition len    - erase and write `len' bytes from memory\n"
+       "                                         at `addr' to flash at `offset'\n"
+       "                                         or to start of mtd `partition'\n"
++      "sf uuid                                - read uuid from flash\n"
+ #ifdef CONFIG_SPI_FLASH_LOCK
+       "sf protect lock/unlock sector len      - protect/unprotect 'len' bytes starting\n"
        "                                         at address 'sector'"
- #endif
- #ifdef CONFIG_CMD_SF_TEST
--      "\nsf test offset len           - run a very basic destructive test"
-+      "\nsf test offset len                   - run a very basic destructive test"
- #endif
-+      "\nsf uuid                                      - read uuid from flash"
-       );
- U_BOOT_CMD(
index 63083555bf558008f9b8afe4821ac9ca2a30b418..3bf80c9dddef1d5af77b8dedea0ebebb45d907e5 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1136,6 +1136,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1119,6 +1119,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7622-bananapi-bpi-r64.dtb \
        mt7623n-bananapi-bpi-r2.dtb \
        mt7981-rfb.dtb \
index 39b254133eb64373ba6946868161508ff6ccddcd..03dddc949b880d9e30eb4784e6580e65133e79c7 100644 (file)
@@ -46,7 +46,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
                INFO("gd25lq128", 0xc86018, 0, 64 * 1024, 256,
                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
                        SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
-@@ -520,6 +527,16 @@ const struct flash_info spi_nor_ids[] =
+@@ -525,6 +532,16 @@ const struct flash_info spi_nor_ids[] =
                        SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
        },
        {
@@ -63,7 +63,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
                INFO("w25q128jw", 0xef8018, 0, 64 * 1024, 256,
                        SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
                        SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
-@@ -583,6 +600,11 @@ const struct flash_info spi_nor_ids[] =
+@@ -588,6 +605,11 @@ const struct flash_info spi_nor_ids[] =
                        SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
        },
        { INFO("w25q256", 0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
index b740bb7abdfed576992559039166f1452ad351aa..539d8712ff62d1d682f9734fef32cb73a0fc9a3f 100644 (file)
@@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mmc/Kconfig
 +++ b/drivers/mmc/Kconfig
-@@ -868,6 +868,14 @@ config MMC_MTK
+@@ -879,6 +879,14 @@ config MMC_MTK
          This is needed if support for any SD/SDIO/MMC devices is required.
          If unsure, say N.
  
@@ -32,7 +32,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  config FSL_SDHC_V2_3
 --- a/drivers/mmc/Makefile
 +++ b/drivers/mmc/Makefile
-@@ -85,3 +85,7 @@ obj-$(CONFIG_RENESAS_SDHI)           += tmio-comm
+@@ -86,3 +86,7 @@ obj-$(CONFIG_RENESAS_SDHI)           += tmio-comm
  obj-$(CONFIG_MMC_BCM2835)             += bcm2835_sdhost.o
  obj-$(CONFIG_MMC_MTK)                 += mtk-sd.o
  obj-$(CONFIG_MMC_SDHCI_F_SDH30)               += f_sdh30.o
index 0133e09e95c85ad60abd26385548142656207905..2ee6378d21f4085e36804bba01ea1d0902530750 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/env/Kconfig
 +++ b/env/Kconfig
-@@ -701,6 +701,12 @@ config ENV_UBI_VOLUME_REDUND
+@@ -687,6 +687,12 @@ config ENV_UBI_VOLUME_REDUND
        help
          Name of the redundant volume that you want to store the environment in.
  
index 48a6515b56a238e3bf26ed0a1aaad5469701b788..e10bbbbd32c0cb1144017ae4a46fe29587f3c6fa 100644 (file)
@@ -6,7 +6,7 @@ Signed-off-by: Dim Fish <dimfish@gmail.com>
 
 --- a/drivers/mtd/nand/spi/foresee.c
 +++ b/drivers/mtd/nand/spi/foresee.c
-@@ -22,8 +22,8 @@ static SPINAND_OP_VARIANTS(write_cache_v
+@@ -24,8 +24,8 @@ static SPINAND_OP_VARIANTS(write_cache_v
                SPINAND_PROG_LOAD(true, 0, NULL, 0));
  
  static SPINAND_OP_VARIANTS(update_cache_variants,
index a06935f53e5564b6da5bd77fbb934cc0b0c14900..aeff6c8cbed068c5489a697444b1047a0ebed100 100644 (file)
@@ -1,6 +1,6 @@
 --- a/tools/image-host.c
 +++ b/tools/image-host.c
-@@ -1175,6 +1175,7 @@ static int fit_config_add_verification_d
+@@ -1189,6 +1189,7 @@ static int fit_config_add_verification_d
   * 2) get public key (X509_get_pubkey)
   * 3) provide der format (d2i_RSAPublicKey)
   */
@@ -8,7 +8,7 @@
  static int read_pub_key(const char *keydir, const void *name,
                        unsigned char **pubkey, int *pubkey_len)
  {
-@@ -1228,6 +1229,13 @@ err_cert:
+@@ -1242,6 +1243,13 @@ err_cert:
        fclose(f);
        return ret;
  }
index 2b3a15fc59ca9d4a84f28ff1a67020eef1db1b5d..c5ec8ba1fd2b9c18fdd579110d8f32821ab65031 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -707,6 +707,12 @@ config CMD_ENV_EXISTS
+@@ -709,6 +709,12 @@ config CMD_ENV_EXISTS
          Check if a variable is defined in the environment for use in
          shell scripting.
  
index e03b212a7464158deee89809b857070b0c92ad6b..6d7844f66d8344327c21dfdb8a31959c54b252dc 100644 (file)
@@ -6,6 +6,6 @@
        lbaint_t blk = 0, blk_r = 0;
 -      int timeout_ms = 1000;
 +      int timeout_ms = blkcnt;
+       u32 grpcnt;
  
-       if (!mmc)
-               return -1;
index 3f180340fc8d3ef6131f6900efbeec9bf8578c10..a93f7655e0e01058d6efe6d0507ea16a0d695fee 100644 (file)
@@ -16,7 +16,7 @@ Reviewed-by: Tom Rini <trini@konsulko.com>
 
 --- a/boot/image-fdt.c
 +++ b/boot/image-fdt.c
-@@ -613,6 +613,12 @@ int image_setup_libfdt(struct bootm_head
+@@ -614,6 +614,12 @@ int image_setup_libfdt(struct bootm_head
                                        images->fit_uname_cfg,
                                        strlen(images->fit_uname_cfg) + 1, 1);
  
index 2835e19b06d4d9a3fac974a5e361b89ed1a83be4..158420d37a8528a8dacc47081150278436758240 100644 (file)
@@ -48,7 +48,7 @@
  #ifdef CONFIG_ENABLE_NAND_NMBM
 --- a/arch/arm/mach-mediatek/Kconfig
 +++ b/arch/arm/mach-mediatek/Kconfig
-@@ -170,4 +170,11 @@ config MTK_TZ_MOVABLE
+@@ -165,4 +165,11 @@ config MTK_TZ_MOVABLE
        select OF_SYSTEM_SETUP
        bool
  
index b118bb6ca4a4ebbb187b8634b0f42ed3a731d157..8425b15bc16d6c2f169375fd25fb7c46e473c5ff 100644 (file)
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1134,6 +1134,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1117,6 +1117,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7622-rfb.dtb \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
index 9307a7c5f0d45527eb7973066765513454b8514a..7d58df2e4823ed9810848ed8255d279ae09ac61d 100644 (file)
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1135,6 +1135,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1118,6 +1118,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
        mt7622-linksys-e8450-ubi.dtb \
  
  DECLARE_GLOBAL_DATA_PTR;
  
-@@ -402,6 +403,20 @@ static int initr_onenand(void)
+@@ -423,6 +424,20 @@ static int initr_onenand(void)
  }
  #endif
  
  #ifdef CONFIG_MMC
  static int initr_mmc(void)
  {
-@@ -710,6 +725,9 @@ static init_fnc_t init_sequence_r[] = {
- #ifdef CONFIG_NMBM_MTD
-       initr_nmbm,
+@@ -735,6 +750,9 @@ static void initcall_run_r(void)
+ #if CONFIG_IS_ENABLED(NMBM_MTD)
+       INITCALL(initr_nmbm);
  #endif
-+#ifdef CONFIG_SPI_FLASH
-+      initr_spiflash,
++#if CONFIG_IS_ENABLED(SPI_FLASH)
++      INITCALL(initr_spiflash);
 +#endif
- #ifdef CONFIG_MMC
-       initr_mmc,
+ #if CONFIG_IS_ENABLED(MMC)
+       INITCALL(initr_mmc);
  #endif
index df8d1f7ee4b2e73a83be85e18a56187feafe6f67..2a6c75cf9dc6d9b682f2f18bdb44aaee93cea6c6 100644 (file)
@@ -22,7 +22,7 @@ Subject: [PATCH] add support for RAVPower RP-WD009
 
 --- a/arch/mips/dts/Makefile
 +++ b/arch/mips/dts/Makefile
-@@ -26,6 +26,7 @@ dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += m
+@@ -25,6 +25,7 @@ dtb-$(CONFIG_TARGET_OCTEON_EBB7304) += m
  dtb-$(CONFIG_TARGET_OCTEON_NIC23) += mrvl,octeon-nic23.dtb
  dtb-$(CONFIG_BOARD_NETGEAR_CG3100D) += netgear,cg3100d.dtb
  dtb-$(CONFIG_BOARD_NETGEAR_DGND3700V2) += netgear,dgnd3700v2.dtb
index 49e341411f6ad08cc1e0e75f1620e198fd0d95c7..cae928e06825bd502b0c4eb4e0f26c4f96dcb4ec 100644 (file)
@@ -15,7 +15,7 @@ Subject: [PATCH] add xiaomi redmi ax6s
 
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1137,6 +1137,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1120,6 +1120,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7622-linksys-e8450-ubi.dtb \
        mt7622-ubnt-unifi-6-lr.dtb \
        mt7622-ubnt-unifi-6-lr-v3.dtb \
index cecfd5a63b00609ffc7badbe3d1ea01f2b63d7c9..5f864d9b18b7228763daab9143faa57e154c54cf 100644 (file)
@@ -13,42 +13,42 @@ Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
 
 --- a/common/board_r.c
 +++ b/common/board_r.c
-@@ -681,19 +681,13 @@ static init_fnc_t init_sequence_r[] = {
-       serial_initialize,
-       initr_announce,
-       dm_announce,
+@@ -691,19 +691,13 @@ static void initcall_run_r(void)
+       INITCALL(serial_initialize);
+       INITCALL(initr_announce);
+       INITCALL(dm_announce);
 -#if CONFIG_IS_ENABLED(WDT)
--      initr_watchdog,
+-      INITCALL(initr_watchdog);
 -#endif
--      INIT_FUNC_WATCHDOG_RESET
-       arch_initr_trap,
- #if defined(CONFIG_BOARD_EARLY_INIT_R)
-       board_early_init_r,
+-      WATCHDOG_RESET();
+       INITCALL(arch_initr_trap);
+ #if CONFIG_IS_ENABLED(BOARD_EARLY_INIT_R)
+       INITCALL(board_early_init_r);
  #endif
--      INIT_FUNC_WATCHDOG_RESET
- #ifdef CONFIG_POST
-       post_output_backlog,
+-      WATCHDOG_RESET();
+ #if CONFIG_IS_ENABLED(POST)
+       INITCALL(post_output_backlog);
  #endif
--      INIT_FUNC_WATCHDOG_RESET
- #if defined(CONFIG_PCI_INIT_R) && defined(CONFIG_SYS_EARLY_PCI_INIT)
+-      WATCHDOG_RESET();
+ #if CONFIG_IS_ENABLED(PCI_INIT_R) && CONFIG_IS_ENABLED(SYS_EARLY_PCI_INIT)
        /*
         * Do early PCI configuration _before_ the flash gets initialised,
-@@ -708,7 +702,6 @@ static init_fnc_t init_sequence_r[] = {
- #ifdef CONFIG_MTD_NOR_FLASH
-       initr_flash,
+@@ -718,7 +712,6 @@ static void initcall_run_r(void)
+ #if CONFIG_IS_ENABLED(MTD_NOR_FLASH)
+       INITCALL(initr_flash);
  #endif
--      INIT_FUNC_WATCHDOG_RESET
- #if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
+-      WATCHDOG_RESET();
+ #if CONFIG_IS_ENABLED(PPC) || CONFIG_IS_ENABLED(M68K) || CONFIG_IS_ENABLED(X86)
        /* initialize higher level parts of CPU like time base and timers */
-       cpu_init_r,
-@@ -737,6 +730,10 @@ static init_fnc_t init_sequence_r[] = {
- #ifdef CONFIG_PVBLOCK
-       initr_pvblock,
+       INITCALL(cpu_init_r);
+@@ -744,6 +737,10 @@ static void initcall_run_r(void)
+ #if CONFIG_IS_ENABLED(PVBLOCK)
+       INITCALL(initr_pvblock);
  #endif
 +#if CONFIG_IS_ENABLED(WDT)
-+      initr_watchdog,
++      INITCALL(initr_watchdog);
 +#endif
-+      INIT_FUNC_WATCHDOG_RESET
-       initr_env,
- #ifdef CONFIG_SYS_MALLOC_BOOTPARAMS
-       initr_malloc_bootparams,
++      WATCHDOG_RESET();
+       INITCALL(initr_env);
+ #if CONFIG_IS_ENABLED(SYS_MALLOC_BOOTPARAMS)
+       INITCALL(initr_malloc_bootparams);