]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
microblaze: board: Check return value whlie saving env variables
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Tue, 22 Sep 2020 11:18:53 +0000 (05:18 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 27 Oct 2020 07:01:36 +0000 (08:01 +0100)
Check and print warning if run time env variables are not saved.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
board/xilinx/microblaze-generic/microblaze-generic.c

index 4e569e910d905bac7a0031eb0121114440f97ac2..724c33987ba430675c649e4cab5b3fe4b23acd10 100644 (file)
@@ -37,6 +37,7 @@ int dram_init(void)
 int board_late_init(void)
 {
        ulong max_size, lowmem_size;
+       u32 status = 0;
 
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYSRESET_MICROBLAZE)
        int ret;
@@ -58,9 +59,12 @@ int board_late_init(void)
        /* Linux default LOWMEM_SIZE is 0x30000000 = 768MB */
        lowmem_size = gd->ram_base + 768 * 1024 * 1024;
 
-       env_set_addr("initrd_high", (void *)min_t(ulong, max_size,
-                                                 lowmem_size));
-       env_set_addr("fdt_high", (void *)min_t(ulong, max_size, lowmem_size));
+       status |= env_set_addr("initrd_high", (void *)min_t(ulong, max_size,
+                               lowmem_size));
+       status |= env_set_addr("fdt_high", (void *)min_t(ulong, max_size,
+                               lowmem_size));
+       if (status)
+               printf("%s: Saving run time variables FAILED\n", __func__);
 
        return 0;
 }