uboot-mediatek: update to 2022.07 release
authorDaniel Golle <daniel@makrotopia.org>
Mon, 11 Jul 2022 10:02:49 +0000 (11:02 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 11 Jul 2022 16:13:22 +0000 (17:13 +0100)
Add patch to fix host-build of the mkimage tool without
CONFIG_TOOLS_LIBCRYPTO.
Update and refresh all patches.

Tested on BananaPi R64 (MT7622) successfully booting from SD card,
eMMC and SPI-NAND.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 files changed:
package/boot/uboot-mediatek/Makefile
package/boot/uboot-mediatek/patches/000-mtk-01-Revert-clk-Add-debugging-for-return-values.patch
package/boot/uboot-mediatek/patches/000-mtk-14-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch
package/boot/uboot-mediatek/patches/000-mtk-16-env-add-support-for-generic-MTD-device.patch
package/boot/uboot-mediatek/patches/000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch
package/boot/uboot-mediatek/patches/110-no-kwbimage.patch
package/boot/uboot-mediatek/patches/120-use-xz-instead-of-lzma.patch
package/boot/uboot-mediatek/patches/130-fix-mkimage-host-build.patch [new file with mode: 0644]
package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch
package/boot/uboot-mediatek/patches/210-cmd-bootmenu-add-ability-to-select-item-by-shortkey.patch
package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch
package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch
package/boot/uboot-mediatek/patches/230-cmd-add-pstore-check.patch
package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch
package/boot/uboot-mediatek/patches/350-add-support-for-Winbond-W25Q512JV.patch
package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch
package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch
package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch
package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch

index defae030287ef85cadfa9b676f78933bb5bae9e2..aeaf8bc14b29942a4801eab2604f750cfe56cac4 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
-PKG_VERSION:=2022.01
-PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413
+PKG_VERSION:=2022.07
+PKG_HASH:=92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e
 PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
 
 include $(INCLUDE_DIR)/u-boot.mk
 PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
 
 include $(INCLUDE_DIR)/u-boot.mk
index 1a0c1ce5b4545f5317b7c2a471ee4eef165905d5..3b68c52713abc6a4fb8e221e51e534b804bc27ce 100644 (file)
@@ -46,7 +46,7 @@ This reverts commit 5c5992cb90cf9ca4d51e38d9a95a13c293904df5.
        }
  
  
        }
  
  
-@@ -501,7 +500,6 @@ int clk_free(struct clk *clk)
+@@ -469,7 +468,6 @@ void clk_free(struct clk *clk)
  ulong clk_get_rate(struct clk *clk)
  {
        const struct clk_ops *ops;
  ulong clk_get_rate(struct clk *clk)
  {
        const struct clk_ops *ops;
@@ -54,7 +54,7 @@ This reverts commit 5c5992cb90cf9ca4d51e38d9a95a13c293904df5.
  
        debug("%s(clk=%p)\n", __func__, clk);
        if (!clk_valid(clk))
  
        debug("%s(clk=%p)\n", __func__, clk);
        if (!clk_valid(clk))
-@@ -511,11 +509,7 @@ ulong clk_get_rate(struct clk *clk)
+@@ -479,11 +477,7 @@ ulong clk_get_rate(struct clk *clk)
        if (!ops->get_rate)
                return -ENOSYS;
  
        if (!ops->get_rate)
                return -ENOSYS;
  
index dead0db17414ef4fcd811d5d2b16ed3155e9df29..1caa7ffd243dfe40b4f1fc480c26a378b417eed7 100644 (file)
@@ -38,9 +38,9 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/drivers/mtd/Kconfig
 +++ b/drivers/mtd/Kconfig
 
 --- a/drivers/mtd/Kconfig
 +++ b/drivers/mtd/Kconfig
-@@ -116,6 +116,8 @@ config STM32_FLASH
-        This is the driver of embedded flash for some STMicroelectronics
-        STM32 MCU.
+@@ -158,6 +158,8 @@ config SYS_MAX_FLASH_BANKS_DETECT
+        to reduce the effective number of flash bank, between 0 and
+        CONFIG_SYS_MAX_FLASH_BANKS
  
 +source "drivers/mtd/mtk-snand/Kconfig"
 +
  
 +source "drivers/mtd/mtk-snand/Kconfig"
 +
index d4f3460614f52e4693f7866875715a4003a6916c..f2e91671fbf47006430a7cfafe04a6aacff830a0 100644 (file)
@@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  
 --- a/env/Kconfig
 +++ b/env/Kconfig
  
 --- a/env/Kconfig
 +++ b/env/Kconfig
-@@ -19,7 +19,7 @@ config ENV_IS_NOWHERE
+@@ -37,7 +37,7 @@ config ENV_IS_NOWHERE
                     !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_MMC && !ENV_IS_IN_NAND && \
                     !ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
                     !ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
@@ -47,7 +47,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        help
          Define this if you don't want to or can't have an environment stored
          on a storage medium. In this case the environment will still exist
        help
          Define this if you don't want to or can't have an environment stored
          on a storage medium. In this case the environment will still exist
-@@ -208,6 +208,27 @@ config ENV_IS_IN_MMC
+@@ -226,6 +226,27 @@ config ENV_IS_IN_MMC
          This value is also in units of bytes, but must also be aligned to
          an MMC sector boundary.
  
          This value is also in units of bytes, but must also be aligned to
          an MMC sector boundary.
  
@@ -75,7 +75,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  config ENV_IS_IN_NAND
        bool "Environment in a NAND device"
        depends on !CHAIN_OF_TRUST
  config ENV_IS_IN_NAND
        bool "Environment in a NAND device"
        depends on !CHAIN_OF_TRUST
-@@ -535,10 +556,16 @@ config ENV_ADDR_REDUND
+@@ -531,10 +552,16 @@ config ENV_ADDR_REDUND
          Offset from the start of the device (or partition) of the redundant
          environment location.
  
          Offset from the start of the device (or partition) of the redundant
          environment location.
  
@@ -92,8 +92,8 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 +                  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
 +                  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 0x88000 if ARCH_SUNXI
-@@ -583,6 +610,12 @@ config ENV_SECT_SIZE
+       default 0xF0000 if ARCH_SUNXI
+@@ -581,6 +608,12 @@ config ENV_SECT_SIZE
        help
          Size of the sector containing the environment.
  
        help
          Size of the sector containing the environment.
  
index c66451dce989903c4a18b8cf5cde45ddf48e3e5c..cc5fb573247ca0c5d34510305f42fac527c97355 100644 (file)
@@ -20,7 +20,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 +CONFIG_ENV_OFFSET=0x280000
  CONFIG_DEBUG_UART_BASE=0x11002000
  CONFIG_DEBUG_UART_CLOCK=25000000
 +CONFIG_ENV_OFFSET=0x280000
  CONFIG_DEBUG_UART_BASE=0x11002000
  CONFIG_DEBUG_UART_CLOCK=25000000
- CONFIG_DEBUG_UART=y
+ CONFIG_SYS_LOAD_ADDR=0x4007ff28
 @@ -22,6 +24,9 @@ CONFIG_CMD_SF_TEST=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_SMC=y
 @@ -22,6 +24,9 @@ CONFIG_CMD_SF_TEST=y
  CONFIG_CMD_PING=y
  CONFIG_CMD_SMC=y
index 65d14f5bece8bdf34954ef16475cd39a3125ef9b..6d4af1f174fed0f7de5216a1a932b419179e8499 100644 (file)
@@ -1,6 +1,6 @@
 --- a/tools/Makefile
 +++ b/tools/Makefile
 --- a/tools/Makefile
 +++ b/tools/Makefile
-@@ -119,7 +119,6 @@ dumpimage-mkimage-objs := aisimage.o \
+@@ -120,7 +120,6 @@ dumpimage-mkimage-objs := aisimage.o \
                        imximage.o \
                        imx8image.o \
                        imx8mimage.o \
                        imximage.o \
                        imx8image.o \
                        imx8mimage.o \
index c13871b71a431d25ccc968019ad245e8b267b5c7..7204c404c042deb824e08ef1ef13e0671039632c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
 --- a/Makefile
 +++ b/Makefile
-@@ -1045,7 +1045,7 @@ quiet_cmd_pad_cat = CAT     $@
+@@ -1061,7 +1061,7 @@ quiet_cmd_pad_cat = CAT     $@
  cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
  
  quiet_cmd_lzma = LZMA    $@
  cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
  
  quiet_cmd_lzma = LZMA    $@
diff --git a/package/boot/uboot-mediatek/patches/130-fix-mkimage-host-build.patch b/package/boot/uboot-mediatek/patches/130-fix-mkimage-host-build.patch
new file mode 100644 (file)
index 0000000..8b110a8
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/tools/image-host.c
++++ b/tools/image-host.c
+@@ -1122,6 +1122,7 @@ static int fit_config_add_verification_d
+  * 2) get public key (X509_get_pubkey)
+  * 3) provide der format (d2i_RSAPublicKey)
+  */
++#ifdef CONFIG_TOOLS_LIBCRYPTO
+ static int read_pub_key(const char *keydir, const void *name,
+                       unsigned char **pubkey, int *pubkey_len)
+ {
+@@ -1175,6 +1176,13 @@ err_cert:
+       fclose(f);
+       return ret;
+ }
++#else
++static int read_pub_key(const char *keydir, const void *name,
++                      unsigned char **pubkey, int *pubkey_len)
++{
++      return -ENOSYS;
++}
++#endif
+ int fit_pre_load_data(const char *keydir, void *keydest, void *fit)
+ {
index 5dce177cfa1397001f1032d372534517e14712df..1759b04899887b096ec86ec0c3fb4efc0d4e7ccf 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cmd/bootm.c
 +++ b/cmd/bootm.c
 --- a/cmd/bootm.c
 +++ b/cmd/bootm.c
-@@ -228,6 +228,65 @@ U_BOOT_CMD(
+@@ -257,6 +257,65 @@ U_BOOT_CMD(
  /* iminfo - print header info for a requested image */
  /*******************************************************************/
  #if defined(CONFIG_CMD_IMI)
  /* iminfo - print header info for a requested image */
  /*******************************************************************/
  #if defined(CONFIG_CMD_IMI)
@@ -68,7 +68,7 @@
  {
 --- a/boot/image-fit.c
 +++ b/boot/image-fit.c
  {
 --- a/boot/image-fit.c
 +++ b/boot/image-fit.c
-@@ -1993,6 +1993,51 @@ static const char *fit_get_image_type_pr
+@@ -1995,6 +1995,51 @@ static const char *fit_get_image_type_pr
        return "unknown";
  }
  
        return "unknown";
  }
  
                   int arch, int image_type, int bootstage_id,
 --- a/include/image.h
 +++ b/include/image.h
                   int arch, int image_type, int bootstage_id,
 --- a/include/image.h
 +++ b/include/image.h
-@@ -952,6 +952,7 @@ int fit_parse_subimage(const char *spec,
+@@ -955,6 +955,7 @@ int fit_parse_subimage(const char *spec,
                ulong *addr, const char **image_name);
  
  int fit_get_subimage_count(const void *fit, int images_noffset);
                ulong *addr, const char **image_name);
  
  int fit_get_subimage_count(const void *fit, int images_noffset);
index c43b542dcbc0ae5a7ded8bb6c65e97a0ad2fab78..b7d064062c9c902487c7027e96f2470c36fb2222 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 
 --- a/cmd/bootmenu.c
 +++ b/cmd/bootmenu.c
 
 --- a/cmd/bootmenu.c
 +++ b/cmd/bootmenu.c
-@@ -11,6 +11,7 @@
+@@ -14,6 +14,7 @@
  #include <menu.h>
  #include <watchdog.h>
  #include <malloc.h>
  #include <menu.h>
  #include <watchdog.h>
  #include <malloc.h>
@@ -20,28 +20,94 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
  #include <linux/delay.h>
  #include <linux/string.h>
  
  #include <linux/delay.h>
  #include <linux/string.h>
  
-@@ -38,6 +39,7 @@ struct bootmenu_data {
-       int active;                     /* active menu entry */
-       int count;                      /* total count of menu entries */
-       struct bootmenu_entry *first;   /* first menu entry */
-+      bool last_choiced;
- };
+@@ -87,16 +88,17 @@ static char *bootmenu_choice_entry(void
+       struct bootmenu_data *menu = data;
+       struct bootmenu_entry *iter;
+       enum bootmenu_key key = KEY_NONE;
++      int choice = -1;
+       int esc = 0;
+       int i;
  
  
- enum bootmenu_key {
-@@ -46,8 +48,27 @@ enum bootmenu_key {
-       KEY_DOWN,
-       KEY_SELECT,
-       KEY_QUIT,
-+      KEY_CHOICE,
- };
+       while (1) {
+               if (menu->delay >= 0) {
+                       /* Autoboot was not stopped */
+-                      bootmenu_autoboot_loop(menu, &key, &esc);
++                      bootmenu_autoboot_loop(menu, &key, &esc, &choice);
+               } else {
+                       /* Some key was pressed, so autoboot was stopped */
+-                      bootmenu_loop(menu, &key, &esc);
++                      bootmenu_loop(menu, &key, &esc, &choice);
+               }
  
  
-+static const char choice_chars[] = {
-+      '1', '2', '3', '4', '5', '6', '7', '8', '9',
-+      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
-+      'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
-+      'u', 'v', 'w', 'x', 'y', 'z'
-+};
+               switch (key) {
+@@ -110,6 +112,12 @@ static char *bootmenu_choice_entry(void
+                               ++menu->active;
+                       /* no menu key selected, regenerate menu */
+                       return NULL;
++              case KEY_CHOICE:
++                      menu->active = choice;
++                      if (!menu->last_choiced) {
++                              menu->last_choiced = true;
++                              return NULL;
++                      }
+               case KEY_SELECT:
+                       iter = menu->first;
+                       for (i = 0; i < menu->active; ++i)
+@@ -181,12 +189,19 @@ static int prepare_bootmenu_entry(struct
+               if (!entry)
+                       return -ENOMEM;
+-              entry->title = strndup(option, sep - option);
++              entry->title = malloc((sep - option) + 4);
+               if (!entry->title) {
+                       free(entry);
+                       return -ENOMEM;
+               }
++              if (i < ARRAY_SIZE(choice_chars)) {
++                      sprintf(entry->title, "%c. %.*s", choice_chars[i],
++                              (int)(sep - option), option);
++              } else {
++                      sprintf(entry->title, "   %.*s", (int)(sep - option), option);
++              }
 +
 +
+               entry->command = strdup(sep + 1);
+               if (!entry->command) {
+                       free(entry->title);
+@@ -331,6 +346,7 @@ static struct bootmenu_data *bootmenu_cr
+       menu->delay = delay;
+       menu->active = 0;
+       menu->first = NULL;
++      menu->last_choiced = false;
+       default_str = env_get("bootmenu_default");
+       if (default_str)
+@@ -356,9 +372,9 @@ static struct bootmenu_data *bootmenu_cr
+               /* Add Quit entry if entering U-Boot console is disabled */
+               if (!IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE))
+-                      entry->title = strdup("U-Boot console");
++                      entry->title = strdup("0. U-Boot console");
+               else
+-                      entry->title = strdup("Quit");
++                      entry->title = strdup("0. Quit");
+               if (!entry->title) {
+                       free(entry);
+--- a/common/menu.c
++++ b/common/menu.c
+@@ -9,6 +9,7 @@
+ #include <cli.h>
+ #include <malloc.h>
+ #include <errno.h>
++#include <linux/ctype.h>
+ #include <linux/delay.h>
+ #include <linux/list.h>
+ #include <watchdog.h>
+@@ -47,6 +48,17 @@ struct menu {
+       int item_cnt;
+ };
 +static int find_choice(char choice)
 +{
 +      int i;
 +static int find_choice(char choice)
 +{
 +      int i;
@@ -53,19 +119,19 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
 +      return -1;
 +}
 +
 +      return -1;
 +}
 +
- static char *bootmenu_getoption(unsigned short int n)
- {
-       char name[MAX_ENV_SIZE];
-@@ -82,7 +103,7 @@ static void bootmenu_print_entry(void *d
+ /*
+  * An iterator function for menu items. callback will be called for each item
+  * in m, with m, a pointer to the item, and extra being passed to callback. If
+@@ -426,7 +445,7 @@ int menu_destroy(struct menu *m)
  }
  
  }
  
static void bootmenu_autoboot_loop(struct bootmenu_data *menu,
--                              enum bootmenu_key *key, int *esc)
-+                              enum bootmenu_key *key, int *esc, int *choice)
+ void bootmenu_autoboot_loop(struct bootmenu_data *menu,
+-                          enum bootmenu_key *key, int *esc)
++                          enum bootmenu_key *key, int *esc, int *choice)
  {
        int i, c;
  
  {
        int i, c;
  
-@@ -115,6 +136,19 @@ static void bootmenu_autoboot_loop(struc
+@@ -456,6 +475,19 @@ void bootmenu_autoboot_loop(struct bootm
                                break;
                        default:
                                *key = KEY_NONE;
                                break;
                        default:
                                *key = KEY_NONE;
@@ -85,12 +151,12 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
                                break;
                        }
  
                                break;
                        }
  
-@@ -136,10 +170,16 @@ static void bootmenu_autoboot_loop(struc
+@@ -475,10 +507,16 @@ void bootmenu_autoboot_loop(struct bootm
  }
  
  }
  
static void bootmenu_loop(struct bootmenu_data *menu,
--              enum bootmenu_key *key, int *esc)
-+              enum bootmenu_key *key, int *esc, int *choice)
+ void bootmenu_loop(struct bootmenu_data *menu,
+-                 enum bootmenu_key *key, int *esc)
++                 enum bootmenu_key *key, int *esc, int *choice)
  {
        int c;
  
  {
        int c;
  
@@ -103,7 +169,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
        if (*esc == 1) {
                if (tstc()) {
                        c = getchar();
        if (*esc == 1) {
                if (tstc()) {
                        c = getchar();
-@@ -165,6 +205,14 @@ static void bootmenu_loop(struct bootmen
+@@ -504,6 +542,14 @@ void bootmenu_loop(struct bootmenu_data
                if (c == '\e') {
                        *esc = 1;
                        *key = KEY_NONE;
                if (c == '\e') {
                        *esc = 1;
                        *key = KEY_NONE;
@@ -118,75 +184,35 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
                }
                break;
        case 1:
                }
                break;
        case 1:
-@@ -216,16 +264,17 @@ static char *bootmenu_choice_entry(void
-       struct bootmenu_data *menu = data;
-       struct bootmenu_entry *iter;
-       enum bootmenu_key key = KEY_NONE;
-+      int choice = -1;
-       int esc = 0;
-       int i;
-       while (1) {
-               if (menu->delay >= 0) {
-                       /* Autoboot was not stopped */
--                      bootmenu_autoboot_loop(menu, &key, &esc);
-+                      bootmenu_autoboot_loop(menu, &key, &esc, &choice);
-               } else {
-                       /* Some key was pressed, so autoboot was stopped */
--                      bootmenu_loop(menu, &key, &esc);
-+                      bootmenu_loop(menu, &key, &esc, &choice);
-               }
-               switch (key) {
-@@ -239,6 +288,12 @@ static char *bootmenu_choice_entry(void
-                               ++menu->active;
-                       /* no menu key selected, regenerate menu */
-                       return NULL;
-+              case KEY_CHOICE:
-+                      menu->active = choice;
-+                      if (!menu->last_choiced) {
-+                              menu->last_choiced = true;
-+                              return NULL;
-+                      }
-               case KEY_SELECT:
-                       iter = menu->first;
-                       for (i = 0; i < menu->active; ++i)
-@@ -294,6 +349,7 @@ static struct bootmenu_data *bootmenu_cr
-       menu->delay = delay;
-       menu->active = 0;
-       menu->first = NULL;
-+      menu->last_choiced = false;
+--- a/include/menu.h
++++ b/include/menu.h
+@@ -40,6 +40,7 @@ struct bootmenu_data {
+       int active;                     /* active menu entry */
+       int count;                      /* total count of menu entries */
+       struct bootmenu_entry *first;   /* first menu entry */
++      bool last_choiced;
+ };
  
  
-       default_str = env_get("bootmenu_default");
-       if (default_str)
-@@ -311,12 +367,19 @@ static struct bootmenu_data *bootmenu_cr
-                       goto cleanup;
+ enum bootmenu_key {
+@@ -48,11 +49,19 @@ enum bootmenu_key {
+       KEY_DOWN,
+       KEY_SELECT,
+       KEY_QUIT,
++      KEY_CHOICE,
+ };
  
  
-               len = sep-option;
--              entry->title = malloc(len + 1);
-+              entry->title = malloc(len + 4);
-               if (!entry->title) {
-                       free(entry);
-                       goto cleanup;
-               }
--              memcpy(entry->title, option, len);
+ void bootmenu_autoboot_loop(struct bootmenu_data *menu,
+-                          enum bootmenu_key *key, int *esc);
++                          enum bootmenu_key *key, int *esc, int *choice);
+ void bootmenu_loop(struct bootmenu_data *menu,
+-                 enum bootmenu_key *key, int *esc);
++                 enum bootmenu_key *key, int *esc, int *choice);
 +
 +
-+              if (i < ARRAY_SIZE(choice_chars)) {
-+                      len = sprintf(entry->title, "%c. %.*s", choice_chars[i],
-+                                    len, option);
-+              } else {
-+                      len = sprintf(entry->title, "   %.*s", len, option);
-+              }
-+
-               entry->title[len] = 0;
-               len = strlen(sep + 1);
-@@ -353,7 +416,7 @@ static struct bootmenu_data *bootmenu_cr
-               if (!entry)
-                       goto cleanup;
++static const char choice_chars[] = {
++      '1', '2', '3', '4', '5', '6', '7', '8', '9',
++      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
++      'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
++      'u', 'v', 'w', 'x', 'y', 'z'
++};
  
  
--              entry->title = strdup("U-Boot console");
-+              entry->title = strdup("0. U-Boot console");
-               if (!entry->title) {
-                       free(entry);
-                       goto cleanup;
+ #endif /* __MENU_H__ */
index 3f98f13c6e155d7d333630ef60508501acd43bfc..4f6464d8cb03e177726b9888762b49667eb09657 100644 (file)
@@ -1,19 +1,10 @@
 --- a/cmd/bootmenu.c
 +++ b/cmd/bootmenu.c
 --- a/cmd/bootmenu.c
 +++ b/cmd/bootmenu.c
-@@ -39,6 +39,7 @@ struct bootmenu_data {
-       int active;                     /* active menu entry */
-       int count;                      /* total count of menu entries */
-       struct bootmenu_entry *first;   /* first menu entry */
-+      char *mtitle;                   /* custom menu title */
-       bool last_choiced;
- };
-@@ -471,7 +472,12 @@ static void menu_display_statusline(stru
+@@ -432,7 +432,11 @@ static void menu_display_statusline(stru
        printf(ANSI_CURSOR_POSITION, 1, 1);
        puts(ANSI_CLEAR_LINE);
        printf(ANSI_CURSOR_POSITION, 1, 1);
        puts(ANSI_CLEAR_LINE);
-       printf(ANSI_CURSOR_POSITION, 2, 1);
--      puts("  *** U-Boot Boot Menu ***");
-+
+       printf(ANSI_CURSOR_POSITION, 2, 3);
+-      puts("*** U-Boot Boot Menu ***");
 +      if (menu->mtitle)
 +              puts(menu->mtitle);
 +      else
 +      if (menu->mtitle)
 +              puts(menu->mtitle);
 +      else
        puts(ANSI_CLEAR_LINE_TO_END);
        printf(ANSI_CURSOR_POSITION, 3, 1);
        puts(ANSI_CLEAR_LINE);
        puts(ANSI_CLEAR_LINE_TO_END);
        printf(ANSI_CURSOR_POSITION, 3, 1);
        puts(ANSI_CLEAR_LINE);
-@@ -525,6 +531,7 @@ static void bootmenu_show(int delay)
-               return;
+@@ -517,6 +521,7 @@ static enum bootmenu_ret bootmenu_show(i
+               return BOOTMENU_RET_FAIL;
        }
  
 +      bootmenu->mtitle = env_get("bootmenu_title");
        for (iter = bootmenu->first; iter; iter = iter->next) {
        }
  
 +      bootmenu->mtitle = env_get("bootmenu_title");
        for (iter = bootmenu->first; iter; iter = iter->next) {
-               if (!menu_item_add(menu, iter->key, iter))
+               if (menu_item_add(menu, iter->key, iter) != 1)
                        goto cleanup;
                        goto cleanup;
+--- a/include/menu.h
++++ b/include/menu.h
+@@ -40,6 +40,7 @@ struct bootmenu_data {
+       int active;                     /* active menu entry */
+       int count;                      /* total count of menu entries */
+       struct bootmenu_entry *first;   /* first menu entry */
++      char *mtitle;                   /* custom menu title */
+       bool last_choiced;
+ };
index f7f202165229d15e9b6fa504ef40185d9ecf3217..544767e2fa2ac5d9ffc27893017f1e884949df77 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
 --- a/cmd/Kconfig
 +++ b/cmd/Kconfig
-@@ -483,6 +483,12 @@ config CMD_ENV_EXISTS
+@@ -540,6 +540,12 @@ config CMD_ENV_EXISTS
          Check if a variable is defined in the environment for use in
          shell scripting.
  
          Check if a variable is defined in the environment for use in
          shell scripting.
  
@@ -76,7 +76,7 @@
  #if defined(CONFIG_CMD_ENV_CALLBACK)
  static int print_static_binding(const char *var_name, const char *callback_name,
                                void *priv)
  #if defined(CONFIG_CMD_ENV_CALLBACK)
  static int print_static_binding(const char *var_name, const char *callback_name,
                                void *priv)
-@@ -1189,6 +1243,9 @@ static struct cmd_tbl cmd_env_sub[] = {
+@@ -1231,6 +1285,9 @@ static struct cmd_tbl cmd_env_sub[] = {
        U_BOOT_CMD_MKENT(load, 1, 0, do_env_load, "", ""),
  #endif
        U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
        U_BOOT_CMD_MKENT(load, 1, 0, do_env_load, "", ""),
  #endif
        U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
@@ -86,7 +86,7 @@
  #if defined(CONFIG_CMD_RUN)
        U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
  #endif
  #if defined(CONFIG_CMD_RUN)
        U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
  #endif
-@@ -1277,6 +1334,9 @@ static char env_help_text[] =
+@@ -1322,6 +1379,9 @@ static char env_help_text[] =
  #if defined(CONFIG_CMD_NVEDIT_EFI)
        "env print -e [-guid guid] [-n] [name ...] - print UEFI environment\n"
  #endif
  #if defined(CONFIG_CMD_NVEDIT_EFI)
        "env print -e [-guid guid] [-n] [name ...] - print UEFI environment\n"
  #endif
@@ -96,7 +96,7 @@
  #if defined(CONFIG_CMD_RUN)
        "env run var [...] - run commands in an environment variable\n"
  #endif
  #if defined(CONFIG_CMD_RUN)
        "env run var [...] - run commands in an environment variable\n"
  #endif
-@@ -1386,6 +1446,17 @@ U_BOOT_CMD(
+@@ -1431,6 +1491,17 @@ U_BOOT_CMD(
  );
  #endif
  
  );
  #endif
  
index 587245d2ab0ba28e3a928b47f229d5187a1f7738..d0abcb1acc2b229b2878376f473acee2f5d6ee39 100644 (file)
@@ -1,6 +1,6 @@
 --- a/cmd/pstore.c
 +++ b/cmd/pstore.c
 --- a/cmd/pstore.c
 +++ b/cmd/pstore.c
-@@ -207,6 +207,58 @@ static int pstore_set(struct cmd_tbl *cm
+@@ -208,6 +208,58 @@ static int pstore_set(struct cmd_tbl *cm
  }
  
  /**
  }
  
  /**
@@ -59,7 +59,7 @@
   * pstore_print_buffer() - Print buffer
   * @type: buffer type
   * @buffer: buffer to print
   * pstore_print_buffer() - Print buffer
   * @type: buffer type
   * @buffer: buffer to print
-@@ -458,6 +510,7 @@ static int pstore_save(struct cmd_tbl *c
+@@ -459,6 +511,7 @@ static int pstore_save(struct cmd_tbl *c
  
  static struct cmd_tbl cmd_pstore_sub[] = {
        U_BOOT_CMD_MKENT(set, 8, 0, pstore_set, "", ""),
  
  static struct cmd_tbl cmd_pstore_sub[] = {
        U_BOOT_CMD_MKENT(set, 8, 0, pstore_set, "", ""),
@@ -67,7 +67,7 @@
        U_BOOT_CMD_MKENT(display, 3, 0, pstore_display, "", ""),
        U_BOOT_CMD_MKENT(save, 4, 0, pstore_save, "", ""),
  };
        U_BOOT_CMD_MKENT(display, 3, 0, pstore_display, "", ""),
        U_BOOT_CMD_MKENT(save, 4, 0, pstore_save, "", ""),
  };
-@@ -531,6 +584,8 @@ U_BOOT_CMD(pstore, 10, 0, do_pstore,
+@@ -560,6 +613,8 @@ U_BOOT_CMD(pstore, 10, 0, do_pstore,
           "  'pmsg-size' is the size of the user space logs record.\n"
           "  'ecc-size' enables/disables ECC support and specifies ECC buffer size in\n"
           "  bytes (0 disables it, 1 is a special value, means 16 bytes ECC).\n"
           "  'pmsg-size' is the size of the user space logs record.\n"
           "  'ecc-size' enables/disables ECC support and specifies ECC buffer size in\n"
           "  bytes (0 disables it, 1 is a special value, means 16 bytes ECC).\n"
index 8517ffb97ce56a3dde491ca1d1250d18f5e6fa5b..ff41c524221d1d55501aad9bd66c4cc0ef8fdffb 100644 (file)
@@ -14,13 +14,11 @@ Reviewed-by: Tom Rini <trini@konsulko.com>
  boot/image-fdt.c | 6 ++++++
  1 file changed, 6 insertions(+)
 
  boot/image-fdt.c | 6 ++++++
  1 file changed, 6 insertions(+)
 
-diff --git a/boot/image-fdt.c b/boot/image-fdt.c
-index 692a9ad3e4..fdb69926a2 100644
 --- a/boot/image-fdt.c
 +++ b/boot/image-fdt.c
 --- a/boot/image-fdt.c
 +++ b/boot/image-fdt.c
-@@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
-               goto err;
-       }
+@@ -639,6 +639,12 @@ int image_setup_libfdt(bootm_headers_t *
+                                       images->fit_uname_cfg,
+                                       strlen(images->fit_uname_cfg) + 1, 1);
  
 +      /* Store name of configuration node as u-boot,bootconf in /chosen node */
 +      if (images->fit_uname_cfg)
  
 +      /* Store name of configuration node as u-boot,bootconf in /chosen node */
 +      if (images->fit_uname_cfg)
@@ -31,6 +29,3 @@ index 692a9ad3e4..fdb69926a2 100644
        /* Update ethernet nodes */
        fdt_fixup_ethernet(blob);
  #if CONFIG_IS_ENABLED(CMD_PSTORE)
        /* Update ethernet nodes */
        fdt_fixup_ethernet(blob);
  #if CONFIG_IS_ENABLED(CMD_PSTORE)
--- 
-2.35.3
-
index 50df49d823cc696c9a5b86b6dd6e1d0d0146c75f..da746bb124cb895a844b45f8922301451b38b09c 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/mtd/spi/spi-nor-ids.c
 +++ b/drivers/mtd/spi/spi-nor-ids.c
 --- a/drivers/mtd/spi/spi-nor-ids.c
 +++ b/drivers/mtd/spi/spi-nor-ids.c
-@@ -369,6 +369,8 @@ const struct flash_info spi_nor_ids[] =
+@@ -376,6 +376,8 @@ 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) },
                        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 01a550b301518b26d9a96a812f750a8065163cdc..3e13427de4ad09e0203d0981394969e516ca4def 100644 (file)
@@ -7,12 +7,11 @@
 -CONFIG_ENV_SIZE=0x1000
 +CONFIG_ENV_SIZE=0x10000
  CONFIG_ENV_OFFSET=0x100000
 -CONFIG_ENV_SIZE=0x1000
 +CONFIG_ENV_SIZE=0x10000
  CONFIG_ENV_OFFSET=0x100000
--CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
- CONFIG_TARGET_MT7623=y
-+CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
+ CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
 +CONFIG_USE_DEFAULT_ENV_FILE=y
 +CONFIG_USE_DEFAULT_ENV_FILE=y
- CONFIG_DISTRO_DEFAULTS=y
+ CONFIG_TARGET_MT7623=y
  CONFIG_SYS_LOAD_ADDR=0x84000000
  CONFIG_SYS_LOAD_ADDR=0x84000000
+ CONFIG_DISTRO_DEFAULTS=y
  CONFIG_FIT=y
 -CONFIG_FIT_VERBOSE=y
 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
  CONFIG_FIT=y
 -CONFIG_FIT_VERBOSE=y
 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
index ac870b86148a80077bde239bee07c7f6d61d368d..f79c86714d8a579760f2d7af17cf4430a7eb59e5 100644 (file)
@@ -10,8 +10,8 @@
  CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
 +CONFIG_USE_DEFAULT_ENV_FILE=y
  CONFIG_TARGET_MT7623=y
  CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
 +CONFIG_USE_DEFAULT_ENV_FILE=y
  CONFIG_TARGET_MT7623=y
- CONFIG_DISTRO_DEFAULTS=y
  CONFIG_SYS_LOAD_ADDR=0x84000000
  CONFIG_SYS_LOAD_ADDR=0x84000000
+ CONFIG_DISTRO_DEFAULTS=y
  CONFIG_FIT=y
 -CONFIG_FIT_VERBOSE=y
 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
  CONFIG_FIT=y
 -CONFIG_FIT_VERBOSE=y
 +CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
index fde679f3863ccf2e22a3e1fd299963b66041a0b9..c4a51aa442b9729348a57db17b95f73b1ba97a7f 100644 (file)
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1133,6 +1133,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1203,6 +1203,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7622-rfb.dtb \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
        mt7622-rfb.dtb \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
index 09a727422a13ef4d95706a57f8b038630bee6da4..bb7045916ff2e83645aa122b97499d8013ff158e 100644 (file)
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
 +};
 --- a/arch/arm/dts/Makefile
 +++ b/arch/arm/dts/Makefile
-@@ -1134,6 +1134,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1204,6 +1204,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
        mt7622-linksys-e8450-ubi.dtb \
        mt7623a-unielec-u7623-02-emmc.dtb \
        mt7622-bananapi-bpi-r64.dtb \
        mt7622-linksys-e8450-ubi.dtb \
 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       \e[33m$ver\e[0m"
 --- a/common/board_r.c
 +++ b/common/board_r.c
 +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title       \e[33m$ver\e[0m"
 --- a/common/board_r.c
 +++ b/common/board_r.c
-@@ -78,6 +78,7 @@
- #ifdef CONFIG_EFI_SETUP_EARLY
+@@ -62,6 +62,7 @@
+ #include <asm-generic/gpio.h>
  #include <efi_loader.h>
  #include <efi_loader.h>
- #endif
+ #include <relocate.h>
 +#include <spi_flash.h>
  
  DECLARE_GLOBAL_DATA_PTR;
  
 +#include <spi_flash.h>
  
  DECLARE_GLOBAL_DATA_PTR;
  
-@@ -417,6 +418,21 @@ static int initr_onenand(void)
+@@ -392,6 +393,21 @@ static int initr_onenand(void)
  }
  #endif
  
  }
  #endif
  
  #ifdef CONFIG_MMC
  static int initr_mmc(void)
  {
  #ifdef CONFIG_MMC
  static int initr_mmc(void)
  {
-@@ -705,6 +721,9 @@ static init_fnc_t init_sequence_r[] = {
+@@ -703,6 +719,9 @@ static init_fnc_t init_sequence_r[] = {
  #ifdef CONFIG_CMD_ONENAND
        initr_onenand,
  #endif
  #ifdef CONFIG_CMD_ONENAND
        initr_onenand,
  #endif