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

From 58e9529fa466ef79232398aeda69373125eb2aac Mon Sep 17 00:00:00 2001
From: Richard Retanubun RichardRetanubun@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 patch uses gd->relocaddr variable to store uboot's relocated address in RAM and shows it in bdinfo command.
This patch moves CONFIG_AMIGAONEG3SE style copying of the address in board_init_f to just before relocation is actually done.
Signed-off-by: Richard Retanubun RichardRetanubun@RuggedCom.com --- Hi Detlev,
Sorry it took a while, got swamped with other tasks. I see your point and have made a patch per your request.
Cheers,
-Richard
common/cmd_bdinfo.c | 1 + include/asm-ppc/global_data.h | 2 -- lib_ppc/board.c | 6 ++---- 3 files changed, 3 insertions(+), 6 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 55e7e20..e031fdb 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -149,9 +149,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..1e3fe59 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -476,10 +476,6 @@ void board_init_f (ulong bootflag)
debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
-#ifdef CONFIG_AMIGAONEG3SE - gd->relocaddr = addr; -#endif - /* * reserve memory for malloc() arena */ @@ -611,6 +607,8 @@ void board_init_f (ulong bootflag)
WATCHDOG_RESET();
+ gd->relocaddr = addr; /* Record relocation address, useful for debug */ + memcpy (id, (void *)gd, sizeof (gd_t));
relocate_code (addr_sp, id, addr);

Hi Richard,
From 58e9529fa466ef79232398aeda69373125eb2aac Mon Sep 17 00:00:00 2001
From: Richard Retanubun RichardRetanubun@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 patch uses gd->relocaddr variable to store uboot's relocated address in RAM and shows it in bdinfo command.
This patch moves CONFIG_AMIGAONEG3SE style copying of the address in board_init_f to just before relocation is actually done.
Signed-off-by: Richard Retanubun RichardRetanubun@RuggedCom.com
Hi Detlev,
Sorry it took a while, got swamped with other tasks. I see your point and have made a patch per your request.
No problem, I know how it is. Thanks for the patch!
Tested-by: Detlev Zundel dzu@denx.de
Cheers,
-Richard
common/cmd_bdinfo.c | 1 + include/asm-ppc/global_data.h | 2 -- lib_ppc/board.c | 6 ++---- 3 files changed, 3 insertions(+), 6 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 55e7e20..e031fdb 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -149,9 +149,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..1e3fe59 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -476,10 +476,6 @@ void board_init_f (ulong bootflag)
debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
-#ifdef CONFIG_AMIGAONEG3SE
- gd->relocaddr = addr;
-#endif
- /*
*/
- reserve memory for malloc() arena
@@ -611,6 +607,8 @@ void board_init_f (ulong bootflag)
WATCHDOG_RESET();
gd->relocaddr = addr; /* Record relocation address, useful for debug */
memcpy (id, (void *)gd, sizeof (gd_t));
relocate_code (addr_sp, id, addr);

Dear richardretanubun@ruggedcom.com,
In message 20100125183120.GA11251@richardretanubun.eng.lan you wrote:
From 58e9529fa466ef79232398aeda69373125eb2aac Mon Sep 17 00:00:00 2001 From: Richard Retanubun RichardRetanubun@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 patch uses gd->relocaddr variable to store uboot's relocated address in RAM and shows it in bdinfo command.
This patch moves CONFIG_AMIGAONEG3SE style copying of the address in board_init_f to just before relocation is actually done.
Signed-off-by: Richard Retanubun RichardRetanubun@RuggedCom.com
Hi Detlev,
Sorry it took a while, got swamped with other tasks. I see your point and have made a patch per your request.
Cheers,
-Richard
common/cmd_bdinfo.c | 1 + include/asm-ppc/global_data.h | 2 -- lib_ppc/board.c | 6 ++---- 3 files changed, 3 insertions(+), 6 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (3)
-
Detlev Zundel
-
richardretanubun@ruggedcom.com
-
Wolfgang Denk