Commit 8ff21d6d authored by Patrice Chotard's avatar Patrice Chotard Committed by Tom Rini
Browse files

stm32f7: board: Fix memory init

Commit 1473b12a

 ("lib: fdtdec: Update ram_base to store ram start
adddress") brings regression on STM32F7 which can't boot.

Use fdtdec_setup_mem_size_base() to setup memory base and size.
Use fdtdec_setup_memory_banksize() to setup memory bank base and size.
Reported-by: default avatarMark Olsson <>
Signed-off-by: Patrice Chotard's avatarPatrice Chotard <>
Cc: Mark Olsson <>
Reviewed-by: default avatarVikas Manocha <>
parent 673c624c
......@@ -21,25 +21,10 @@
int get_memory_base_size(fdt_addr_t *mr_base, fdt_addr_t *mr_size)
int mr_node;
mr_node = fdt_path_offset(gd->fdt_blob, "/memory");
if (mr_node < 0)
return mr_node;
*mr_base = fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, mr_node,
"reg", 0, mr_size, false);
debug("mr_base = %lx, mr_size= %lx\n", *mr_base, *mr_size);
return 0;
int dram_init(void)
int rv;
fdt_addr_t mr_base, mr_size;
int rv;
struct udevice *dev;
rv = uclass_get_device(UCLASS_RAM, 0, &dev);
if (rv) {
......@@ -48,26 +33,12 @@ int dram_init(void)
rv = get_memory_base_size(&mr_base, &mr_size);
if (rv)
return rv;
gd->ram_size = mr_size;
gd->ram_top = mr_base;
return rv;
return fdtdec_setup_mem_size_base();
int dram_init_banksize(void)
fdt_addr_t mr_base, mr_size;
get_memory_base_size(&mr_base, &mr_size);
* Fill in global info with description of SRAM configuration
gd->bd->bi_dram[0].start = mr_base;
gd->bd->bi_dram[0].size = mr_size;
return 0;
return fdtdec_setup_memory_banksize();
int board_early_init_f(void)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment