diff options
author | Wolfgang Denk <wd@denx.de> | 2008-06-05 01:12:30 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-06-05 01:12:30 +0200 |
commit | 8155efbd7ae9c65564ca98affe94631d612ae088 (patch) | |
tree | 23f89ba651f48bf88c653796cb64f2c58d2f0515 /board/atmel/atngw100/atngw100.c | |
parent | 5e1882df6a3efc7de5524d28cea4ecde7d163d54 (diff) | |
parent | 9ef1cbef1a649e3779298b0e663be4865cbbbfbc (diff) | |
download | u-boot-imx-8155efbd7ae9c65564ca98affe94631d612ae088.zip u-boot-imx-8155efbd7ae9c65564ca98affe94631d612ae088.tar.gz u-boot-imx-8155efbd7ae9c65564ca98affe94631d612ae088.tar.bz2 |
Merge branch 'master' of ssh://mercury/home/wd/git/u-boot/master
Diffstat (limited to 'board/atmel/atngw100/atngw100.c')
-rw-r--r-- | board/atmel/atngw100/atngw100.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c index 1ccbe2c..c649855 100644 --- a/board/atmel/atngw100/atngw100.c +++ b/board/atmel/atngw100/atngw100.c @@ -25,12 +25,12 @@ #include <asm/sdram.h> #include <asm/arch/clk.h> #include <asm/arch/gpio.h> -#include <asm/arch/hmatrix2.h> +#include <asm/arch/hmatrix.h> 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, @@ -47,8 +47,8 @@ static const struct sdram_info sdram = { int board_early_init_f(void) { - /* Set the SDRAM_ENABLE bit in the HEBI SFR */ - hmatrix2_writel(SFR4, 1 << 1); + /* Enable SDRAM in the EBI mux */ + hmatrix_slave_write(EBI, SFR, HMATRIX_BIT(EBI_SDRAM_ENABLE)); gpio_enable_ebi(); gpio_enable_usart1(); @@ -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) |