From: Daniel Golle Date: Tue, 11 Apr 2023 23:21:22 +0000 (+0100) Subject: uboot-mediatek: update to v2023.04 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=50f7c5af4a07a8a898a0a60068c6fd4cc40a3273;p=openwrt%2Fstaging%2Fdangole.git uboot-mediatek: update to v2023.04 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 --- diff --git a/package/boot/uboot-mediatek/Makefile b/package/boot/uboot-mediatek/Makefile index ef47cffe37..938ed227bd 100644 --- a/package/boot/uboot-mediatek/Makefile +++ b/package/boot/uboot-mediatek/Makefile @@ -1,8 +1,8 @@ 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 diff --git a/package/boot/uboot-mediatek/patches/000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch b/package/boot/uboot-mediatek/patches/000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch index 4e019ed6a9..cd9004844c 100644 --- a/package/boot/uboot-mediatek/patches/000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch +++ b/package/boot/uboot-mediatek/patches/000-mtk-20-configs-mt7622-enable-environment-for-mt7622_rfb.patch @@ -30,4 +30,4 @@ Signed-off-by: Weijie Gao +CONFIG_ENV_SIZE_REDUND=0x40000 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y CONFIG_NET_RANDOM_ETHADDR=y - CONFIG_REGMAP=y + CONFIG_USE_IPADDR=y diff --git a/package/boot/uboot-mediatek/patches/001-pinctrl-mediatek-set-R1-R0-in-case-pullen-pullsel-su.patch b/package/boot/uboot-mediatek/patches/001-pinctrl-mediatek-set-R1-R0-in-case-pullen-pullsel-su.patch new file mode 100644 index 0000000000..988c78cdfb --- /dev/null +++ b/package/boot/uboot-mediatek/patches/001-pinctrl-mediatek-set-R1-R0-in-case-pullen-pullsel-su.patch @@ -0,0 +1,88 @@ +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 +X-Patchwork-Id: 1768270 +Return-Path: +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 +To: u-boot@lists.denx.de, Sam Shih , + GSS_MTK_Uboot_upstream , + Chunfeng Yun , + Weijie Gao , Ryder Lee , + Frank Wunderlich +Cc: Steven Liu =?utf-8?b?KOWKieS6uuixqik=?= , + John Crispin +Subject: [PATCH] pinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded +Message-ID: +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 +Sender: "U-Boot" + +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 +--- + 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); + diff --git a/package/boot/uboot-mediatek/patches/100-00-clk-remove-log_ret-from-clk_get_rate.patch b/package/boot/uboot-mediatek/patches/100-00-clk-remove-log_ret-from-clk_get_rate.patch index 30dcffd59e..d5f6f73762 100644 --- a/package/boot/uboot-mediatek/patches/100-00-clk-remove-log_ret-from-clk_get_rate.patch +++ b/package/boot/uboot-mediatek/patches/100-00-clk-remove-log_ret-from-clk_get_rate.patch @@ -20,7 +20,7 @@ Signed-off-by: Weijie Gao --- 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; @@ -28,7 +28,7 @@ Signed-off-by: Weijie Gao 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; diff --git a/package/boot/uboot-mediatek/patches/100-01-board-mediatek-add-more-network-configurations.patch b/package/boot/uboot-mediatek/patches/100-01-board-mediatek-add-more-network-configurations.patch deleted file mode 100644 index f0486bdc47..0000000000 --- a/package/boot/uboot-mediatek/patches/100-01-board-mediatek-add-more-network-configurations.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 97df847f8f895cc2692bb0e4e933269c275da378 Mon Sep 17 00:00:00 2001 -From: Weijie Gao -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 ---- - 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 diff --git a/package/boot/uboot-mediatek/patches/100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch b/package/boot/uboot-mediatek/patches/100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch index 41d6950170..a6c59d1f66 100644 --- a/package/boot/uboot-mediatek/patches/100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch +++ b/package/boot/uboot-mediatek/patches/100-02-drivers-mtd-add-support-for-MediaTek-SPI-NAND-flash-.patch @@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao --- 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 @@ -46,7 +46,7 @@ Signed-off-by: Weijie Gao + 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 diff --git a/package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch b/package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch index 7f3d497e45..da87978aef 100644 --- a/package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch +++ b/package/boot/uboot-mediatek/patches/100-04-env-add-support-for-generic-MTD-device.patch @@ -27,7 +27,7 @@ Signed-off-by: Weijie Gao 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) @@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao --- 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 && \ @@ -47,9 +47,9 @@ Signed-off-by: Weijie Gao 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" @@ -75,7 +75,7 @@ Signed-off-by: Weijie Gao 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. @@ -93,7 +93,7 @@ Signed-off-by: Weijie Gao 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. @@ -108,7 +108,7 @@ Signed-off-by: Weijie Gao 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 @@ -389,7 +389,7 @@ Signed-off-by: Weijie Gao +}; --- 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, @@ -399,7 +399,7 @@ Signed-off-by: Weijie Gao 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 diff --git a/package/boot/uboot-mediatek/patches/100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch b/package/boot/uboot-mediatek/patches/100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch index 1c62130cf6..d90ca64704 100644 --- a/package/boot/uboot-mediatek/patches/100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch +++ b/package/boot/uboot-mediatek/patches/100-05-mtd-add-a-new-mtd-device-type-for-NMBM.patch @@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao --- 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; diff --git a/package/boot/uboot-mediatek/patches/100-06-mtd-add-core-facility-code-of-NMBM.patch b/package/boot/uboot-mediatek/patches/100-06-mtd-add-core-facility-code-of-NMBM.patch index 7cc85e0718..bf04f5b6e4 100644 --- a/package/boot/uboot-mediatek/patches/100-06-mtd-add-core-facility-code-of-NMBM.patch +++ b/package/boot/uboot-mediatek/patches/100-06-mtd-add-core-facility-code-of-NMBM.patch @@ -31,7 +31,7 @@ Signed-off-by: Weijie Gao --- 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" diff --git a/package/boot/uboot-mediatek/patches/100-09-cmd-add-nmbm-command.patch b/package/boot/uboot-mediatek/patches/100-09-cmd-add-nmbm-command.patch index 91c7a5b04f..c1188c62a5 100644 --- a/package/boot/uboot-mediatek/patches/100-09-cmd-add-nmbm-command.patch +++ b/package/boot/uboot-mediatek/patches/100-09-cmd-add-nmbm-command.patch @@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao --- 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 @@ -30,7 +30,7 @@ Signed-off-by: Weijie Gao 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 diff --git a/package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch b/package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch index 2e07a58329..0b4ee32b62 100644 --- a/package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch +++ b/package/boot/uboot-mediatek/patches/100-11-env-add-support-for-NMBM-upper-MTD-layer.patch @@ -26,8 +26,8 @@ Signed-off-by: Weijie Gao + 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|\ @@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao /* --- 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 && \ @@ -47,7 +47,7 @@ Signed-off-by: Weijie Gao 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. @@ -69,7 +69,7 @@ Signed-off-by: Weijie Gao 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 || \ @@ -80,7 +80,7 @@ Signed-off-by: Weijie Gao 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 @@ -260,7 +260,7 @@ Signed-off-by: Weijie Gao +}; --- 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, @@ -270,11 +270,11 @@ Signed-off-by: Weijie Gao 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) diff --git a/package/boot/uboot-mediatek/patches/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch b/package/boot/uboot-mediatek/patches/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch index 86d1d77419..31f26be053 100644 --- a/package/boot/uboot-mediatek/patches/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch +++ b/package/boot/uboot-mediatek/patches/100-13-cmd-add-a-new-command-for-NAND-flash-debugging.patch @@ -26,7 +26,7 @@ Signed-off-by: Weijie Gao --- 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 @@ -43,7 +43,7 @@ Signed-off-by: Weijie Gao 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 diff --git a/package/boot/uboot-mediatek/patches/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch b/package/boot/uboot-mediatek/patches/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch index 6be54b4947..3d79731dd1 100644 --- a/package/boot/uboot-mediatek/patches/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch +++ b/package/boot/uboot-mediatek/patches/100-14-mtd-spi-nor-add-support-to-read-flash-unique-ID.patch @@ -114,7 +114,7 @@ Signed-off-by: Weijie Gao 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; @@ -132,7 +132,7 @@ Signed-off-by: Weijie Gao #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); diff --git a/package/boot/uboot-mediatek/patches/100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch b/package/boot/uboot-mediatek/patches/100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch index 6a4e6c3ca6..ce59cc73ae 100644 --- a/package/boot/uboot-mediatek/patches/100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch +++ b/package/boot/uboot-mediatek/patches/100-15-cmd-sf-add-support-to-read-flash-unique-ID.patch @@ -27,7 +27,7 @@ Signed-off-by: Weijie Gao 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); @@ -36,7 +36,7 @@ Signed-off-by: Weijie Gao 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" diff --git a/package/boot/uboot-mediatek/patches/100-16-cmd-bootmenu-add-ability-to-select-item-by-shortkey.patch b/package/boot/uboot-mediatek/patches/100-16-cmd-bootmenu-add-ability-to-select-item-by-shortkey.patch index e0571671bc..6a9ac54dfd 100644 --- a/package/boot/uboot-mediatek/patches/100-16-cmd-bootmenu-add-ability-to-select-item-by-shortkey.patch +++ b/package/boot/uboot-mediatek/patches/100-16-cmd-bootmenu-add-ability-to-select-item-by-shortkey.patch @@ -14,40 +14,41 @@ Signed-off-by: Weijie Gao --- 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; @@ -57,7 +58,7 @@ Signed-off-by: Weijie Gao 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; @@ -83,7 +84,7 @@ Signed-off-by: Weijie Gao 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; @@ -91,7 +92,7 @@ Signed-off-by: Weijie Gao 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)) @@ -105,7 +106,7 @@ Signed-off-by: Weijie Gao 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; }; @@ -139,68 +140,93 @@ Signed-off-by: Weijie Gao /* * 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 @@ @@ -209,10 +235,10 @@ Signed-off-by: Weijie Gao +#include + + 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); @@ -221,26 +247,66 @@ Signed-off-by: Weijie Gao /** * 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: diff --git a/package/boot/uboot-mediatek/patches/100-19-board-mt7622-use-new-spi-nand-driver.patch b/package/boot/uboot-mediatek/patches/100-19-board-mt7622-use-new-spi-nand-driver.patch index 624da59d25..03555d4a4b 100644 --- a/package/boot/uboot-mediatek/patches/100-19-board-mt7622-use-new-spi-nand-driver.patch +++ b/package/boot/uboot-mediatek/patches/100-19-board-mt7622-use-new-spi-nand-driver.patch @@ -63,7 +63,7 @@ Signed-off-by: Weijie Gao 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 diff --git a/package/boot/uboot-mediatek/patches/100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch b/package/boot/uboot-mediatek/patches/100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch index ff327dd3b8..1d855bf460 100644 --- a/package/boot/uboot-mediatek/patches/100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch +++ b/package/boot/uboot-mediatek/patches/100-20-board-mt7981-add-reference-board-using-new-spi-nand-.patch @@ -18,7 +18,7 @@ Signed-off-by: Weijie Gao --- 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 \ diff --git a/package/boot/uboot-mediatek/patches/100-21-mtd-spi-nor-add-more-flash-ids.patch b/package/boot/uboot-mediatek/patches/100-21-mtd-spi-nor-add-more-flash-ids.patch index 20a827141d..0833424821 100644 --- a/package/boot/uboot-mediatek/patches/100-21-mtd-spi-nor-add-more-flash-ids.patch +++ b/package/boot/uboot-mediatek/patches/100-21-mtd-spi-nor-add-more-flash-ids.patch @@ -33,9 +33,9 @@ Signed-off-by: Weijie Gao { 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 | @@ -45,7 +45,7 @@ Signed-off-by: Weijie Gao 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) }, { @@ -62,7 +62,7 @@ Signed-off-by: Weijie Gao 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) }, diff --git a/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch b/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch index 5f1f268150..1709680ebb 100644 --- a/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch +++ b/package/boot/uboot-mediatek/patches/100-23-mmc-mtk-sd-add-support-to-display-verbose-error-log.patch @@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao --- 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. @@ -29,7 +29,7 @@ Signed-off-by: Weijie Gao + 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 diff --git a/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch b/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch index bfe27a482c..ed74eab1e4 100644 --- a/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch +++ b/package/boot/uboot-mediatek/patches/100-24-cmd-ubi-make-volume-find-create-remove-APIs-public.patch @@ -45,7 +45,7 @@ Signed-off-by: Weijie Gao 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); diff --git a/package/boot/uboot-mediatek/patches/100-26-env-ubi-add-support-to-create-environment-volume-if-.patch b/package/boot/uboot-mediatek/patches/100-26-env-ubi-add-support-to-create-environment-volume-if-.patch index 4f47a01661..98c81acdcf 100644 --- a/package/boot/uboot-mediatek/patches/100-26-env-ubi-add-support-to-create-environment-volume-if-.patch +++ b/package/boot/uboot-mediatek/patches/100-26-env-ubi-add-support-to-create-environment-volume-if-.patch @@ -14,7 +14,7 @@ Signed-off-by: Weijie Gao --- 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. @@ -29,7 +29,7 @@ Signed-off-by: Weijie Gao 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 */ @@ -48,7 +48,7 @@ Signed-off-by: Weijie Gao #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; } @@ -60,7 +60,7 @@ Signed-off-by: Weijie Gao 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; } diff --git a/package/boot/uboot-mediatek/patches/100-29-board-mediatek-wire-up-NMBM-support.patch b/package/boot/uboot-mediatek/patches/100-29-board-mediatek-wire-up-NMBM-support.patch index 9808e2c860..b561a79944 100644 --- a/package/boot/uboot-mediatek/patches/100-29-board-mediatek-wire-up-NMBM-support.patch +++ b/package/boot/uboot-mediatek/patches/100-29-board-mediatek-wire-up-NMBM-support.patch @@ -114,7 +114,7 @@ Subject: [PATCH] board: mediatek: wire-up NMBM support +} --- 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 */ @@ -133,9 +133,8 @@ Subject: [PATCH] board: mediatek: wire-up NMBM support + int board_init(void) { -+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; -+ return 0; -+} + return 0; + } + +int board_late_init(void) +{ @@ -172,11 +171,11 @@ Subject: [PATCH] board: mediatek: wire-up NMBM support + 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 */ @@ -195,9 +194,8 @@ Subject: [PATCH] board: mediatek: wire-up NMBM support + int board_init(void) { -+ gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; -+ return 0; -+} + return 0; + } + +int board_late_init(void) +{ @@ -236,5 +234,5 @@ Subject: [PATCH] board: mediatek: wire-up NMBM support + add_mtd_device(upper); +#endif + - return 0; - } ++ return 0; ++} diff --git a/package/boot/uboot-mediatek/patches/110-no-kwbimage.patch b/package/boot/uboot-mediatek/patches/110-no-kwbimage.patch index 5fb896d92d..76921b757e 100644 --- a/package/boot/uboot-mediatek/patches/110-no-kwbimage.patch +++ b/package/boot/uboot-mediatek/patches/110-no-kwbimage.patch @@ -1,6 +1,6 @@ --- 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 \ diff --git a/package/boot/uboot-mediatek/patches/120-use-xz-instead-of-lzma.patch b/package/boot/uboot-mediatek/patches/120-use-xz-instead-of-lzma.patch index 9f46fed4c9..7fda30a756 100644 --- a/package/boot/uboot-mediatek/patches/120-use-xz-instead-of-lzma.patch +++ b/package/boot/uboot-mediatek/patches/120-use-xz-instead-of-lzma.patch @@ -1,6 +1,6 @@ --- 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 $@ diff --git a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch index 3990f7df37..7cf0778e47 100644 --- a/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch +++ b/package/boot/uboot-mediatek/patches/200-cmd-add-imsz-and-imszb.patch @@ -123,7 +123,7 @@ 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); diff --git a/package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch b/package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch index 69a3a07b90..a99b77be08 100644 --- a/package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch +++ b/package/boot/uboot-mediatek/patches/211-cmd-bootmenu-custom-title.patch @@ -1,6 +1,6 @@ --- 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); @@ -13,7 +13,7 @@ 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; } @@ -23,7 +23,7 @@ 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 */ diff --git a/package/boot/uboot-mediatek/patches/212-cmd-bootmenu-hack-restore-ansi.patch b/package/boot/uboot-mediatek/patches/212-cmd-bootmenu-hack-restore-ansi.patch new file mode 100644 index 0000000000..cdb1477d42 --- /dev/null +++ b/package/boot/uboot-mediatek/patches/212-cmd-bootmenu-hack-restore-ansi.patch @@ -0,0 +1,11 @@ +--- 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. diff --git a/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch b/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch index f79d1376a3..37956727b2 100644 --- a/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch +++ b/package/boot/uboot-mediatek/patches/220-cmd-env-readmem.patch @@ -1,6 +1,6 @@ --- 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. @@ -15,7 +15,7 @@ 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 @@ -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) -@@ -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, "", ""), @@ -86,7 +86,7 @@ #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 @@ -96,7 +96,7 @@ #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 diff --git a/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch b/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch index 5a84598f90..873d80f6f9 100644 --- a/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch +++ b/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch @@ -28,4 +28,4 @@ Reviewed-by: Tom Rini + /* Update ethernet nodes */ fdt_fixup_ethernet(blob); - #if CONFIG_IS_ENABLED(CMD_PSTORE) + #if IS_ENABLED(CONFIG_CMD_PSTORE) diff --git a/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch b/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch index 4abf13eda8..d34ed6f2ae 100644 --- a/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch +++ b/package/boot/uboot-mediatek/patches/300-force-pylibfdt-build.patch @@ -1,6 +1,6 @@ --- 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 diff --git a/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch b/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch index 5011e74257..0af267c50d 100644 --- a/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch +++ b/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch @@ -17,7 +17,7 @@ #include #include -@@ -25,7 +32,19 @@ int board_init(void) +@@ -24,7 +31,19 @@ int board_init(void) int board_late_init(void) { diff --git a/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch b/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch index d064fe4363..942f86a928 100644 --- a/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch +++ b/package/boot/uboot-mediatek/patches/400-update-bpir2-defconfig.patch @@ -1,9 +1,9 @@ --- 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 @@ -13,9 +13,6 @@ +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 @@ -27,6 +24,9 @@ +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" @@ -68,16 +68,12 @@ +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 @@ -91,69 +87,56 @@ +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 diff --git a/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch b/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch index 791be30050..5862ad7343 100644 --- a/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch +++ b/package/boot/uboot-mediatek/patches/401-update-u7623-defconfig.patch @@ -1,9 +1,9 @@ --- 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 @@ -13,9 +13,6 @@ +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 @@ -27,6 +24,9 @@ +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" @@ -69,16 +69,12 @@ +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 @@ -99,61 +95,52 @@ +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 @@ diff --git a/package/boot/uboot-mediatek/patches/402-update-bananapi-bpi-r64-device-tree.patch b/package/boot/uboot-mediatek/patches/402-update-bananapi-bpi-r64-device-tree.patch index 7aa0ca9c88..ca8f371d61 100644 --- a/package/boot/uboot-mediatek/patches/402-update-bananapi-bpi-r64-device-tree.patch +++ b/package/boot/uboot-mediatek/patches/402-update-bananapi-bpi-r64-device-tree.patch @@ -51,7 +51,15 @@ 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>; @@ -60,7 +68,7 @@ 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>; diff --git a/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch b/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch index 8627b2ebaf..85bcd00db0 100644 --- a/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch +++ b/package/boot/uboot-mediatek/patches/404-add-bananapi_bpi-r64_defconfigs.patch @@ -1,6 +1,6 @@ --- /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 @@ -161,6 +161,10 @@ +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 @@ @@ -248,7 +252,7 @@ +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" --- /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 @@ -396,6 +400,10 @@ +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 @@ @@ -457,7 +465,7 @@ +_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title $ver" --- /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 @@ -599,6 +607,10 @@ +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 @@ diff --git a/package/boot/uboot-mediatek/patches/406-dts-mt7623n-bpi-r2-uart0-force-highspeed.patch b/package/boot/uboot-mediatek/patches/406-dts-mt7623n-bpi-r2-uart0-force-highspeed.patch new file mode 100644 index 0000000000..8e4c32697e --- /dev/null +++ b/package/boot/uboot-mediatek/patches/406-dts-mt7623n-bpi-r2-uart0-force-highspeed.patch @@ -0,0 +1,10 @@ +--- 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"; + }; + diff --git a/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch b/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch index 13d9a3c750..5a419e9432 100644 --- a/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch +++ b/package/boot/uboot-mediatek/patches/410-add-linksys-e8450.patch @@ -1,6 +1,6 @@ --- /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 @@ -133,6 +133,10 @@ +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 @@ -140,7 +144,7 @@ +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. @@ -303,6 +307,7 @@ +}; + +&uart0 { ++ mediatek,force-highspeed; + status = "okay"; +}; + @@ -336,7 +341,7 @@ +}; --- 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 \ diff --git a/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch b/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch index 6c35e07870..edeb4a6895 100644 --- a/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch +++ b/package/boot/uboot-mediatek/patches/412-add-ubnt-unifi-6-lr.patch @@ -1,6 +1,6 @@ --- /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 @@ -144,9 +144,13 @@ +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. @@ -300,6 +304,7 @@ +}; + +&uart0 { ++ mediatek,force-highspeed; + status = "okay"; +}; + @@ -336,7 +341,7 @@ +}; --- 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 \ diff --git a/package/boot/uboot-mediatek/patches/420-add-support-for-RAVPower-RP-WD009.patch b/package/boot/uboot-mediatek/patches/420-add-support-for-RAVPower-RP-WD009.patch index a89b6c68bd..b29b83f807 100644 --- a/package/boot/uboot-mediatek/patches/420-add-support-for-RAVPower-RP-WD009.patch +++ b/package/boot/uboot-mediatek/patches/420-add-support-for-RAVPower-RP-WD009.patch @@ -125,7 +125,7 @@ Subject: [PATCH] add support for RAVPower RP-WD009 +} --- /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 @@ -190,6 +190,10 @@ Subject: [PATCH] add support for RAVPower RP-WD009 +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 @@ diff --git a/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch b/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch index 7bde3f17c3..2859ae42bf 100644 --- a/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch +++ b/package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch @@ -1,6 +1,6 @@ --- 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 \ @@ -11,7 +11,7 @@ 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 @@ -206,9 +206,13 @@ +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 @@ -402,9 +406,13 @@ +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 @@ -599,9 +607,13 @@ +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 @@ -797,6 +809,10 @@ +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 @@ @@ -835,7 +851,7 @@ + --- /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. @@ -897,6 +913,7 @@ +}; + +&uart0 { ++ mediatek,force-highspeed; + status = "okay"; +}; + diff --git a/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch b/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch index 26c4e14661..56c60ff438 100644 --- a/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch +++ b/package/boot/uboot-mediatek/patches/431-add-xiaomi_redmi-ax6000.patch @@ -1,6 +1,6 @@ --- /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 @@ -177,9 +177,13 @@ +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. @@ -215,6 +219,7 @@ +}; + +&uart0 { ++ mediatek,force-highspeed; + status = "okay"; +}; +