From: Michal Simek Date: Mon, 22 Feb 2016 09:22:31 +0000 (+0100) Subject: ARM64: zynqmp: Clear temporary place for storing DDR sizes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd828220df4cec2c192582ef8c02725a0d5768ac;p=thirdparty%2Fu-boot.git ARM64: zynqmp: Clear temporary place for storing DDR sizes 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 --- diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c index 303b132c9a7..232ac67ee3d 100644 --- a/board/xilinx/zynqmp/zynqmp.c +++ b/board/xilinx/zynqmp/zynqmp.c @@ -135,7 +135,7 @@ static phys_size_t fdt_get_reg(const void *fdt, int nodeoffset, void *buf, #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) { @@ -157,6 +157,8 @@ int dram_init(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) {