summaryrefslogtreecommitdiff
path: root/lib_avr32
diff options
context:
space:
mode:
authorHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2009-03-23 10:22:41 +0100
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>2009-03-23 10:22:41 +0100
commit8206bfae3ab7f99965136384360ba2de0c6f4c3b (patch)
treee11bf0fad2e418e6771e8db7dbcb6630a6053f0c /lib_avr32
parentee1702d75a30d076139d1841383a1fa7220a0e11 (diff)
parent58a518c3d8a2c7de11d414e8b903495daee7dc7e (diff)
downloadu-boot-imx-8206bfae3ab7f99965136384360ba2de0c6f4c3b.zip
u-boot-imx-8206bfae3ab7f99965136384360ba2de0c6f4c3b.tar.gz
u-boot-imx-8206bfae3ab7f99965136384360ba2de0c6f4c3b.tar.bz2
Merge branch 'mimc200'
Diffstat (limited to 'lib_avr32')
-rw-r--r--lib_avr32/board.c14
-rw-r--r--lib_avr32/bootm.c2
-rw-r--r--lib_avr32/interrupts.c7
3 files changed, 20 insertions, 3 deletions
diff --git a/lib_avr32/board.c b/lib_avr32/board.c
index 2a98bd4..57115df 100644
--- a/lib_avr32/board.c
+++ b/lib_avr32/board.c
@@ -48,6 +48,14 @@ static unsigned long mem_malloc_start = 0;
static unsigned long mem_malloc_end = 0;
static unsigned long mem_malloc_brk = 0;
+/* Weak aliases for optional board functions */
+static int __do_nothing(void)
+{
+ return 0;
+}
+int board_postclk_init(void) __attribute__((weak, alias("__do_nothing")));
+int board_early_init_r(void) __attribute__((weak, alias("__do_nothing")));
+
/* The malloc area is right below the monitor image in RAM */
static void mem_malloc_init(void)
{
@@ -78,7 +86,7 @@ void *sbrk(ptrdiff_t increment)
}
#ifdef CONFIG_SYS_DMA_ALLOC_LEN
-#include <asm/cacheflush.h>
+#include <asm/arch/cacheflush.h>
#include <asm/io.h>
static unsigned long dma_alloc_start;
@@ -188,6 +196,7 @@ void board_init_f(ulong board_type)
/* Perform initialization sequence */
board_early_init_f();
cpu_init();
+ board_postclk_init();
env_init();
init_baudrate();
serial_init();
@@ -275,6 +284,8 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
gd->flags |= GD_FLG_RELOC;
gd->reloc_off = dest_addr - CONFIG_SYS_MONITOR_BASE;
+ board_early_init_r();
+
monitor_flash_len = _edata - _text;
/*
@@ -311,7 +322,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
mem_malloc_init();
malloc_bin_reloc();
dma_alloc_init();
- board_init_info();
enable_interrupts();
diff --git a/lib_avr32/bootm.c b/lib_avr32/bootm.c
index 03ab8d1..0ca4718 100644
--- a/lib_avr32/bootm.c
+++ b/lib_avr32/bootm.c
@@ -24,7 +24,7 @@
#include <image.h>
#include <zlib.h>
#include <asm/byteorder.h>
-#include <asm/addrspace.h>
+#include <asm/arch/addrspace.h>
#include <asm/io.h>
#include <asm/setup.h>
#include <asm/arch/clk.h>
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);
}