From acac475212cbedb17b321a363a1c878e2b47b37f Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Fri, 14 Dec 2007 16:51:22 +0100 Subject: AVR32: Enable interrupts at bootup The timer code depends on the timer interrupt to keep track of the upper 32 bits of the cycle counter. This obviously doesn't work when interrupts are disabled the whole time. Signed-off-by: Haavard Skinnemoen --- lib_avr32/board.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib_avr32') diff --git a/lib_avr32/board.c b/lib_avr32/board.c index 11d864feac..809ee3be92 100644 --- a/lib_avr32/board.c +++ b/lib_avr32/board.c @@ -311,6 +311,8 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) dma_alloc_init(); board_init_info(); + enable_interrupts(); + bd->bi_flashstart = 0; bd->bi_flashsize = 0; bd->bi_flashoffset = 0; -- cgit From df9c25ea04b38a0e05d4f8c73c5cc144cdafa7db Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Mon, 17 Dec 2007 11:02:44 +0100 Subject: AVR32: Fix logic inversion in disable_interrupts() disable_interrupts() should return nonzero if interrupts were _enabled_ before, not disabled. Signed-off-by: Haavard Skinnemoen --- lib_avr32/interrupts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib_avr32') diff --git a/lib_avr32/interrupts.c b/lib_avr32/interrupts.c index ce538f3d92..28df20db01 100644 --- a/lib_avr32/interrupts.c +++ b/lib_avr32/interrupts.c @@ -35,5 +35,5 @@ int disable_interrupts(void) sr = sysreg_read(SR); asm volatile("ssrf %0" : : "n"(SYSREG_GM_OFFSET)); - return SYSREG_BFEXT(GM, sr); + return !SYSREG_BFEXT(GM, sr); } -- cgit