summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAlessandro Rubini <rubini@unipv.it>2009-12-05 13:39:31 +0100
committerAnatolij Gustschin <agust@denx.de>2010-01-27 21:23:14 +0100
commit3e446cbdf30221b9ca3a89b0f5abbfc691ce7755 (patch)
tree7bce6b7c5cdc945580827b0ea51b6a5654761236 /drivers/video
parent9b208ece0a4e040774e24990b7cb6f0ad0ca4cc7 (diff)
downloadtalos-obmc-uboot-3e446cbdf30221b9ca3a89b0f5abbfc691ce7755.tar.gz
talos-obmc-uboot-3e446cbdf30221b9ca3a89b0f5abbfc691ce7755.zip
video: add amba-clcd prime-cell
This adds support for the CLCD logic cell. It accepts precompiled register values for specific configuration through a board-supplied data structure. It is used by the Nomadik nhk8815, added by a later patch in this series. Signed-off-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/Makefile1
-rw-r--r--drivers/video/amba.c79
2 files changed, 80 insertions, 0 deletions
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index bb6b5a0d51..a5e339a21b 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_ATI_RADEON_FB) += ati_radeon_fb.o
COBJS-$(CONFIG_ATMEL_LCD) += atmel_lcdfb.o
COBJS-$(CONFIG_CFB_CONSOLE) += cfb_console.o
COBJS-$(CONFIG_S6E63D6) += s6e63d6.o
+COBJS-$(CONFIG_VIDEO_AMBA) += amba.o
COBJS-$(CONFIG_VIDEO_CT69000) += ct69000.o
COBJS-$(CONFIG_VIDEO_MB862xx) += mb862xx.o
COBJS-$(CONFIG_VIDEO_MX3) += mx3fb.o
diff --git a/drivers/video/amba.c b/drivers/video/amba.c
new file mode 100644
index 0000000000..ffa1c399e1
--- /dev/null
+++ b/drivers/video/amba.c
@@ -0,0 +1,79 @@
+/*
+ * Driver for AMBA PrimeCell CLCD
+ *
+ * Copyright (C) 2009 Alessandro Rubini
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <lcd.h>
+#include <amba_clcd.h>
+
+/* These variables are required by lcd.c -- although it sets them by itself */
+int lcd_line_length;
+int lcd_color_fg;
+int lcd_color_bg;
+void *lcd_base;
+void *lcd_console_address;
+short console_col;
+short console_row;
+
+/*
+ * To use this driver you need to provide the following in board files:
+ * a panel_info definition
+ * an lcd_enable function (can't define a weak default with current code)
+ */
+
+/* There is nothing to do with color registers, we use true color */
+void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
+{
+ return;
+}
+
+/* Low level initialization of the logic cell: depends on panel_info */
+void lcd_ctrl_init(void *lcdbase)
+{
+ struct clcd_config *config;
+ struct clcd_registers *regs;
+ u32 cntl;
+
+ config = panel_info.priv;
+ regs = config->address;
+ cntl = config->cntl & ~CNTL_LCDEN;
+
+ /* Lazily, just copy the registers over: first control with disable */
+ writel(cntl, &regs->cntl);
+
+ writel(config->tim0, &regs->tim0);
+ writel(config->tim1, &regs->tim1);
+ writel(config->tim2, &regs->tim2);
+ writel(config->tim3, &regs->tim3);
+ writel((u32)lcdbase, &regs->ubas);
+ /* finally, enable */
+ writel(cntl | CNTL_LCDEN, &regs->cntl);
+}
+
+/* This is trivial, and copied from atmel_lcdfb.c */
+ulong calc_fbsize(void)
+{
+ return ((panel_info.vl_col * panel_info.vl_row *
+ NBITS(panel_info.vl_bpix)) / 8) + PAGE_SIZE;
+}
OpenPOWER on IntegriCloud