diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-05-19 11:36:28 +0200 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-05-27 15:27:31 +0200 |
commit | a23e277c4a3a2bbc42d237aae29da3a8971e757f (patch) | |
tree | 22e2e0bc2559d38166e1d1844c9a8ac0429b0475 /board/atmel/atngw100/atngw100.c | |
parent | 95107b7c028806919630bf02c653aa8f4f867c94 (diff) | |
download | u-boot-imx-a23e277c4a3a2bbc42d237aae29da3a8971e757f.zip u-boot-imx-a23e277c4a3a2bbc42d237aae29da3a8971e757f.tar.gz u-boot-imx-a23e277c4a3a2bbc42d237aae29da3a8971e757f.tar.bz2 |
avr32: Rework SDRAM initialization code
This cleans up the SDRAM initialization and related code a bit, and
allows faster booting.
* Add definitions for EBI and internal SRAM to asm/arch/memory-map.h
* Remove memory test from sdram_init() and make caller responsible
for verifying the SDRAM and determining its size.
* Remove base_address member from struct sdram_config (was sdram_info)
* Add data_bits member to struct sdram_config and kill CFG_SDRAM_16BIT
* Add support for a common STK1000 hack: 16MB SDRAM instead of 8.
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Diffstat (limited to 'board/atmel/atngw100/atngw100.c')
-rw-r--r-- | board/atmel/atngw100/atngw100.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c index 3ff6f0f..c649855 100644 --- a/board/atmel/atngw100/atngw100.c +++ b/board/atmel/atngw100/atngw100.c @@ -29,8 +29,8 @@ DECLARE_GLOBAL_DATA_PTR; -static const struct sdram_info sdram = { - .phys_addr = CFG_SDRAM_BASE, +static const struct sdram_config sdram_config = { + .data_bits = SDRAM_DATA_16BIT, .row_bits = 13, .col_bits = 9, .bank_bits = 2, @@ -66,7 +66,22 @@ int board_early_init_f(void) long int initdram(int board_type) { - return sdram_init(&sdram); + unsigned long expected_size; + unsigned long actual_size; + void *sdram_base; + + sdram_base = map_physmem(EBI_SDRAM_BASE, EBI_SDRAM_SIZE, MAP_NOCACHE); + + expected_size = sdram_init(sdram_base, &sdram_config); + actual_size = get_ram_size(sdram_base, expected_size); + + unmap_physmem(sdram_base, EBI_SDRAM_SIZE); + + if (expected_size != actual_size) + printf("Warning: Only %u of %u MiB SDRAM is working\n", + actual_size >> 20, expected_size >> 20); + + return actual_size; } void board_init_info(void) |