[U-Boot] [PATCH v2 7/9] AVR32: Must add NOPs after disabling interrupts for AT32UC3A0512ES

Gunnar Rangoy
2009-01-23T11:56:32Z

From: Olav Morken <olavmrk@gmail.com>

The AT32UC3A0512ES chip has a bug when disabling interrupts. As a
workaround, two NOPs can be inserted.

Signed-off-by: Gunnar Rangoy <gunnar@rangoy.com>
Signed-off-by: Paul Driveklepp <pauldriveklepp@gmail.com>
Signed-off-by: Olav Morken <olavmrk@gmail.com>
---
lib_avr32/interrupts.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib_avr32/interrupts.c b/lib_avr32/interrupts.c
index 28df20d..bbbc490 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);
}
--
1.6.0.4