lib: fdtdec: Update ram_base to store ram start adddress
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Mon, 16 Jul 2018 10:26:10 +0000 (15:56 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Jul 2018 08:49:56 +0000 (10:49 +0200)
This patch updates the ram_base to store the start address of
the first bank DRAM and the use this ram_base to calculate ram_top
properly. This patch fixes the erroneous calculation of ram_top
incase of non zero ram start address.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/board_f.c
lib/fdtdec.c

index e943347ce3dfdf32a6f9b8dc233833539295da66..88d770071c38ccb26081f0c0750116f63f8a1f70 100644 (file)
@@ -281,9 +281,9 @@ static int setup_dest_addr(void)
        gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
 #endif
 #ifdef CONFIG_SYS_SDRAM_BASE
-       gd->ram_top = CONFIG_SYS_SDRAM_BASE;
+       gd->ram_base = CONFIG_SYS_SDRAM_BASE;
 #endif
-       gd->ram_top += get_effective_memsize();
+       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);
index 1b0c430945a937661c791d26fe3d97034606754f..66dff0f906b71bd79ca9df7f28a95e73120ed8d1 100644 (file)
@@ -1173,6 +1173,7 @@ int fdtdec_setup_memory_size(void)
        }
 
        gd->ram_size = (phys_size_t)(res.end - res.start + 1);
+       gd->ram_base = (unsigned long)res.start;
        debug("%s: Initial DRAM size %llx\n", __func__,
              (unsigned long long)gd->ram_size);