public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] SPL: Add spl_early_board_init() generic function
Date: Mon, 16 Jan 2017 02:19:45 +0100	[thread overview]
Message-ID: <20170116021945.72f84a81@jawa> (raw)
In-Reply-To: <07e4aa0c-1ed2-39d4-9c93-60ff97e2623e@denx.de>

Dear All,

> On 01/15/2017 11:46 PM, Lukasz Majewski wrote:
> > Some boards do require early adjustments (due to e.g. HW fix) in
> > SPL code. In this particular case such operations must be performed
> > just before ANY external IC is accessed (good example here is the
> > I2C early bus access).
> 
> Shouldn't such stuff be done in board_init_f or so then ?
> board_init_r is pretty late ...
> 
> btw I'm not a big fan of adding more and more callbacks, what is the
> usecase here ?

We had some discussion with Marek and we have found better (and more
important already existing) place for this code.

Please regard this patch as not needed and hence dropped.

> 
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >  common/spl/Kconfig | 8 ++++++++
> >  common/spl/spl.c   | 6 ++++++
> >  include/spl.h      | 4 ++++
> >  3 files changed, 18 insertions(+)
> > 
> > diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> > index bb99f1f..7e6f9c4 100644
> > --- a/common/spl/Kconfig
> > +++ b/common/spl/Kconfig
> > @@ -185,6 +185,14 @@ config SPL_SAVEENV
> >  	  "reboot_image" and act accordingly and change the
> > reboot_image to default mode using setenv and save the environemnt.
> >  
> > +config SPL_EARLY_BOARD_INIT
> > +	bool "Support early board init code"
> > +	depends on SPL
> > +	help
> > +	  Enable support for very early SPL board code adjustments.
> > +	  Some boards require having adjustements done before any
> > +	  peripherals being operational (e.g. I2C, SPI, UART).
> > +
> >  config SPL_ETH_SUPPORT
> >  	bool "Support Ethernet"
> >  	depends on SPL_ENV_SUPPORT
> > diff --git a/common/spl/spl.c b/common/spl/spl.c
> > index bdb165a..a15647b 100644
> > --- a/common/spl/spl.c
> > +++ b/common/spl/spl.c
> > @@ -393,6 +393,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
> >  	struct spl_image_info spl_image;
> >  	int i;
> >  
> > +#ifdef CONFIG_SPL_EARLY_BOARD_INIT
> > +	debug(">>spl:early_board_init()\n");
> > +
> > +	spl_early_board_init();
> > +#endif
> > +
> >  	debug(">>spl:board_init_r()\n");
> >  
> >  #if defined(CONFIG_SYS_SPL_MALLOC_START)
> > diff --git a/include/spl.h b/include/spl.h
> > index e080a82..00a2058 100644
> > --- a/include/spl.h
> > +++ b/include/spl.h
> > @@ -215,6 +215,10 @@ int spl_init(void);
> >  void spl_board_init(void);
> >  #endif
> >  
> > +#ifdef CONFIG_SPL_EARLY_BOARD_INIT
> > +void spl_early_board_init(void);
> > +#endif
> > +
> >  /**
> >   * spl_was_boot_source() - check if U-Boot booted from SPL
> >   *
> > 
> 
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

      reply	other threads:[~2017-01-16  1:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-15 22:46 [U-Boot] [PATCH] SPL: Add spl_early_board_init() generic function Lukasz Majewski
2017-01-15 23:03 ` Marek Vasut
2017-01-16  1:19   ` Lukasz Majewski [this message]

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=20170116021945.72f84a81@jawa \
    --to=lukma@denx.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox