uboot-mediatek: update to 2022.07 release
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>
This commit is contained in:
parent
b68e9f2e19
commit
fa75a3a935
@ -1,8 +1,8 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
include $(INCLUDE_DIR)/kernel.mk
|
include $(INCLUDE_DIR)/kernel.mk
|
||||||
|
|
||||||
PKG_VERSION:=2022.01
|
PKG_VERSION:=2022.07
|
||||||
PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413
|
PKG_HASH:=92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e
|
||||||
PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
|
PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
|
||||||
|
|
||||||
include $(INCLUDE_DIR)/u-boot.mk
|
include $(INCLUDE_DIR)/u-boot.mk
|
||||||
|
@ -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)
|
ulong clk_get_rate(struct clk *clk)
|
||||||
{
|
{
|
||||||
const struct clk_ops *ops;
|
const struct clk_ops *ops;
|
||||||
@ -54,7 +54,7 @@ This reverts commit 5c5992cb90cf9ca4d51e38d9a95a13c293904df5.
|
|||||||
|
|
||||||
debug("%s(clk=%p)\n", __func__, clk);
|
debug("%s(clk=%p)\n", __func__, clk);
|
||||||
if (!clk_valid(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)
|
if (!ops->get_rate)
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
|
|
||||||
--- a/drivers/mtd/Kconfig
|
--- a/drivers/mtd/Kconfig
|
||||||
+++ b/drivers/mtd/Kconfig
|
+++ b/drivers/mtd/Kconfig
|
||||||
@@ -116,6 +116,8 @@ config STM32_FLASH
|
@@ -158,6 +158,8 @@ config SYS_MAX_FLASH_BANKS_DETECT
|
||||||
This is the driver of embedded flash for some STMicroelectronics
|
to reduce the effective number of flash bank, between 0 and
|
||||||
STM32 MCU.
|
CONFIG_SYS_MAX_FLASH_BANKS
|
||||||
|
|
||||||
+source "drivers/mtd/mtk-snand/Kconfig"
|
+source "drivers/mtd/mtk-snand/Kconfig"
|
||||||
+
|
+
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
|
|
||||||
--- a/env/Kconfig
|
--- a/env/Kconfig
|
||||||
+++ b/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_MMC && !ENV_IS_IN_NAND && \
|
||||||
!ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
|
!ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
|
||||||
!ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
|
!ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
|
||||||
@ -47,7 +47,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
help
|
help
|
||||||
Define this if you don't want to or can't have an environment stored
|
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
|
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
|
This value is also in units of bytes, but must also be aligned to
|
||||||
an MMC sector boundary.
|
an MMC sector boundary.
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
config ENV_IS_IN_NAND
|
config ENV_IS_IN_NAND
|
||||||
bool "Environment in a NAND device"
|
bool "Environment in a NAND device"
|
||||||
depends on !CHAIN_OF_TRUST
|
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
|
Offset from the start of the device (or partition) of the redundant
|
||||||
environment location.
|
environment location.
|
||||||
|
|
||||||
@ -92,8 +92,8 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
+ ENV_IS_IN_SPI_FLASH || ENV_IS_IN_MTD
|
+ ENV_IS_IN_SPI_FLASH || ENV_IS_IN_MTD
|
||||||
default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
|
default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
|
||||||
default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
|
default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
|
||||||
default 0x88000 if ARCH_SUNXI
|
default 0xF0000 if ARCH_SUNXI
|
||||||
@@ -583,6 +610,12 @@ config ENV_SECT_SIZE
|
@@ -581,6 +608,12 @@ config ENV_SECT_SIZE
|
||||||
help
|
help
|
||||||
Size of the sector containing the environment.
|
Size of the sector containing the environment.
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
+CONFIG_ENV_OFFSET=0x280000
|
+CONFIG_ENV_OFFSET=0x280000
|
||||||
CONFIG_DEBUG_UART_BASE=0x11002000
|
CONFIG_DEBUG_UART_BASE=0x11002000
|
||||||
CONFIG_DEBUG_UART_CLOCK=25000000
|
CONFIG_DEBUG_UART_CLOCK=25000000
|
||||||
CONFIG_DEBUG_UART=y
|
CONFIG_SYS_LOAD_ADDR=0x4007ff28
|
||||||
@@ -22,6 +24,9 @@ CONFIG_CMD_SF_TEST=y
|
@@ -22,6 +24,9 @@ CONFIG_CMD_SF_TEST=y
|
||||||
CONFIG_CMD_PING=y
|
CONFIG_CMD_PING=y
|
||||||
CONFIG_CMD_SMC=y
|
CONFIG_CMD_SMC=y
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/tools/Makefile
|
--- a/tools/Makefile
|
||||||
+++ b/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 \
|
imximage.o \
|
||||||
imx8image.o \
|
imx8image.o \
|
||||||
imx8mimage.o \
|
imx8mimage.o \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/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; }
|
cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
|
||||||
|
|
||||||
quiet_cmd_lzma = LZMA $@
|
quiet_cmd_lzma = LZMA $@
|
||||||
|
@ -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)
|
||||||
|
{
|
@ -1,6 +1,6 @@
|
|||||||
--- a/cmd/bootm.c
|
--- a/cmd/bootm.c
|
||||||
+++ b/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 */
|
/* iminfo - print header info for a requested image */
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
#if defined(CONFIG_CMD_IMI)
|
#if defined(CONFIG_CMD_IMI)
|
||||||
@ -68,7 +68,7 @@
|
|||||||
{
|
{
|
||||||
--- a/boot/image-fit.c
|
--- a/boot/image-fit.c
|
||||||
+++ b/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";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@
|
|||||||
int arch, int image_type, int bootstage_id,
|
int arch, int image_type, int bootstage_id,
|
||||||
--- a/include/image.h
|
--- a/include/image.h
|
||||||
+++ b/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);
|
ulong *addr, const char **image_name);
|
||||||
|
|
||||||
int fit_get_subimage_count(const void *fit, int images_noffset);
|
int fit_get_subimage_count(const void *fit, int images_noffset);
|
||||||
|
@ -12,7 +12,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
|
|
||||||
--- a/cmd/bootmenu.c
|
--- a/cmd/bootmenu.c
|
||||||
+++ b/cmd/bootmenu.c
|
+++ b/cmd/bootmenu.c
|
||||||
@@ -11,6 +11,7 @@
|
@@ -14,6 +14,7 @@
|
||||||
#include <menu.h>
|
#include <menu.h>
|
||||||
#include <watchdog.h>
|
#include <watchdog.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
@ -20,105 +20,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/string.h>
|
#include <linux/string.h>
|
||||||
|
|
||||||
@@ -38,6 +39,7 @@ struct bootmenu_data {
|
@@ -87,16 +88,17 @@ static char *bootmenu_choice_entry(void
|
||||||
int active; /* active menu entry */
|
|
||||||
int count; /* total count of menu entries */
|
|
||||||
struct bootmenu_entry *first; /* first menu entry */
|
|
||||||
+ bool last_choiced;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum bootmenu_key {
|
|
||||||
@@ -46,8 +48,27 @@ enum bootmenu_key {
|
|
||||||
KEY_DOWN,
|
|
||||||
KEY_SELECT,
|
|
||||||
KEY_QUIT,
|
|
||||||
+ KEY_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'
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static int find_choice(char choice)
|
|
||||||
+{
|
|
||||||
+ int i;
|
|
||||||
+
|
|
||||||
+ for (i = 0; i < ARRAY_SIZE(choice_chars); i++)
|
|
||||||
+ if (tolower(choice) == choice_chars[i])
|
|
||||||
+ return i;
|
|
||||||
+
|
|
||||||
+ 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
|
|
||||||
}
|
|
||||||
|
|
||||||
static 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;
|
|
||||||
|
|
||||||
@@ -115,6 +136,19 @@ static void bootmenu_autoboot_loop(struc
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
*key = KEY_NONE;
|
|
||||||
+ if (*esc)
|
|
||||||
+ break;
|
|
||||||
+
|
|
||||||
+ *choice = find_choice(c);
|
|
||||||
+ if ((*choice >= 0 &&
|
|
||||||
+ *choice < menu->count - 1)) {
|
|
||||||
+ *key = KEY_CHOICE;
|
|
||||||
+ } else if (c == '0') {
|
|
||||||
+ *choice = menu->count - 1;
|
|
||||||
+ *key = KEY_CHOICE;
|
|
||||||
+ } else {
|
|
||||||
+ *key = KEY_NONE;
|
|
||||||
+ }
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -136,10 +170,16 @@ static void bootmenu_autoboot_loop(struc
|
|
||||||
}
|
|
||||||
|
|
||||||
static void bootmenu_loop(struct bootmenu_data *menu,
|
|
||||||
- enum bootmenu_key *key, int *esc)
|
|
||||||
+ enum bootmenu_key *key, int *esc, int *choice)
|
|
||||||
{
|
|
||||||
int c;
|
|
||||||
|
|
||||||
+ if (menu->last_choiced) {
|
|
||||||
+ menu->last_choiced = false;
|
|
||||||
+ *key = KEY_SELECT;
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (*esc == 1) {
|
|
||||||
if (tstc()) {
|
|
||||||
c = getchar();
|
|
||||||
@@ -165,6 +205,14 @@ static void bootmenu_loop(struct bootmen
|
|
||||||
if (c == '\e') {
|
|
||||||
*esc = 1;
|
|
||||||
*key = KEY_NONE;
|
|
||||||
+ } else {
|
|
||||||
+ *choice = find_choice(c);
|
|
||||||
+ if ((*choice >= 0 && *choice < menu->count - 1)) {
|
|
||||||
+ *key = KEY_CHOICE;
|
|
||||||
+ } else if (c == '0') {
|
|
||||||
+ *choice = menu->count - 1;
|
|
||||||
+ *key = KEY_CHOICE;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
@@ -216,16 +264,17 @@ static char *bootmenu_choice_entry(void
|
|
||||||
struct bootmenu_data *menu = data;
|
struct bootmenu_data *menu = data;
|
||||||
struct bootmenu_entry *iter;
|
struct bootmenu_entry *iter;
|
||||||
enum bootmenu_key key = KEY_NONE;
|
enum bootmenu_key key = KEY_NONE;
|
||||||
@ -138,7 +40,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
@@ -239,6 +288,12 @@ static char *bootmenu_choice_entry(void
|
@@ -110,6 +112,12 @@ static char *bootmenu_choice_entry(void
|
||||||
++menu->active;
|
++menu->active;
|
||||||
/* no menu key selected, regenerate menu */
|
/* no menu key selected, regenerate menu */
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -151,7 +53,28 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
case KEY_SELECT:
|
case KEY_SELECT:
|
||||||
iter = menu->first;
|
iter = menu->first;
|
||||||
for (i = 0; i < menu->active; ++i)
|
for (i = 0; i < menu->active; ++i)
|
||||||
@@ -294,6 +349,7 @@ static struct bootmenu_data *bootmenu_cr
|
@@ -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->delay = delay;
|
||||||
menu->active = 0;
|
menu->active = 0;
|
||||||
menu->first = NULL;
|
menu->first = NULL;
|
||||||
@ -159,34 +82,137 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
|
|||||||
|
|
||||||
default_str = env_get("bootmenu_default");
|
default_str = env_get("bootmenu_default");
|
||||||
if (default_str)
|
if (default_str)
|
||||||
@@ -311,12 +367,19 @@ static struct bootmenu_data *bootmenu_cr
|
@@ -356,9 +372,9 @@ static struct bootmenu_data *bootmenu_cr
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
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);
|
|
||||||
+
|
|
||||||
+ 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;
|
|
||||||
|
|
||||||
|
/* 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("U-Boot console");
|
||||||
+ entry->title = strdup("0. U-Boot console");
|
+ entry->title = strdup("0. U-Boot console");
|
||||||
|
else
|
||||||
|
- entry->title = strdup("Quit");
|
||||||
|
+ entry->title = strdup("0. Quit");
|
||||||
|
|
||||||
if (!entry->title) {
|
if (!entry->title) {
|
||||||
free(entry);
|
free(entry);
|
||||||
goto cleanup;
|
--- 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;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(choice_chars); i++)
|
||||||
|
+ if (tolower(choice) == choice_chars[i])
|
||||||
|
+ return i;
|
||||||
|
+
|
||||||
|
+ return -1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
@@ -456,6 +475,19 @@ void bootmenu_autoboot_loop(struct bootm
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
*key = KEY_NONE;
|
||||||
|
+ if (*esc)
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ *choice = find_choice(c);
|
||||||
|
+ if ((*choice >= 0 &&
|
||||||
|
+ *choice < menu->count - 1)) {
|
||||||
|
+ *key = KEY_CHOICE;
|
||||||
|
+ } else if (c == '0') {
|
||||||
|
+ *choice = menu->count - 1;
|
||||||
|
+ *key = KEY_CHOICE;
|
||||||
|
+ } else {
|
||||||
|
+ *key = KEY_NONE;
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -475,10 +507,16 @@ void bootmenu_autoboot_loop(struct bootm
|
||||||
|
}
|
||||||
|
|
||||||
|
void bootmenu_loop(struct bootmenu_data *menu,
|
||||||
|
- enum bootmenu_key *key, int *esc)
|
||||||
|
+ enum bootmenu_key *key, int *esc, int *choice)
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
|
||||||
|
+ if (menu->last_choiced) {
|
||||||
|
+ menu->last_choiced = false;
|
||||||
|
+ *key = KEY_SELECT;
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (*esc == 1) {
|
||||||
|
if (tstc()) {
|
||||||
|
c = getchar();
|
||||||
|
@@ -504,6 +542,14 @@ void bootmenu_loop(struct bootmenu_data
|
||||||
|
if (c == '\e') {
|
||||||
|
*esc = 1;
|
||||||
|
*key = KEY_NONE;
|
||||||
|
+ } else {
|
||||||
|
+ *choice = find_choice(c);
|
||||||
|
+ if ((*choice >= 0 && *choice < menu->count - 1)) {
|
||||||
|
+ *key = KEY_CHOICE;
|
||||||
|
+ } else if (c == '0') {
|
||||||
|
+ *choice = menu->count - 1;
|
||||||
|
+ *key = KEY_CHOICE;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
--- 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;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum bootmenu_key {
|
||||||
|
@@ -48,11 +49,19 @@ enum bootmenu_key {
|
||||||
|
KEY_DOWN,
|
||||||
|
KEY_SELECT,
|
||||||
|
KEY_QUIT,
|
||||||
|
+ KEY_CHOICE,
|
||||||
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
+
|
||||||
|
+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'
|
||||||
|
+};
|
||||||
|
|
||||||
|
#endif /* __MENU_H__ */
|
||||||
|
@ -1,19 +1,10 @@
|
|||||||
--- a/cmd/bootmenu.c
|
--- a/cmd/bootmenu.c
|
||||||
+++ b/cmd/bootmenu.c
|
+++ b/cmd/bootmenu.c
|
||||||
@@ -39,6 +39,7 @@ struct bootmenu_data {
|
@@ -432,7 +432,11 @@ static void menu_display_statusline(stru
|
||||||
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
|
|
||||||
printf(ANSI_CURSOR_POSITION, 1, 1);
|
printf(ANSI_CURSOR_POSITION, 1, 1);
|
||||||
puts(ANSI_CLEAR_LINE);
|
puts(ANSI_CLEAR_LINE);
|
||||||
printf(ANSI_CURSOR_POSITION, 2, 1);
|
printf(ANSI_CURSOR_POSITION, 2, 3);
|
||||||
- puts("*** U-Boot Boot Menu ***");
|
- puts("*** U-Boot Boot Menu ***");
|
||||||
+
|
|
||||||
+ if (menu->mtitle)
|
+ if (menu->mtitle)
|
||||||
+ puts(menu->mtitle);
|
+ puts(menu->mtitle);
|
||||||
+ else
|
+ else
|
||||||
@ -22,11 +13,21 @@
|
|||||||
puts(ANSI_CLEAR_LINE_TO_END);
|
puts(ANSI_CLEAR_LINE_TO_END);
|
||||||
printf(ANSI_CURSOR_POSITION, 3, 1);
|
printf(ANSI_CURSOR_POSITION, 3, 1);
|
||||||
puts(ANSI_CLEAR_LINE);
|
puts(ANSI_CLEAR_LINE);
|
||||||
@@ -525,6 +531,7 @@ static void bootmenu_show(int delay)
|
@@ -517,6 +521,7 @@ static enum bootmenu_ret bootmenu_show(i
|
||||||
return;
|
return BOOTMENU_RET_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ bootmenu->mtitle = env_get("bootmenu_title");
|
+ bootmenu->mtitle = env_get("bootmenu_title");
|
||||||
for (iter = bootmenu->first; iter; iter = iter->next) {
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/cmd/Kconfig
|
--- a/cmd/Kconfig
|
||||||
+++ b/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
|
Check if a variable is defined in the environment for use in
|
||||||
shell scripting.
|
shell scripting.
|
||||||
|
|
||||||
@ -76,7 +76,7 @@
|
|||||||
#if defined(CONFIG_CMD_ENV_CALLBACK)
|
#if defined(CONFIG_CMD_ENV_CALLBACK)
|
||||||
static int print_static_binding(const char *var_name, const char *callback_name,
|
static int print_static_binding(const char *var_name, const char *callback_name,
|
||||||
void *priv)
|
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, "", ""),
|
U_BOOT_CMD_MKENT(load, 1, 0, do_env_load, "", ""),
|
||||||
#endif
|
#endif
|
||||||
U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
|
U_BOOT_CMD_MKENT(print, CONFIG_SYS_MAXARGS, 1, do_env_print, "", ""),
|
||||||
@ -86,7 +86,7 @@
|
|||||||
#if defined(CONFIG_CMD_RUN)
|
#if defined(CONFIG_CMD_RUN)
|
||||||
U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
|
U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
|
||||||
#endif
|
#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)
|
#if defined(CONFIG_CMD_NVEDIT_EFI)
|
||||||
"env print -e [-guid guid] [-n] [name ...] - print UEFI environment\n"
|
"env print -e [-guid guid] [-n] [name ...] - print UEFI environment\n"
|
||||||
#endif
|
#endif
|
||||||
@ -96,7 +96,7 @@
|
|||||||
#if defined(CONFIG_CMD_RUN)
|
#if defined(CONFIG_CMD_RUN)
|
||||||
"env run var [...] - run commands in an environment variable\n"
|
"env run var [...] - run commands in an environment variable\n"
|
||||||
#endif
|
#endif
|
||||||
@@ -1386,6 +1446,17 @@ U_BOOT_CMD(
|
@@ -1431,6 +1491,17 @@ U_BOOT_CMD(
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/cmd/pstore.c
|
--- a/cmd/pstore.c
|
||||||
+++ b/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
|
* pstore_print_buffer() - Print buffer
|
||||||
* @type: buffer type
|
* @type: buffer type
|
||||||
* @buffer: buffer to print
|
* @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[] = {
|
static struct cmd_tbl cmd_pstore_sub[] = {
|
||||||
U_BOOT_CMD_MKENT(set, 8, 0, pstore_set, "", ""),
|
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(display, 3, 0, pstore_display, "", ""),
|
||||||
U_BOOT_CMD_MKENT(save, 4, 0, pstore_save, "", ""),
|
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"
|
" '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"
|
" '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"
|
" bytes (0 disables it, 1 is a special value, means 16 bytes ECC).\n"
|
||||||
|
@ -14,13 +14,11 @@ Reviewed-by: Tom Rini <trini@konsulko.com>
|
|||||||
boot/image-fdt.c | 6 ++++++
|
boot/image-fdt.c | 6 ++++++
|
||||||
1 file changed, 6 insertions(+)
|
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
|
--- a/boot/image-fdt.c
|
||||||
+++ b/boot/image-fdt.c
|
+++ b/boot/image-fdt.c
|
||||||
@@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
|
@@ -639,6 +639,12 @@ int image_setup_libfdt(bootm_headers_t *
|
||||||
goto err;
|
images->fit_uname_cfg,
|
||||||
}
|
strlen(images->fit_uname_cfg) + 1, 1);
|
||||||
|
|
||||||
+ /* Store name of configuration node as u-boot,bootconf in /chosen node */
|
+ /* Store name of configuration node as u-boot,bootconf in /chosen node */
|
||||||
+ if (images->fit_uname_cfg)
|
+ if (images->fit_uname_cfg)
|
||||||
@ -31,6 +29,3 @@ index 692a9ad3e4..fdb69926a2 100644
|
|||||||
/* Update ethernet nodes */
|
/* Update ethernet nodes */
|
||||||
fdt_fixup_ethernet(blob);
|
fdt_fixup_ethernet(blob);
|
||||||
#if CONFIG_IS_ENABLED(CMD_PSTORE)
|
#if CONFIG_IS_ENABLED(CMD_PSTORE)
|
||||||
--
|
|
||||||
2.35.3
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/mtd/spi/spi-nor-ids.c
|
--- a/drivers/mtd/spi/spi-nor-ids.c
|
||||||
+++ b/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)
|
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) },
|
{ INFO("w25q256", 0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
|
||||||
|
@ -7,12 +7,11 @@
|
|||||||
-CONFIG_ENV_SIZE=0x1000
|
-CONFIG_ENV_SIZE=0x1000
|
||||||
+CONFIG_ENV_SIZE=0x10000
|
+CONFIG_ENV_SIZE=0x10000
|
||||||
CONFIG_ENV_OFFSET=0x100000
|
CONFIG_ENV_OFFSET=0x100000
|
||||||
-CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
|
CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
|
||||||
CONFIG_TARGET_MT7623=y
|
|
||||||
+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=y
|
||||||
-CONFIG_FIT_VERBOSE=y
|
-CONFIG_FIT_VERBOSE=y
|
||||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
|
CONFIG_DEFAULT_DEVICE_TREE="mt7623a-unielec-u7623-02-emmc"
|
||||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||||
CONFIG_TARGET_MT7623=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=y
|
||||||
-CONFIG_FIT_VERBOSE=y
|
-CONFIG_FIT_VERBOSE=y
|
||||||
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
|
||||||
|
@ -337,7 +337,7 @@
|
|||||||
+};
|
+};
|
||||||
--- a/arch/arm/dts/Makefile
|
--- a/arch/arm/dts/Makefile
|
||||||
+++ b/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 \
|
mt7622-rfb.dtb \
|
||||||
mt7623a-unielec-u7623-02-emmc.dtb \
|
mt7623a-unielec-u7623-02-emmc.dtb \
|
||||||
mt7622-bananapi-bpi-r64.dtb \
|
mt7622-bananapi-bpi-r64.dtb \
|
||||||
|
@ -349,7 +349,7 @@
|
|||||||
+};
|
+};
|
||||||
--- a/arch/arm/dts/Makefile
|
--- a/arch/arm/dts/Makefile
|
||||||
+++ b/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 \
|
mt7623a-unielec-u7623-02-emmc.dtb \
|
||||||
mt7622-bananapi-bpi-r64.dtb \
|
mt7622-bananapi-bpi-r64.dtb \
|
||||||
mt7622-linksys-e8450-ubi.dtb \
|
mt7622-linksys-e8450-ubi.dtb \
|
||||||
@ -412,15 +412,15 @@
|
|||||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||||
--- a/common/board_r.c
|
--- a/common/board_r.c
|
||||||
+++ b/common/board_r.c
|
+++ b/common/board_r.c
|
||||||
@@ -78,6 +78,7 @@
|
@@ -62,6 +62,7 @@
|
||||||
#ifdef CONFIG_EFI_SETUP_EARLY
|
#include <asm-generic/gpio.h>
|
||||||
#include <efi_loader.h>
|
#include <efi_loader.h>
|
||||||
#endif
|
#include <relocate.h>
|
||||||
+#include <spi_flash.h>
|
+#include <spi_flash.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
@@ -417,6 +418,21 @@ static int initr_onenand(void)
|
@@ -392,6 +393,21 @@ static int initr_onenand(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -442,7 +442,7 @@
|
|||||||
#ifdef CONFIG_MMC
|
#ifdef CONFIG_MMC
|
||||||
static int initr_mmc(void)
|
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
|
#ifdef CONFIG_CMD_ONENAND
|
||||||
initr_onenand,
|
initr_onenand,
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user