Merge branch '2021-02-02-drop-asm_global_data-when-unused'
[platform/kernel/u-boot.git] / arch / riscv / cpu / fu540 / dram.c
index cec130e..1fdc783 100644 (file)
@@ -23,7 +23,6 @@ int dram_init_banksize(void)
 
 ulong board_get_usable_ram_top(ulong total_size)
 {
-#ifdef CONFIG_64BIT
        /*
         * Ensure that we run from first 4GB so that all
         * addresses used by U-Boot are 32bit addresses.
@@ -32,8 +31,8 @@ ulong board_get_usable_ram_top(ulong total_size)
         * devices work fine because DMA mapping APIs will
         * provide 32bit DMA addresses only.
         */
-       if (gd->ram_top > SZ_4G)
-               return SZ_4G;
-#endif
+       if (gd->ram_top >= SZ_4G)
+               return SZ_4G - 1;
+
        return gd->ram_top;
 }