All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] pxafb: enable VIDEO support (CONFIG_VIDEO).
Date: Mon, 23 Jul 2007 10:05:31 +0200	[thread overview]
Message-ID: <20070723080531.GA30029@enneenne.com> (raw)

Signed-off-by: Rodolfo Giometti <giometti@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

                 reply	other threads:[~2007-07-23  8:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070723080531.GA30029@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.