X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=lib_avr32%2Fboard.c;h=917ed6ce75ef8f7eccd29605dfece339778a1c36;hb=27f13075a659da046372dfe249d808f2f6ddb432;hp=959375a48f173354c641cb6be89eec78793acfbf;hpb=156feb90d200f186cdfd856d7f6f1878bb1bec1e;p=u-boot diff --git a/lib_avr32/board.c b/lib_avr32/board.c index 959375a48f..917ed6ce75 100644 --- a/lib_avr32/board.c +++ b/lib_avr32/board.c @@ -22,11 +22,15 @@ #include #include #include -#include +#include #include #include #include +#ifdef CONFIG_BITBANGMII +#include +#endif + #include #include @@ -41,13 +45,6 @@ const char version_string[] = unsigned long monitor_flash_len; -/* - * Begin and end of memory area for malloc(), and current "brk" - */ -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) { @@ -56,37 +53,8 @@ static int __do_nothing(void) 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) -{ - unsigned long monitor_addr; - - monitor_addr = CONFIG_SYS_MONITOR_BASE + gd->reloc_off; - mem_malloc_end = monitor_addr; - mem_malloc_start = mem_malloc_end - CONFIG_SYS_MALLOC_LEN; - mem_malloc_brk = mem_malloc_start; - - printf("malloc: Using memory from 0x%08lx to 0x%08lx\n", - mem_malloc_start, mem_malloc_end); - - memset ((void *)mem_malloc_start, 0, - mem_malloc_end - mem_malloc_start); -} - -void *sbrk(ptrdiff_t increment) -{ - unsigned long old = mem_malloc_brk; - unsigned long new = old + increment; - - if ((new < mem_malloc_start) || (new > mem_malloc_end)) - return NULL; - - mem_malloc_brk = new; - return ((void *)old); -} - #ifdef CONFIG_SYS_DMA_ALLOC_LEN -#include +#include #include static unsigned long dma_alloc_start; @@ -239,6 +207,18 @@ void board_init_f(ulong board_type) addr -= CONFIG_SYS_DMA_ALLOC_LEN; #endif +#ifdef CONFIG_LCD +#ifdef CONFIG_FB_ADDR + printf("LCD: Frame buffer allocated at preset 0x%08x\n", + CONFIG_FB_ADDR); + gd->fb_base = (void *)CONFIG_FB_ADDR; +#else + addr = lcd_setmem(addr); + printf("LCD: Frame buffer allocated at 0x%08lx\n", addr); + gd->fb_base = (void *)addr; +#endif /* CONFIG_FB_ADDR */ +#endif /* CONFIG_LCD */ + /* Allocate a Board Info struct on a word boundary */ addr -= sizeof(bd_t); addr &= ~3UL; @@ -319,7 +299,10 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) #endif timer_init(); - mem_malloc_init(); + + /* The malloc area is right below the monitor image in RAM */ + mem_malloc_init(CONFIG_SYS_MONITOR_BASE + gd->reloc_off - + CONFIG_SYS_MALLOC_LEN, CONFIG_SYS_MALLOC_LEN); malloc_bin_reloc(); dma_alloc_init(); @@ -350,7 +333,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) bd->bi_ip_addr = getenv_IPaddr ("ipaddr"); - devices_init(); + stdio_init(); jumptable_init(); console_init_r(); @@ -358,6 +341,9 @@ void board_init_r(gd_t *new_gd, ulong dest_addr) if (s) load_addr = simple_strtoul(s, NULL, 16); +#ifdef CONFIG_BITBANGMII + bb_miiphy_init(); +#endif #if defined(CONFIG_CMD_NET) s = getenv("bootfile"); if (s)