diff options
author | Gerlando Falauto <gerlando.falauto@keymile.com> | 2012-07-25 06:23:48 +0000 |
---|---|---|
committer | Prafulla Wadaskar <prafulla@marvell.com> | 2012-10-03 16:43:13 +0530 |
commit | b3168f4be86ef02905281ff7531960112e10cc7e (patch) | |
tree | bd5b68951292adc14ffdf59943419f0b01954be8 /arch/arm/cpu/arm926ejs | |
parent | 455151652524570d7c5b320718c7004e63e01656 (diff) | |
download | u-boot-imx-b3168f4be86ef02905281ff7531960112e10cc7e.zip u-boot-imx-b3168f4be86ef02905281ff7531960112e10cc7e.tar.gz u-boot-imx-b3168f4be86ef02905281ff7531960112e10cc7e.tar.bz2 |
kirkwood: implement kw_sdram_size_adjust
Size of the SDRAM chips might differ between any two (otherwise
identical) instances of the same board.
So add a function kw_sdram_size_adjust() which reads out the current
ram size for a given bank, and adjusts the Kirkwood's SDRAM window size
register accordingly.
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Diffstat (limited to 'arch/arm/cpu/arm926ejs')
-rw-r--r-- | arch/arm/cpu/arm926ejs/kirkwood/dram.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm926ejs/kirkwood/dram.c b/arch/arm/cpu/arm926ejs/kirkwood/dram.c index 5e2f9d8..807894f 100644 --- a/arch/arm/cpu/arm926ejs/kirkwood/dram.c +++ b/arch/arm/cpu/arm926ejs/kirkwood/dram.c @@ -97,6 +97,17 @@ u32 kw_sdram_bs(enum memory_bank bank) return result; } +void kw_sdram_size_adjust(enum memory_bank bank) +{ + u32 size; + + /* probe currently equipped RAM size */ + size = get_ram_size((void *)kw_sdram_bar(bank), kw_sdram_bs(bank)); + + /* adjust SDRAM window size accordingly */ + kw_sdram_bs_set(bank, size); +} + #ifndef CONFIG_SYS_BOARD_DRAM_INIT int dram_init(void) { |