cmd_fdt: Actually fix fdt command in sandbox
authorJoe Hershberger <joe.hershberger@ni.com>
Thu, 5 Feb 2015 03:56:53 +0000 (21:56 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 18 Feb 2015 03:19:16 +0000 (20:19 -0700)
Commit 90bac29a76bc8d649b41a55f2786c0abef9bb2c1 claims to fix this bug
that was introduced in commit a92fd6577ea17751ead9b50243e3c562125cf581
but doesn't actually make the change that the commit message describes.

Actually fix the bug this time.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
common/bootm.c
common/cmd_fdt.c
common/image-fdt.c
include/fdt_support.h

index e2dc16486b3bf0dba90c736bba3cd3a7a0a762ee..34f60bbb5319e0fe8bea2c8ac0c5db85fdcae76f 100644 (file)
@@ -233,7 +233,7 @@ static int bootm_find_fdt(int flag, int argc, char * const argv[])
                return 1;
        }
 
-       set_working_fdt_addr(images.ft_addr);
+       set_working_fdt_addr((ulong)images.ft_addr);
 
        return 0;
 }
index dc59fab8280dc57f0ae546ad552215dea0d99774..58784965750e9f66ad36f651883e062a4beb68a1 100644 (file)
@@ -38,13 +38,13 @@ static int is_printable_string(const void *data, int len);
  */
 struct fdt_header *working_fdt;
 
-void set_working_fdt_addr(void *addr)
+void set_working_fdt_addr(ulong addr)
 {
        void *buf;
 
-       buf = map_sysmem((ulong)addr, 0);
+       buf = map_sysmem(addr, 0);
        working_fdt = buf;
-       setenv_addr("fdtaddr", addr);
+       setenv_ulong("fdtaddr", addr);
 }
 
 /*
@@ -123,7 +123,7 @@ static int do_fdt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
                if (control)
                        gd->fdt_blob = blob;
                else
-                       set_working_fdt_addr((void *)blob);
+                       set_working_fdt_addr(addr);
 
                if (argc >= 2) {
                        int  len;
index e3f06cdd1a28406e8a1a2613d543b71c27d44942..d9e47283c716c4d47b709e1390a78dd376f95b08 100644 (file)
@@ -190,7 +190,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size)
        *of_flat_tree = of_start;
        *of_size = of_len;
 
-       set_working_fdt_addr(*of_flat_tree);
+       set_working_fdt_addr((ulong)*of_flat_tree);
        return 0;
 
 error:
index 1f19fe4c9622a84c365f500ff80b2b72bb61baf1..ae5e8a3ef6366f2d5ad29b5a0a788170b5b668a9 100644 (file)
@@ -100,7 +100,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
  */
 int ft_system_setup(void *blob, bd_t *bd);
 
-void set_working_fdt_addr(void *addr);
+void set_working_fdt_addr(ulong addr);
 int fdt_shrink_to_minimum(void *blob);
 int fdt_increase_size(void *fdt, int add_len);