All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Ford <aford173@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] davinci: spl: Create board_init_f for explicit initialization
Date: Tue, 21 May 2019 07:59:46 -0500	[thread overview]
Message-ID: <CAHCN7xJBaJspQeW2LRbNBuA5YucESiCCj162EK2tLAqDA=uzVw@mail.gmail.com> (raw)
In-Reply-To: <a6b39a89-4bc2-7ec0-138d-d4fb5b771391@ti.com>

On Tue, May 21, 2019 at 7:52 AM Sekhar Nori <nsekhar@ti.com> wrote:
>
> On 21/05/19 1:05 AM, Adam Ford wrote:
> > The arch_cpu_init() and preloader_console_init() functions
> > were not getting called until board_init_r() as part of the
> > spl_board_init() functions.  This patch explicitly moves these
> > initialization sequences earlier in startup, and now clears BSS
> > per the suggested workflow in the README. This also means that
> > CONFIG_SPL_BOARD_INIT can be removed from the defconfig
> >
> > Suggested-by: Sekhar Nori <nsekhar@ti.com>
> > Signed-off-by: Adam Ford <aford173@gmail.com>
> >
> > diff --git a/arch/arm/mach-davinci/spl.c b/arch/arm/mach-davinci/spl.c
> > index 103639e347..05c78f1801 100644
> > --- a/arch/arm/mach-davinci/spl.c
> > +++ b/arch/arm/mach-davinci/spl.c
> > @@ -37,6 +37,33 @@ void spl_board_init(void)
> >       preloader_console_init();
> >  }
> >
> > +void board_init_f(ulong boot_flags)
> > +{
> > +     gd->flags = boot_flags;
> > +     gd->have_console = 0;
> > +
> > +     if (!(gd->flags & GD_FLG_SPL_INIT)) {
> > +             if (spl_init())
> > +                     hang();
> > +     }
> > +
> > +     arch_cpu_init();
> > +
> > +     board_early_init_f();
> > +
> > +     /* setup GP timer */
> > +     timer_init();
> > +
> > +     /* UART clocks enabled and gd valid - init serial console */
> > +     preloader_console_init();
> > +
> > +     /* Clear the BSS. */
> > +     memset(__bss_start, 0, __bss_end - __bss_start);
> > +
> > +     /* load/boot image from boot device */
> > +     board_init_r(NULL, 0);
> > +}
>
> This seems incorrect. board_init_r() is already called by
> arch/arm/lib/crt0.S. A much simple fix should do. I was able to get back
> to working on this today. Will send a patch soon.

I used the board_init_f functions I found for a bunch of various other
boards as the basis and they do this, but I confirmed that removing
the board_init_r() call from here appears to work correctly.
However, I'll test your patch when it's available.

adam
>
> Thanks,
> Sekhar

  reply	other threads:[~2019-05-21 12:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-20 19:35 [U-Boot] [PATCH] davinci: spl: Create board_init_f for explicit initialization Adam Ford
2019-05-21 12:52 ` Sekhar Nori
2019-05-21 12:59   ` Adam Ford [this message]
2019-05-21 13:49     ` Adam Ford
2019-05-31 11:48 ` Adam Ford

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='CAHCN7xJBaJspQeW2LRbNBuA5YucESiCCj162EK2tLAqDA=uzVw@mail.gmail.com' \
    --to=aford173@gmail.com \
    --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.