Merge branch 'patch/h3-fit' into allwinner

This commit is contained in:
Samuel Holland 2022-03-17 23:43:20 -05:00
commit 9fd8cea961
5 changed files with 36 additions and 20 deletions

View File

@ -367,7 +367,7 @@ config BUILD_TARGET
default "u-boot-spl.kwb" if ARCH_MVEBU && SPL default "u-boot-spl.kwb" if ARCH_MVEBU && SPL
default "u-boot-elf.srec" if RCAR_GEN3 default "u-boot-elf.srec" if RCAR_GEN3
default "u-boot.itb" if !BINMAN && SPL_LOAD_FIT && (ARCH_ROCKCHIP || \ default "u-boot.itb" if !BINMAN && SPL_LOAD_FIT && (ARCH_ROCKCHIP || \
ARCH_SUNXI || RISCV || ARCH_ZYNQMP) RISCV || ARCH_ZYNQMP)
default "u-boot.kwb" if ARCH_KIRKWOOD default "u-boot.kwb" if ARCH_KIRKWOOD
default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT default "u-boot-with-spl.bin" if ARCH_AT91 && SPL_NAND_SUPPORT
default "u-boot-with-spl.imx" if ARCH_MX6 && SPL default "u-boot-with-spl.imx" if ARCH_MX6 && SPL

View File

@ -1098,6 +1098,7 @@ config ARCH_SUNXI
imply SPL_GPIO imply SPL_GPIO
imply SPL_LIBCOMMON_SUPPORT imply SPL_LIBCOMMON_SUPPORT
imply SPL_LIBGENERIC_SUPPORT imply SPL_LIBGENERIC_SUPPORT
imply SPL_LOAD_FIT
imply SPL_MMC if MMC imply SPL_MMC if MMC
imply SPL_POWER imply SPL_POWER
imply SPL_SERIAL imply SPL_SERIAL

View File

@ -1,13 +1,19 @@
#include <config.h> #include <config.h>
#ifdef CONFIG_MACH_SUN50I_H6 #ifdef CONFIG_ARM64
#define BL31_ADDR 0x104000 #define ARCH "arm64"
#define SCP_ADDR 0x114000
#elif defined(CONFIG_MACH_SUN50I_H616)
#define BL31_ADDR 0x40000000
#else #else
#define BL31_ADDR 0x44000 #define ARCH "arm"
#define SCP_ADDR 0x50000 #endif
#if defined(CONFIG_MACH_SUN50I) || defined(CONFIG_MACH_SUN50I_H5)
#define BL31_ADDR 0x00044000
#define SCP_ADDR 0x00050000
#elif defined(CONFIG_MACH_SUN50I_H6)
#define BL31_ADDR 0x00104000
#define SCP_ADDR 0x00114000
#elif defined(CONFIG_MACH_SUN50I_H616)
#define BL31_ADDR 0x40000000
#endif #endif
/ { / {
@ -34,30 +40,33 @@
filename = "spl/sunxi-spl.bin"; filename = "spl/sunxi-spl.bin";
}; };
#ifdef CONFIG_ARM64 #ifdef CONFIG_SPL_LOAD_FIT
fit { fit {
description = "Configuration to load ATF before U-Boot"; description = "Configuration to load U-Boot and firmware";
offset = <32768>;
#address-cells = <1>; #address-cells = <1>;
fit,fdt-list = "of-list"; fit,fdt-list = "of-list";
images { images {
uboot { uboot {
description = "U-Boot (64-bit)"; description = "U-Boot";
type = "standalone"; type = "standalone";
os = "u-boot"; os = "u-boot";
arch = "arm64"; arch = ARCH;
compression = "none"; compression = "none";
load = <CONFIG_SYS_TEXT_BASE>; load = <CONFIG_SYS_TEXT_BASE>;
entry = <CONFIG_SYS_TEXT_BASE>;
u-boot-nodtb { u-boot-nodtb {
}; };
}; };
#ifdef BL31_ADDR
atf { atf {
description = "ARM Trusted Firmware"; description = "ARM Trusted Firmware";
type = "firmware"; type = "firmware";
os = "arm-trusted-firmware"; os = "arm-trusted-firmware";
arch = "arm64"; arch = ARCH;
compression = "none"; compression = "none";
load = <BL31_ADDR>; load = <BL31_ADDR>;
entry = <BL31_ADDR>; entry = <BL31_ADDR>;
@ -67,6 +76,7 @@
missing-msg = "atf-bl31-sunxi"; missing-msg = "atf-bl31-sunxi";
}; };
}; };
#endif
#ifdef SCP_ADDR #ifdef SCP_ADDR
scp { scp {
@ -95,19 +105,23 @@
@config-SEQ { @config-SEQ {
description = "NAME"; description = "NAME";
#ifdef BL31_ADDR
firmware = "atf"; firmware = "atf";
#ifndef SCP_ADDR
loadables = "uboot";
#else #else
loadables = "scp", "uboot"; firmware = "uboot";
#endif #endif
loadables =
#ifdef SCP_ADDR
"scp",
#endif
"uboot";
fdt = "fdt-SEQ"; fdt = "fdt-SEQ";
}; };
}; };
}; };
#else #else
u-boot-img { u-boot-img {
offset = <CONFIG_SPL_PAD_TO>; offset = <32768>;
}; };
#endif #endif
}; };

View File

@ -455,8 +455,7 @@ config SPL_MD5
config SPL_FIT_IMAGE_TINY config SPL_FIT_IMAGE_TINY
bool "Remove functionality from SPL FIT loading to reduce size" bool "Remove functionality from SPL FIT loading to reduce size"
depends on SPL_FIT depends on SPL_FIT
default y if MACH_SUN50I || MACH_SUN50I_H5 || SUN50I_GEN_H6 default y if ARCH_IMX8M || ARCH_SUNXI
default y if ARCH_IMX8M
help help
Enable this to reduce the size of the FIT image loading code Enable this to reduce the size of the FIT image loading code
in SPL, if space for the SPL binary is very tight. in SPL, if space for the SPL binary is very tight.

View File

@ -457,7 +457,9 @@ class Entry(object):
if self.offset_unset: if self.offset_unset:
self.Raise('No offset set with offset-unset: should another ' self.Raise('No offset set with offset-unset: should another '
'entry provide this correct offset?') 'entry provide this correct offset?')
self.offset = tools.align(offset, self.align) elif self.offset > offset:
offset = self.offset
self.offset = tools.align(offset, self.align)
needed = self.pad_before + self.contents_size + self.pad_after needed = self.pad_before + self.contents_size + self.pad_after
needed = tools.align(needed, self.align_size) needed = tools.align(needed, self.align_size)
size = self.size size = self.size