[U-Boot] [PATCH 3/6] avr32: Reserve memory for LCD framebuffer

Haavard Skinnemoen haavard.skinnemoen at atmel.com
Tue Sep 2 11:20:51 CEST 2008


Use lcd_setmem() to reserve memory for the LCD framebuffer before
relocation.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen at atmel.com>
---
 include/asm-avr32/global_data.h |    1 +
 lib_avr32/board.c               |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-avr32/global_data.h b/include/asm-avr32/global_data.h
index 007cfe4..7510401 100644
--- a/include/asm-avr32/global_data.h
+++ b/include/asm-avr32/global_data.h
@@ -41,6 +41,7 @@ typedef	struct	global_data {
 	unsigned long	reloc_off;	/* Relocation Offset */
 	unsigned long	env_addr;	/* Address of env struct */
 	unsigned long	env_valid;	/* Checksum of env valid? */
+	unsigned long	fb_base;	/* Base address of frame buffer */
 	unsigned long	cpu_hz;		/* cpu core clock frequency */
 	void		**jt;		/* jump table */
 } gd_t;
diff --git a/lib_avr32/board.c b/lib_avr32/board.c
index 4ed6c96..9bc475c 100644
--- a/lib_avr32/board.c
+++ b/lib_avr32/board.c
@@ -238,6 +238,12 @@ void board_init_f(ulong board_type)
 	addr -= CFG_DMA_ALLOC_LEN;
 #endif
 
+#ifdef CONFIG_LCD
+	/* Reserve memory for LCD display (always full pages) */
+	addr = lcd_setmem(addr);
+	gd->fb_base = addr;
+#endif
+
 	/* Allocate a Board Info struct on a word boundary */
 	addr -= sizeof(bd_t);
 	addr &= ~3UL;
-- 
1.5.6.3



More information about the U-Boot mailing list