[U-Boot] [PATCH v2] arm926ejs: 16-byte align stack to avoid LDRD/STRD problems

Simon Kagstrom simon.kagstrom at netinsight.net
Tue Oct 6 09:07:20 CEST 2009


On Mon, 05 Oct 2009 13:37:36 -0500
Tom <Tom.Rix at windriver.com> wrote:

> Simon Kagstrom wrote:
> > U-boot for Marvell Kirkwood boards no longer work after the EABI changes
> > introduced in commit f772acf8a584067033eff1e231fcd1fb3a00d3d9. This
> > turns out to be caused by a stack alignment issue. The armv5te
> > instructions ldrd/strd instructions require 8-byte alignment to work
> > properly (otherwise undefined behavior), and start.S gave the stack a
> > 12-byte alignment.
> > 
> > Tested on an OpenRD base board, where both printouts and ubifs stuff now
> > works.
> 
> Has this patch been tested on any other boards ?
> This patch looks ok, I am just concerned about regressions.

It would probably be good to have it tested on non-Kirkwood boards as
well. I can't see that it should do any harm to other boards though -
it's just aligning the stack to 8 bytes (disregard the Subject for now
and see v3 of the patch :-)).

The strange thing is really why it worked before on other boards.
Perhaps the stack by change was already 8-byte aligned there, or
perhaps ldrd/strd with non-8-byte alignment is handled. The
architecture manual says that the behavior of ldrd/strd is undefined
unless the address is 8-byte aligned, but I suppose that allows for it
to actually work.

// Simon


More information about the U-Boot mailing list