uboot-mediatek: update to U-Boot 2024.01 release
[openwrt/openwrt.git] / package / boot / uboot-mediatek / patches / 100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch
index ce59cc73aef051975de4b8307a4a6325792fc7f9..f7cbd8d052c3aa626ac2d2cdf717cac2f66a5335 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/cmd/sf.c
 +++ b/cmd/sf.c
-@@ -407,6 +407,14 @@ static int do_spi_protect(int argc, char
+@@ -412,6 +412,14 @@ static int do_spi_protect(int argc, char
        return ret == 0 ? 0 : 1;
  }
  
@@ -27,22 +27,20 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  enum {
        STAGE_ERASE,
        STAGE_CHECK,
-@@ -601,6 +609,8 @@ static int do_spi_flash(struct cmd_tbl *
+@@ -606,6 +614,8 @@ static int do_spi_flash(struct cmd_tbl *
                ret = do_spi_flash_erase(argc, argv);
-       else if (strcmp(cmd, "protect") == 0)
+       else if (IS_ENABLED(CONFIG_SPI_FLASH_LOCK) && strcmp(cmd, "protect") == 0)
                ret = do_spi_protect(argc, argv);
 +      else if (strcmp(cmd, "uuid") == 0)
 +              ret = do_spi_flash_read_uuid();
        else if (IS_ENABLED(CONFIG_CMD_SF_TEST) && !strcmp(cmd, "test"))
                ret = do_spi_flash_test(argc, argv);
        else
-@@ -626,7 +636,8 @@ static const char long_help[] =
-       "                                         at `addr' to flash at `offset'\n"
-       "                                         or to start of mtd `partition'\n"
-       "sf protect lock/unlock sector len      - protect/unprotect 'len' bytes starting\n"
--      "                                         at address 'sector'"
-+      "                                         at address 'sector'\n"
-+      "sf uuid                                        - read uuid from flash"
+@@ -636,6 +646,7 @@ U_BOOT_LONGHELP(sf,
  #ifdef CONFIG_CMD_SF_TEST
        "\nsf test offset len           - run a very basic destructive test"
  #endif
++      "sf uuid                                - read uuid from flash"
+       );
+ U_BOOT_CMD(