Skip to content

Commit

Permalink
uboot-mediatek: update to U-Boot 2024.10
Browse files Browse the repository at this point in the history
Update to latest U-Boot release.
Patches refreshed and fixed when needed.

Signed-off-by: Daniel Golle <[email protected]>
  • Loading branch information
dangowrt committed Oct 13, 2024
1 parent 4f4cb52 commit f8c22c9
Show file tree
Hide file tree
Showing 44 changed files with 112 additions and 123 deletions.
7 changes: 4 additions & 3 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:=2024.07
PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f
PKG_VERSION:=2024.10
PKG_HASH:=b28daf4ac17e43156363078bf510297584137f6df50fced9b12df34f61a92fb0
PKG_BUILD_DEPENDS:=!(TARGET_ramips||TARGET_mediatek_mt7623):arm-trusted-firmware-tools/host

UBOOT_USE_INTREE_DTC:=1
Expand Down Expand Up @@ -830,7 +830,8 @@ UBOOT_TARGETS := \

UBOOT_CUSTOMIZE_CONFIG := \
--disable TOOLS_KWBIMAGE \
--disable TOOLS_LIBCRYPTO
--disable TOOLS_LIBCRYPTO \
--disable TOOLS_MKEFICAPSULE

ifdef CONFIG_TARGET_mediatek
UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE:.fip=.bin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -238,6 +238,8 @@ config SYS_MAX_FLASH_BANKS_DETECT
@@ -246,6 +246,8 @@ config SYS_MAX_FLASH_BANKS_DETECT
to reduce the effective number of flash bank, between 0 and
CONFIG_SYS_MAX_FLASH_BANKS

Expand All @@ -49,7 +49,7 @@ Signed-off-by: Weijie Gao <[email protected]>
config SYS_NAND_MAX_OOBFREE
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -39,3 +39,5 @@ obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPOR
@@ -40,3 +40,5 @@ obj-$(CONFIG_$(SPL_TPL_)SPI_FLASH_SUPPOR
obj-$(CONFIG_SPL_UBI) += ubispl/

endif
Expand Down Expand Up @@ -1313,7 +1313,7 @@ Signed-off-by: Weijie Gao <[email protected]>
+ * Author: Weijie Gao <[email protected]>
+ */
+
+#include <common.h>
+#include <config.h>
+#include <dm.h>
+#include <malloc.h>
+#include <mapmem.h>
Expand Down Expand Up @@ -1896,7 +1896,7 @@ Signed-off-by: Weijie Gao <[email protected]>
+#ifndef _MTK_SNAND_OS_H_
+#define _MTK_SNAND_OS_H_
+
+#include <common.h>
+#include <config.h>
+#include <cpu_func.h>
+#include <errno.h>
+#include <div64.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Signed-off-by: Weijie Gao <[email protected]>
+ * Author: Weijie Gao <[email protected]>
+ */
+
+#include <common.h>
+#include <config.h>
+#include <dm.h>
+#include <dm/uclass.h>
+#include <malloc.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Signed-off-by: Weijie Gao <[email protected]>
+};
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -108,6 +108,7 @@ enum env_location {
@@ -107,6 +107,7 @@ enum env_location {
ENVL_FAT,
ENVL_FLASH,
ENVL_MMC,
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/mtdparts.c
+++ b/cmd/mtdparts.c
@@ -1057,6 +1057,9 @@ int mtd_id_parse(const char *id, const c
@@ -1054,6 +1054,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;
Expand All @@ -27,7 +27,7 @@ Signed-off-by: Weijie Gao <[email protected]>
return 1;
--- a/include/jffs2/load_kernel.h
+++ b/include/jffs2/load_kernel.h
@@ -16,11 +16,13 @@
@@ -17,11 +17,13 @@
#define MTD_DEV_TYPE_NAND 0x0002
#define MTD_DEV_TYPE_ONENAND 0x0004
#define MTD_DEV_TYPE_SPINAND 0x0008
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -274,6 +274,8 @@ source "drivers/mtd/ubi/Kconfig"
@@ -282,6 +282,8 @@ source "drivers/mtd/ubi/Kconfig"

source "drivers/mtd/nvmxip/Kconfig"

Expand All @@ -42,7 +42,7 @@ Signed-off-by: Weijie Gao <[email protected]>
endmenu
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -41,3 +41,4 @@ obj-$(CONFIG_SPL_UBI) += ubispl/
@@ -42,3 +42,4 @@ obj-$(CONFIG_SPL_UBI) += ubispl/
endif

obj-$(CONFIG_MTK_SPI_NAND) += mtk-snand/
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
@@ -373,6 +373,20 @@ static int initr_nand(void)
@@ -372,6 +372,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)
@@ -664,6 +678,9 @@ static init_fnc_t init_sequence_r[] = {
@@ -663,6 +677,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
@@ -1450,6 +1450,12 @@ config CMD_NAND_TORTURE
@@ -1465,6 +1465,12 @@ config CMD_NAND_TORTURE

endif # CMD_NAND

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Signed-off-by: SkyLake.Huang <[email protected]>

--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -722,6 +722,42 @@ out_put_mtd:
@@ -721,6 +721,42 @@ out_put_mtd:
return CMD_RET_SUCCESS;
}

Expand Down 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[])
@@ -769,6 +805,7 @@ U_BOOT_LONGHELP(mtd,
@@ -768,6 +804,7 @@ U_BOOT_LONGHELP(mtd,
"\n"
"Specific functions:\n"
"mtd bad <name>\n"
+ "mtd markbad <name> <off>\n"
#if CONFIG_IS_ENABLED(CMD_MTD_OTP)
"mtd otpread <name> [u|f] <off> <size>\n"
"mtd otpwrite <name> <off> <hex string>\n"
@@ -809,4 +846,6 @@ U_BOOT_CMD_WITH_SUBCMDS(mtd, "MTD utils"
@@ -808,4 +845,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 @@ -240,7 +240,7 @@ Signed-off-by: Weijie Gao <[email protected]>
+};
--- a/include/env_internal.h
+++ b/include/env_internal.h
@@ -110,6 +110,7 @@ enum env_location {
@@ -109,6 +109,7 @@ enum env_location {
ENVL_MMC,
ENVL_MTD,
ENVL_NAND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -1450,6 +1450,14 @@ config CMD_NAND_TORTURE
@@ -1465,6 +1465,14 @@ config CMD_NAND_TORTURE

endif # CMD_NAND

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/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -2908,6 +2908,100 @@ static int spi_nor_init_params(struct sp
@@ -2958,6 +2958,100 @@ static int spi_nor_init_params(struct sp
return 0;
}

Expand Down Expand Up @@ -114,7 +114,7 @@ Signed-off-by: Weijie Gao <[email protected]>
static int spi_nor_hwcaps2cmd(u32 hwcaps, const int table[][2], size_t size)
{
size_t i;
@@ -4027,6 +4121,7 @@ int spi_nor_scan(struct spi_nor *nor)
@@ -4077,6 +4171,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/cmd/bootmenu.c
+++ b/cmd/bootmenu.c
@@ -89,6 +89,7 @@ static char *bootmenu_choice_entry(void
@@ -88,6 +88,7 @@ static char *bootmenu_choice_entry(void
struct bootmenu_data *menu = data;
struct bootmenu_entry *iter;
enum bootmenu_key key = BKEY_NONE;
+ int choice = -1;
int i;

cli_ch_init(cch);
@@ -96,10 +97,10 @@ static char *bootmenu_choice_entry(void
@@ -95,10 +96,10 @@ static char *bootmenu_choice_entry(void
while (1) {
if (menu->delay >= 0) {
/* Autoboot was not stopped */
Expand All @@ -35,7 +35,7 @@ Signed-off-by: Weijie Gao <[email protected]>
}

switch (key) {
@@ -113,6 +114,12 @@ static char *bootmenu_choice_entry(void
@@ -112,6 +113,12 @@ static char *bootmenu_choice_entry(void
++menu->active;
/* no menu key selected, regenerate menu */
return NULL;
Expand All @@ -48,7 +48,7 @@ Signed-off-by: Weijie Gao <[email protected]>
case BKEY_SELECT:
iter = menu->first;
for (i = 0; i < menu->active; ++i)
@@ -170,6 +177,9 @@ static int prepare_bootmenu_entry(struct
@@ -169,6 +176,9 @@ static int prepare_bootmenu_entry(struct
unsigned short int i = *index;
struct bootmenu_entry *entry = NULL;
struct bootmenu_entry *iter = *current;
Expand All @@ -58,7 +58,7 @@ Signed-off-by: Weijie Gao <[email protected]>

while ((option = bootmenu_getoption(i))) {

@@ -184,11 +194,24 @@ static int prepare_bootmenu_entry(struct
@@ -183,11 +193,24 @@ static int prepare_bootmenu_entry(struct
if (!entry)
return -ENOMEM;

Expand All @@ -84,15 +84,15 @@ Signed-off-by: Weijie Gao <[email protected]>

entry->command = strdup(sep + 1);
if (!entry->command) {
@@ -334,6 +357,7 @@ static struct bootmenu_data *bootmenu_cr
@@ -333,6 +356,7 @@ static struct bootmenu_data *bootmenu_cr
menu->delay = delay;
menu->active = 0;
menu->first = NULL;
+ menu->last_choiced = false;

default_str = env_get("bootmenu_default");
if (default_str)
@@ -369,9 +393,9 @@ static struct bootmenu_data *bootmenu_cr
@@ -368,9 +392,9 @@ static struct bootmenu_data *bootmenu_cr

/* Add Quit entry if exiting bootmenu is disabled */
if (!IS_ENABLED(CONFIG_BOOTMENU_DISABLE_UBOOT_CONSOLE))
Expand All @@ -106,7 +106,7 @@ Signed-off-by: Weijie Gao <[email protected]>
free(entry);
--- a/common/menu.c
+++ b/common/menu.c
@@ -49,6 +49,33 @@ struct menu {
@@ -48,6 +48,33 @@ struct menu {
int item_cnt;
};

Expand Down Expand Up @@ -140,7 +140,7 @@ Signed-off-by: Weijie Gao <[email protected]>
/*
* 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
@@ -428,7 +455,7 @@ int menu_destroy(struct menu *m)
@@ -426,7 +453,7 @@ int menu_destroy(struct menu *m)
}

enum bootmenu_key bootmenu_autoboot_loop(struct bootmenu_data *menu,
Expand All @@ -149,7 +149,7 @@ Signed-off-by: Weijie Gao <[email protected]>
{
enum bootmenu_key key = BKEY_NONE;
int i, c;
@@ -463,6 +490,19 @@ enum bootmenu_key bootmenu_autoboot_loop
@@ -461,6 +488,19 @@ enum bootmenu_key bootmenu_autoboot_loop
break;
default:
key = BKEY_NONE;
Expand All @@ -169,7 +169,7 @@ Signed-off-by: Weijie Gao <[email protected]>
break;
}
break;
@@ -483,7 +523,8 @@ enum bootmenu_key bootmenu_autoboot_loop
@@ -481,7 +521,8 @@ enum bootmenu_key bootmenu_autoboot_loop
return key;
}

Expand All @@ -179,7 +179,7 @@ Signed-off-by: Weijie Gao <[email protected]>
{
enum bootmenu_key key;

@@ -515,6 +556,20 @@ enum bootmenu_key bootmenu_conv_key(int
@@ -513,6 +554,20 @@ enum bootmenu_key bootmenu_conv_key(int
case ' ':
key = BKEY_SPACE;
break;
Expand All @@ -200,7 +200,7 @@ Signed-off-by: Weijie Gao <[email protected]>
default:
key = BKEY_NONE;
break;
@@ -524,11 +579,16 @@ enum bootmenu_key bootmenu_conv_key(int
@@ -522,11 +577,16 @@ enum bootmenu_key bootmenu_conv_key(int
}

enum bootmenu_key bootmenu_loop(struct bootmenu_data *menu,
Expand All @@ -218,7 +218,7 @@ Signed-off-by: Weijie Gao <[email protected]>
c = cli_ch_process(cch, 0);
if (!c) {
while (!c && !tstc()) {
@@ -542,7 +602,7 @@ enum bootmenu_key bootmenu_loop(struct b
@@ -540,7 +600,7 @@ enum bootmenu_key bootmenu_loop(struct b
}
}

Expand Down Expand Up @@ -301,7 +301,7 @@ Signed-off-by: Weijie Gao <[email protected]>

switch (key) {
case BKEY_UP:
@@ -1839,7 +1839,7 @@ char *eficonfig_choice_change_boot_order
@@ -1881,7 +1881,7 @@ char *eficonfig_choice_change_boot_order

cli_ch_init(cch);
while (1) {
Expand All @@ -312,7 +312,7 @@ Signed-off-by: Weijie Gao <[email protected]>
case BKEY_PLUS:
--- a/boot/bootflow_menu.c
+++ b/boot/bootflow_menu.c
@@ -234,7 +234,7 @@ int bootflow_menu_run(struct bootstd_pri
@@ -240,7 +240,7 @@ int bootflow_menu_run(struct bootstd_pri

key = 0;
if (ichar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/common/spl/spl_nand.c
+++ b/common/spl/spl_nand.c
@@ -19,7 +19,11 @@
@@ -18,7 +18,11 @@

uint32_t __weak spl_nand_get_uboot_raw_page(void)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Signed-off-by: Weijie Gao <[email protected]>
reg = <0x11014000 0x1000>;
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -147,9 +147,11 @@ config SYS_CONFIG_NAME
@@ -148,9 +148,11 @@ config SYS_CONFIG_NAME

config MTK_BROM_HEADER_INFO
string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Signed-off-by: Weijie Gao <[email protected]>

--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -1225,6 +1225,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
@@ -1190,6 +1190,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
mt7623n-bananapi-bpi-r2.dtb \
mt7629-rfb.dtb \
mt7981-rfb.dtb \
Expand Down
Loading

0 comments on commit f8c22c9

Please sign in to comment.