Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel <korgull@home.nl>
To: buildroot@busybox.net
Subject: [Buildroot] endian issue
Date: Sat, 15 May 2010 17:26:57 +0200	[thread overview]
Message-ID: <201005151726.58323.korgull@home.nl> (raw)
In-Reply-To: <hsmbug$d0p$1@dough.gmane.org>

On Saturday 15 May 2010 04:43:29 pm Grant Edwards wrote:
> On 2010-05-15, Lionel Landwerlin <llandwerlin@gmail.com> wrote:
> > Le samedi 15 mai 2010 ?? 15:47 +0200, Marcel a ??crit :
> >> I'm using an Atmel sam9g45 using buildroot with linux 2.6.33.
> >> 
> >> I currently have most of my things working but run into an issue which
> >> is endian related.
> > 
> > The endianness configuration of your processor isn't something you
> > can usually change 'on-the-fly'. It's usually set up early in the
> > boot process.
> 
> While the endian configuration of the ARM9 core can be changed, the
> AT91 peripherals are little-endian.  In theory, he should be able to
> run the ARM9 core in big-endian mode, but a running uC core without
> any working peripherals is surprisingly useless.
> 
> > So you have to choose whether you want to compile all your system in
> > big or little endian, you can select that from the buildroot
> > architecture configuration (arm -> little, armeb -> big, for
> > example).
> 
> In this case, he has to choose little-endian.

That's very clear. 

> [I've never seen an ARM-based uController that had peripherals with
> configurable endianess -- are there any?]
> 
> >> Is there any way to compile my package in big-endian mode from
> >> buildroot? Or is there another way I should force this?
> > 
> > You can't select that for 1 package, it's for the whole system or
> > nothing. Otherwise, the smartest approch would be to make endian
> > detection (at compile time or at running time) to adapt your
> > processing algorithm.
> 
> Yep, the OP's should driver should return data in host-order.
> 
> Otherwise, he'll have to suffer the guilt of knowing that a few years
> from now some poor sod who inherits the code will have a stroke from
> the effort required to resist the urge to track down the OP and slap
> him silly.

If I wish to do that, how do I detect the endianness of a sytem and do I need 
to reformat my data in my drivers for this ? If so, isn't that a pure waste of 
cpu cycles for the sake of reusable code ?
If I can do this without any speed sacrifice than I will do it, if not....than 
it's simply not an option for this system.

Best regards,
Marcel

  reply	other threads:[~2010-05-15 15:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-15 13:47 [Buildroot] endian issue Marcel
2010-05-15 14:09 ` Grant Edwards
2010-05-15 14:19 ` Lionel Landwerlin
2010-05-15 14:43   ` Grant Edwards
2010-05-15 15:26     ` Marcel [this message]
2010-05-15 16:33       ` Thomas Petazzoni
2010-05-15 16:37       ` Lionel Landwerlin
2010-05-15 16:45       ` Grant Edwards
2010-05-15 17:53         ` Marcel
2010-05-15 15:18   ` Marcel

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=201005151726.58323.korgull@home.nl \
    --to=korgull@home.nl \
    --cc=buildroot@busybox.net \
    /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