diff options
author | Peter Tyser <ptyser@xes-inc.com> | 2009-06-30 17:15:48 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-07-01 23:12:01 -0500 |
commit | 0d595f76bc9c7c8dff5bd31dffed87a840a03c56 (patch) | |
tree | fe9fd5c24c569893155ae2c52257c6402351af9b /board/mpc8540eval/mpc8540eval.c | |
parent | 79f4333ceb059049b3ee560167d6cbaec493695f (diff) | |
download | u-boot-imx-0d595f76bc9c7c8dff5bd31dffed87a840a03c56.zip u-boot-imx-0d595f76bc9c7c8dff5bd31dffed87a840a03c56.tar.gz u-boot-imx-0d595f76bc9c7c8dff5bd31dffed87a840a03c56.tar.bz2 |
fsl_dma: Break out common memory initialization function
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/mpc8540eval/mpc8540eval.c')
-rw-r--r-- | board/mpc8540eval/mpc8540eval.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/board/mpc8540eval/mpc8540eval.c b/board/mpc8540eval/mpc8540eval.c index 04a7470..7c27233 100644 --- a/board/mpc8540eval/mpc8540eval.c +++ b/board/mpc8540eval/mpc8540eval.c @@ -137,39 +137,9 @@ phys_size_t initdram (int board_type) { /* Initialize all of memory for ECC, then * enable errors */ - uint *p = 0; - uint i = 0; volatile ccsr_ddr_t *ddr= (void *)(CONFIG_SYS_MPC85xx_DDR_ADDR); - for (*p = 0; p < (uint *)(8 * 1024); p++) { - if (((unsigned int)p & 0x1f) == 0) { dcbz(p); } - *p = (unsigned int)0xdeadbeef; - if (((unsigned int)p & 0x1c) == 0x1c) { dcbf(p); } - } - - /* 8K */ - dmacpy(0x2000, 0, 0x2000); - /* 16K */ - dmacpy(0x4000, 0, 0x4000); - /* 32K */ - dmacpy(0x8000, 0, 0x8000); - /* 64K */ - dmacpy(0x10000, 0, 0x10000); - /* 128k */ - dmacpy(0x20000, 0, 0x20000); - /* 256k */ - dmacpy(0x40000, 0, 0x40000); - /* 512k */ - dmacpy(0x80000, 0, 0x80000); - /* 1M */ - dmacpy(0x100000, 0, 0x100000); - /* 2M */ - dmacpy(0x200000, 0, 0x200000); - /* 4M */ - dmacpy(0x400000, 0, 0x400000); - - for (i = 1; i < dram_size / 0x800000; i++) - dmacpy(0x800000 * i, 0, 0x800000); + dma_meminit(CONFIG_MEM_INIT_VALUE, dram_size); /* Enable errors for ECC */ ddr->err_disable = 0x00000000; |