]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ARM64: zynqmp: Clear temporary place for storing DDR sizes
authorMichal Simek <michal.simek@xilinx.com>
Mon, 22 Feb 2016 09:22:31 +0000 (10:22 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 23 Feb 2016 08:13:15 +0000 (09:13 +0100)
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>
board/xilinx/zynqmp/zynqmp.c

index 303b132c9a78d175bea7c8ca5887bce42af95e25..232ac67ee3de0f4e9d59344603f46611b09cf935 100644 (file)
@@ -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) {