kernel: remove uboot,env hack
authorRosen Penev <[email protected]>
Thu, 27 Nov 2025 07:24:16 +0000 (23:24 -0800)
committerHauke Mehrtens <[email protected]>
Sun, 30 Nov 2025 19:18:08 +0000 (20:18 +0100)
Since everything got migrated to the layouts driver, this is no longer
needed.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20948
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/ath79/patches-6.12/400-mtd-nor-support-mtd-name-from-device-tree.patch
target/linux/generic/hack-6.12/402-mtd-blktrans-call-add-disks-after-mtd-device.patch
target/linux/generic/hack-6.12/420-mtd-support-OpenWrt-s-MTD_ROOTFS_ROOT_DEV.patch
target/linux/generic/pending-6.12/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch [deleted file]
target/linux/pistachio/patches-6.12/401-mtd-nor-support-mtd-name-from-device-tree.patch

index bbdc90c1cf314b3bf87dcb88b4ab31c7702523f9..39f3fa76fcbfcfcdf17d02b8c5c5900c8d0cc430 100644 (file)
@@ -33,7 +33,7 @@ Signed-off-by: Abhimanyu Vishwakarma <[email protected]>
        mtd->flags = MTD_CAP_NORFLASH;
 --- a/drivers/mtd/mtdcore.c
 +++ b/drivers/mtd/mtdcore.c
-@@ -872,6 +872,17 @@ out_error:
+@@ -849,6 +849,17 @@ out_error:
   */
  static void mtd_set_dev_defaults(struct mtd_info *mtd)
  {
index 5ccb6bc7d849a314eb811f1c731763b5a59a9e52..d5a68d681bb8ac6fdcbc118a7995a211a8542f48 100644 (file)
@@ -91,7 +91,7 @@ Signed-off-by: Daniel Golle <[email protected]>
  
  #include "mtdcore.h"
  
-@@ -1132,6 +1133,8 @@ int mtd_device_parse_register(struct mtd
+@@ -1109,6 +1110,8 @@ int mtd_device_parse_register(struct mtd
                register_reboot_notifier(&mtd->reboot_notifier);
        }
  
index 52965418004baf3c8f911096b432a36cfdaa1187..1b17c2fe8829e40b22446dc179b43b6574f3937a 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki <[email protected]>
 
 --- a/drivers/mtd/mtdcore.c
 +++ b/drivers/mtd/mtdcore.c
-@@ -803,7 +803,8 @@ int add_mtd_device(struct mtd_info *mtd)
+@@ -780,7 +780,8 @@ int add_mtd_device(struct mtd_info *mtd)
  
        mutex_unlock(&mtd_table_mutex);
  
diff --git a/target/linux/generic/pending-6.12/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch b/target/linux/generic/pending-6.12/401-mtd-don-t-register-NVMEM-devices-for-partitions-with.patch
deleted file mode 100644 (file)
index 119f1da..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Tue, 31 Oct 2023 15:51:01 +0100
-Subject: [PATCH] mtd: don't register NVMEM devices for partitions with custom
- drivers
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This fixes issue exposed by upstream commit f4cf4e5db331 ("Revert
-"nvmem: add new config option"").
-
-Signed-off-by: Rafał Miłecki <[email protected]>
----
- drivers/mtd/mtdcore.c | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
-
---- a/drivers/mtd/mtdcore.c
-+++ b/drivers/mtd/mtdcore.c
-@@ -549,6 +549,29 @@ static int mtd_nvmem_add(struct mtd_info
-       struct device_node *node = mtd_get_of_node(mtd);
-       struct nvmem_config config = {};
-+      /*
-+       * Do NOT register NVMEM device for any partition that is meant to be
-+       * handled by a U-Boot env driver. That would result in associating two
-+       * different NVMEM devices with the same OF node.
-+       *
-+       * An example of unwanted behaviour of above (forwardtrace):
-+       * of_get_mac_addr_nvmem()
-+       * of_nvmem_cell_get()
-+       * __nvmem_device_get()
-+       *
-+       * We can't have __nvmem_device_get() return "mtdX" NVMEM device instead
-+       * of U-Boot env NVMEM device. That would result in failing to find
-+       * NVMEM cell.
-+       *
-+       * This issue seems to affect U-Boot env case only and will go away with
-+       * switch to NVMEM layouts.
-+       */
-+      if (of_device_is_compatible(node, "u-boot,env") ||
-+          of_device_is_compatible(node, "u-boot,env-redundant-bool") ||
-+          of_device_is_compatible(node, "u-boot,env-redundant-count") ||
-+          of_device_is_compatible(node, "brcm,env"))
-+              return 0;
-+
-       config.id = NVMEM_DEVID_NONE;
-       config.dev = &mtd->dev;
-       config.name = dev_name(&mtd->dev);
index ff686e03a755cb035e629bc986f74bc6477ede98..af773a64ebad6433c553f401dc3376be43aec123 100644 (file)
@@ -41,7 +41,7 @@ Signed-off-by: Abhimanyu Vishwakarma <[email protected]>
                return PTR_ERR_OR_ZERO(mem->name);
 --- a/drivers/mtd/mtdcore.c
 +++ b/drivers/mtd/mtdcore.c
-@@ -872,6 +872,17 @@ out_error:
+@@ -849,6 +849,17 @@ out_error:
   */
  static void mtd_set_dev_defaults(struct mtd_info *mtd)
  {