Update to next U-Boot timed release.
Remove now obsolete patch
100-01-board-mediatek-add-more-network-configurations.patch
Default IP addresses are now dealt with in Kconfig, no longer in board-
specific C header files.
Add patches to restore ANSI support in bootmenu which was broken upstream,
always use high-speed mode on serial UART for improved stability and fix
an issue with pinconf not being applied on MT7623 resulting in eMMC
being inaccessible when booting from micro SD card.
In order to keep the size of the bootloader on MT7623 below 512kB remove
some unneeded commands on both MT7623 boards.
Tested on:
* BananaPi BPi-R2 (MT7623N)
* BananaPi BPi-R3 (MT7986A)
* BananaPi BPi-R64 (MT7622A)
* Linksys E8450 (MT7622B)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
-PKG_VERSION:=2023.01
-PKG_HASH:=69423bad380f89a0916636e89e6dcbd2e4512d584308d922d1039d1e4331950f
+PKG_VERSION:=2023.04
+PKG_HASH:=e31cac91545ff41b71cec5d8c22afd695645cd6e2a442ccdacacd60534069341
PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host
include $(INCLUDE_DIR)/u-boot.mk
+CONFIG_ENV_SIZE_REDUND=0x40000
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_NET_RANDOM_ETHADDR=y
- CONFIG_REGMAP=y
+ CONFIG_USE_IPADDR=y
--- /dev/null
+From patchwork Wed Apr 12 20:36:43 2023
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+X-Patchwork-Submitter: Daniel Golle <daniel@makrotopia.org>
+X-Patchwork-Id: 1768270
+Return-Path: <u-boot-bounces@lists.denx.de>
+X-Original-To: incoming@patchwork.ozlabs.org
+Delivered-To: patchwork-incoming@legolas.ozlabs.org
+Date: Wed, 12 Apr 2023 21:36:43 +0100
+From: Daniel Golle <daniel@makrotopia.org>
+To: u-boot@lists.denx.de, Sam Shih <sam.shih@mediatek.com>,
+ GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
+ Chunfeng Yun <chunfeng.yun@mediatek.com>,
+ Weijie Gao <weijie.gao@mediatek.com>, Ryder Lee <ryder.lee@mediatek.com>,
+ Frank Wunderlich <frank-w@public-files.de>
+Cc: Steven Liu =?utf-8?b?KOWKieS6uuixqik=?= <steven.liu@mediatek.com>,
+ John Crispin <john@phrozen.org>
+Subject: [PATCH] pinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded
+Message-ID: <ZDcWW7kLSLn1GMZ1@makrotopia.org>
+MIME-Version: 1.0
+Content-Disposition: inline
+X-BeenThere: u-boot@lists.denx.de
+X-Mailman-Version: 2.1.39
+Precedence: list
+List-Id: U-Boot discussion <u-boot.lists.denx.de>
+Sender: "U-Boot" <u-boot-bounces@lists.denx.de>
+
+Commit dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and
+related functions") changed the logic deciding to set R0 and R1
+registers for V1 devices.
+
+Before:
+ /* Also set PUPD/R0/R1 if the pin has them */
+ err = mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup);
+ if (err != -EINVAL) {
+ mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0);
+ mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1);
+ }
+
+After:
+ /* try pupd_r1_r0 if pullen_pullsel return error */
+ err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
+ val);
+ if (err)
+ return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
+ pullup, val);
+
+Tracing mtk_pinconf_bias_set_pullen_pullsel shows that the function
+always either returns 0 in case of success or -EINVAL in case any error
+has occurred. Hence the logic responsible of the decision to program R0
+and R1 has been inverted.
+
+This leads to problems on BananaPi R2 (MT7623N) when booting from
+SDMMC, it turns out accessing eMMC no longer works since
+U-Boot 2022.07:
+
+MT7623> mmc dev 0
+Card did not respond to voltage select! : -110
+
+The problem wasn't detected for a long time as both eMMC and SDMMC work
+fine if they are used to boot from, and hence R0 and R1 were already
+setup by the bootrom and/or preloader.
+
+Fix the logic to restore the originally intended and correct behavior
+and also change the descriptive comment accordingly.
+
+Fixes: dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and related functions")
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
++++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+@@ -349,10 +349,10 @@ int mtk_pinconf_bias_set_v1(struct udevi
+ {
+ int err;
+
+- /* try pupd_r1_r0 if pullen_pullsel return error */
++ /* set pupd_r1_r0 if pullen_pullsel succeeded */
+ err = mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup,
+ val);
+- if (err)
++ if (!err)
+ return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable,
+ pullup, val);
+
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
-@@ -469,7 +469,6 @@ void clk_free(struct clk *clk)
+@@ -471,7 +471,6 @@ void clk_free(struct clk *clk)
ulong clk_get_rate(struct clk *clk)
{
const struct clk_ops *ops;
debug("%s(clk=%p)\n", __func__, clk);
if (!clk_valid(clk))
-@@ -479,11 +478,7 @@ ulong clk_get_rate(struct clk *clk)
+@@ -481,11 +480,7 @@ ulong clk_get_rate(struct clk *clk)
if (!ops->get_rate)
return -ENOSYS;
+++ /dev/null
-From 97df847f8f895cc2692bb0e4e933269c275da378 Mon Sep 17 00:00:00 2001
-From: Weijie Gao <weijie.gao@mediatek.com>
-Date: Tue, 2 Mar 2021 15:47:45 +0800
-Subject: [PATCH 35/71] board: mediatek: add more network configurations
-
-Make the network configurations uniform for mediatek boards
-
-Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
----
- include/configs/mt7622.h | 3 ++-
- include/configs/mt7623.h | 1 +
- include/configs/mt7629.h | 1 +
- include/configs/mt7981.h | 5 +++++
- include/configs/mt7986.h | 5 +++++
- 5 files changed, 14 insertions(+), 1 deletion(-)
-
---- a/include/configs/mt7622.h
-+++ b/include/configs/mt7622.h
-@@ -19,6 +19,7 @@
-
- /* Ethernet */
- #define CONFIG_IPADDR 192.168.1.1
--#define CONFIG_SERVERIP 192.168.1.3
-+#define CONFIG_SERVERIP 192.168.1.2
-+#define CONFIG_NETMASK 255.255.255.0
-
- #endif
---- a/include/configs/mt7623.h
-+++ b/include/configs/mt7623.h
-@@ -35,6 +35,7 @@
- /* Ethernet */
- #define CONFIG_IPADDR 192.168.1.1
- #define CONFIG_SERVERIP 192.168.1.2
-+#define CONFIG_NETMASK 255.255.255.0
-
- #ifdef CONFIG_DISTRO_DEFAULTS
-
---- a/include/configs/mt7629.h
-+++ b/include/configs/mt7629.h
-@@ -30,5 +30,6 @@
- /* Ethernet */
- #define CONFIG_IPADDR 192.168.1.1
- #define CONFIG_SERVERIP 192.168.1.2
-+#define CONFIG_NETMASK 255.255.255.0
-
- #endif
---- a/include/configs/mt7981.h
-+++ b/include/configs/mt7981.h
-@@ -18,4 +18,9 @@
- /* DRAM */
- #define CONFIG_SYS_SDRAM_BASE 0x40000000
-
-+/* Ethernet */
-+#define CONFIG_IPADDR 192.168.1.1
-+#define CONFIG_SERVERIP 192.168.1.2
-+#define CONFIG_NETMASK 255.255.255.0
-+
- #endif
---- a/include/configs/mt7986.h
-+++ b/include/configs/mt7986.h
-@@ -18,4 +18,9 @@
- /* DRAM */
- #define CONFIG_SYS_SDRAM_BASE 0x40000000
-
-+/* Ethernet */
-+#define CONFIG_IPADDR 192.168.1.1
-+#define CONFIG_SERVERIP 192.168.1.2
-+#define CONFIG_NETMASK 255.255.255.0
-+
- #endif
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -210,6 +210,8 @@ config SYS_MAX_FLASH_BANKS_DETECT
+@@ -238,6 +238,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/nand/Kconfig"
- config SYS_NAND_MAX_CHIPS
+ config SYS_NAND_MAX_OOBFREE
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -38,3 +38,5 @@ obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPOR
defined(CONFIG_ENV_IS_IN_NAND) || \
defined(CONFIG_ENV_IS_IN_NVRAM) || \
defined(CONFIG_ENV_IS_IN_ONENAND) || \
-@@ -62,7 +63,7 @@ DECLARE_GLOBAL_DATA_PTR;
+@@ -61,7 +62,7 @@ DECLARE_GLOBAL_DATA_PTR;
#if !defined(ENV_IS_IN_DEVICE) && \
!defined(CONFIG_ENV_IS_NOWHERE)
--- a/env/Kconfig
+++ b/env/Kconfig
-@@ -53,7 +53,7 @@ config ENV_IS_NOWHERE
+@@ -62,7 +62,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 && \
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
-@@ -242,6 +242,27 @@ config ENV_IS_IN_MMC
- This value is also in units of bytes, but must also be aligned to
- an MMC sector boundary.
+@@ -251,6 +251,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"
config ENV_IS_IN_NAND
bool "Environment in a NAND device"
depends on !CHAIN_OF_TRUST
-@@ -549,10 +570,16 @@ config ENV_ADDR_REDUND
+@@ -558,10 +579,16 @@ config ENV_ADDR_REDUND
Offset from the start of the device (or partition) of the redundant
environment location.
default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
default 0xF0000 if ARCH_SUNXI
-@@ -600,6 +627,12 @@ config ENV_SECT_SIZE
+@@ -609,6 +636,12 @@ config ENV_SECT_SIZE
help
Size of the sector containing the environment.
depends on ENV_IS_IN_UBI
--- a/env/Makefile
+++ b/env/Makefile
-@@ -26,6 +26,7 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_IS_NOWHERE)
+@@ -24,6 +24,7 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_IS_NOWHERE)
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_MMC) += mmc.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FAT) += fat.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_EXT4) += ext4.o
+};
--- a/include/env_internal.h
+++ b/include/env_internal.h
-@@ -130,6 +130,7 @@ enum env_location {
+@@ -109,6 +109,7 @@ enum env_location {
ENVL_FAT,
ENVL_FLASH,
ENVL_MMC,
ENVL_ONENAND,
--- a/tools/Makefile
+++ b/tools/Makefile
-@@ -40,6 +40,7 @@ ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
+@@ -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
--- a/cmd/mtdparts.c
+++ b/cmd/mtdparts.c
-@@ -1060,6 +1060,9 @@ int mtd_id_parse(const char *id, const c
+@@ -1057,6 +1057,9 @@ int mtd_id_parse(const char *id, const c
} else if (strncmp(p, "spi-nand", 8) == 0) {
*dev_type = MTD_DEV_TYPE_SPINAND;
p += 8;
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -226,4 +226,6 @@ source "drivers/mtd/spi/Kconfig"
+@@ -272,4 +272,6 @@ source "drivers/mtd/spi/Kconfig"
source "drivers/mtd/ubi/Kconfig"
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
-@@ -1342,6 +1342,12 @@ config CMD_NAND_TORTURE
+@@ -1352,6 +1352,12 @@ config CMD_NAND_TORTURE
endif # CMD_NAND
depends on NVME
--- a/cmd/Makefile
+++ b/cmd/Makefile
-@@ -125,6 +125,7 @@ obj-y += legacy-mtd-utils.o
+@@ -123,6 +123,7 @@ obj-y += legacy-mtd-utils.o
endif
obj-$(CONFIG_CMD_MUX) += mux.o
obj-$(CONFIG_CMD_NAND) += nand.o
+ defined(CONFIG_ENV_IS_IN_NMBM) || \
defined(CONFIG_ENV_IS_IN_NVRAM) || \
defined(CONFIG_ENV_IS_IN_ONENAND) || \
- defined(CONFIG_ENV_IS_IN_SATA) || \
-@@ -64,7 +65,7 @@ DECLARE_GLOBAL_DATA_PTR;
+ defined(CONFIG_ENV_IS_IN_SPI_FLASH) || \
+@@ -63,7 +64,7 @@ DECLARE_GLOBAL_DATA_PTR;
#if !defined(ENV_IS_IN_DEVICE) && \
!defined(CONFIG_ENV_IS_NOWHERE)
# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|MTD|\
/*
--- a/env/Kconfig
+++ b/env/Kconfig
-@@ -53,7 +53,7 @@ config ENV_IS_NOWHERE
+@@ -62,7 +62,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 && \
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
-@@ -303,6 +303,21 @@ config ENV_RANGE
+@@ -312,6 +312,21 @@ config ENV_RANGE
Specifying a range with more erase blocks than are needed to hold
CONFIG_ENV_SIZE allows bad blocks within the range to be avoided.
config ENV_IS_IN_NVRAM
bool "Environment in a non-volatile RAM"
depends on !CHAIN_OF_TRUST
-@@ -579,7 +594,7 @@ config ENV_MTD_NAME
+@@ -588,7 +603,7 @@ config ENV_MTD_NAME
config ENV_OFFSET
hex "Environment offset"
depends on ENV_IS_IN_EEPROM || ENV_IS_IN_MMC || ENV_IS_IN_NAND || \
default 0xF0000 if ARCH_SUNXI
--- a/env/Makefile
+++ b/env/Makefile
-@@ -28,6 +28,7 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FAT) +
+@@ -26,6 +26,7 @@ obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FAT) +
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_EXT4) += ext4.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_MTD) += mtd.o
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_NAND) += nand.o
+};
--- a/include/env_internal.h
+++ b/include/env_internal.h
-@@ -132,6 +132,7 @@ enum env_location {
+@@ -111,6 +111,7 @@ enum env_location {
ENVL_MMC,
ENVL_MTD,
ENVL_NAND,
ENVL_REMOTE,
--- a/tools/Makefile
+++ b/tools/Makefile
-@@ -42,6 +42,7 @@ ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
+@@ -39,6 +39,7 @@ 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
ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
- CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y)
+ BUILD_ENVCRC ?= $(ENVCRC-y)
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
-@@ -1342,6 +1342,14 @@ config CMD_NAND_TORTURE
+@@ -1352,6 +1352,14 @@ config CMD_NAND_TORTURE
endif # CMD_NAND
bool "nmbm"
--- a/cmd/Makefile
+++ b/cmd/Makefile
-@@ -125,6 +125,7 @@ obj-y += legacy-mtd-utils.o
+@@ -123,6 +123,7 @@ obj-y += legacy-mtd-utils.o
endif
obj-$(CONFIG_CMD_MUX) += mux.o
obj-$(CONFIG_CMD_NAND) += nand.o
static int spi_nor_hwcaps2cmd(u32 hwcaps, const int table[][2], size_t size)
{
size_t i;
-@@ -3901,6 +3995,7 @@ int spi_nor_scan(struct spi_nor *nor)
+@@ -3930,6 +4024,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;
#define SNOR_MFR_CYPRESS 0x34
/*
-@@ -565,6 +566,7 @@ struct spi_nor {
+@@ -571,6 +572,7 @@ struct spi_nor {
void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
int (*read_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
int (*write_reg)(struct spi_nor *nor, u8 opcode, u8 *buf, int len);
enum {
STAGE_ERASE,
STAGE_CHECK,
-@@ -603,6 +611,8 @@ static int do_spi_flash(struct cmd_tbl *
+@@ -601,6 +609,8 @@ static int do_spi_flash(struct cmd_tbl *
ret = do_spi_flash_erase(argc, argv);
else if (strcmp(cmd, "protect") == 0)
ret = do_spi_protect(argc, argv);
else if (IS_ENABLED(CONFIG_CMD_SF_TEST) && !strcmp(cmd, "test"))
ret = do_spi_flash_test(argc, argv);
else
-@@ -633,7 +643,8 @@ static const char long_help[] =
+@@ -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"
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
-@@ -87,16 +87,17 @@ static char *bootmenu_choice_entry(void
+@@ -89,6 +89,7 @@ static char *bootmenu_choice_entry(void
struct bootmenu_data *menu = data;
struct bootmenu_entry *iter;
- enum bootmenu_key key = KEY_NONE;
+ enum bootmenu_key key = BKEY_NONE;
+ int choice = -1;
- int esc = 0;
int i;
+ cli_ch_init(cch);
+@@ -96,10 +97,10 @@ static char *bootmenu_choice_entry(void
while (1) {
if (menu->delay >= 0) {
/* Autoboot was not stopped */
-- bootmenu_autoboot_loop(menu, &key, &esc);
-+ bootmenu_autoboot_loop(menu, &key, &esc, &choice);
+- key = bootmenu_autoboot_loop(menu, cch);
++ key = bootmenu_autoboot_loop(menu, cch, &choice);
} else {
/* Some key was pressed, so autoboot was stopped */
-- bootmenu_loop(menu, &key, &esc);
-+ bootmenu_loop(menu, &key, &esc, &choice);
+- key = bootmenu_loop(menu, cch);
++ key = bootmenu_loop(menu, cch, &choice);
}
switch (key) {
-@@ -110,6 +111,12 @@ static char *bootmenu_choice_entry(void
+@@ -113,6 +114,12 @@ static char *bootmenu_choice_entry(void
++menu->active;
/* no menu key selected, regenerate menu */
return NULL;
-+ case KEY_CHOICE:
++ case BKEY_CHOICE:
+ menu->active = choice;
+ if (!menu->last_choiced) {
+ menu->last_choiced = true;
+ return NULL;
+ }
- case KEY_SELECT:
+ case BKEY_SELECT:
iter = menu->first;
for (i = 0; i < menu->active; ++i)
-@@ -167,6 +174,9 @@ static int prepare_bootmenu_entry(struct
+@@ -170,6 +177,9 @@ static int prepare_bootmenu_entry(struct
unsigned short int i = *index;
struct bootmenu_entry *entry = NULL;
struct bootmenu_entry *iter = *current;
while ((option = bootmenu_getoption(i))) {
-@@ -181,11 +191,24 @@ static int prepare_bootmenu_entry(struct
+@@ -184,11 +194,24 @@ static int prepare_bootmenu_entry(struct
if (!entry)
return -ENOMEM;
entry->command = strdup(sep + 1);
if (!entry->command) {
-@@ -331,6 +354,7 @@ static struct bootmenu_data *bootmenu_cr
+@@ -334,6 +357,7 @@ static struct bootmenu_data *bootmenu_cr
menu->delay = delay;
menu->active = 0;
menu->first = NULL;
default_str = env_get("bootmenu_default");
if (default_str)
-@@ -366,9 +390,9 @@ static struct bootmenu_data *bootmenu_cr
+@@ -369,9 +393,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))
free(entry);
--- a/common/menu.c
+++ b/common/menu.c
-@@ -47,6 +47,33 @@ struct menu {
+@@ -49,6 +49,33 @@ struct menu {
int item_cnt;
};
/*
* 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 +453,7 @@ int menu_destroy(struct menu *m)
+@@ -428,7 +455,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)
+ enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
+- struct cli_ch_state *cch)
++ struct cli_ch_state *cch, int *choice)
{
+ enum bootmenu_key key = BKEY_NONE;
int i, c;
-
-@@ -456,6 +483,19 @@ void bootmenu_autoboot_loop(struct bootm
+@@ -463,6 +490,19 @@ enum bootmenu_key bootmenu_autoboot_loop
break;
default:
- *key = KEY_NONE;
-+ if (*esc)
+ key = BKEY_NONE;
++ if (cch->esc_len || !choice)
+ break;
+
+ *choice = find_choice(c);
+ if ((*choice >= 0 &&
+ *choice < menu->count - 1)) {
-+ *key = KEY_CHOICE;
++ key = BKEY_CHOICE;
+ } else if (c == '0') {
+ *choice = menu->count - 1;
-+ *key = KEY_CHOICE;
++ key = BKEY_CHOICE;
+ } else {
-+ *key = KEY_NONE;
++ key = BKEY_NONE;
+ }
break;
}
+ break;
+@@ -483,7 +523,8 @@ enum bootmenu_key bootmenu_autoboot_loop
+ return key;
+ }
+
+-enum bootmenu_key bootmenu_conv_key(int ichar)
++enum bootmenu_key bootmenu_conv_key(struct bootmenu_data *menu, int ichar,
++ int *choice)
+ {
+ enum bootmenu_key key;
-@@ -475,10 +515,16 @@ void bootmenu_autoboot_loop(struct bootm
+@@ -515,6 +556,20 @@ enum bootmenu_key bootmenu_conv_key(int
+ case ' ':
+ key = BKEY_SPACE;
+ break;
++ case '0' ... '9':
++ case 'a' ... 'z':
++ if (choice && menu) {
++ *choice = find_choice(ichar);
++ if ((*choice >= 0 && *choice < menu->count - 1)) {
++ key = BKEY_CHOICE;
++ break;
++ } else if (ichar == '0') {
++ *choice = menu->count - 1;
++ key = BKEY_CHOICE;
++ break;
++ }
++ }
++ fallthrough;
+ default:
+ key = BKEY_NONE;
+ break;
+@@ -524,11 +579,16 @@ enum bootmenu_key bootmenu_conv_key(int
}
- void bootmenu_loop(struct bootmenu_data *menu,
-- enum bootmenu_key *key, int *esc)
-+ enum bootmenu_key *key, int *esc, int *choice)
+ enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
+- struct cli_ch_state *cch)
++ struct cli_ch_state *cch, int *choice)
{
+ enum bootmenu_key key;
int c;
+ if (menu->last_choiced) {
+ menu->last_choiced = false;
-+ *key = KEY_SELECT;
-+ return;
++ return BKEY_SELECT;
+ }
+
- if (*esc == 1) {
- if (tstc()) {
- c = getchar();
-@@ -504,6 +550,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;
-+ }
+ c = cli_ch_process(cch, 0);
+ if (!c) {
+ while (!c && !tstc()) {
+@@ -542,7 +602,7 @@ enum bootmenu_key bootmenu_loop(struct b
}
- break;
- case 1:
+ }
+
+- key = bootmenu_conv_key(c);
++ key = bootmenu_conv_key(menu, c, choice);
+
+ return key;
+ }
--- a/include/menu.h
+++ b/include/menu.h
@@ -6,6 +6,8 @@
+#include <linux/ctype.h>
+
+ struct cli_ch_state;
struct menu;
- struct menu *menu_create(char *title, int timeout, int prompt,
-@@ -18,6 +20,8 @@ int menu_get_choice(struct menu *m, void
+@@ -19,6 +21,8 @@ int menu_get_choice(struct menu *m, void
int menu_item_add(struct menu *m, char *item_key, void *item_data);
int menu_destroy(struct menu *m);
int menu_default_choice(struct menu *m, void **choice);
/**
* menu_show() Show a boot menu
-@@ -40,6 +44,7 @@ struct bootmenu_data {
+@@ -41,6 +45,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 {
-@@ -51,11 +56,12 @@ enum bootmenu_key {
- KEY_PLUS,
- KEY_MINUS,
- KEY_SPACE,
-+ KEY_CHOICE,
+ /** enum bootmenu_key - keys that can be returned by the bootmenu */
+@@ -54,6 +59,7 @@ enum bootmenu_key {
+ BKEY_MINUS,
+ BKEY_SPACE,
+ BKEY_SAVE,
++ BKEY_CHOICE,
+
+ BKEY_COUNT,
};
+@@ -76,7 +82,7 @@ enum bootmenu_key {
+ * anything else: KEY_NONE
+ */
+ enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
+- struct cli_ch_state *cch);
++ struct cli_ch_state *cch, int *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);
+ /**
+ * bootmenu_loop() - handle waiting for a keypress when autoboot is disabled
+@@ -102,7 +108,7 @@ enum bootmenu_key bootmenu_autoboot_loop
+ * Space: BKEY_SPACE
+ */
+ enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
+- struct cli_ch_state *cch);
++ struct cli_ch_state *cch, int *choice);
+
+ /**
+ * bootmenu_conv_key() - Convert a U-Boot keypress into a menu key
+@@ -110,6 +116,7 @@ enum bootmenu_key bootmenu_loop(struct b
+ * @ichar: Keypress to convert (ASCII, including control characters)
+ * Returns: Menu key that corresponds to @ichar, or BKEY_NONE if none
+ */
+-enum bootmenu_key bootmenu_conv_key(int ichar);
++enum bootmenu_key bootmenu_conv_key(struct bootmenu_data *menu, int ichar,
++ int *choice);
#endif /* __MENU_H__ */
+--- a/cmd/eficonfig.c
++++ b/cmd/eficonfig.c
+@@ -239,7 +239,7 @@ char *eficonfig_choice_entry(void *data)
+ cli_ch_init(cch);
+
+ while (1) {
+- key = bootmenu_loop((struct bootmenu_data *)efi_menu, cch);
++ key = bootmenu_loop((struct bootmenu_data *)efi_menu, cch, NULL);
+
+ switch (key) {
+ case BKEY_UP:
+@@ -1937,7 +1937,7 @@ char *eficonfig_choice_change_boot_order
+
+ cli_ch_init(cch);
+ while (1) {
+- key = bootmenu_loop(NULL, cch);
++ key = bootmenu_loop(NULL, cch, NULL);
+
+ switch (key) {
+ case BKEY_PLUS:
CONFIG_CMD_PCI=y
CONFIG_CMD_SF_TEST=y
CONFIG_CMD_PING=y
-@@ -36,6 +37,10 @@ CONFIG_SYSCON=y
+@@ -40,6 +41,10 @@ CONFIG_SYSCON=y
CONFIG_CLK=y
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_MMC_MTK=y
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -1266,6 +1266,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1288,6 +1288,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7623n-bananapi-bpi-r2.dtb \
mt7629-rfb.dtb \
mt7981-rfb.dtb \
{ INFO("en25s64", 0x1c3817, 0, 64 * 1024, 128, SECT_4K) },
#endif
#ifdef CONFIG_SPI_FLASH_GIGADEVICE /* GIGADEVICE */
-@@ -119,6 +120,11 @@ const struct flash_info spi_nor_ids[] =
- SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
- },
+@@ -149,6 +150,11 @@ const struct flash_info spi_nor_ids[] =
+ {INFO("gd55x02g", 0xc8481C, 0, 64 * 1024, 4096, SECT_4K |
+ SPI_NOR_OCTAL_READ | SPI_NOR_4B_OPCODES)},
{
+ INFO("gd25q256", 0xc84019, 0, 64 * 1024, 512,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
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)
-@@ -398,6 +404,16 @@ const struct flash_info spi_nor_ids[] =
+@@ -468,6 +474,16 @@ const struct flash_info spi_nor_ids[] =
SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
},
{
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)
-@@ -447,6 +463,11 @@ const struct flash_info spi_nor_ids[] =
+@@ -517,6 +533,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) },
--- a/drivers/mmc/Kconfig
+++ b/drivers/mmc/Kconfig
-@@ -818,6 +818,14 @@ config MMC_MTK
+@@ -823,6 +823,14 @@ config MMC_MTK
This is needed if support for any SD/SDIO/MMC devices is required.
If unsure, say N.
+
endif
- config FSL_ESDHC
+ config FSL_SDHC_V2_3
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -84,3 +84,7 @@ obj-$(CONFIG_RENESAS_SDHI) += tmio-comm
struct ubi_volume *vol;
--- a/include/ubi_uboot.h
+++ b/include/ubi_uboot.h
-@@ -73,6 +73,10 @@ extern void ubi_exit(void);
+@@ -51,6 +51,10 @@ extern void ubi_exit(void);
extern int ubi_part(char *part_name, const char *vid_header_offset);
extern int ubi_volume_write(char *volume, void *buf, size_t size);
extern int ubi_volume_read(char *volume, char *buf, size_t size);
--- a/env/Kconfig
+++ b/env/Kconfig
-@@ -666,6 +666,12 @@ config ENV_UBI_VOLUME_REDUND
+@@ -675,6 +675,12 @@ config ENV_UBI_VOLUME_REDUND
help
Name of the redundant volume that you want to store the environment in.
depends on ENV_IS_IN_UBI
--- a/env/ubi.c
+++ b/env/ubi.c
-@@ -100,6 +100,18 @@ static int env_ubi_save(void)
+@@ -106,6 +106,18 @@ static int env_ubi_save(void)
#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */
#endif /* CONFIG_CMD_SAVEENV */
#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
static int env_ubi_load(void)
{
-@@ -129,6 +141,11 @@ static int env_ubi_load(void)
+@@ -135,6 +147,11 @@ static int env_ubi_load(void)
return -EIO;
}
read1_fail = ubi_volume_read(CONFIG_ENV_UBI_VOLUME, (void *)tmp_env1,
CONFIG_ENV_SIZE);
if (read1_fail)
-@@ -166,6 +183,9 @@ static int env_ubi_load(void)
+@@ -172,6 +189,9 @@ static int env_ubi_load(void)
return -EIO;
}
+}
--- a/board/mediatek/mt7981/mt7981_rfb.c
+++ b/board/mediatek/mt7981/mt7981_rfb.c
-@@ -4,7 +4,59 @@
+@@ -4,7 +4,58 @@
* Author: Sam Shih <sam.shih@mediatek.com>
*/
+
int board_init(void)
{
-+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
-+ return 0;
-+}
+ return 0;
+ }
+
+int board_late_init(void)
+{
+ add_mtd_device(upper);
+#endif
+
- return 0;
- }
++ return 0;
++}
--- a/board/mediatek/mt7986/mt7986_rfb.c
+++ b/board/mediatek/mt7986/mt7986_rfb.c
-@@ -4,7 +4,61 @@
+@@ -4,7 +4,60 @@
* Author: Sam Shih <sam.shih@mediatek.com>
*/
+
int board_init(void)
{
-+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
-+ return 0;
-+}
+ return 0;
+ }
+
+int board_late_init(void)
+{
+ add_mtd_device(upper);
+#endif
+
- return 0;
- }
++ return 0;
++}
--- a/tools/Makefile
+++ b/tools/Makefile
-@@ -121,7 +121,6 @@ dumpimage-mkimage-objs := aisimage.o \
+@@ -115,7 +115,6 @@ dumpimage-mkimage-objs := aisimage.o \
imximage.o \
imx8image.o \
imx8mimage.o \
--- a/Makefile
+++ b/Makefile
-@@ -1069,7 +1069,7 @@ quiet_cmd_pad_cat = CAT $@
+@@ -1067,7 +1067,7 @@ quiet_cmd_pad_cat = CAT $@
cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
quiet_cmd_lzma = LZMA $@
int arch, int ph_type, int bootstage_id,
--- a/include/image.h
+++ b/include/image.h
-@@ -1042,6 +1042,7 @@ int fit_parse_subimage(const char *spec,
+@@ -1046,6 +1046,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);
--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
-@@ -449,7 +449,11 @@ static void menu_display_statusline(stru
+@@ -452,7 +452,11 @@ static void menu_display_statusline(stru
printf(ANSI_CURSOR_POSITION, 1, 1);
puts(ANSI_CLEAR_LINE);
printf(ANSI_CURSOR_POSITION, 2, 3);
puts(ANSI_CLEAR_LINE_TO_END);
printf(ANSI_CURSOR_POSITION, 3, 1);
puts(ANSI_CLEAR_LINE);
-@@ -534,6 +538,7 @@ static enum bootmenu_ret bootmenu_show(i
+@@ -537,6 +541,7 @@ static enum bootmenu_ret bootmenu_show(i
return BOOTMENU_RET_FAIL;
}
goto cleanup;
--- a/include/menu.h
+++ b/include/menu.h
-@@ -44,6 +44,7 @@ struct bootmenu_data {
+@@ -45,6 +45,7 @@ struct bootmenu_data {
int active; /* active menu entry */
int count; /* total count of menu entries */
struct bootmenu_entry *first; /* first menu entry */
--- /dev/null
+--- a/common/menu.c
++++ b/common/menu.c
+@@ -15,7 +15,7 @@
+
+ #include "menu.h"
+
+-#define ansi 0
++#define ansi 1
+
+ /*
+ * Internally, each item in a menu is represented by a struct menu_item.
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
-@@ -591,6 +591,12 @@ config CMD_ENV_EXISTS
+@@ -601,6 +601,12 @@ config CMD_ENV_EXISTS
Check if a variable is defined in the environment for use in
shell scripting.
help
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
-@@ -409,6 +409,60 @@ int do_env_ask(struct cmd_tbl *cmdtp, in
+@@ -408,6 +408,60 @@ int do_env_ask(struct cmd_tbl *cmdtp, in
}
#endif
#if defined(CONFIG_CMD_ENV_CALLBACK)
static int print_static_binding(const char *var_name, const char *callback_name,
void *priv)
-@@ -1232,6 +1286,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, "", ""),
#if defined(CONFIG_CMD_RUN)
U_BOOT_CMD_MKENT(run, CONFIG_SYS_MAXARGS, 1, do_run, "", ""),
#endif
-@@ -1323,6 +1380,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_RUN)
"env run var [...] - run commands in an environment variable\n"
#endif
-@@ -1432,6 +1492,17 @@ U_BOOT_CMD(
+@@ -1431,6 +1491,17 @@ U_BOOT_CMD(
);
#endif
+
/* Update ethernet nodes */
fdt_fixup_ethernet(blob);
- #if CONFIG_IS_ENABLED(CMD_PSTORE)
+ #if IS_ENABLED(CONFIG_CMD_PSTORE)
--- a/Makefile
+++ b/Makefile
-@@ -2028,26 +2028,7 @@ endif
+@@ -2000,26 +2000,7 @@ endif
# Check dtc and pylibfdt, if DTC is provided, else build them
PHONY += scripts_dtc
scripts_dtc: scripts_basic
#include <mtd.h>
#include <linux/mtd/mtd.h>
-@@ -25,7 +32,19 @@ int board_init(void)
+@@ -24,7 +31,19 @@ int board_init(void)
int board_late_init(void)
{
--- a/configs/mt7623n_bpir2_defconfig
+++ b/configs/mt7623n_bpir2_defconfig
-@@ -5,57 +5,142 @@ CONFIG_ARCH_MEDIATEK=y
- CONFIG_TEXT_BASE=0x81e00000
- CONFIG_SYS_MALLOC_F_LEN=0x4000
+@@ -7,35 +7,105 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
+ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81ffff10
-CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_SIZE=0x10000
CONFIG_ENV_OFFSET=0x100000
+CONFIG_SYS_PROMPT="MT7623> "
CONFIG_TARGET_MT7623=y
CONFIG_SYS_LOAD_ADDR=0x84000000
- CONFIG_DISTRO_DEFAULTS=y
- CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
- CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81ffff10
CONFIG_FIT=y
-CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_BOARD_LATE_INIT=y
++# CONFIG_BOOTSTD is not set
++# CONFIG_BOOT_DEFAULTS is not set
+ CONFIG_DISTRO_DEFAULTS=y
CONFIG_BOOTDELAY=3
+CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_DEFAULT_FDT_FILE="mt7623n-bananapi-bpi-r2.dtb"
+CONFIG_CMD_LINK_LOCAL=y
+CONFIG_CMD_MBR=y
CONFIG_CMD_MMC=y
--CONFIG_CMD_READ=y
+ CONFIG_CMD_READ=y
-# CONFIG_CMD_SETEXPR is not set
-+CONFIG_CMD_MTD=y
# CONFIG_CMD_NFS is not set
-+CONFIG_CMD_PCI=y
+CONFIG_CMD_SF_TEST=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_PXE=y
-+CONFIG_CMD_PWM=y
-+CONFIG_CMD_SMC=y
+CONFIG_CMD_TFTPBOOT=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_ASKENV=y
+CONFIG_CMD_STRINGS=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_UUID=y
-+CONFIG_CMD_MMC=y
-+CONFIG_CMD_READ=y
+CONFIG_CMD_SCSI=y
+CONFIG_DISPLAY_CPUINFO=y
+CONFIG_DM_ETH=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_MMC=y
-+CONFIG_DM_MTD=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
-+CONFIG_DM_SERIAL=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_USB=y
+CONFIG_DM_PCI=y
-+CONFIG_DM_PWM=y
+CONFIG_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_SCSI_AHCI=y
+CONFIG_SCSI=y
-+CONFIG_PWM_MTK=y
+CONFIG_HUSH_PARSER=y
-+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
- CONFIG_REGMAP=y
- CONFIG_SYSCON=y
- CONFIG_CLK=y
-+CONFIG_LZMA=y
-+CONFIG_MEDIATEK_ETH=y
- # CONFIG_MMC_QUIRKS is not set
+ CONFIG_USE_IPADDR=y
+ CONFIG_IPADDR="192.168.1.1"
+ CONFIG_USE_SERVERIP=y
+@@ -47,6 +117,12 @@ CONFIG_CLK=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_MMC_HS400_SUPPORT=y
CONFIG_MMC_MTK=y
-+CONFIG_MTK_POWER_DOMAIN=y
-+CONFIG_MTK_SERIAL=y
-+CONFIG_MTK_TIMER=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_PARTITION_UUIDS=y
+CONFIG_PCI=y
+CONFIG_PCIE_MEDIATEK=y
+CONFIG_PHY=y
++CONFIG_PINCONF=y
CONFIG_PHY_FIXED=y
--CONFIG_MEDIATEK_ETH=y
+ CONFIG_MEDIATEK_ETH=y
CONFIG_PINCTRL=y
- CONFIG_PINCONF=y
- CONFIG_PINCTRL_MT7623=y
- CONFIG_POWER_DOMAIN=y
--CONFIG_MTK_POWER_DOMAIN=y
--CONFIG_DM_SERIAL=y
--CONFIG_MTK_SERIAL=y
+@@ -56,10 +132,13 @@ CONFIG_POWER_DOMAIN=y
+ CONFIG_MTK_POWER_DOMAIN=y
+ CONFIG_DM_SERIAL=y
+ CONFIG_MTK_SERIAL=y
+CONFIG_RANDOM_UUID=y
+CONFIG_REGEX=y
CONFIG_SYSRESET=y
CONFIG_SYSRESET_WATCHDOG=y
CONFIG_TIMER=y
--CONFIG_MTK_TIMER=y
+ CONFIG_MTK_TIMER=y
+CONFIG_VERSION_VARIABLE=y
CONFIG_WDT_MTK=y
--CONFIG_LZMA=y
+ CONFIG_LZMA=y
# CONFIG_EFI_GRUB_ARM32_WORKAROUND is not set
--- /dev/null
+++ b/bananapi_bpi-r2_env
--- a/configs/mt7623a_unielec_u7623_02_defconfig
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
-@@ -5,55 +5,140 @@ CONFIG_ARCH_MEDIATEK=y
- CONFIG_TEXT_BASE=0x81e00000
- CONFIG_SYS_MALLOC_F_LEN=0x4000
+@@ -7,34 +7,110 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
+ CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+ CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81ffff10
-CONFIG_ENV_SIZE=0x1000
+CONFIG_ENV_SIZE=0x10000
CONFIG_ENV_OFFSET=0x100000
+CONFIG_SYS_PROMPT="MT7623> "
CONFIG_TARGET_MT7623=y
CONFIG_SYS_LOAD_ADDR=0x84000000
- CONFIG_DISTRO_DEFAULTS=y
- CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
- CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x81ffff10
CONFIG_FIT=y
-CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_MENU_SHOW=y
+CONFIG_BOARD_LATE_INIT=y
++# CONFIG_BOOTSTD is not set
++# CONFIG_BOOT_DEFAULTS is not set
+ CONFIG_DISTRO_DEFAULTS=y
CONFIG_BOOTDELAY=3
+CONFIG_BOOTP_SEND_HOSTNAME=y
CONFIG_DEFAULT_FDT_FILE="mt7623a-unielec-u7623-02-emmc.dtb"
+CONFIG_CMD_LINK_LOCAL=y
+CONFIG_CMD_MBR=y
CONFIG_CMD_MMC=y
--CONFIG_CMD_READ=y
+ CONFIG_CMD_READ=y
-# CONFIG_CMD_SETEXPR is not set
# CONFIG_CMD_NFS is not set
--CONFIG_ENV_IS_IN_MMC=y
-+CONFIG_CMD_PCI=y
+CONFIG_CMD_SF_TEST=y
+CONFIG_CMD_PING=y
+CONFIG_CMD_PXE=y
-+CONFIG_CMD_PWM=y
-+CONFIG_CMD_SMC=y
+CONFIG_CMD_TFTPBOOT=y
+CONFIG_CMD_TFTPSRV=y
+CONFIG_CMD_ASKENV=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_SCSI=y
+CONFIG_DM_MMC=y
-+CONFIG_DM_MTD=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_SERIAL=y
+CONFIG_DM_REGULATOR_GPIO=y
+CONFIG_DM_USB=y
+CONFIG_DM_PCI=y
-+CONFIG_DM_PWM=y
+CONFIG_AHCI=y
+CONFIG_AHCI_PCI=y
+CONFIG_SCSI_AHCI=y
+CONFIG_SCSI=y
-+CONFIG_PWM_MTK=y
+CONFIG_HUSH_PARSER=y
+ CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_MMC_ENV_DEV=0
+CONFIG_ENV_OVERWRITE=y
+CONFIG_ENV_IS_IN_MMC=y
CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_NETCONSOLE=y
- CONFIG_REGMAP=y
- CONFIG_SYSCON=y
- CONFIG_CLK=y
-+CONFIG_LZMA=y
-+CONFIG_MEDIATEK_ETH=y
- # CONFIG_MMC_QUIRKS is not set
+ CONFIG_USE_IPADDR=y
+ CONFIG_IPADDR="192.168.1.1"
+ CONFIG_USE_SERVERIP=y
+@@ -46,6 +122,11 @@ CONFIG_CLK=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_MMC_HS400_SUPPORT=y
CONFIG_MMC_MTK=y
-+CONFIG_MTK_POWER_DOMAIN=y
-+CONFIG_MTK_SERIAL=y
-+CONFIG_MTK_TIMER=y
+CONFIG_OF_LIBFDT_OVERLAY=y
+CONFIG_PARTITION_UUIDS=y
+CONFIG_PCI=y
+CONFIG_PCIE_MEDIATEK=y
+CONFIG_PHY=y
CONFIG_PHY_FIXED=y
--CONFIG_MEDIATEK_ETH=y
+ CONFIG_MEDIATEK_ETH=y
CONFIG_PINCTRL=y
- CONFIG_PINCONF=y
- CONFIG_PINCTRL_MT7623=y
- CONFIG_POWER_DOMAIN=y
--CONFIG_MTK_POWER_DOMAIN=y
--CONFIG_DM_SERIAL=y
--CONFIG_MTK_SERIAL=y
+@@ -55,9 +136,12 @@ CONFIG_POWER_DOMAIN=y
+ CONFIG_MTK_POWER_DOMAIN=y
+ CONFIG_DM_SERIAL=y
+ CONFIG_MTK_SERIAL=y
+CONFIG_RANDOM_UUID=y
+CONFIG_REGEX=y
CONFIG_SYSRESET=y
CONFIG_SYSRESET_WATCHDOG=y
CONFIG_TIMER=y
--CONFIG_MTK_TIMER=y
+ CONFIG_MTK_TIMER=y
+CONFIG_VERSION_VARIABLE=y
CONFIG_WDT_MTK=y
--CONFIG_LZMA=y
+ CONFIG_LZMA=y
--- /dev/null
+++ b/unielec_u7623-02_env
@@ -0,0 +1,47 @@
reg_1p8v: regulator-1p8v {
compatible = "regulator-fixed";
regulator-name = "fixed-1.8V";
-@@ -197,7 +234,7 @@
+@@ -182,6 +219,7 @@
+ };
+
+ &uart0 {
++ mediatek,force-highspeed;
+ status = "okay";
+ };
+
+@@ -197,7 +235,7 @@
status = "okay";
bus-width = <8>;
max-frequency = <50000000>;
vmmc-supply = <®_3p3v>;
vqmmc-supply = <®_3p3v>;
non-removable;
-@@ -208,7 +245,7 @@
+@@ -208,7 +246,7 @@
pinctrl-0 = <&mmc1_pins_default>;
status = "okay";
bus-width = <4>;
--- /dev/null
+++ b/configs/mt7622_bananapi_bpi-r64-sdmmc_defconfig
-@@ -0,0 +1,160 @@
+@@ -0,0 +1,164 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_MTK=y
+CONFIG_USB_STORAGE=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/bananapi_bpi-r64-sdmmc_env
@@ -0,0 +1,82 @@
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
--- /dev/null
+++ b/configs/mt7622_bananapi_bpi-r64-emmc_defconfig
-@@ -0,0 +1,147 @@
+@@ -0,0 +1,151 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_MTK=y
+CONFIG_USB_STORAGE=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/bananapi_bpi-r64-emmc_env
@@ -0,0 +1,56 @@
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
--- /dev/null
+++ b/configs/mt7622_bananapi_bpi-r64-snand_defconfig
-@@ -0,0 +1,141 @@
+@@ -0,0 +1,145 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_MTK=y
+CONFIG_USB_STORAGE=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.3"
--- /dev/null
+++ b/bananapi_bpi-r64-snand_env
@@ -0,0 +1,57 @@
--- /dev/null
+--- a/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
++++ b/arch/arm/dts/mt7623n-bananapi-bpi-r2.dts
+@@ -243,6 +243,7 @@
+ &uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins_a>;
++ mediatek,force-highspeed;
+ status = "okay";
+ };
+
--- /dev/null
+++ b/configs/mt7622_linksys_e8450_defconfig
-@@ -0,0 +1,137 @@
+@@ -0,0 +1,141 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_HEXDUMP=y
+CONFIG_RANDOM_UUID=y
+CONFIG_REGEX=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
+CONFIG_USB=y
+CONFIG_USB_HOST=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_STORAGE=y
--- /dev/null
+++ b/arch/arm/dts/mt7622-linksys-e8450-ubi.dts
-@@ -0,0 +1,193 @@
+@@ -0,0 +1,194 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019 MediaTek Inc.
+};
+
+&uart0 {
++ mediatek,force-highspeed;
+ status = "okay";
+};
+
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -1263,6 +1263,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1285,6 +1285,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7622-rfb.dtb \
mt7623a-unielec-u7623-02-emmc.dtb \
mt7622-bananapi-bpi-r64.dtb \
--- /dev/null
+++ b/configs/mt7622_ubnt_unifi-6-lr_defconfig
-@@ -0,0 +1,143 @@
+@@ -0,0 +1,147 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_SPI_FLASH_XMC=y
+CONFIG_SPI_FLASH_USE_4K_SECTORS=y
+CONFIG_SYS_HAS_NONCACHED_MEMORY=y
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/arch/arm/dts/mt7622-ubnt-unifi-6-lr.dts
-@@ -0,0 +1,187 @@
+@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019 MediaTek Inc.
+};
+
+&uart0 {
++ mediatek,force-highspeed;
+ status = "okay";
+};
+
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -1264,6 +1264,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1286,6 +1286,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7623a-unielec-u7623-02-emmc.dtb \
mt7622-bananapi-bpi-r64.dtb \
mt7622-linksys-e8450-ubi.dtb \
+}
--- /dev/null
+++ b/configs/ravpower-rp-wd009-ram_defconfig
-@@ -0,0 +1,64 @@
+@@ -0,0 +1,68 @@
+CONFIG_MIPS=y
+CONFIG_SYS_LOAD_ADDR=0x80010000
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_BAUDRATE=57600
+CONFIG_SYS_MAXARGS=64
+CONFIG_SYS_CBSIZE=512
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/include/configs/ravpower-rp-wd009.h
@@ -0,0 +1,40 @@
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -1271,6 +1271,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1293,6 +1293,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7981-snfi-nand-rfb.dtb \
mt7981-emmc-rfb.dtb \
mt7981-sd-rfb.dtb \
mt7986a-sd-rfb.dtb \
--- /dev/null
+++ b/configs/mt7986a_bpi-r3-emmc_defconfig
-@@ -0,0 +1,194 @@
+@@ -0,0 +1,198 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_LMB_MAX_REGIONS=64
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/configs/mt7986a_bpi-r3-nor_defconfig
-@@ -0,0 +1,193 @@
+@@ -0,0 +1,197 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_SF=y
+CONFIG_LMB_MAX_REGIONS=64
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/configs/mt7986a_bpi-r3-sd_defconfig
-@@ -0,0 +1,194 @@
+@@ -0,0 +1,198 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_LMB_MAX_REGIONS=64
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/configs/mt7986a_bpi-r3-snand_defconfig
-@@ -0,0 +1,195 @@
+@@ -0,0 +1,199 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_LMB_MAX_REGIONS=64
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/arch/arm/dts/mt7986a-bpi-r3-emmc.dts
@@ -0,0 +1,33 @@
+
--- /dev/null
+++ b/arch/arm/dts/mt7986a-bpi-r3-sd.dts
-@@ -0,0 +1,269 @@
+@@ -0,0 +1,270 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021 MediaTek Inc.
+};
+
+&uart0 {
++ mediatek,force-highspeed;
+ status = "okay";
+};
+
--- /dev/null
+++ b/configs/mt7986_xiaomi_redmi-ax6000_defconfig
-@@ -0,0 +1,176 @@
+@@ -0,0 +1,180 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_CMD_NAND=y
+CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_LMB_MAX_REGIONS=64
++CONFIG_USE_IPADDR=y
++CONFIG_IPADDR="192.168.1.1"
++CONFIG_USE_SERVERIP=y
++CONFIG_SERVERIP="192.168.1.254"
--- /dev/null
+++ b/arch/arm/dts/mt7986a-xiaomi_redmi-ax6000.dts
-@@ -0,0 +1,152 @@
+@@ -0,0 +1,153 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021 MediaTek Inc.
+};
+
+&uart0 {
++ mediatek,force-highspeed;
+ status = "okay";
+};
+