Hi Alexey,
On 2026-09-18T10:52:27, Alexey Charkov <[email protected]> wrote:
> rockchip: Choose FIT payload compression via Kconfig
>
> The dtsi infers how to compress from whichever SPL decompressor happens
> to be enabled, so there is no way to ask for one in particular, turning
> a decompressor on for something else silently changes the image, and the
> conditional has to be updated with every new algorithm.
>
> Move the selection to Kconfig instead, with proper help texts and support
> for all available compression algorithms. Each choice enables the
> decompressor that provides it, and carries the compression level.
>
> Signed-off-by: Alexey Charkov <[email protected]>
>
> arch/arm/dts/rockchip-u-boot.dtsi | 16 +++-----
> arch/arm/mach-rockchip/Kconfig | 78
> +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 84 insertions(+), 10 deletions(-)
> diff --git a/arch/arm/dts/rockchip-u-boot.dtsi
> b/arch/arm/dts/rockchip-u-boot.dtsi
> @@ -61,11 +53,15 @@
> +#if CONFIG_ROCKCHIP_UBOOT_COMP_LEVEL != 0
> + compress-level =
> +
> <CONFIG_ROCKCHIP_UBOOT_COMP_LEVEL>;
> +#endif
No defconfig in the tree selects anything other than 'none', so CI
never builds an image with 'compress' or 'compress-level' set here.
Patch 9 enables SPL_ZSTD on sandbox for the same reason. Please can
you enable one of the choices on a board you can test (your RK3576
one?), so the binman side gets some build coverage?
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> @@ -758,6 +758,84 @@ config ROCKCHIP_MASKROM_IMAGE
> +config ROCKCHIP_UBOOT_COMP_GZIP
> + bool "gzip"
> + select SPL_GZIP
With this patch the choice is offered on every Rockchip board with
SPL_FIT, but many of them cannot boot the result, as discussed on the
cover letter. For example evb-rk3399 has CONFIG_TEXT_BASE=0x00800000
and CONFIG_SYS_LOAD_ADDR=0x800800, and 0x800800 is the most common
value after 0xc00800 in the Rockchip defconfigs.
Since this is the patch which makes the option visible, please can you
deal with that here, so that selecting gzip does not quietly produce
an image which fails in SPL? I am not sure what the best approach is:
perhaps a separate staging address for SPL, or a build-time check that
the two regions cannot overlap.
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> @@ -758,6 +758,84 @@ config ROCKCHIP_MASKROM_IMAGE
> +config ROCKCHIP_UBOOT_COMP_LEVEL
> + int "Compression level for U-Boot proper"
> + depends on !ROCKCHIP_UBOOT_COMP_NONE && !ROCKCHIP_UBOOT_COMP_LZMA
When SPL_FIT is disabled the choice is hidden, so none of its symbols
is set and this condition is true. The prompt then appears, with no
range, on boards which have no FIT at all. For example,
evb-rk3036_defconfig ends up with:
CONFIG_ROCKCHIP_UBOOT_COMP='none'
CONFIG_ROCKCHIP_UBOOT_COMP_LEVEL=0
Please can you list the algorithms which do take a level instead:
depends on ROCKCHIP_UBOOT_COMP_GZIP || ROCKCHIP_UBOOT_COMP_LZO || \
ROCKCHIP_UBOOT_COMP_LZ4 || ROCKCHIP_UBOOT_COMP_ZSTD
That also means a new algorithm has to opt in, rather than getting a
level prompt with no range.
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> @@ -758,6 +758,84 @@ config ROCKCHIP_MASKROM_IMAGE
> + How hard to compress, numbered the way the algorithm's own tool
> + numbers it. Leave it at 0 to take the tool's default.
Not quite. For lz4, binman passes -5 when no level is given (see patch
10), so this should say that 0 uses binman's default.
Regards,
Simon