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 v3 1/2] arm: move C runtime setup code in crt0.S
Date: Thu, 15 Nov 2012 23:41:07 +0100	[thread overview]
Message-ID: <20121115234107.54c1409d@lilith> (raw)
In-Reply-To: <CAPnjgZ2YGRrg-9q0WWAXdvi6P_fPN91Yh6vPuS6AvgUDqB+kiA@mail.gmail.com>

Hi Simon,

On Thu, 15 Nov 2012 11:35:27 -0800, Simon Glass <sjg@chromium.org>
wrote:

> Hi Albert,
> 
> On Sat, Nov 10, 2012 at 9:00 AM, Albert ARIBAUD
> <albert.u.boot@aribaud.net> wrote:
> > Move all the C runtime setup code from every start.S
> > in arch/arm into arch/arm/lib/crt0.S. This covers
> > the code sequence from isetting up the initial stack
> > to calling into board_init_r().
> >
> > Also, rewrite the C runtime setup and make functions
> > board_init_*() and relocate_code() behave according to
> > normal C semantics (no jumping across the C stack any
> > more, etc).
> >
> > Some SPL targets had to be touched because they use
> > start.S exolicitly or for some reason; the relevant
> > maintainers and custodians are cc:ed.
> >
> > Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> 
> I am very pleased to see this. My generic relocation series from some
> time ago is still hanging around. Your series tidies up some things
> which would make that series easier to do. I'm happy to take another
> look at it.

I do remember your series -- it is part of what gave me the incentive 
toput this patch series together. :)

> I have tested your series on a Tegra seaboard, and got it running with
> a few changes. Please see comments below.

> > +       ldr     r0, =__bss_start        /* this is auto-relocated! */
> > +       ldr     r1, =__bss_end__        /* this is auto-relocated! */
> 
> I noticed this last time around - really we should have __bss_end__,
> not __bss_end. Something to look at in future work, perhaps.

Noted.

> > +       bhs     clbss_l
> 
> I think this should be blo, not bhs. Otherwise the BSS does not get
> cleared and my seaboard doesn't boot properly.

Thanks -- not the first time I see these... I'll have a go at checking
all loops.

> > +       /* call board_init_r */
> > +       ldr     pc, _board_init_r       /* this is auto-relocated! */
> 
> For my toolchain I need:
> 
> ldr     pc, =board_init_r
> 
> otherwise I get:
> 
> crt0.S: Assembler messages:
> crt0.S:176: Error: internal_relocation (type: OFFSET_IMM) not fixed up

Thanks -- this could well cure errors that Tom Warren reported to me
for various toolchains.

> Also _board_init_r seems to be the wrong symbol name for me:
> 
> arch/arm/lib/libarm.o: In function `clbss_l':
> /home/sjg/trunk/src/third_party/u-boot/files/arch/arm/lib/crt0.S:176:
> undefined reference to `_board_init_r'

Thanks a lot for the feedback and analysis! This should make V4 work on
a much wider range of ARM boards.

> Regards,
> Simon

Amicalement,
-- 
Albert.

  reply	other threads:[~2012-11-15 22:41 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-04  3:57 [U-Boot] [PATCH v1 0/1] Factorize ARM startup code as mush as possible Albert ARIBAUD
2012-11-04  3:57 ` [U-Boot] [PATCH v1] arm: move generic startup code in crt0.S Albert ARIBAUD
2012-11-04  7:29   ` Wolfgang Denk
2012-11-04  8:36     ` Albert ARIBAUD
2012-11-04 11:32 ` [U-Boot] [PATCH v2 0/2] Factorize ARM startup code as mush as possible Albert ARIBAUD
2012-11-04 11:32   ` [U-Boot] [PATCH v2 1/2] arm: move C runtime setup code in crt0.S Albert ARIBAUD
2012-11-04 11:32     ` [U-Boot] [PATCH v2 2/2] arm: remove useless code in start.S files Albert ARIBAUD
2012-11-04 11:34     ` [U-Boot] [PATCH v2 1/2] arm: move C runtime setup code in crt0.S Albert ARIBAUD
2012-11-04 15:06     ` Vikram Narayanan
2012-11-04 18:01       ` Albert ARIBAUD
2012-11-05  8:31     ` Andreas Bießmann
2012-11-10 16:48       ` Albert ARIBAUD
2012-11-10 16:53     ` Albert ARIBAUD
2012-11-04 11:43   ` [U-Boot] [PATCH v2 0/2] Factorize ARM startup code as mush as possible Albert ARIBAUD
2012-11-04 17:38     ` Tom Rini
2012-11-05  7:39       ` Sughosh Ganu
2012-11-08 14:20         ` Sughosh Ganu
2012-11-10 14:30           ` Albert ARIBAUD
2012-11-13  4:10             ` Sughosh Ganu
2012-11-13 19:55               ` Albert ARIBAUD
2012-12-09 20:31                 ` Sughosh Ganu
2012-11-10 17:00   ` [U-Boot] [PATCH v3 " Albert ARIBAUD
2012-11-10 17:00     ` [U-Boot] [PATCH v3 1/2] arm: move C runtime setup code in crt0.S Albert ARIBAUD
2012-11-10 17:00       ` [U-Boot] [PATCH v3 2/2] arm: remove useless code in start.S files Albert ARIBAUD
2012-11-15 19:35       ` [U-Boot] [PATCH v3 1/2] arm: move C runtime setup code in crt0.S Simon Glass
2012-11-15 22:41         ` Albert ARIBAUD [this message]
2012-11-10 17:28     ` [U-Boot] [PATCH v3 0/2] Factorize ARM startup code as mush as possible Albert ARIBAUD
2012-11-27 12:43     ` [U-Boot] [PATCH v4 " Albert ARIBAUD
2012-11-27 12:43       ` [U-Boot] [PATCH v4 1/2] arm: move C runtime setup code in crt0.S Albert ARIBAUD
2012-11-27 12:43         ` [U-Boot] [PATCH v4 2/2] arm: remove useless code in start.S files Albert ARIBAUD
2013-01-07 14:41           ` Tom Rini
2012-11-28 21:18         ` [U-Boot] [PATCH v4 1/2] arm: move C runtime setup code in crt0.S Simon Glass
2012-11-28 22:34           ` Albert ARIBAUD
2012-11-30 22:10             ` Simon Glass
2012-12-23 15:03               ` Albert ARIBAUD
2012-12-26 20:41                 ` Simon Glass
2013-01-05  1:00                   ` Simon Glass
2012-12-09 20:33         ` Sughosh Ganu
2013-01-07 14:40         ` Tom Rini
2013-01-08 19:26         ` Tom Rini
2013-01-08 19:50           ` Albert ARIBAUD
2013-01-08 20:18         ` [U-Boot] [PATCH v5 0/2] Factorize ARM startup code as much as possible Albert ARIBAUD
2013-01-08 20:18           ` [U-Boot] [PATCH v5 1/2] arm: move C runtime setup code in crt0.S Albert ARIBAUD
2013-01-08 20:18             ` [U-Boot] [PATCH v5 2/2] arm: remove useless code in start.S files Albert ARIBAUD
2013-01-08 21:16           ` [U-Boot] [PATCH v5 0/2] Factorize ARM startup code as much as possible Albert ARIBAUD
2012-12-27 11:27       ` [U-Boot] [PATCH v4 0/2] Factorize ARM startup code as mush " Albert ARIBAUD
2013-01-08 17:20       ` Albert ARIBAUD

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=20121115234107.54c1409d@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.