decompress: xz: enable armthumb BCJ filter for Thumb-2 barebox
Subsystems (2)
PATCH 1/1 decompress: xz: enable armthumb BCJ filter for Thumb-2 barebox
The XZ decompressor in barebox has BCJ filter support for THUMB, but like Linux, it's unused and instead the ARM BCJ filter is used.
Fixing that lets us save a few kilobytes, which is especially useful for legacy configuration that fit a whole barebox into limited on-chip SRAM (and not only the prebootloader). For example, with this patch applied barebox-am33xx-beaglebone-mlo.img is shrinked 3K from 109236 to 106028 bytes.
--- lib/decompress_unxz.c | 2 ++ scripts/xz_wrap.sh | 4 ++++ 2 files changed, 6 insertions(+)
lib/decompress_unxz.c +2 -0
@@ -133,6 +133,8 @@#ifdef CONFIG_ARM # ifdef CONFIG_CPU_64 # define XZ_DEC_ARM64 +# elif definedCONFIG_THUMB2_BAREBOX +# define XZ_DEC_ARMTHUMB # else # define XZ_DEC_ARM # endif
scripts/xz_wrap.sh +4 -0
@@ -20,6 +20,10 @@ case $SRCARCH in sparc) BCJ=--sparc ;; esac +if grep -q '^CONFIG_THUMB2_BAREBOX=y$' include/config/auto.conf; then + BCJ=--armthumb +fi + # clear BCJ filter if unsupported xz -H | grep -q -- $BCJ || BCJ=
Signature · 1 line
2.39.2
Sascha Hauer
AppliedQuoted 8 lines · Ahmad Fatoum
The XZ decompressor in barebox has BCJ filter support for THUMB, but like Linux, it's unused and instead the ARM BCJ filter is used.
Fixing that lets us save a few kilobytes, which is especially useful for legacy configuration that fit a whole barebox into limited on-chip SRAM (and not only the prebootloader). For example, with this patch applied barebox-am33xx-beaglebone-mlo.img is shrinked 3K from 109236 to 106028 bytes.
Quoted 5 lines
Signed-off-by Ahmad Fatoum <[email protected]>--- lib/decompress_unxz.c | 2 ++ scripts/xz_wrap.sh | 4 ++++ 2 files changed, 6 insertions(+)
Applied, thanks
Sascha
Quoted 34 lines
lib/decompress_unxz.c +2
-0@@ -133,6 +133,8 @@#ifdef CONFIG_ARM # ifdef CONFIG_CPU_64 # define XZ_DEC_ARM64 +# elif definedCONFIG_THUMB2_BAREBOX +# define XZ_DEC_ARMTHUMB # else # define XZ_DEC_ARM # endif scripts/xz_wrap.sh +4
-0@@ -20,6 +20,10 @@ case $SRCARCH in sparc) BCJ=--sparc ;; esac +if grep -q '^CONFIG_THUMB2_BAREBOX=y$' include/config/auto.conf; then + BCJ=--armthumb +fi + # clear BCJ filter if unsupported xz -H | grep -q -- $BCJ || BCJ=Signature · 1 line
2.39.2
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |