All of lore.kernel.org
 help / color / mirror / Atom feed
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: Mon, 13 Apr 2015 19:47:35 +0200	[thread overview]
Message-ID: <20150413194735.3f38decd@lilith> (raw)
In-Reply-To: <552644D3.5060806@denx.de>

Hello Stefan,

On Thu, 09 Apr 2015 11:22:27 +0200, Stefan Roese <sr@denx.de> wrote:
> Hi Albert,
> 
> On 25.02.2015 23:09, Albert ARIBAUD wrote:
> > 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.
> 
> Any update on this?

I am just restarting on this right now.

> Thanks,
> Stefan

Amicalement,
-- 
Albert.

      reply	other threads:[~2015-04-13 17:47 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
2015-04-09  9:22     ` Stefan Roese
2015-04-13 17:47       ` Albert ARIBAUD [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=20150413194735.3f38decd@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.