]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board_f: Fix printing gd->ram_size and gd->ram_top
authorPali Rohár <pali@kernel.org>
Fri, 9 Sep 2022 15:32:41 +0000 (17:32 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 23 Sep 2022 19:13:18 +0000 (15:13 -0400)
Members gd->ram_size and gd->ram_top are of type phys_addr_t which does not
have to fit into ulong type. So cast them into unsigned long long.

Fixes: 37dc958947ed ("global_data.h: Change ram_top type to phys_addr_t")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/board_f.c

index aee3f56d67ccbd73c13dcf0afa4e013a1c711421..970c8ff67f3f01306060ac1a369d40188c4747ed 100644 (file)
@@ -328,7 +328,7 @@ static int setup_dest_addr(void)
        /*
         * Ram is setup, size stored in gd !!
         */
-       debug("Ram size: %08lX\n", (ulong)gd->ram_size);
+       debug("Ram size: %08llX\n", (unsigned long long)gd->ram_size);
 #if CONFIG_VAL(SYS_MEM_TOP_HIDE)
        /*
         * Subtract specified amount of memory to hide so that it won't
@@ -348,7 +348,7 @@ static int setup_dest_addr(void)
        gd->ram_top = gd->ram_base + get_effective_memsize();
        gd->ram_top = board_get_usable_ram_top(gd->mon_len);
        gd->relocaddr = gd->ram_top;
-       debug("Ram top: %08lX\n", (ulong)gd->ram_top);
+       debug("Ram top: %08llX\n", (unsigned long long)gd->ram_top);
 #if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))
        /*
         * We need to make sure the location we intend to put secondary core