[U-Boot-Users] can gd cause hang in board_init_r?

in board_init_r(lib_mips/board.c)
i add three serial out lines serial_puts("before gd\n"); printf("gd =%x \n", gd); serial_puts("after cmd relocate!\n");
sometimes, it only output first line,sometimes the first two lines, sometimes the three lines are all outputed, are these caused by gd operation? or other reasons?
thanks for any hints
Regards zhuzhenhua
my board_init_r as follows
void board_init_r (gd_t *id, ulong dest_addr) { DECLARE_GLOBAL_DATA_PTR; cmd_tbl_t *cmdtp; ulong size; extern void malloc_bin_reloc (void); #ifndef CFG_ENV_IS_NOWHERE extern char * env_name_spec; #endif char *s, *e; bd_t *bd; int i;
serial_puts("before gd\n"); gd = id; printf("gd =%x \n", gd); gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
//debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
monitor_flash_len = (ulong)&uboot_end_data - dest_addr;
/* * We have to relocate the command table manually */ for (cmdtp = &__u_boot_cmd_start; cmdtp != &__u_boot_cmd_end; cmdtp++) { ulong addr;
addr = (ulong) (cmdtp->cmd) + gd->reloc_off; #if 0 printf ("Command "%s": 0x%08lx => 0x%08lx\n", cmdtp->name, (ulong) (cmdtp->cmd), addr); #endif cmdtp->cmd = (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
addr = (ulong)(cmdtp->name) + gd->reloc_off; cmdtp->name = (char *)addr;
if (cmdtp->usage) { addr = (ulong)(cmdtp->usage) + gd->reloc_off; cmdtp->usage = (char *)addr; } #ifdef CFG_LONGHELP if (cmdtp->help) { addr = (ulong)(cmdtp->help) + gd->reloc_off; cmdtp->help = (char *)addr; } #endif }
serial_puts("after cmd relocate!\n");
#if 0 ... #endif while(1); }

In message 50c9a2250511220523m77f4abc6odaaa50c070f38d94@mail.gmail.com you wrote:
sometimes, it only output first line,sometimes the first two lines, sometimes the three lines are all outputed, are these caused by gd operation? or other reasons?
Bogus settings of the global data pointer can cause all kinds of nasty surprises. But of course there are also many other possible reasons for the effect you observe. Incorrect initialization of the SDRAM is the most likely one.
Best regards,
Wolfgang Denk

thanks for your answer Bogus settings of the global data pointer can cause all kinds of nasty surprises?
if i used native board.c in lib_mips/, does it means there can be a Bogus settings of the global data pointer?
regards
zhuzhenhua
On 11/22/05, Wolfgang Denk wd@denx.de wrote:
In message 50c9a2250511220523m77f4abc6odaaa50c070f38d94@mail.gmail.com you wrote:
sometimes, it only output first line,sometimes the first two lines, sometimes the three lines are all outputed, are these caused by gd operation? or other reasons?
Bogus settings of the global data pointer can cause all kinds of nasty surprises. But of course there are also many other possible reasons for the effect you observe. Incorrect initialization of the SDRAM is the most likely one.
Best regards,
Wolfgang Denk
-- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Ernest asks Frank how long he has been working for the company. "Ever since they threatened to fire me."
participants (2)
-
Wolfgang Denk
-
zhuzhenhua