tmp is placed in BSS section but BSS section is initialized after
relocation but DDR layout needs to be known before relocation that's
why clear temporary place for DDR sizes.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
#define FDT_REG_SIZE sizeof(u32)
/* Temp location for sharing data for storing */
-u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; /* Up to 64-bit address + 64-bit size */
+static u8 tmp[CONFIG_NR_DRAM_BANKS * 16]; /* Up to 64-bit address + 64-bit size */
void dram_init_banksize(void)
{
const void *blob = gd->fdt_blob;
const u32 *cell;
+ memset(&tmp, 0, sizeof(tmp));
+
/* find or create "/memory" node. */
node = fdt_subnode_offset(blob, 0, "memory");
if (node < 0) {