summaryrefslogtreecommitdiffstats
path: root/lib_arm
diff options
context:
space:
mode:
authorStelian Pop <stelian@popies.net>2008-05-09 21:57:18 +0200
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2008-05-10 11:44:55 +0200
commit39cf480484fcce5c04a590ee1c30be0c17b02c34 (patch)
tree54b08d094a8e1ecae391eb07cf477b9ed5b1a0a2 /lib_arm
parent2118ebb44dc40f8117c94950fd95799a9ef821b2 (diff)
downloadblackbird-obmc-uboot-39cf480484fcce5c04a590ee1c30be0c17b02c34.tar.gz
blackbird-obmc-uboot-39cf480484fcce5c04a590ee1c30be0c17b02c34.zip
Add ATMEL LCD driver
This patch adds support for the ATMEL LCDC driver which is used on some AT91 and AVR platforms. Is has been tested with the AT91CAP9ADK, AT91SAM9261EK, AT91SAM9263EK and AT91SAM9RLEK boards. Adaptation for AVR32 should probably be easy. Signed-off-by: Stelian Pop <stelian@popies.net> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'lib_arm')
-rw-r--r--lib_arm/board.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/lib_arm/board.c b/lib_arm/board.c
index 67506b35e1..b2e6910c49 100644
--- a/lib_arm/board.c
+++ b/lib_arm/board.c
@@ -121,6 +121,20 @@ void *sbrk (ptrdiff_t increment)
return ((void *) old);
}
+char *strmhz(char *buf, long hz)
+{
+ long l, n;
+ long m;
+
+ n = hz / 1000000L;
+ l = sprintf (buf, "%ld", n);
+ m = (hz % 1000000L) / 1000L;
+ if (m != 0)
+ sprintf (buf + l, ".%03ld", m);
+ return (buf);
+}
+
+
/************************************************************************
* Coloured LED functionality
************************************************************************
@@ -279,7 +293,7 @@ void start_armboot (void)
{
init_fnc_t **init_fnc_ptr;
char *s;
-#ifndef CFG_NO_FLASH
+#if !defined(CFG_NO_FLASH) || defined (CONFIG_VFD) || defined(CONFIG_LCD)
ulong size;
#endif
#if defined(CONFIG_VFD) || defined(CONFIG_LCD)
@@ -323,16 +337,19 @@ void start_armboot (void)
#endif /* CONFIG_VFD */
#ifdef CONFIG_LCD
-# ifndef PAGE_SIZE
-# define PAGE_SIZE 4096
-# endif
- /*
- * reserve memory for LCD display (always full pages)
- */
- /* bss_end is defined in the board-specific linker script */
- addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
- size = lcd_setmem (addr);
- gd->fb_base = addr;
+ /* board init may have inited fb_base */
+ if (!gd->fb_base) {
+# ifndef PAGE_SIZE
+# define PAGE_SIZE 4096
+# endif
+ /*
+ * reserve memory for LCD display (always full pages)
+ */
+ /* bss_end is defined in the board-specific linker script */
+ addr = (_bss_end + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
+ size = lcd_setmem (addr);
+ gd->fb_base = addr;
+ }
#endif /* CONFIG_LCD */
/* armboot_start is defined in the board-specific linker script */
OpenPOWER on IntegriCloud