X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fboard_r.c;h=551429c8431fe5a0ab0d322b0e68872a3e0d7963;hb=fe5d1abcf47b2419f69d722deea902c0d44842e7;hp=602a239380d02951793b1d6cb34cc1c5be686f37;hpb=304f936aeaab0c3cc9d5af438fd3498ac7682991;p=u-boot diff --git a/common/board_r.c b/common/board_r.c index 602a239380..551429c843 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -133,7 +133,7 @@ static int initr_reloc_global_data(void) { #ifdef __ARM__ monitor_flash_len = _end - __image_copy_start; -#elif !defined(CONFIG_SANDBOX) +#elif !defined(CONFIG_SANDBOX) && !defined(CONFIG_NIOS2) monitor_flash_len = (ulong)&__init_end - gd->relocaddr; #endif #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) @@ -259,6 +259,10 @@ static int initr_malloc(void) { 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), @@ -269,27 +273,10 @@ static int initr_malloc(void) #ifdef CONFIG_DM static int initr_dm(void) { - int ret; - - ret = dm_init(); - if (ret) { - debug("dm_init() failed: %d\n", ret); - return ret; - } - ret = dm_scan_platdata(); - if (ret) { - debug("dm_scan_platdata() failed: %d\n", ret); - return ret; - } -#ifdef CONFIG_OF_CONTROL - ret = dm_scan_fdt(gd->fdt_blob); - if (ret) { - debug("dm_scan_fdt() failed: %d\n", ret); - return ret; - } -#endif - - return 0; + /* 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 @@ -588,21 +575,19 @@ static int initr_status_led(void) #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 @@ -927,7 +912,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) int i; #endif -#ifndef CONFIG_X86 +#if !defined(CONFIG_X86) && !defined(CONFIG_ARM) && !defined(CONFIG_ARM64) gd = new_gd; #endif