linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: kernel entry for thumb2-only cpus
Date: Fri, 3 Aug 2012 11:04:52 +0200	[thread overview]
Message-ID: <20120803090452.GE2626@pengutronix.de> (raw)

Hello,

in both arch/arm/kernel/head.S and arch/arm/kernel/head-nommu.S we have

	.arm
 THUMB( adr     r9, BSYM(1f)    )       @ Kernel is always entered in ARM.
 THUMB( bx      r9              )       @ If this is a Thumb-2 kernel,
 THUMB( .thumb                  )       @ switch to Thumb now.
 THUMB(1:                       )

as first instructions at the entry point. This is a problem for
thumb2-only cpus (e.g. Cortex-M3).

Up to now I commented out the first three lines for the Cortex-M3 port.
What should we do about that. There are two possibilities I see:

 a) introduce a kconfig symbol for thumb2-only builds and #ifdef the
    first three lines out if it is given.
 b) expect the bootloader to directly jump to the label 1.

The downside of a) is that a boot loader on a cpu that is capable to
execute the tradtional instructions would need to detect if the switch
to thumb is there or not and react accordingly. (In fact it needs to
distringuish three cases:

 - traditional kernel
 - thumb2 kernel with ARM entry
 - thumb2 kernel without ARM entry

.) So I think b) is the more sensible option in the long run.

What do you think?

If so I'd expand the comment with this expectation.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

             reply	other threads:[~2012-08-03  9:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-03  9:04 Uwe Kleine-König [this message]
2012-08-03 11:45 ` kernel entry for thumb2-only cpus Will Deacon
2012-08-05  9:55   ` Uwe Kleine-König
2012-08-05 11:42     ` Will Deacon
2012-08-06  4:32     ` Nicolas Pitre
2012-08-06 18:40       ` Matt Sealey
2012-08-06 19:08         ` Russell King - ARM Linux
2012-08-06 19:30           ` Matt Sealey
2012-08-06 19:40             ` Russell King - ARM Linux
2012-08-06 20:00               ` Matt Sealey
2012-08-06 22:36                 ` Nicolas Pitre
2012-08-06 23:14                   ` Matt Sealey
2012-08-07  0:08                     ` Nicolas Pitre
2012-08-07 17:06                       ` Russell King - ARM Linux
2012-08-07 22:34                       ` Matt Sealey
2012-08-08  5:04                         ` Nicolas Pitre
2012-08-08 17:53                           ` Matt Sealey
2012-08-08 18:53                             ` Nicolas Pitre
2012-08-08 15:33                         ` Russell King - ARM Linux
2012-08-08 10:54       ` Dave Martin

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=20120803090452.GE2626@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).