Config_sys_spl_malloc_size

I’m trying to use upgraded opensbi and u-boot from 2021.07 with meta-sifive patches. For opensbi, the meta-sifive patches either don’t apply or aren’t relevant… For u-boot, I’ve got 13 patches applied.

However, this solution doesn’t work for me, I get this:

U-Boot SPL 2021.07-00020-g44d6cab48e (Aug 01 2021 - 09:14:31 +1200)
Trying to boot from MMC1
Could not get FIT buffer of 2735104 bytes
        check CONFIG_SYS_SPL_MALLOC_SIZE
Unhandled exception: Load address misaligned
EPC: 0000000008003466 RA: 0000000008003466 TVAL: 00000000856fee5e


resetting ...
reset not supported yet
### ERROR ### Please RESET the board ###

I am still using the advice of carlosedp for burning u-boot/spl/u-boot-spl.bin to partition1, and u-boot/u-boot.itb to partition2.

fw_payload.bin is 2105640 bytes, and u-boot.itb is 2735047 bytes.

Do the settings in include/configs/sifive-unmatched.h regarding SPL need changing?

I changed them to this, and now it boots:

  #define CONFIG_SPL_MAX_SIZE		0x00400000
  #define CONFIG_SPL_BSS_MAX_SIZE		0x00400000
  #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00400000

I’ve was able to build a working 2021-07 u-boot. However, I used the old 0.9 version/tag of OpenSBI.

There are two extra patches in meta-sifive/recipes-bsp/u-boot/files that I applied. I’m not sure if they’re really needed (probably not the rv32 patch), but the other tools patch seems useful.

Also, I added the following lines to u-boot/include/configs/sifive-unmatched.h in the CONFIG_EXTRA_ENV_SETTINGS #define.

	"fdt_high=0xffffffffffffffff\0" \
	"initrd_high=0xffffffffffffffff\0" \

Also, I built the u-boot 2021-07 release/tag. It looks like you’re building some later commit which isn’t recommended.

git checkout v2021.07 -b tmp

The only patches to u-boot that I applied beyond the 2021.07 commit were the meta-sifive patches, and also setting the clock frequency to 1.4 ghz, and adding the fdt_high setting.

I could rollback opensbi, I see now I was on the wrong branch. Is that going to make it that much smaller? Or am I passing the wrong file to u-boot via the OPENSBI env variable? (fw_payload.bin)… yep, the u-boot_2021.07.bb recipe has “ft_dynamic.bin”.