From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] arm: support Thumb-1 with CONFIG_SYS_THUMB_BUILD
Date: Wed, 25 Feb 2015 23:09:46 +0100 [thread overview]
Message-ID: <20150225230946.1b0bb4d8@lilith> (raw)
In-Reply-To: <1424786016-12976-1-git-send-email-albert.u.boot@aribaud.net>
Hello Albert,
On Tue, 24 Feb 2015 14:53:36 +0100, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> When building a THumb-1-only target with CONFIG_SYS_THUMB_BUILD,
> some files fail to build, most of the time because they include
> mcr instructions, which only exist for Thumb-2.
>
> Thos patch introduces a Kconfig option CONFIG_THUMB2 and uses
> it to select between Thumb-2 and ARM mode for the aforementioned
> files.
>
> Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> This patch has been build-tested and run-tested on ED Mini V2,
> above the "edmini: switch to SPL" patch, and found to reduce
> U-Boot size by 25% and SPL size by 14%... and to run fine. :)
>
> This patch has also been tested against side effects on the
> non-Thumb wireless_space target. The binaries produced with
> and without ths patch were found to differ only by their
> version string.
>
> Changes in v2:
> - fixed a typo in the commit message
> - added file arch/arm/thumb1/include/asm/proc-armv/system.h,
> which overrides arch/arm/include/asm/proc-armv/system.h
> when building for Thumb-1 and provides non-functional but
> Thumb-compilable IRQ and FIQ related macros and functions.
Ok, this does not fare as good as I have hoped, because there are also
thumb1-unfrendly macros in arch/arm/include/asm/cache.h, this time with
mcr and mrc instructions.
/me hates macros used as inline functions. :(
I cannot just replace the macros with empty inline functions as I did
with arch/arm/include/asm/proc-armv/system.h, since this would cause
cache to not work. :(
This leaves only one solution: when buildding for thumb1, replace the
macros in cache.h with plain function prototypes, and provide simple
ARM-state implementations for these. We'll lose a bit of performance as
instead of a single mcr or mrc instruction, we'll have a call switching
from Thumb to ARM state, the mcr/mrc instruction, and a return to Thumb
state. Hopefully that won't hurt performance too much.
V3 in the works.
Amicalement,
--
Albert.
next prev parent reply other threads:[~2015-02-25 22:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-01 2:55 [U-Boot] [PATCH] arm: support Thumb-1 with CONFIG_SYS_THUMB_BUILD Albert ARIBAUD
2015-02-10 13:36 ` Stefan Roese
2015-02-24 13:55 ` Albert ARIBAUD
2015-02-24 13:53 ` [U-Boot] [PATCH v2] " Albert ARIBAUD
2015-02-24 14:00 ` Albert ARIBAUD
2015-02-25 22:09 ` Albert ARIBAUD [this message]
2015-04-09 9:22 ` Stefan Roese
2015-04-13 17:47 ` Albert ARIBAUD
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=20150225230946.1b0bb4d8@lilith \
--to=albert.u.boot@aribaud.net \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.