#include <status_led.h>
#endif
#include <net.h>
-#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
-#include <cmd_bedbug.h>
-#endif
#ifdef CFG_ALLOC_DPRAM
#if !defined(CONFIG_8260)
#include <commproc.h>
extern ulong __init_end;
extern ulong _end;
-
ulong monitor_flash_len;
+#if (CONFIG_COMMANDS & CFG_CMD_BEDBUG)
+#include <bedbug/type.h>
+#endif
+
/*
* Begin and End of memory area for malloc(), and current "brk"
*/
* relocate the code and continue running from DRAM.
*
* Reserve memory at end of RAM for (top down in that order):
- * - kernel log buffer
+ * - kernel log buffer
* - protected RAM
* - LCD framebuffer
* - monitor code
#ifdef CONFIG_LOGBUFFER
/* reserve kernel log buffer */
addr -= (LOGBUFF_RESERVE);
-# ifdef DEBUG
- printf ("Reserving %ldk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, addr);
-# endif
+ debug ("Reserving %dk for kernel logbuffer at %08lx\n", LOGBUFF_LEN, addr);
#endif
#ifdef CONFIG_PRAM
i = getenv_r ("pram", tmp, sizeof (tmp));
reg = (i > 0) ? simple_strtoul (tmp, NULL, 10) : CONFIG_PRAM;
addr -= (reg << 10); /* size is in kB */
-# ifdef DEBUG
- printf ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
-# endif
+ debug ("Reserving %ldk for protected RAM at %08lx\n", reg, addr);
#endif /* CONFIG_PRAM */
/* round down to next 4 kB limit */
addr &= ~(4096 - 1);
-#ifdef DEBUG
- printf ("Top of RAM usable for U-Boot at: %08lx\n", addr);
-#endif
+ debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
#ifdef CONFIG_LCD
/* reserve memory for LCD display (always full pages) */
/*
* reserve memory for U-Boot code, data & bss
- * round down to next 16 kB limit
+ * round down to next 4 kB limit
*/
addr -= len;
- addr &= ~(16 * 1024 - 1);
+ addr &= ~(4096 - 1);
-#ifdef DEBUG
- printf ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
-#endif
+ debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
#ifdef CONFIG_AMIGAONEG3SE
gd->relocaddr = addr;
* reserve memory for malloc() arena
*/
addr_sp = addr - TOTAL_MALLOC_LEN;
-#ifdef DEBUG
- printf ("Reserving %dk for malloc() at: %08lx\n",
+ debug ("Reserving %dk for malloc() at: %08lx\n",
TOTAL_MALLOC_LEN >> 10, addr_sp);
-#endif
/*
* (permanently) allocate a Board Info struct
addr_sp -= sizeof (bd_t);
bd = (bd_t *) addr_sp;
gd->bd = bd;
-#ifdef DEBUG
- printf ("Reserving %d Bytes for Board Info at: %08lx\n",
+ debug ("Reserving %d Bytes for Board Info at: %08lx\n",
sizeof (bd_t), addr_sp);
-#endif
addr_sp -= sizeof (gd_t);
id = (gd_t *) addr_sp;
-#ifdef DEBUG
- printf ("Reserving %d Bytes for Global Data at: %08lx\n",
+ debug ("Reserving %d Bytes for Global Data at: %08lx\n",
sizeof (gd_t), addr_sp);
-#endif
/*
* Finally, we set up a new (bigger) stack.
addr_sp &= ~0xF;
*((ulong *) addr_sp)-- = 0;
*((ulong *) addr_sp)-- = 0;
-#ifdef DEBUG
- printf ("Stack Pointer at: %08lx\n", addr_sp);
-#endif
+ debug ("Stack Pointer at: %08lx\n", addr_sp);
/*
* Save local variables to board info struct
#endif
#endif
-#ifdef DEBUG
- printf ("New Stack Pointer is: %08lx\n", addr_sp);
-#endif
+ debug ("New Stack Pointer is: %08lx\n", addr_sp);
WATCHDOG_RESET ();
#ifdef CONFIG_POST
post_bootmode_init();
- post_run (NULL, POST_ROM | post_bootmode_get(0));
+ if (post_hotkeys_pressed(gd)) /* Force the long-running tests (memory) */
+ post_run (NULL, POST_ROM | POST_SLOWTEST);
+ else
+ post_run (NULL, POST_ROM | post_bootmode_get(0));
#endif
WATCHDOG_RESET();
void board_init_r (gd_t *id, ulong dest_addr)
{
DECLARE_GLOBAL_DATA_PTR;
-
cmd_tbl_t *cmdtp;
char *s, *e;
bd_t *bd;
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
-#ifdef DEBUG
- printf ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
-#endif
+ debug ("Now running in RAM - U-Boot at: %08lx\n", dest_addr);
WATCHDOG_RESET ();
gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
-
+
monitor_flash_len = (ulong)&__init_end - dest_addr;
/*
* We have to relocate the command table manually
*/
- for (cmdtp = &cmd_tbl[0]; cmdtp->name; cmdtp++) {
+ 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",
/*
* Fill in missing fields of bd_info.
- * We do this here, where we have "normal" access to the
- * environment; we used to do this still running from ROM,
- * where had to use getenv_r(), which can be pretty slow when
- * the environment is in EEPROM.
+ * We do this here, where we have "normal" access to the
+ * environment; we used to do this still running from ROM,
+ * where had to use getenv_r(), which can be pretty slow when
+ * the environment is in EEPROM.
*/
s = getenv ("ethaddr");
#if defined (CONFIG_MBX) || defined (CONFIG_RPXCLASSIC) || defined(CONFIG_IAD210)
defined(CONFIG_COGENT) || \
defined(CONFIG_CPCI405) || \
defined(CONFIG_EVB64260) || \
- defined(CONFIG_HYMOD) || \
defined(CONFIG_KUP4K) || \
defined(CONFIG_LWMON) || \
defined(CONFIG_PCU_E) || \
defined(CONFIG_SPD823TS) )
WATCHDOG_RESET ();
-# ifdef DEBUG
- puts ("Reset Ethernet PHY\n");
-# endif
+ debug ("Reset Ethernet PHY\n");
reset_phy ();
#endif
kgdb_init ();
#endif
-#ifdef DEBUG
- printf ("U-Boot relocated to %08lx\n", dest_addr);
-#endif
+ debug ("U-Boot relocated to %08lx\n", dest_addr);
/*
* Enable Interrupts
#endif
#ifdef CONFIG_POST
- post_run (NULL, POST_RAM | post_bootmode_get(0));
- if (post_bootmode_get(0) & POST_POWERFAIL) {
+ if (gd->post_hotkeys_latch)
+ post_run (NULL, POST_RAM | POST_SLOWTEST);
+ else
+ post_run (NULL, POST_RAM | post_bootmode_get(0));
+ if (post_bootmode_get(0) & POST_SLOWTEST) {
post_bootmode_clear();
board_poweroff();
}