From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] decompress: xz: enable armthumb BCJ filter for Thumb-2 barebox
Date: Mon, 23 Oct 2023 11:55:28 +0200 [thread overview]
Message-ID: <20231023095528.GS3359458@pengutronix.de> (raw)
In-Reply-To: <20231020180912.2914428-1-a.fatoum@pengutronix.de>
On Fri, Oct 20, 2023 at 08:09:12PM +0200, Ahmad Fatoum wrote:
> 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.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> lib/decompress_unxz.c | 2 ++
> scripts/xz_wrap.sh | 4 ++++
> 2 files changed, 6 insertions(+)
Applied, thanks
Sascha
>
> diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c
> index 132ab4a239b3..ad6a5f20ba28 100644
> --- a/lib/decompress_unxz.c
> +++ b/lib/decompress_unxz.c
> @@ -133,6 +133,8 @@
> #ifdef CONFIG_ARM
> # ifdef CONFIG_CPU_64
> # define XZ_DEC_ARM64
> +# elif defined CONFIG_THUMB2_BAREBOX
> +# define XZ_DEC_ARMTHUMB
> # else
> # define XZ_DEC_ARM
> # endif
> diff --git a/scripts/xz_wrap.sh b/scripts/xz_wrap.sh
> index 5b5f3adcff6d..a6373a748168 100755
> --- a/scripts/xz_wrap.sh
> +++ b/scripts/xz_wrap.sh
> @@ -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=
>
> --
> 2.39.2
>
>
>
--
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 |
prev parent reply other threads:[~2023-10-23 9:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 18:09 Ahmad Fatoum
2023-10-23 9:55 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231023095528.GS3359458@pengutronix.de \
--to=sha@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox