#include <ide.h>
#endif
#include <initcall.h>
+#include <init_helpers.h>
#ifdef CONFIG_PS2KBD
#include <keyboard.h>
#endif
#include <timer.h>
#include <trace.h>
#include <watchdog.h>
-#ifdef CONFIG_CMD_AMBAPP
-#include <ambapp.h>
-#endif
#ifdef CONFIG_ADDR_MAP
#include <asm/mmu.h>
#endif
#include <asm/sections.h>
-#ifdef CONFIG_X86
-#include <asm/init_helpers.h>
-#endif
#include <dm/root.h>
#include <linux/compiler.h>
#include <linux/err.h>
DECLARE_GLOBAL_DATA_PTR;
-#if defined(CONFIG_SPARC)
-extern int prom_init(void);
-#endif
-
ulong monitor_flash_len;
__weak int board_flash_wp_on(void)
return 0;
}
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
static int initr_trap(void)
{
/*
}
#endif
-#ifdef CONFIG_WINBOND_83C553
-static int initr_w83c553f(void)
-{
- /*
- * Initialise the ISA bridge
- */
- initialise_w83c553f();
- return 0;
-}
-#endif
-
static int initr_barrier(void)
{
#ifdef CONFIG_PPC
}
#endif
-#if !defined(CONFIG_SYS_NO_FLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
static int initr_flash(void)
{
ulong flash_size = 0;
{
puts("NAND: ");
nand_init();
+ printf("%lu MiB\n", nand_size() / 1024);
return 0;
}
#endif
}
#endif
-#if defined(CONFIG_STATUS_LED)
+#if defined(CONFIG_LED_STATUS)
static int initr_status_led(void)
{
-#if defined(STATUS_LED_BOOT)
- status_led_set(STATUS_LED_BOOT, STATUS_LED_BLINKING);
+#if defined(CONFIG_LED_STATUS_BOOT)
+ status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_BLINKING);
#else
status_led_init();
#endif
}
#endif
-#if defined(CONFIG_CMD_AMBAPP) && defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
-extern int do_ambapp_print(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
-
-static int initr_ambapp_print(void)
-{
- puts("AMBA:\n");
- do_ambapp_print(NULL, 0, 0, NULL);
-
- return 0;
-}
-#endif
-
-#if defined(CONFIG_SCSI)
+#if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI)
static int initr_scsi(void)
{
puts("SCSI: ");
}
#endif
-#if defined(CONFIG_CMD_DOC)
-static int initr_doc(void)
-{
- puts("DOC: ");
- doc_init();
- return 0;
-}
-#endif
-
#ifdef CONFIG_BITBANGMII
static int initr_bbmii(void)
{
*
* TODO: perhaps reset the watchdog in the initcall function after each call?
*/
-init_fnc_t init_sequence_r[] = {
+static init_fnc_t init_sequence_r[] = {
initr_trace,
initr_reloc,
/* TODO: could x86/PPC have this also perhaps? */
#ifdef CONFIG_NEEDS_MANUAL_RELOC
initr_manual_reloc_cmdtable,
#endif
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_MIPS)
initr_trap,
#endif
#ifdef CONFIG_ADDR_MAP
*/
initr_pci,
#endif
-#ifdef CONFIG_WINBOND_83C553
- initr_w83c553f,
-#endif
#ifdef CONFIG_ARCH_EARLY_INIT_R
arch_early_init_r,
#endif
power_init_board,
-#ifndef CONFIG_SYS_NO_FLASH
+#ifdef CONFIG_MTD_NOR_FLASH
initr_flash,
#endif
INIT_FUNC_WATCHDOG_RESET
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86) || \
- defined(CONFIG_SPARC)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K) || defined(CONFIG_X86)
/* initialize higher level parts of CPU like time base and timers */
cpu_init_r,
#endif
#if defined(CONFIG_MICROBLAZE) || defined(CONFIG_AVR32) || defined(CONFIG_M68K)
timer_init, /* initialize timer */
#endif
-#if defined(CONFIG_STATUS_LED)
+#if defined(CONFIG_LED_STATUS)
initr_status_led,
#endif
/* PPC has a udelay(20) here dating from 2002. Why? */
#ifdef CONFIG_BOARD_LATE_INIT
board_late_init,
#endif
-#if defined(CONFIG_CMD_AMBAPP)
- ambapp_init_reloc,
-#if defined(CONFIG_SYS_AMBAPP_PRINT_ON_STARTUP)
- initr_ambapp_print,
-#endif
-#endif
-#ifdef CONFIG_SCSI
+#if defined(CONFIG_SCSI) && !defined(CONFIG_DM_SCSI)
INIT_FUNC_WATCHDOG_RESET
initr_scsi,
#endif
-#ifdef CONFIG_CMD_DOC
- INIT_FUNC_WATCHDOG_RESET
- initr_doc,
-#endif
#ifdef CONFIG_BITBANGMII
initr_bbmii,
#endif
#endif
#ifdef CONFIG_PS2KBD
initr_kbd,
-#endif
-#if defined(CONFIG_SPARC)
- prom_init,
#endif
run_main_loop,
};
void board_init_r(gd_t *new_gd, ulong dest_addr)
{
+ /*
+ * Set up the new global data pointer. So far only x86 does this
+ * here.
+ * TODO(sjg@chromium.org): Consider doing this for all archs, or
+ * dropping the new_gd parameter.
+ */
+#if CONFIG_IS_ENABLED(X86_64)
+ arch_setup_gd(new_gd);
+#endif
+
#ifdef CONFIG_NEEDS_MANUAL_RELOC
int i;
#endif