[U-Boot-Users] [PATCH] pxafb: enable VIDEO support (CONFIG_VIDEO).

Rodolfo Giometti giometti at enneenne.com
Mon Jul 23 10:05:31 CEST 2007


Signed-off-by: Rodolfo Giometti <giometti at linux.it>
---
 common/lcd.c    |   34 ----------------------------------
 cpu/pxa/pxafb.c |    4 ++--
 lib_arm/board.c |   37 +++++++++++++++++++++++++++++++++++--
 3 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/common/lcd.c b/common/lcd.c
index 57bc2aa..353524c 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -39,7 +39,6 @@
 #if defined(CONFIG_POST)
 #include <post.h>
 #endif
-#include <lcd.h>
 #include <watchdog.h>
 
 #if defined(CONFIG_PXA250) || defined(CONFIG_PXA27X)
@@ -73,8 +72,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-ulong lcd_setmem (ulong addr);
-
 static void lcd_drawchars (ushort x, ushort y, uchar *str, int count);
 static inline void lcd_puts_xy (ushort x, ushort y, uchar *s);
 static inline void lcd_putc_xy (ushort x, ushort y, uchar  c);
@@ -447,37 +444,6 @@ static int lcd_init (void *lcdbase)
 }
 
 
-/************************************************************************/
-/* ** ROM capable initialization part - needed to reserve FB memory	*/
-/************************************************************************/
-/*
- * This is called early in the system initialization to grab memory
- * for the LCD controller.
- * Returns new address for monitor, after reserving LCD buffer memory
- *
- * Note that this is running from ROM, so no write access to global data.
- */
-ulong lcd_setmem (ulong addr)
-{
-	ulong size;
-	int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;
-
-	debug ("LCD panel info: %d x %d, %d bit/pix\n",
-		panel_info.vl_col, panel_info.vl_row, NBITS (panel_info.vl_bpix) );
-
-	size = line_length * panel_info.vl_row;
-
-	/* Round up to nearest full page */
-	size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
-
-	/* Allocate pages for the frame buffer. */
-	addr -= size;
-
-	debug ("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr);
-
-	return (addr);
-}
-
 /*----------------------------------------------------------------------*/
 
 static void lcd_setfgcolor (int color)
diff --git a/cpu/pxa/pxafb.c b/cpu/pxa/pxafb.c
index a4436d9..3f7bfb0 100644
--- a/cpu/pxa/pxafb.c
+++ b/cpu/pxa/pxafb.c
@@ -38,7 +38,7 @@
 
 /* #define DEBUG */
 
-#ifdef CONFIG_LCD
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
 
 /*----------------------------------------------------------------------*/
 /*
@@ -507,4 +507,4 @@ static int pxafb_init (vidinfo_t *vid)
 /************************************************************************/
 /************************************************************************/
 
-#endif /* CONFIG_LCD */
+#endif /* CONFIG_LCD || CONFIG_VIDEO */
diff --git a/lib_arm/board.c b/lib_arm/board.c
index babc254..7e36325 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -44,6 +44,7 @@
 #include <devices.h>
 #include <version.h>
 #include <net.h>
+#include <lcd.h>
 
 #ifdef CONFIG_DRIVER_SMC91111
 #include "../drivers/smc91111.h"
@@ -98,6 +99,38 @@ void mem_malloc_init (ulong dest_addr)
 			mem_malloc_end - mem_malloc_start);
 }
 
+/************************************************************************/
+/* ** ROM capable initialization part - needed to reserve FB memory	*/
+/************************************************************************/
+/*
+ * This is called early in the system initialization to grab memory
+ * for the LCD controller.
+ * Returns new address for monitor, after reserving LCD buffer memory
+ *
+ * Note that this is running from ROM, so no write access to global data.
+ */
+static
+ulong lcd_setmem (ulong addr)
+{
+	ulong size;
+	int line_length = (panel_info.vl_col * NBITS (panel_info.vl_bpix)) / 8;
+
+	debug ("LCD panel info: %d x %d, %d bit/pix\n",
+		panel_info.vl_col, panel_info.vl_row, NBITS (panel_info.vl_bpix) );
+
+	size = line_length * panel_info.vl_row;
+
+	/* Round up to nearest full page */
+	size = (size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+
+	/* Allocate pages for the frame buffer. */
+	addr -= size;
+
+	debug ("Reserving %ldk for LCD Framebuffer at: %08lx\n", size>>10, addr);
+
+	return (addr);
+}
+
 void *sbrk (ptrdiff_t increment)
 {
 	ulong old = mem_malloc_brk;
@@ -240,7 +273,7 @@ void start_armboot (void)
 #ifndef CFG_NO_FLASH
 	ulong size;
 #endif
-#if defined(CONFIG_VFD) || defined(CONFIG_LCD)
+#if defined(CONFIG_VFD) || defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
 	unsigned long addr;
 #endif
 
@@ -280,7 +313,7 @@ void start_armboot (void)
 	gd->fb_base = addr;
 #endif /* CONFIG_VFD */
 
-#ifdef CONFIG_LCD
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
 #	ifndef PAGE_SIZE
 #	  define PAGE_SIZE 4096
 #	endif
-- 
1.5.1.1





More information about the U-Boot mailing list