From 66c98a0c3807720a32ce49c9ba2a5808555062d7 Mon Sep 17 00:00:00 2001 From: Vitaly Andrianov Date: Wed, 11 Feb 2015 14:07:58 -0500 Subject: keystone2: ddr3: eliminate using global ddr3_size variable KS2 ddr3 initialization uses ddr3_size global variable before u-boot relocation. Even if the variable is not being used after relocation, writing to it corrupts relocation table. This patch removes the global ddr3_size variable and uses local one instead. Signed-off-by: Vitaly Andrianov Tested-by: Nishanth Menon --- board/ti/ks2_evm/board.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'board/ti/ks2_evm/board.c') diff --git a/board/ti/ks2_evm/board.c b/board/ti/ks2_evm/board.c index 04ec675103..8892a2843d 100644 --- a/board/ti/ks2_evm/board.c +++ b/board/ti/ks2_evm/board.c @@ -35,12 +35,14 @@ static struct aemif_config aemif_configs[] = { int dram_init(void) { - ddr3_init(); + u32 ddr3_size; + + ddr3_size = ddr3_init(); gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, CONFIG_MAX_RAM_BANK_SIZE); aemif_init(ARRAY_SIZE(aemif_configs), aemif_configs); - ddr3_init_ecc(KS2_DDR3A_EMIF_CTRL_BASE); + ddr3_init_ecc(KS2_DDR3A_EMIF_CTRL_BASE, ddr3_size); return 0; } -- cgit v1.2.1