Commit 1473b12ad0b33771ded1b2fd6b73d2cd6d73b8f7

Authored by Siva Durga Prasad Paladugu
Committed by Michal Simek
1 parent f4da871a7f

lib: fdtdec: Update ram_base to store ram start adddress

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>

Showing 2 changed files with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -281,9 +281,9 @@
281 281 gd->ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
282 282 #endif
283 283 #ifdef CONFIG_SYS_SDRAM_BASE
284   - gd->ram_top = CONFIG_SYS_SDRAM_BASE;
  284 + gd->ram_base = CONFIG_SYS_SDRAM_BASE;
285 285 #endif
286   - gd->ram_top += get_effective_memsize();
  286 + gd->ram_top = gd->ram_base + get_effective_memsize();
287 287 gd->ram_top = board_get_usable_ram_top(gd->mon_len);
288 288 gd->relocaddr = gd->ram_top;
289 289 debug("Ram top: %08lX\n", (ulong)gd->ram_top);
... ... @@ -1173,6 +1173,7 @@
1173 1173 }
1174 1174  
1175 1175 gd->ram_size = (phys_size_t)(res.end - res.start + 1);
  1176 + gd->ram_base = (unsigned long)res.start;
1176 1177 debug("%s: Initial DRAM size %llx\n", __func__,
1177 1178 (unsigned long long)gd->ram_size);
1178 1179