omap3: fix bi_dram initialization when CONFIG_NR_DRAM_BANKS is 1
PATCH 1/1 omap3: fix bi_dram initialization when CONFIG_NR_DRAM_BANKS is 1
When CONFIG_NR_DRAM_BANKS is 1 gd->bd->bi_dram[1] assignment exceeds bi_dram array bounds. Perform it only if CONFIG_NR_DRAM_BANKS is greater than 1.
--- cpu/arm_cortexa8/omap3/board.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
cpu/arm_cortexa8/omap3/board.c +3 -0
@@ -291,8 +291,11 @@ int dram_init(void) gd->bd->bi_dram[0 ].start =PHYS_SDRAM_1 ; gd->bd->bi_dram[0 ].size = size0; + +#if (CONFIG_NR_DRAM_BANKS >1 ) gd->bd->bi_dram[1 ].start =PHYS_SDRAM_1 +get_sdr_cs_offset (CS1 ); gd->bd->bi_dram[1 ].size = size1; +#endif return 0 ; }
Signature · 1 line
1.6.0.6
Paulraj
PATCH 1/1 omap3: fix bi_dram initialization when CONFIG_NR_DRAM_BANKS is 1
Quoted 18 lines
When
CONFIG_NR_DRAM_BANKSis 1 gd->bd->bi_dram[1] assignment exceedsbi_dramarray bounds. Perform it only ifCONFIG_NR_DRAM_BANKSis greater than 1.Signed-off-by Mike Rapoport <[email protected]>--- cpu/arm_cortexa8/omap3/board.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)cpu/arm_cortexa8/omap3/board.c +0
-0@@ -291,8 +291,11 @@ int dram_init(void)
cpu/arm_cortexa8/omap3/board.c int dram_init(void) · line 301
Quoted 10 lines
cpu/arm_cortexa8/omap3/board.c +3
-0gd->bd->bi_dram[0 ].start =PHYS_SDRAM_1 ; gd->bd->bi_dram[0 ].size = size0; + +#if (CONFIG_NR_DRAM_BANKS >1 ) gd->bd->bi_dram[1 ].start =PHYS_SDRAM_1 +get_sdr_cs_offset (CS1 ); gd->bd->bi_dram[1 ].size = size1; +#endif return 0 ; }
This is fine with me. The only issue is of late we have been having issues with OAMP3 boards not booting properly. This is probably due to changes that were made when some patches were added to u-boot-ti.
I think I'll add this when we get to the bottom of the above issues.
Thanks,
Sandeep