X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=cmd%2Fspl.c;h=3b8992a16364c8a3f9e6c234bbc5870554673d19;hb=refs%2Fheads%2Fmaster;hp=057764aa8d984c323f4df96e170ecae20f5921f7;hpb=d82477748d641e60ba3e1a0b55d98362aed70f80;p=people%2Fms%2Fu-boot.git diff --git a/cmd/spl.c b/cmd/spl.c index 057764aa8d..3b8992a163 100644 --- a/cmd/spl.c +++ b/cmd/spl.c @@ -8,6 +8,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -108,16 +109,23 @@ static int spl_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) 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)) { + if ((c) && ((long)c->cmd <= SPL_EXPORT_LAST)) { argc -= 2; argv += 2; - if (call_bootm(argc, argv, subcmd_list[(int)c->cmd])) + if (call_bootm(argc, argv, subcmd_list[(long)c->cmd])) return -1; - switch ((int)c->cmd) { + switch ((long)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)); +#ifdef CONFIG_CMD_SPL_WRITE_SIZE + if (fdt_totalsize(images.ft_addr) > + CONFIG_CMD_SPL_WRITE_SIZE) + puts("WARN: FDT size > CMD_SPL_WRITE_SIZE\n"); +#endif break; #endif case SPL_EXPORT_ATAGS: @@ -147,7 +155,7 @@ static int do_spl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) c = find_cmd_tbl(argv[1], &cmd_spl_sub[0], ARRAY_SIZE(cmd_spl_sub)); if (c) { - cmd = (int)c->cmd; + cmd = (long)c->cmd; switch (cmd) { case SPL_EXPORT: argc--;