include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
-PKG_VERSION:=2021.10
-PKG_HASH:=cde723e19262e646f2670d25e5ec4b1b368490de950d4e26275a988c36df0bd4
+PKG_VERSION:=2022.01
+PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413
PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host
include $(INCLUDE_DIR)/u-boot.mk
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
-@@ -87,7 +87,7 @@ static int clk_get_by_index_tail(int ret
+@@ -88,7 +88,7 @@ static int clk_get_by_index_tail(int ret
if (ret) {
debug("%s: uclass_get_device_by_of_offset failed: err=%d\n",
__func__, ret);
}
clk->dev = dev_clk;
-@@ -100,15 +100,14 @@ static int clk_get_by_index_tail(int ret
+@@ -101,15 +101,14 @@ static int clk_get_by_index_tail(int ret
ret = clk_of_xlate_default(clk, args);
if (ret) {
debug("of_xlate() failed: %d\n", ret);
}
static int clk_get_by_indexed_prop(struct udevice *dev, const char *prop_name,
-@@ -127,7 +126,7 @@ static int clk_get_by_indexed_prop(struc
+@@ -128,7 +127,7 @@ static int clk_get_by_indexed_prop(struc
if (ret) {
debug("%s: fdtdec_parse_phandle_with_args failed: err=%d\n",
__func__, ret);
}
-@@ -502,7 +501,6 @@ int clk_free(struct clk *clk)
+@@ -501,7 +500,6 @@ int 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))
-@@ -512,11 +510,7 @@ ulong clk_get_rate(struct clk *clk)
+@@ -511,11 +509,7 @@ ulong clk_get_rate(struct clk *clk)
if (!ops->get_rate)
return -ENOSYS;
--- a/include/configs/mt7622.h
+++ b/include/configs/mt7622.h
-@@ -36,6 +36,7 @@
+@@ -30,6 +30,7 @@
/* Ethernet */
#define CONFIG_IPADDR 192.168.1.1
#endif
--- a/include/configs/mt7623.h
+++ b/include/configs/mt7623.h
-@@ -54,6 +54,7 @@
+@@ -45,6 +45,7 @@
/* Ethernet */
#define CONFIG_IPADDR 192.168.1.1
#define CONFIG_SERVERIP 192.168.1.2
--- a/include/configs/mt7629.h
+++ b/include/configs/mt7629.h
-@@ -52,5 +52,6 @@
+@@ -45,5 +45,6 @@
/* Ethernet */
#define CONFIG_IPADDR 192.168.1.1
#define CONFIG_SERVERIP 192.168.1.2
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -109,6 +109,8 @@ config HBMC_AM654
- This is the driver for HyperBus controller on TI's AM65x and
- other SoCs
+@@ -116,6 +116,8 @@ config STM32_FLASH
+ This is the driver of embedded flash for some STMicroelectronics
+ STM32 MCU.
+source "drivers/mtd/mtk-snand/Kconfig"
+
source "drivers/mtd/nand/Kconfig"
- source "drivers/mtd/spi/Kconfig"
+ config SYS_NAND_MAX_CHIPS
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -39,3 +39,5 @@ obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPOR
+}
--- /dev/null
+++ b/drivers/mtd/mtk-snand/mtk-snand-mtd.c
-@@ -0,0 +1,526 @@
+@@ -0,0 +1,524 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
+ else
+ instr->state = MTD_ERASE_DONE;
+
-+ if (!ret)
-+ mtd_erase_callback(instr);
-+ else
++ if (ret)
+ ret = -EIO;
+
+ return ret;
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
-@@ -50,6 +50,7 @@ DECLARE_GLOBAL_DATA_PTR;
+@@ -48,6 +48,7 @@ DECLARE_GLOBAL_DATA_PTR;
defined(CONFIG_ENV_IS_IN_MMC) || \
defined(CONFIG_ENV_IS_IN_FAT) || \
defined(CONFIG_ENV_IS_IN_EXT4) || \
defined(CONFIG_ENV_IS_IN_NAND) || \
defined(CONFIG_ENV_IS_IN_NVRAM) || \
defined(CONFIG_ENV_IS_IN_ONENAND) || \
-@@ -64,7 +65,7 @@ DECLARE_GLOBAL_DATA_PTR;
+@@ -62,7 +63,7 @@ DECLARE_GLOBAL_DATA_PTR;
#if !defined(ENV_IS_IN_DEVICE) && \
!defined(CONFIG_ENV_IS_NOWHERE)
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
-@@ -207,6 +207,27 @@ config ENV_IS_IN_MMC
+@@ -208,6 +208,27 @@ config ENV_IS_IN_MMC
This value is also in units of bytes, but must also be aligned to
an MMC sector boundary.
config ENV_IS_IN_NAND
bool "Environment in a NAND device"
depends on !CHAIN_OF_TRUST
-@@ -534,10 +555,16 @@ config ENV_ADDR_REDUND
+@@ -535,10 +556,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 0x88000 if ARCH_SUNXI
-@@ -582,6 +609,12 @@ config ENV_SECT_SIZE
+@@ -583,6 +610,12 @@ config ENV_SECT_SIZE
help
Size of the sector containing the environment.
+};
--- a/include/env_internal.h
+++ b/include/env_internal.h
-@@ -131,6 +131,7 @@ enum env_location {
+@@ -130,6 +130,7 @@ enum env_location {
ENVL_FAT,
ENVL_FLASH,
ENVL_MMC,
snor: snor@11014000 {
compatible = "mediatek,mtk-snor";
reg = <0x11014000 0x1000>;
---- a/board/mediatek/mt7629/Kconfig
-+++ b/board/mediatek/mt7629/Kconfig
-@@ -12,6 +12,39 @@ config MTK_SPL_PAD_SIZE
-
- config MTK_BROM_HEADER_INFO
- string
-- default "media=nor"
-+ default "media=nor" if BOOT_FROM_SNOR
-+ default "media=snand;nandinfo=2k+64" if BOOT_FROM_SNAND_2K_64
-+ default "media=snand;nandinfo=2k+128" if BOOT_FROM_SNAND_2K_128
-+ default "media=snand;nandinfo=4k+128" if BOOT_FROM_SNAND_4K_128
-+ default "media=snand;nandinfo=4k+256" if BOOT_FROM_SNAND_4K_256
-+
-+choice
-+ prompt "Boot device"
-+ default BOOT_FROM_SNOR
-+
-+config BOOT_FROM_SNOR
-+ bool "SPI-NOR"
-+
-+config BOOT_FROM_SNAND_2K_64
-+ bool "SPI-NAND (2K+64)"
-+ select MT7629_BOOT_FROM_SNAND
-+
-+config BOOT_FROM_SNAND_2K_128
-+ bool "SPI-NAND (2K+128)"
-+ select MT7629_BOOT_FROM_SNAND
-+
-+config BOOT_FROM_SNAND_4K_128
-+ bool "SPI-NAND (4K+128)"
-+ select MT7629_BOOT_FROM_SNAND
-+
-+config BOOT_FROM_SNAND_4K_256
-+ bool "SPI-NAND (4K+256)"
-+ select MT7629_BOOT_FROM_SNAND
-+
-+endchoice
-+
-+config MT7629_BOOT_FROM_SNAND
-+ bool
-+ default n
-
- endif
--- /dev/null
+++ b/configs/mt7629_nand_rfb_defconfig
@@ -0,0 +1,111 @@
+# CONFIG_EFI_LOADER is not set
--- a/include/configs/mt7629.h
+++ b/include/configs/mt7629.h
-@@ -30,12 +30,19 @@
+@@ -25,12 +25,19 @@
/* Defines for SPL */
#define CONFIG_SPL_STACK 0x106000
reg = <0x11014000 0x1000>;
--- a/configs/mt7622_rfb_defconfig
+++ b/configs/mt7622_rfb_defconfig
-@@ -15,6 +15,7 @@ CONFIG_LOG=y
+@@ -16,6 +16,7 @@ CONFIG_LOG=y
CONFIG_SYS_PROMPT="MT7622> "
CONFIG_CMD_BOOTMENU=y
CONFIG_CMD_MMC=y
CONFIG_CMD_PCI=y
CONFIG_CMD_SF_TEST=y
CONFIG_CMD_PING=y
-@@ -27,6 +28,10 @@ CONFIG_SYSCON=y
+@@ -28,6 +29,10 @@ CONFIG_SYSCON=y
CONFIG_CLK=y
CONFIG_MMC_HS200_SUPPORT=y
CONFIG_MMC_MTK=y
--- a/configs/mt7629_rfb_defconfig
+++ b/configs/mt7629_rfb_defconfig
-@@ -28,9 +28,14 @@ CONFIG_SPL_WATCHDOG=y
+@@ -29,9 +29,14 @@ CONFIG_SPL_WATCHDOG=y
CONFIG_HUSH_PARSER=y
CONFIG_SYS_PROMPT="U-Boot> "
CONFIG_CMD_BOOTMENU=y
CONFIG_DEBUG_UART_BASE=0x11002000
CONFIG_DEBUG_UART_CLOCK=25000000
CONFIG_DEBUG_UART=y
-@@ -21,6 +23,9 @@ CONFIG_CMD_SF_TEST=y
+@@ -22,6 +24,9 @@ CONFIG_CMD_SF_TEST=y
CONFIG_CMD_PING=y
CONFIG_CMD_SMC=y
CONFIG_ENV_OVERWRITE=y
--- a/tools/Makefile
+++ b/tools/Makefile
-@@ -118,7 +118,6 @@ dumpimage-mkimage-objs := aisimage.o \
+@@ -119,7 +119,6 @@ dumpimage-mkimage-objs := aisimage.o \
imximage.o \
imx8image.o \
imx8mimage.o \
--- a/Makefile
+++ b/Makefile
-@@ -1051,7 +1051,7 @@ quiet_cmd_pad_cat = CAT $@
+@@ -1045,7 +1045,7 @@ quiet_cmd_pad_cat = CAT $@
cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }
quiet_cmd_lzma = LZMA $@
static int do_iminfo(struct cmd_tbl *cmdtp, int flag, int argc,
char *const argv[])
{
---- a/common/image-fit.c
-+++ b/common/image-fit.c
-@@ -1962,6 +1962,51 @@ static const char *fit_get_image_type_pr
+--- a/boot/image-fit.c
++++ b/boot/image-fit.c
+@@ -1993,6 +1993,51 @@ static const char *fit_get_image_type_pr
return "unknown";
}
int arch, int image_type, int bootstage_id,
--- a/include/image.h
+++ b/include/image.h
-@@ -996,6 +996,7 @@ int fit_parse_subimage(const char *spec,
+@@ -952,6 +952,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/Kconfig
+++ b/cmd/Kconfig
-@@ -484,6 +484,12 @@ config CMD_ENV_EXISTS
+@@ -483,6 +483,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
-@@ -473,6 +473,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)
-@@ -1377,6 +1431,9 @@ static struct cmd_tbl cmd_env_sub[] = {
+@@ -1189,6 +1243,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
-@@ -1465,6 +1522,9 @@ static char env_help_text[] =
+@@ -1277,6 +1334,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
-@@ -1574,6 +1634,17 @@ U_BOOT_CMD(
+@@ -1386,6 +1446,17 @@ U_BOOT_CMD(
);
#endif
env_relocate();
return 0;
}
---- a/board/mediatek/mt7622/Kconfig
-+++ b/board/mediatek/mt7622/Kconfig
-@@ -14,4 +14,8 @@ config MTK_BROM_HEADER_INFO
- string
- default "media=nor"
+--- a/arch/arm/mach-mediatek/Kconfig
++++ b/arch/arm/mach-mediatek/Kconfig
+@@ -115,4 +115,8 @@ config MTK_BROM_HEADER_INFO
+ default "media=emmc" if TARGET_MT8516 || TARGET_MT8365 || TARGET_MT8183
+ default "lk=1" if TARGET_MT7623
+config RESET_BUTTON_LABEL
+ string "Button to trigger factory reset"
---- a/board/mediatek/mt7623/Kconfig
-+++ b/board/mediatek/mt7623/Kconfig
-@@ -10,4 +10,8 @@ config MTK_BROM_HEADER_INFO
- string
- default "lk=1"
-
-+config RESET_BUTTON_LABEL
-+ string "Button to trigger factory reset"
-+ default "reset"
-+
- endif
--- a/board/mediatek/mt7623/mt7623_rfb.c
+++ b/board/mediatek/mt7623/mt7623_rfb.c
@@ -4,8 +4,17 @@
--- a/drivers/mtd/spi/spi-nor-ids.c
+++ b/drivers/mtd/spi/spi-nor-ids.c
-@@ -353,6 +353,8 @@ const struct flash_info spi_nor_ids[] =
+@@ -369,6 +369,8 @@ const struct flash_info spi_nor_ids[] =
SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
},
{ INFO("w25q256", 0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
--- a/configs/mt7623n_bpir2_defconfig
+++ b/configs/mt7623n_bpir2_defconfig
-@@ -4,52 +4,137 @@ CONFIG_ARCH_MEDIATEK=y
+@@ -4,53 +4,138 @@ CONFIG_ARCH_MEDIATEK=y
CONFIG_SYS_TEXT_BASE=0x81e00000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
+CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
+CONFIG_USE_DEFAULT_ENV_FILE=y
CONFIG_DISTRO_DEFAULTS=y
+ CONFIG_SYS_LOAD_ADDR=0x84000000
CONFIG_FIT=y
-CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
--- a/configs/mt7623a_unielec_u7623_02_defconfig
+++ b/configs/mt7623a_unielec_u7623_02_defconfig
-@@ -4,50 +4,134 @@ CONFIG_ARCH_MEDIATEK=y
+@@ -4,51 +4,135 @@ CONFIG_ARCH_MEDIATEK=y
CONFIG_SYS_TEXT_BASE=0x81e00000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_NR_DRAM_BANKS=1
+CONFIG_USE_DEFAULT_ENV_FILE=y
CONFIG_TARGET_MT7623=y
CONFIG_DISTRO_DEFAULTS=y
+ CONFIG_SYS_LOAD_ADDR=0x84000000
CONFIG_FIT=y
-CONFIG_FIT_VERBOSE=y
+CONFIG_FIT_ENABLE_SHA256_SUPPORT=y
--- /dev/null
+++ b/configs/mt7622_bananapi_bpi-r64-sdmmc_defconfig
-@@ -0,0 +1,158 @@
+@@ -0,0 +1,159 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TARGET_MT7622=y
+CONFIG_SYS_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_SYS_LOAD_ADDR=0x40080000
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_BOOTP_SEND_HOSTNAME=y
+_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,145 @@
+@@ -0,0 +1,146 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TARGET_MT7622=y
+CONFIG_SYS_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_SYS_LOAD_ADDR=0x40080000
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_BOOTP_SEND_HOSTNAME=y
+_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,139 @@
+@@ -0,0 +1,140 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_SYS_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_SYS_LOAD_ADDR=0x40080000
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_BOOTP_SEND_HOSTNAME=y
--- /dev/null
+++ b/configs/mt7622_linksys_e8450_defconfig
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,136 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TARGET_MT7622=y
+CONFIG_SYS_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_SYS_LOAD_ADDR=0x40080000
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_BOARD_LATE_INIT=y
+CONFIG_BOOTP_SEND_HOSTNAME=y
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -1104,6 +1104,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1133,6 +1133,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,140 @@
+@@ -0,0 +1,141 @@
+CONFIG_ARM=y
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_ARCH_MEDIATEK=y
+CONFIG_TARGET_MT7622=y
+CONFIG_SYS_TEXT_BASE=0x41e00000
+CONFIG_SYS_MALLOC_F_LEN=0x4000
++CONFIG_SYS_LOAD_ADDR=0x40080000
+CONFIG_USE_DEFAULT_ENV_FILE=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nor0:128k(bl2),640k(fip),64k(u-boot-env),256k(factory),64k(eeprom),15232k(recovery),-(firmware)"
+CONFIG_ENV_IS_IN_MTD=y
+};
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
-@@ -1105,6 +1105,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
+@@ -1134,6 +1134,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7623a-unielec-u7623-02-emmc.dtb \
mt7622-bananapi-bpi-r64.dtb \
mt7622-linksys-e8450-ubi.dtb \
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title \e[33m$ver\e[0m"
--- a/common/board_r.c
+++ b/common/board_r.c
-@@ -77,6 +77,7 @@
+@@ -78,6 +78,7 @@
#ifdef CONFIG_EFI_SETUP_EARLY
#include <efi_loader.h>
#endif
DECLARE_GLOBAL_DATA_PTR;
-@@ -416,6 +417,21 @@ static int initr_onenand(void)
+@@ -417,6 +418,21 @@ static int initr_onenand(void)
}
#endif