Skip to content

Commit

Permalink
uboot-mediatek: update to U-Boot 2024.01 release
Browse files Browse the repository at this point in the history
Rebase local patches on top of quarterly timed release, allowing to
drop numerous patches which have been accepted upstream since the
release of U-Boot 2023.07.02.

Signed-off-by: Daniel Golle <[email protected]>
  • Loading branch information
dangowrt committed Jul 1, 2024
1 parent 15d850a commit 21ab9a9
Show file tree
Hide file tree
Showing 82 changed files with 2,639 additions and 10,672 deletions.
88 changes: 83 additions & 5 deletions package/boot/uboot-mediatek/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_VERSION:=2023.07.02
PKG_HASH:=6b6a48581c14abb0f95bd87c1af4d740922406d7b801002a9f94727fdde021d5
PKG_VERSION:=2024.01
PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3
PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host

include $(INCLUDE_DIR)/u-boot.mk
Expand Down Expand Up @@ -277,10 +277,10 @@ define U-Boot/mt7986_bananapi_bpi-r3-snand
BUILD_DEVICES:=bananapi_bpi-r3
UBOOT_CONFIG:=mt7986a_bpi-r3-snand
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand
BL2_BOOTDEV:=spim-nand-ubi
BL2_SOC:=mt7986
BL2_DDRTYPE:=ddr4
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ddr4
DEPENDS:=+trusted-firmware-a-mt7986-spim-nand-ubi-ddr4
endef

define U-Boot/mt7986_bananapi_bpi-r3-nor
Expand All @@ -296,6 +296,78 @@ define U-Boot/mt7986_bananapi_bpi-r3-nor
FIP_COMPRESS:=1
endef

define U-Boot/mt7988_bananapi_bpi-r4-emmc
NAME:=BananaPi BPi-R4
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=bananapi_bpi-r4
UBOOT_CONFIG:=mt7988a_bananapi_bpi-r4-emmc
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=emmc
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-emmc-comb
endef

define U-Boot/mt7988_bananapi_bpi-r4-sdmmc
NAME:=BananaPi BPi-R4
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=bananapi_bpi-r4
UBOOT_CONFIG:=mt7988a_bananapi_bpi-r4-sdmmc
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=sdmmc
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-sdmmc-comb
endef

define U-Boot/mt7988_bananapi_bpi-r4-snand
NAME:=BananaPi BPi-R4
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=bananapi_bpi-r4
UBOOT_CONFIG:=mt7988a_bananapi_bpi-r4-snand
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand-ubi
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-spim-nand-ubi-comb
endef

define U-Boot/mt7988_bananapi_bpi-r4-poe-emmc
NAME:=BananaPi BPi-R4 2.5GE
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=bananapi_bpi-r4-poe
UBOOT_CONFIG:=mt7988a_bananapi_bpi-r4-poe-emmc
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=emmc
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-emmc-comb
endef

define U-Boot/mt7988_bananapi_bpi-r4-poe-sdmmc
NAME:=BananaPi BPi-R4 2.5GE
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=bananapi_bpi-r4-poe
UBOOT_CONFIG:=mt7988a_bananapi_bpi-r4-poe-sdmmc
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=sdmmc
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-sdmmc-comb
endef

define U-Boot/mt7988_bananapi_bpi-r4-poe-snand
NAME:=BananaPi BPi-R4 2.5GE
BUILD_SUBTARGET:=filogic
BUILD_DEVICES:=bananapi_bpi-r4-poe
UBOOT_CONFIG:=mt7988a_bananapi_bpi-r4-poe-snand
UBOOT_IMAGE:=u-boot.fip
BL2_BOOTDEV:=spim-nand-ubi
BL2_SOC:=mt7988
BL2_DDRTYPE:=comb
DEPENDS:=+trusted-firmware-a-mt7988-spim-nand-ubi-comb
endef

define U-Boot/mt7988_rfb-spim-nand
NAME:=MT7988 Reference Board
BUILD_SUBTARGET:=filogic
Expand Down Expand Up @@ -371,7 +443,7 @@ UBOOT_TARGETS := \
mt7623n_bpir2 \
mt7623a_unielec_u7623 \
mt7628_rfb \
ravpower_rp-wd009 \
mt7628_ravpower_rp-wd009 \
mt7629_rfb \
mt7981_rfb-spim-nand \
mt7981_rfb-emmc \
Expand All @@ -383,6 +455,12 @@ UBOOT_TARGETS := \
mt7986_bananapi_bpi-r3-snand \
mt7986_bananapi_bpi-r3-nor \
mt7986_rfb \
mt7988_bananapi_bpi-r4-emmc \
mt7988_bananapi_bpi-r4-sdmmc \
mt7988_bananapi_bpi-r4-snand \
mt7988_bananapi_bpi-r4-poe-emmc \
mt7988_bananapi_bpi-r4-poe-sdmmc \
mt7988_bananapi_bpi-r4-poe-snand \
mt7988_rfb-spim-nand \
mt7988_rfb-snand \
mt7988_rfb-nor \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Signed-off-by: Weijie Gao <[email protected]>
CONFIG_DEFAULT_DEVICE_TREE="mt7622-rfb"
+CONFIG_ENV_SIZE=0x20000
+CONFIG_ENV_OFFSET=0x280000
CONFIG_SYS_PROMPT="MT7622> "
CONFIG_DEBUG_UART_BASE=0x11002000
CONFIG_DEBUG_UART_CLOCK=25000000
CONFIG_SYS_LOAD_ADDR=0x4007ff28
@@ -25,6 +27,9 @@ CONFIG_CMD_SF_TEST=y
CONFIG_CMD_PING=y
CONFIG_CMD_SMC=y
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ Signed-off-by: Weijie Gao <[email protected]>
+}
--- /dev/null
+++ b/drivers/mtd/mtk-snand/mtk-snand-ids.c
@@ -0,0 +1,515 @@
@@ -0,0 +1,519 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+/*
+ * Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
Expand Down Expand Up @@ -901,6 +901,10 @@ Signed-off-by: Weijie Gao <[email protected]>
+ SNAND_MEMORG_1G_2K_64,
+ &snand_cap_read_from_cache_quad_q2d,
+ &snand_cap_program_load_x4),
+ SNAND_INFO("GD5F1GQ5UExxG", SNAND_ID(SNAND_ID_ADDR, 0xc8, 0x51),
+ SNAND_MEMORG_1G_2K_128,
+ &snand_cap_read_from_cache_quad,
+ &snand_cap_program_load_x4),
+ SNAND_INFO("GD5F2GQ4UExIG", SNAND_ID(SNAND_ID_ADDR, 0xc8, 0xd2),
+ SNAND_MEMORG_2G_2K_128,
+ &snand_cap_read_from_cache_quad_q2d,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,18 @@ Signed-off-by: Weijie Gao <[email protected]>
7 files changed, 299 insertions(+), 3 deletions(-)
create mode 100644 env/mtd.c

--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -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_MTD) || \
defined(CONFIG_ENV_IS_IN_NAND) || \
defined(CONFIG_ENV_IS_IN_NVRAM) || \
defined(CONFIG_ENV_IS_IN_ONENAND) || \
@@ -61,7 +62,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|\
+# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|MTD|\
NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
#endif

--- a/env/Kconfig
+++ b/env/Kconfig
@@ -62,7 +62,7 @@ config ENV_IS_NOWHERE
@@ -61,7 +61,7 @@ config ENV_IS_DEFAULT
!ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
!ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
!ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
- !ENV_IS_IN_UBI
+ !ENV_IS_IN_UBI && !ENV_IS_IN_MTD
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
@@ -251,6 +251,27 @@ config ENV_IS_IN_MMC
select ENV_IS_NOWHERE

config ENV_IS_NOWHERE
@@ -254,6 +254,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.

Expand Down Expand Up @@ -75,7 +56,7 @@ Signed-off-by: Weijie Gao <[email protected]>
config ENV_IS_IN_NAND
bool "Environment in a NAND device"
depends on !CHAIN_OF_TRUST
@@ -558,10 +579,16 @@ config ENV_ADDR_REDUND
@@ -561,10 +582,16 @@ config ENV_ADDR_REDUND
Offset from the start of the device (or partition) of the redundant
environment location.

Expand All @@ -93,7 +74,7 @@ Signed-off-by: Weijie Gao <[email protected]>
default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
default 0xF0000 if ARCH_SUNXI
@@ -609,6 +636,12 @@ config ENV_SECT_SIZE
@@ -622,6 +649,12 @@ config ENV_SECT_SIZE
help
Size of the sector containing the environment.

Expand All @@ -118,7 +99,7 @@ Signed-off-by: Weijie Gao <[email protected]>
obj-$(CONFIG_$(SPL_TPL_)ENV_IS_IN_FLASH) += flash.o
--- a/env/env.c
+++ b/env/env.c
@@ -69,6 +69,9 @@ static enum env_location env_locations[]
@@ -46,6 +46,9 @@ static enum env_location env_locations[]
#ifdef CONFIG_ENV_IS_IN_MMC
ENVL_MMC,
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/common/board_r.c
+++ b/common/board_r.c
@@ -388,6 +388,20 @@ static int initr_nand(void)
@@ -373,6 +373,20 @@ static int initr_nand(void)
}
#endif

Expand All @@ -34,7 +34,7 @@ Signed-off-by: Weijie Gao <[email protected]>
#if defined(CONFIG_CMD_ONENAND)
/* go init the NAND */
static int initr_onenand(void)
@@ -696,6 +710,9 @@ static init_fnc_t init_sequence_r[] = {
@@ -675,6 +689,9 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_CMD_ONENAND
initr_onenand,
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1353,6 +1353,12 @@ config CMD_NAND_TORTURE
@@ -1392,6 +1392,12 @@ config CMD_NAND_TORTURE

endif # CMD_NAND

Expand All @@ -30,7 +30,7 @@ Signed-off-by: Weijie Gao <[email protected]>
depends on NVME
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -125,6 +125,7 @@ obj-y += legacy-mtd-utils.o
@@ -127,6 +127,7 @@ obj-y += legacy-mtd-utils.o
endif
obj-$(CONFIG_CMD_MUX) += mux.o
obj-$(CONFIG_CMD_NAND) += nand.o
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Signed-off-by: SkyLake.Huang <[email protected]>
#ifdef CONFIG_AUTO_COMPLETE
static int mtd_name_complete(int argc, char *const argv[], char last_char,
int maxv, char *cmdv[])
@@ -552,6 +588,7 @@ static char mtd_help_text[] =
@@ -551,6 +587,7 @@ U_BOOT_LONGHELP(mtd,
"\n"
"Specific functions:\n"
"mtd bad <name>\n"
+ "mtd markbad <name> <off>\n"
"\n"
"With:\n"
"\t<name>: NAND partition/chip name (or corresponding DM device name or OF path)\n"
@@ -577,4 +614,6 @@ U_BOOT_CMD_WITH_SUBCMDS(mtd, "MTD utils"
@@ -575,4 +612,6 @@ U_BOOT_CMD_WITH_SUBCMDS(mtd, "MTD utils"
U_BOOT_SUBCMD_MKENT_COMPLETE(erase, 4, 0, do_mtd_erase,
mtd_name_complete),
U_BOOT_SUBCMD_MKENT_COMPLETE(bad, 2, 1, do_mtd_bad,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,17 @@ Signed-off-by: Weijie Gao <[email protected]>
7 files changed, 180 insertions(+), 3 deletions(-)
create mode 100644 env/nmbm.c

--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -50,6 +50,7 @@ DECLARE_GLOBAL_DATA_PTR;
defined(CONFIG_ENV_IS_IN_EXT4) || \
defined(CONFIG_ENV_IS_IN_MTD) || \
defined(CONFIG_ENV_IS_IN_NAND) || \
+ defined(CONFIG_ENV_IS_IN_NMBM) || \
defined(CONFIG_ENV_IS_IN_NVRAM) || \
defined(CONFIG_ENV_IS_IN_ONENAND) || \
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|\
-NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
+NAND|NMBM|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
#endif

/*
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -62,7 +62,7 @@ config ENV_IS_NOWHERE
@@ -59,6 +59,7 @@ config ENV_IS_DEFAULT
def_bool y if !ENV_IS_IN_EEPROM && !ENV_IS_IN_EXT4 && \
!ENV_IS_IN_FAT && !ENV_IS_IN_FLASH && \
!ENV_IS_IN_MMC && !ENV_IS_IN_NAND && \
+ !ENV_IS_IN_NMBM && \
!ENV_IS_IN_NVRAM && !ENV_IS_IN_ONENAND && \
!ENV_IS_IN_REMOTE && !ENV_IS_IN_SPI_FLASH && \
- !ENV_IS_IN_UBI && !ENV_IS_IN_MTD
+ !ENV_IS_IN_UBI && !ENV_IS_IN_NMBM && !ENV_IS_IN_MTD
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
@@ -312,6 +312,21 @@ config ENV_RANGE
!ENV_IS_IN_UBI && !ENV_IS_IN_MTD
@@ -315,6 +316,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.

Expand All @@ -69,7 +49,7 @@ Signed-off-by: Weijie Gao <[email protected]>
config ENV_IS_IN_NVRAM
bool "Environment in a non-volatile RAM"
depends on !CHAIN_OF_TRUST
@@ -588,7 +603,7 @@ config ENV_MTD_NAME
@@ -591,7 +607,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 || \
Expand All @@ -90,7 +70,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/env/env.c
+++ b/env/env.c
@@ -75,6 +75,9 @@ static enum env_location env_locations[]
@@ -52,6 +52,9 @@ static enum env_location env_locations[]
#ifdef CONFIG_ENV_IS_IN_NAND
ENVL_NAND,
#endif
Expand Down
Loading

0 comments on commit 21ab9a9

Please sign in to comment.