From: Haavard Skinnemoen Date: Sun, 17 Dec 2006 13:46:06 +0000 (+0100) Subject: AVR32: Use initdram() instead of board_init_memories() X-Git-Tag: v1.3.0-rc1~110^2~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=12f099c08167a7a51aeee623bc16dafd0841271c;p=oweals%2Fu-boot.git AVR32: Use initdram() instead of board_init_memories() Conform to the "standard" interface and use initdram() instead of board_init_memories() on AVR32. This enables us to get rid of the sdram_size member of the global_data struct as well. Signed-off-by: Haavard Skinnemoen --- diff --git a/board/atmel/atstk1000/atstk1000.c b/board/atmel/atstk1000/atstk1000.c index 8210bc60e8..9f735da089 100644 --- a/board/atmel/atstk1000/atstk1000.c +++ b/board/atmel/atstk1000/atstk1000.c @@ -53,9 +53,9 @@ int board_early_init_f(void) return 0; } -void board_init_memories(void) +long int initdram(int board_type) { - gd->sdram_size = sdram_init(&sdram); + return sdram_init(&sdram); } void board_init_info(void) diff --git a/include/asm-avr32/global_data.h b/include/asm-avr32/global_data.h index 7c45b36259..681c514ccf 100644 --- a/include/asm-avr32/global_data.h +++ b/include/asm-avr32/global_data.h @@ -36,7 +36,6 @@ typedef struct global_data { bd_t *bd; unsigned long flags; unsigned long baudrate; - unsigned long sdram_size; unsigned long stack_end; /* highest stack address */ unsigned long have_console; /* serial_init() was called */ unsigned long reloc_off; /* Relocation Offset */ diff --git a/include/asm-avr32/initcalls.h b/include/asm-avr32/initcalls.h index 7ba25cde53..583e5dc101 100644 --- a/include/asm-avr32/initcalls.h +++ b/include/asm-avr32/initcalls.h @@ -26,8 +26,6 @@ extern int cpu_init(void); extern int timer_init(void); -extern void board_init_memories(void); -extern void board_init_pio(void); extern void board_init_info(void); #endif /* __ASM_AVR32_INITCALLS_H__ */ diff --git a/lib_avr32/board.c b/lib_avr32/board.c index c55ebd5b22..a407bcad14 100644 --- a/lib_avr32/board.c +++ b/lib_avr32/board.c @@ -125,7 +125,7 @@ static void display_flash_config (void) printf("at address 0x%08lx\n", gd->bd->bi_flashstart); } -void board_init_f(ulong unused) +void board_init_f(ulong board_type) { gd_t gd_data; gd_t *new_gd; @@ -134,6 +134,7 @@ void board_init_f(ulong unused) unsigned long monitor_len; unsigned long monitor_addr; unsigned long addr; + long sdram_size; /* Initialize the global data pointer */ memset(&gd_data, 0, sizeof(gd_data)); @@ -147,10 +148,10 @@ void board_init_f(ulong unused) serial_init(); console_init_f(); display_banner(); - board_init_memories(); + sdram_size = initdram(board_type); /* If we have no SDRAM, we can't go on */ - if (!gd->sdram_size) + if (sdram_size <= 0) panic("No working SDRAM available\n"); /* @@ -164,7 +165,7 @@ void board_init_f(ulong unused) * - global data struct * - stack */ - addr = CFG_SDRAM_BASE + gd->sdram_size; + addr = CFG_SDRAM_BASE + sdram_size; monitor_len = _end - _text; /* @@ -199,7 +200,7 @@ void board_init_f(ulong unused) * information we have. */ bd->bi_dram[0].start = CFG_SDRAM_BASE; - bd->bi_dram[0].size = gd->sdram_size; + bd->bi_dram[0].size = sdram_size; bd->bi_baudrate = gd->baudrate; memcpy(new_gd, gd, sizeof(gd_t));