Message ID | 20240430153053.308788-3-jonas@kwiboo.se |
---|---|
State | Accepted |
Commit | 6007b69d544ec3fc63a9a5f52723b0cc264e2331 |
Delegated to: | Kever Yang |
Headers | show |
Series | rockchip: rk3399: Fix loading FIT from SD-card when booting from eMMC | expand |
On 2024/4/30 23:30, Jonas Karlman wrote: > On rk3399-puma the FIT payload is located at sector 0x200 compared > to the more Rockchip common sector 0x4000 offset: > > SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 > > Because FIT payload is located at sector 0x200 and IDBlock is located at > sector 64, the combined size of TPL+SPL (idbloader.img) cannot take up > more than 224 KiB: > > (0x200 - 64) x 512 = 0x38000 (224 KiB) > > Adjust SPL_PAD_TO to match the used 0x200 sector offset. > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Thanks, - Kever > --- > v2: New patch split from DT sync patch > > With this change it should be possible to drop the following u-boot.dtsi > override and use the default offset = <CONFIG_SPL_PAD_TO>. > > offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>; > --- > configs/puma-rk3399_defconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig > index 14a7bc8b1e00..ec7d52a6e13e 100644 > --- a/configs/puma-rk3399_defconfig > +++ b/configs/puma-rk3399_defconfig > @@ -31,7 +31,7 @@ CONFIG_DEBUG_UART=y > CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb" > CONFIG_DISPLAY_BOARDINFO_LATE=y > CONFIG_SPL_MAX_SIZE=0x2e000 > -CONFIG_SPL_PAD_TO=0x7f8000 > +CONFIG_SPL_PAD_TO=0x38000 > # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set > # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set > CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig index 14a7bc8b1e00..ec7d52a6e13e 100644 --- a/configs/puma-rk3399_defconfig +++ b/configs/puma-rk3399_defconfig @@ -31,7 +31,7 @@ CONFIG_DEBUG_UART=y CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_SPL_MAX_SIZE=0x2e000 -CONFIG_SPL_PAD_TO=0x7f8000 +CONFIG_SPL_PAD_TO=0x38000 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
On rk3399-puma the FIT payload is located at sector 0x200 compared to the more Rockchip common sector 0x4000 offset: SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 Because FIT payload is located at sector 0x200 and IDBlock is located at sector 64, the combined size of TPL+SPL (idbloader.img) cannot take up more than 224 KiB: (0x200 - 64) x 512 = 0x38000 (224 KiB) Adjust SPL_PAD_TO to match the used 0x200 sector offset. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> --- v2: New patch split from DT sync patch With this change it should be possible to drop the following u-boot.dtsi override and use the default offset = <CONFIG_SPL_PAD_TO>. offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>; --- configs/puma-rk3399_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)