#ifdef CONFIG_HAS_DATAFLASH
#include <dataflash.h>
#endif
+#include <dm.h>
#include <environment.h>
#include <fdtdec.h>
#if defined(CONFIG_CMD_IDE)
#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;
static int initr_reloc_global_data(void)
{
-#ifdef CONFIG_SYS_SYM_OFFSETS
- monitor_flash_len = _end_ofs;
-#elif !defined(CONFIG_SANDBOX)
+#ifdef __ARM__
+ monitor_flash_len = _end - __image_copy_start;
+#elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2)
monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
#endif
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
{
ulong malloc_start;
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+ debug("Pre-reloc malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
+ gd->malloc_ptr / 1024);
+#endif
/* The malloc area is immediately below the monitor copy in DRAM */
malloc_start = gd->relocaddr - TOTAL_MALLOC_LEN;
mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN),
return 0;
}
+#ifdef CONFIG_DM
+static int initr_dm(void)
+{
+ /* Save the pre-reloc driver model and start a new one */
+ gd->dm_root_f = gd->dm_root;
+ gd->dm_root = NULL;
+ return dm_init_and_scan(false);
+}
+#endif
+
__weak int power_init_board(void)
{
return 0;
# else
checkboard();
# endif
+ return 0;
}
#endif
#if defined(CONFIG_CMD_SCSI)
static int initr_scsi(void)
{
- /* Not supported properly on ARM yet */
-#ifndef CONFIG_ARM
puts("SCSI: ");
scsi_init();
-#endif
return 0;
}
-#endif /* CONFIG_CMD_NET */
+#endif
#if defined(CONFIG_CMD_DOC)
static int initr_doc(void)
{
puts("DOC: ");
doc_init();
+ return 0;
}
#endif
}
#endif
-#ifdef CONFIG_MODEM_SUPPORT
-static int initr_modem(void)
-{
- /* TODO: with new initcalls, move this into the driver */
- extern int do_mdm_init;
-
- do_mdm_init = gd->do_mdm_init;
- return 0;
-}
-#endif
-
static int run_main_loop(void)
{
#ifdef CONFIG_SANDBOX
initr_barrier,
initr_malloc,
bootstage_relocate,
+#ifdef CONFIG_DM
+ initr_dm,
+#endif
#ifdef CONFIG_ARCH_EARLY_INIT_R
arch_early_init_r,
#endif
#endif
#ifdef CONFIG_PS2KBD
initr_kbd,
-#endif
-#ifdef CONFIG_MODEM_SUPPORT
- initr_modem,
#endif
run_main_loop,
};