summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 612404c)
raw | patch | inline | side by side (parent: 612404c)
author | Arun Mankuzhi <arun.m@samsung.com> | |
Fri, 30 Nov 2012 13:01:14 +0000 (13:01 +0000) | ||
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | |
Thu, 10 Jan 2013 21:21:27 +0000 (22:21 +0100) |
In Cortex-A15 architecture, when we run cache invalidate
the cache clean operation executes automatically.
So if there are any dirty cache lines before disabling the L2 cache
these will be synchronized with the main memory when
invalidate_dcache_all() runs in the last part of U-boot
The two functions after flush_dcache_all is using the stack. So this
data will be on the cache. After disable when invalidate is called the
data will be flushed from cache to memory. This corrupts the stack in
invalida_dcache_all. So this change is required to avoid the u-boot
hang.
So flush has to be done just before clearing CR_C bit
Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
the cache clean operation executes automatically.
So if there are any dirty cache lines before disabling the L2 cache
these will be synchronized with the main memory when
invalidate_dcache_all() runs in the last part of U-boot
The two functions after flush_dcache_all is using the stack. So this
data will be on the cache. After disable when invalidate is called the
data will be flushed from cache to memory. This corrupts the stack in
invalida_dcache_all. So this change is required to avoid the u-boot
hang.
So flush has to be done just before clearing CR_C bit
Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
arch/arm/lib/cache-cp15.c | patch | blob | history |
index 6edf815d4d7b85f9b6197260b9b870acb01b586f..1cab27c22629fe5bd034d8278efa8d09e36f7378 100644 (file)
return;
/* if disabling data cache, disable mmu too */
cache_bit |= CR_M;
- flush_dcache_all();
}
+ reg = get_cr();
+ cp_delay();
+ if (cache_bit == (CR_C | CR_M))
+ flush_dcache_all();
set_cr(reg & ~cache_bit);
}
#endif