All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure
@ 2012-11-01 23:42 Simon Glass
  2012-11-01 23:42 ` [U-Boot] [PATCH 02/10] arm: move flush_dcache_all() to just before disable cache Simon Glass
                   ` (10 more replies)
  0 siblings, 11 replies; 29+ messages in thread
From: Simon Glass @ 2012-11-01 23:42 UTC (permalink / raw)
  To: u-boot

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
revert to assembler, this fix just forces this to be built with -O2.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 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 939de10..8f8385d 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -110,6 +110,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)
 {
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2013-01-18 13:29 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-01 23:42 [U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 02/10] arm: move flush_dcache_all() to just before disable cache Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 03/10] arm: Keep track of the tlb size as well as its location Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 04/10] arm: Move fdt check earlier so that board_early_init_f() can use it Simon Glass
2012-11-03 14:56   ` Wolfgang Denk
2012-11-03 21:53     ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 05/10] arm: Add CONFIG_DELAY_ENVIRONMENT to delay environment loading Simon Glass
2012-11-03 12:30   ` Wolfgang Denk
2012-11-07  0:16     ` Simon Glass
2013-01-18 12:06   ` Lucas Stach
2013-01-18 13:29     ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 06/10] arm: Add CONFIG_DISPLAY_BOARDINFO_LATE to display board info on LCD Simon Glass
2012-11-03 12:33   ` Wolfgang Denk
2012-11-15 22:37     ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 07/10] arm: Add option to display customised memory information Simon Glass
2012-11-03 14:54   ` Wolfgang Denk
2012-11-15 22:45     ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 08/10] arm: Make interrupts.o and reset.o in libarm also appear in SPL Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 09/10] arm: Move bootstage record for board_init_f() to after arch_cpu_init() Simon Glass
2012-11-03 14:55   ` Wolfgang Denk
2012-11-07  0:51     ` Simon Glass
2012-11-07 13:18       ` Wolfgang Denk
2012-11-22 14:57         ` Simon Glass
2012-11-01 23:42 ` [U-Boot] [PATCH 10/10] arm: Tabify code for MMC initialization Simon Glass
2012-11-03  8:32 ` [U-Boot] [PATCH 01/10] arm: Compile cache_disable() with -O2 to avoid failure Marek Vasut
2012-11-03 12:29 ` Wolfgang Denk
2012-11-07  0:45   ` Simon Glass
2012-11-07 12:55     ` Wolfgang Denk
2012-11-07 15:42       ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.