Skip to content

Commit

Permalink
uboot-mediatek: update to 2022.07 release
Browse files Browse the repository at this point in the history
Add patch to fix host-build of the mkimage tool without
CONFIG_TOOLS_LIBCRYPTO.
Update and refresh all patches.

Tested on BananaPi R64 (MT7622) successfully booting from SD card,
eMMC and SPI-NAND.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
  • Loading branch information
dangowrt committed Jul 11, 2022
1 parent b68e9f2 commit fa75a3a
Show file tree
Hide file tree
Showing 19 changed files with 207 additions and 162 deletions.
4 changes: 2 additions & 2 deletions package/boot/uboot-mediatek/Makefile
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_VERSION:=2022.01
PKG_HASH:=81b4543227db228c03f8a1bf5ddbc813b0bb8f6555ce46064ef721a6fc680413
PKG_VERSION:=2022.07
PKG_HASH:=92b08eb49c24da14c1adbf70a71ae8f37cc53eeb4230e859ad8b6733d13dcf5e
PKG_BUILD_DEPENDS:=arm-trusted-firmware-tools/host

include $(INCLUDE_DIR)/u-boot.mk
Expand Down
Expand Up @@ -46,15 +46,15 @@ This reverts commit 5c5992cb90cf9ca4d51e38d9a95a13c293904df5.
}


@@ -501,7 +500,6 @@ int clk_free(struct clk *clk)
@@ -469,7 +468,6 @@ void clk_free(struct clk *clk)
ulong clk_get_rate(struct clk *clk)
{
const struct clk_ops *ops;
- int ret;

debug("%s(clk=%p)\n", __func__, clk);
if (!clk_valid(clk))
@@ -511,11 +509,7 @@ ulong clk_get_rate(struct clk *clk)
@@ -479,11 +477,7 @@ ulong clk_get_rate(struct clk *clk)
if (!ops->get_rate)
return -ENOSYS;

Expand Down
Expand Up @@ -38,9 +38,9 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -116,6 +116,8 @@ config STM32_FLASH
This is the driver of embedded flash for some STMicroelectronics
STM32 MCU.
@@ -158,6 +158,8 @@ config SYS_MAX_FLASH_BANKS_DETECT
to reduce the effective number of flash bank, between 0 and
CONFIG_SYS_MAX_FLASH_BANKS

+source "drivers/mtd/mtk-snand/Kconfig"
+
Expand Down
Expand Up @@ -38,7 +38,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>

--- a/env/Kconfig
+++ b/env/Kconfig
@@ -19,7 +19,7 @@ config ENV_IS_NOWHERE
@@ -37,7 +37,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 && \
Expand All @@ -47,7 +47,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
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
@@ -208,6 +208,27 @@ config ENV_IS_IN_MMC
@@ -226,6 +226,27 @@ config ENV_IS_IN_MMC
This value is also in units of bytes, but must also be aligned to
an MMC sector boundary.

Expand Down Expand Up @@ -75,7 +75,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
config ENV_IS_IN_NAND
bool "Environment in a NAND device"
depends on !CHAIN_OF_TRUST
@@ -535,10 +556,16 @@ config ENV_ADDR_REDUND
@@ -531,10 +552,16 @@ config ENV_ADDR_REDUND
Offset from the start of the device (or partition) of the redundant
environment location.

Expand All @@ -92,8 +92,8 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+ ENV_IS_IN_SPI_FLASH || ENV_IS_IN_MTD
default 0x3f8000 if ARCH_ROCKCHIP && ENV_IS_IN_MMC
default 0x140000 if ARCH_ROCKCHIP && ENV_IS_IN_SPI_FLASH
default 0x88000 if ARCH_SUNXI
@@ -583,6 +610,12 @@ config ENV_SECT_SIZE
default 0xF0000 if ARCH_SUNXI
@@ -581,6 +608,12 @@ config ENV_SECT_SIZE
help
Size of the sector containing the environment.

Expand Down
Expand Up @@ -20,7 +20,7 @@ Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
+CONFIG_ENV_OFFSET=0x280000
CONFIG_DEBUG_UART_BASE=0x11002000
CONFIG_DEBUG_UART_CLOCK=25000000
CONFIG_DEBUG_UART=y
CONFIG_SYS_LOAD_ADDR=0x4007ff28
@@ -22,6 +24,9 @@ CONFIG_CMD_SF_TEST=y
CONFIG_CMD_PING=y
CONFIG_CMD_SMC=y
Expand Down
2 changes: 1 addition & 1 deletion package/boot/uboot-mediatek/patches/110-no-kwbimage.patch
@@ -1,6 +1,6 @@
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -119,7 +119,6 @@ dumpimage-mkimage-objs := aisimage.o \
@@ -120,7 +120,6 @@ dumpimage-mkimage-objs := aisimage.o \
imximage.o \
imx8image.o \
imx8mimage.o \
Expand Down
@@ -1,6 +1,6 @@
--- a/Makefile
+++ b/Makefile
@@ -1045,7 +1045,7 @@ quiet_cmd_pad_cat = CAT $@
@@ -1061,7 +1061,7 @@ quiet_cmd_pad_cat = CAT $@
cmd_pad_cat = $(cmd_objcopy) && $(append) || { rm -f $@; false; }

quiet_cmd_lzma = LZMA $@
Expand Down
@@ -0,0 +1,24 @@
--- a/tools/image-host.c
+++ b/tools/image-host.c
@@ -1122,6 +1122,7 @@ static int fit_config_add_verification_d
* 2) get public key (X509_get_pubkey)
* 3) provide der format (d2i_RSAPublicKey)
*/
+#ifdef CONFIG_TOOLS_LIBCRYPTO
static int read_pub_key(const char *keydir, const void *name,
unsigned char **pubkey, int *pubkey_len)
{
@@ -1175,6 +1176,13 @@ err_cert:
fclose(f);
return ret;
}
+#else
+static int read_pub_key(const char *keydir, const void *name,
+ unsigned char **pubkey, int *pubkey_len)
+{
+ return -ENOSYS;
+}
+#endif

int fit_pre_load_data(const char *keydir, void *keydest, void *fit)
{
@@ -1,6 +1,6 @@
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -228,6 +228,65 @@ U_BOOT_CMD(
@@ -257,6 +257,65 @@ U_BOOT_CMD(
/* iminfo - print header info for a requested image */
/*******************************************************************/
#if defined(CONFIG_CMD_IMI)
Expand Down Expand Up @@ -68,7 +68,7 @@
{
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -1993,6 +1993,51 @@ static const char *fit_get_image_type_pr
@@ -1995,6 +1995,51 @@ static const char *fit_get_image_type_pr
return "unknown";
}

Expand Down Expand Up @@ -122,7 +122,7 @@
int arch, int image_type, int bootstage_id,
--- a/include/image.h
+++ b/include/image.h
@@ -952,6 +952,7 @@ int fit_parse_subimage(const char *spec,
@@ -955,6 +955,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);
Expand Down

0 comments on commit fa75a3a

Please sign in to comment.