diff options
author | Simon Glass <sjg@chromium.org> | 2011-06-09 12:27:37 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:39:20 -0700 |
commit | 0d031f4966d90bc041269f32318dbbbfc138d1de (patch) | |
tree | b28029ed692d06401772ac91be0de25f4154a7be /arch/arm/lib | |
parent | e255747c6a08c18084df0ba3a10484cbf7c9f639 (diff) |
Compile cache_disable() with -O2 to avoid failure
It is good to have these functions written in C instead of assembler,
but with -O0 the cache_disable() function doesn't return. Rather than
change it, this fix just forces this to be built with -O2.
BUG=chromium-os:14082
TEST=build U-Boot with -O0 in the top-level config.mk, run and type:
'dcache off' and see that it doesn't hang.
Change-Id: I22d0b0828cadae38f378535a34ecfb1e4eed4b39
Reviewed-on: http://gerrit.chromium.org/gerrit/2401
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r-- | arch/arm/lib/cache-cp15.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c index cc40124d8c..614d3dcde3 100644 --- a/arch/arm/lib/cache-cp15.c +++ b/arch/arm/lib/cache-cp15.c @@ -142,6 +142,16 @@ static void cache_enable(uint32_t cache_bit) set_cr(reg | cache_bit); } +/* + * Big hack warning! + * + * Devs like to compile with -O0 to get a nice debugging illusion. But this + * function does not survive that since -O0 causes the compiler to read the + * PC back from the stack after the dcache flush. Might it be possible to fix + * this by flushing the write buffer? + */ +static void cache_disable(uint32_t cache_bit) __attribute__ ((optimize(2))); + /* cache_bit must be either CR_I or CR_C */ static void cache_disable(uint32_t cache_bit) { |