static int initr_env(void) { /* initialize environment */ if (should_load_env()) env_relocate(); else set_default_env(NULL); #ifdef CONFIG_OF_CONTROL env_set_addr("fdtcontroladdr", gd->fdt_blob); #endif /* Initialize from environment */ load_addr = env_get_ulong("loadaddr", 16, load_addr); return 0; }
static int spl_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { const cmd_tbl_t *c; if (argc < 2) /* no subcommand */ return cmd_usage(cmdtp); c = find_cmd_tbl(argv[1], &cmd_spl_export_sub[0], ARRAY_SIZE(cmd_spl_export_sub)); if ((c) && ((int)c->cmd <= SPL_EXPORT_LAST)) { argc -= 2; argv += 2; if (call_bootm(argc, argv, subcmd_list[(int)c->cmd])) return -1; switch ((int)c->cmd) { #ifdef CONFIG_OF_LIBFDT case SPL_EXPORT_FDT: printf("Argument image is now in RAM: 0x%p\n", (void *)images.ft_addr); env_set_addr("fdtargsaddr", images.ft_addr); env_set_hex("fdtargslen", fdt_totalsize(images.ft_addr)); if (fdt_totalsize(images.ft_addr) > CONFIG_CMD_SPL_WRITE_SIZE) puts("WARN: FDT size > CMD_SPL_WRITE_SIZE\n"); break; #endif case SPL_EXPORT_ATAGS: printf("Argument image is now in RAM at: 0x%p\n", (void *)gd->bd->bi_boot_params); break; } } else { /* Unrecognized command */ return cmd_usage(cmdtp); } return 0; }