public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7 v4] i2c, dtt: move dtt_init () to board_init_r ()
Date: Tue, 24 Feb 2009 10:10:46 -0600	[thread overview]
Message-ID: <1235491846.19570.71.camel@localhost.localdomain> (raw)
In-Reply-To: <49A3CC46.3000602@denx.de>

Hi Heiko,

On Tue, 2009-02-24 at 11:30 +0100, Heiko Schocher wrote:
> In case where a board not uses CONFIG_POST, it is not
> necessary to init the DTTs when running from flash.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
>  lib_ppc/board.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/lib_ppc/board.c b/lib_ppc/board.c
> index 3bcfb45..375b091 100644
> --- a/lib_ppc/board.c
> +++ b/lib_ppc/board.c
> @@ -339,10 +339,10 @@ init_fnc_t *init_sequence[] = {
>  #if defined(CONFIG_HARD_SPI)
>  	init_func_spi,
>  #endif
> +#ifdef CONFIG_POST
>  #if defined(CONFIG_DTT)		/* Digital Thermometers and Thermostats */
>  	dtt_init,
>  #endif
> -#ifdef CONFIG_POST
>  	post_init_f,
>  #endif
>  	INIT_FUNC_WATCHDOG_RESET
> @@ -1072,6 +1072,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
> 
>  	WATCHDOG_RESET ();
> 
> +#if defined(CONFIG_DTT) && !defined(CONFIG_POST)
> +	dtt_init ();
> +#endif
>  #if defined(CONFIG_CMD_SCSI)
>  	WATCHDOG_RESET ();
>  	puts ("SCSI:  ");

Is there a reason we can't just move the dtt_init() call to after
relocation to RAM for both the cases with and without CONFIG_POST
defined?  If some POST relies on the temperature sensors being
initialized it seems cleaner to change the POST to run after relocation
than add more ifdefery to common code.

Unconditionally moving dtt_init() to after relocation would also allow
dtt drivers to use global variables, etc (which it just so happens an
lm90-type driver I'm working on requires:).

Best,
Peter

  reply	other threads:[~2009-02-24 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24 10:30 [U-Boot] [PATCH 1/7 v4] i2c, dtt: move dtt_init () to board_init_r () Heiko Schocher
2009-02-24 16:10 ` Peter Tyser [this message]
2009-02-24 21:34   ` Wolfgang Denk
2009-02-25  7:08   ` Heiko Schocher

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=1235491846.19570.71.camel@localhost.localdomain \
    --to=ptyser@xes-inc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox