
On Sat, Feb 13, 2021 at 11:45:50PM +0100, Heiko Stuebner wrote:
Hi Roger,
Am Samstag, 13. Februar 2021, 16:59:01 CET schrieb Roger Pau Monne:
From: Roger Pau Monné royger@FreeBSD.org
Using a non-default SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR setting makes the resulting u-boot-rockchip.bin unbootable, as it gets stuck after SPL. Removing the setting from the defconfig allows U-Boot to load successfully.
Hmm, I'd disagree slightly.
In the rockchip-common.h the CONFIG_SPL_PAD_TO is defined as
/* ((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512) */ #define CONFIG_SPL_PAD_TO 8355840
so it's a static value but based on the MMCSD_RAW_MODE... config option.
So instead of mandating one specific MMCSD_RAW_MODE... value that CONFIG_SPL_PAD_TO should be defined based on the the actual config value of CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR and not some static number that then gets enforced for all boards.
So, what does CONFIG_SPL_PAD_TO actually mean, in this case? And SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR ? What I'm getting at is that we generally have some required to be fixed (by the SoC/ROM/etc) locations some parts of our SPL/TPL/U-Boot need to be at and then the rest of the values are (supposed to be) well and carefully chosen offsets and not changed around. So with the above comment in the code to explain where 8355840 came from, it also shouldn't and nor should CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR be changed without a compelling reason.