[U-Boot] U-Boot 2018.07 Still Broken for Allwinner H3 SoCs

Chen-Yu Tsai wens at csie.org
Wed Sep 5 04:43:13 UTC 2018


On Wed, Sep 5, 2018 at 11:23 AM Chen-Yu Tsai <wens at csie.org> wrote:
>
> On Tue, Sep 4, 2018 at 8:22 PM Peter Robinson <pbrobinson at gmail.com> wrote:
> >
> > > > On Tue, Jul 10, 2018 at 4:04 AM, Chen-Yu Tsai <wens at csie.org> wrote:
> > > > > This is on a Libre Computer ALL-H3-CC H3 variant. Still running a
> > > > > bisect, but v2018.07-rc1 is a working version. From the EHCI error
> > > > > messages, I'm thinking it might be related to the USB changes lately.
> > > > > Not sure if any other SoCs (ex. A64) are broken or not at the moment.
> > > >
> > > > I'm still seeing this issue in 2018.09 RC1, what's the status of a fix for this?
> > >
> > > This is a bug in binutils: https://sourceware.org/bugzilla/show_bug.cgi?id=23571
> > > It has been fixed upstream.
> >
> > For reference the Fedora binutils maintainer (and also one of the
> > upstream developers made the following note about the fix:
> >
> > https://bugzilla.redhat.com/show_bug.cgi?id=1624751#c3
> > ---
> > It should also be noted that this problem can be avoided in the U-Boot linker
> > script if the align expression is put on the left of the colon.  Like this:
> >
> >         .__secure_start
> >   #ifndef CONFIG_ARMV7_SECURE_BASE
> >                 ALIGN(CONSTANT(COMMONPAGESIZE))
> >   #endif
> >         : {
> >                 KEEP(*(.__secure_start))
> >         }
> >
> > This has the advantage that the solution will work with older versions of the
> > binutils package.
>
> Thanks. Apparently ALIGN and other commands should come before the colon.
> I suppose the linker just ignores commands in incorrect places, or just
> tries its best to comply. Anyway, I'm the one that got it wrong the first
> time around.

More on this:

According to the ld documents, ALIGN before the colon is an expression
specifying an address for the section [1], while ALIGN after the colon is
a section attribute for a forced alignment [2].

A third way to accomplish our goal, have the __secure_start symbol within
the .__secure_start section aligned, is to have

    . = ALIGN(CONSTANT(COMMONPAGESIZE));

before

    KEEP(*(.__secure_start))

This is used to align the __secure_stack_end symbol [3].

All these methods accomplish the goal, but have subtle differences. In
particular, the third method aligns the symbols themselves, but not the
start of the section.

ChenYu

[1] https://sourceware.org/binutils/docs-2.31/ld/Output-Section-Address.html
[2] https://sourceware.org/binutils/docs-2.31/ld/Output-Section-Attributes.html
[3] https://elixir.bootlin.com/u-boot/latest/source/arch/arm/cpu/u-boot.lds#L91

> > ---
> >
> > So you may wish to fix it like that so it's not dependent on versions
> > of binutils.
>
> Will do.
>
> ChenYu


More information about the U-Boot mailing list