From b423f94063bf04e92047ff85c7e53441eb3b712b Mon Sep 17 00:00:00 2001 From: Olav Morken Date: Fri, 23 Jan 2009 12:56:32 +0100 Subject: [PATCH] AVR32: Must add NOPs after disabling interrupts for AT32UC3A0512ES The AT32UC3A0512ES chip has a bug when disabling interrupts. As a workaround, two NOPs can be inserted. Signed-off-by: Gunnar Rangoy Signed-off-by: Paul Driveklepp Signed-off-by: Olav Morken Signed-off-by: Haavard Skinnemoen --- lib_avr32/interrupts.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib_avr32/interrupts.c b/lib_avr32/interrupts.c index 28df20db01..bbbc490db2 100644 --- a/lib_avr32/interrupts.c +++ b/lib_avr32/interrupts.c @@ -35,5 +35,12 @@ int disable_interrupts(void) sr = sysreg_read(SR); asm volatile("ssrf %0" : : "n"(SYSREG_GM_OFFSET)); +#ifdef CONFIG_AT32UC3A0xxx + /* Two NOPs are required after masking interrupts on the + * AT32UC3A0512ES. See errata 41.4.5.5. */ + asm("nop"); + asm("nop"); +#endif + return !SYSREG_BFEXT(GM, sr); } -- 2.39.5