[U-Boot] [PATCH] PPC: Record uboot's relocated address in RAM and show in bdinfo.

Detlev Zundel dzu at denx.de
Fri Jan 15 17:13:48 CET 2010


Hi Richard,

> From a1d1f6fa9b579c4a766eea45c01224edd536880c Mon Sep 17 00:00:00 2001
> From: Richard Retanubun <RichardRetanubun at RuggedCom.com>
> Date: Fri, 15 Jan 2010 10:06:06 -0500
> Subject: [PATCH] PPC: Record uboot's relocated address in RAM and show in bdinfo.
>
> This commit uses gd->relocaddr variable to store uboot's relocated
> address in RAM and shows it in bdinfo command.
>
> Signed-off-by: Richard Retanubun <RichardRetanubun at RuggedCom.com>
> ---
>  common/cmd_bdinfo.c           |    1 +
>  include/asm-ppc/global_data.h |    2 --
>  lib_ppc/board.c               |    8 ++++++++
>  3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
> index 11c1547..f8400bc 100644
> --- a/common/cmd_bdinfo.c
> +++ b/common/cmd_bdinfo.c
> @@ -115,6 +115,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  #endif
>  	printf ("IP addr     = %pI4\n", &bd->bi_ip_addr);
>  	printf ("baudrate    = %6ld bps\n", bd->bi_baudrate   );
> +	print_num ("relocaddr", gd->relocaddr);
>  	return 0;
>  }
>
> diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h
> index 3f11918..d3dd44e 100644
> --- a/include/asm-ppc/global_data.h
> +++ b/include/asm-ppc/global_data.h
> @@ -152,9 +152,7 @@ typedef	struct	global_data {
>      defined(CONFIG_SANDPOINT)
>  	void *		console_addr;
>  #endif
> -#ifdef CONFIG_AMIGAONEG3SE
>  	unsigned long	relocaddr;	/* Start address of U-Boot in RAM */
> -#endif
>  #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
>  	unsigned long	fb_base;	/* Base address of framebuffer memory	*/
>  #endif
> diff --git a/lib_ppc/board.c b/lib_ppc/board.c
> index dd22f99..f4a357b 100644
> --- a/lib_ppc/board.c
> +++ b/lib_ppc/board.c
> @@ -659,6 +659,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
>
>  	debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
>
> +	/*
> +	 * Record uboot's address in RAM, useful for debugging;
> +	 * CONFIG_AMIGAONEG3SE gets the address during board_init_f.
> +	 */
> +#ifndef CONFIG_AMIGAONEG3SE
> +	gd->relocaddr = dest_addr;
> +#endif
> +
>  	WATCHDOG_RESET ();

Please excuse my ignorance, but why not simply remove the #ifdef
CONFIG_AMIGAONEG3SE in board_init_f?  Actually I was hoping to remove
the Amigaone special case.

Cheers
  Detlev

-- 
I'm  not  one of those who   think Bill Gates is   the devil. I simply
suspect that if Microsoft ever met up with the devil, it wouldn't need
an interpreter.
               --NICHOLAS PETRELEY, Sr. Editor, InfoWorld
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list