diff options
author | Wolfgang Denk <wd@denx.de> | 2008-04-29 20:06:42 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-04-29 20:06:42 +0200 |
commit | 84666476841cef3ef6df5c5a2a110d43b0936999 (patch) | |
tree | 7db6eed156c8b285651f00155f7dd8407a7ab49d /board/lwmon5/sdram.c | |
parent | 3a427fd2ec3d980875a25327955c34a2de0b494c (diff) | |
parent | f4c4d21a885ccc222fd0acdf653b683249e85117 (diff) | |
download | u-boot-imx-84666476841cef3ef6df5c5a2a110d43b0936999.zip u-boot-imx-84666476841cef3ef6df5c5a2a110d43b0936999.tar.gz u-boot-imx-84666476841cef3ef6df5c5a2a110d43b0936999.tar.bz2 |
Merge branch 'master' of git://www.denx.de/git/u-boot-ppc4xx
Diffstat (limited to 'board/lwmon5/sdram.c')
-rw-r--r-- | board/lwmon5/sdram.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/board/lwmon5/sdram.c b/board/lwmon5/sdram.c index 7c3cf49..36b5100 100644 --- a/board/lwmon5/sdram.c +++ b/board/lwmon5/sdram.c @@ -34,6 +34,7 @@ #include <asm/processor.h> #include <asm/mmu.h> #include <asm/io.h> +#include <asm/cache.h> #include <ppc440.h> #include <watchdog.h> @@ -59,7 +60,6 @@ extern int denali_wait_for_dlllock(void); extern void denali_core_search_data_eye(void); extern void dcbz_area(u32 start_address, u32 num_bytes); -extern void dflush(void); static u32 is_ecc_enabled(void) { @@ -106,6 +106,7 @@ static void program_ecc(u32 start_address, { u32 val; u32 current_addr = start_address; + u32 size; int bytes_remaining; sync(); @@ -123,12 +124,18 @@ static void program_ecc(u32 start_address, * watchdog. */ while (bytes_remaining > 0) { - dcbz_area(current_addr, min((64 << 20), bytes_remaining)); + size = min((64 << 20), bytes_remaining); + + /* Write zero's to SDRAM */ + dcbz_area(current_addr, size); + + /* Write modified dcache lines back to memory */ + clean_dcache_range(current_addr, current_addr + size); + current_addr += 64 << 20; bytes_remaining -= 64 << 20; WATCHDOG_RESET(); } - dflush(); sync(); wait_ddr_idle(); |