From 7892f619d40f4196e41e7114c5dfee9fad0f572f Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Tue, 30 Jun 2009 17:15:45 -0500 Subject: 8xxx: Rename dma_xfer() to dmacpy() Also update dmacpy()'s argument order to match memcpy's and use phys_addr_t/phy_size_t for address/size arguments Signed-off-by: Peter Tyser Signed-off-by: Kumar Gala --- board/sbc8560/sbc8560.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'board/sbc8560') diff --git a/board/sbc8560/sbc8560.c b/board/sbc8560/sbc8560.c index 7f032c8..f8527f9 100644 --- a/board/sbc8560/sbc8560.c +++ b/board/sbc8560/sbc8560.c @@ -349,29 +349,28 @@ phys_size_t initdram (int board_type) } /* 8K */ - dma_xfer((uint *)0x2000,0x2000,(uint *)0); + dmacpy(0x2000, 0, 0x2000); /* 16K */ - dma_xfer((uint *)0x4000,0x4000,(uint *)0); + dmacpy(0x4000, 0, 0x4000); /* 32K */ - dma_xfer((uint *)0x8000,0x8000,(uint *)0); + dmacpy(0x8000, 0, 0x8000); /* 64K */ - dma_xfer((uint *)0x10000,0x10000,(uint *)0); + dmacpy(0x10000, 0, 0x10000); /* 128k */ - dma_xfer((uint *)0x20000,0x20000,(uint *)0); + dmacpy(0x20000, 0, 0x20000); /* 256k */ - dma_xfer((uint *)0x40000,0x40000,(uint *)0); + dmacpy(0x40000, 0, 0x40000); /* 512k */ - dma_xfer((uint *)0x80000,0x80000,(uint *)0); + dmacpy(0x80000, 0, 0x80000); /* 1M */ - dma_xfer((uint *)0x100000,0x100000,(uint *)0); + dmacpy(0x100000, 0, 0x100000); /* 2M */ - dma_xfer((uint *)0x200000,0x200000,(uint *)0); + dmacpy(0x200000, 0, 0x200000); /* 4M */ - dma_xfer((uint *)0x400000,0x400000,(uint *)0); + dmacpy(0x400000, 0, 0x400000); - for (i = 1; i < dram_size / 0x800000; i++) { - dma_xfer((uint *)(0x800000*i),0x800000,(uint *)0); - } + for (i = 1; i < dram_size / 0x800000; i++) + dmacpy(0x800000 * i, 0, 0x800000); /* Enable errors for ECC */ ddr->err_disable = 0x00000000; -- cgit v1.1 From 79f4333ceb059049b3ee560167d6cbaec493695f Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Tue, 30 Jun 2009 17:15:47 -0500 Subject: 8xxx: Move dma_init() call to common code Signed-off-by: Peter Tyser Signed-off-by: Kumar Gala --- board/sbc8560/sbc8560.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/sbc8560') diff --git a/board/sbc8560/sbc8560.c b/board/sbc8560/sbc8560.c index f8527f9..17f900b 100644 --- a/board/sbc8560/sbc8560.c +++ b/board/sbc8560/sbc8560.c @@ -341,7 +341,7 @@ phys_size_t initdram (int board_type) uint *p = 0; uint i = 0; volatile ccsr_ddr_t *ddr= (void *)(CONFIG_SYS_MPC85xx_DDR_ADDR); - dma_init(); + for (*p = 0; p < (uint *)(8 * 1024); p++) { if (((unsigned int)p & 0x1f) == 0) { dcbz(p); } *p = (unsigned int)0xdeadbeef; -- cgit v1.1 From 0d595f76bc9c7c8dff5bd31dffed87a840a03c56 Mon Sep 17 00:00:00 2001 From: Peter Tyser Date: Tue, 30 Jun 2009 17:15:48 -0500 Subject: fsl_dma: Break out common memory initialization function Signed-off-by: Peter Tyser Signed-off-by: Kumar Gala --- board/sbc8560/sbc8560.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'board/sbc8560') diff --git a/board/sbc8560/sbc8560.c b/board/sbc8560/sbc8560.c index 17f900b..c40b5e3 100644 --- a/board/sbc8560/sbc8560.c +++ b/board/sbc8560/sbc8560.c @@ -338,39 +338,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; -- cgit v1.1