summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/at91sam9m10ihd
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-01-27 12:20:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-28 09:45:39 +0100
commit9d8cef4687daf8e4f186c4e894a50db7f106e7df (patch)
treeefd27a6cc75540aeee9b90678bccc9346a95b79c /arch/arm/boards/at91sam9m10ihd
parent6d8a9516675f4a0f24286f43aedc59ce6d68f1e0 (diff)
downloadbarebox-9d8cef4687daf8e4f186c4e894a50db7f106e7df.tar.gz
barebox-9d8cef4687daf8e4f186c4e894a50db7f106e7df.tar.xz
at91sam9m10ihd: add lcd support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/at91sam9m10ihd')
-rw-r--r--arch/arm/boards/at91sam9m10ihd/env/init/splash8
-rw-r--r--arch/arm/boards/at91sam9m10ihd/init.c66
2 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/boards/at91sam9m10ihd/env/init/splash b/arch/arm/boards/at91sam9m10ihd/env/init/splash
new file mode 100644
index 0000000000..18e74dfcc9
--- /dev/null
+++ b/arch/arm/boards/at91sam9m10ihd/env/init/splash
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+splash=/env/splash.png
+
+if [ -f ${splash} -a -e /dev/fb0 ]; then
+ splash -o ${splash}
+ fb0.enable=1
+fi
diff --git a/arch/arm/boards/at91sam9m10ihd/init.c b/arch/arm/boards/at91sam9m10ihd/init.c
index 32f6a8ce0a..245724741b 100644
--- a/arch/arm/boards/at91sam9m10ihd/init.c
+++ b/arch/arm/boards/at91sam9m10ihd/init.c
@@ -173,6 +173,71 @@ static int at91sam9m10g45ek_mem_init(void)
}
mem_initcall(at91sam9m10g45ek_mem_init);
+#if defined(CONFIG_DRIVER_VIDEO_ATMEL)
+static int ek_gpio_request_output(int gpio, const char *name)
+{
+ int ret;
+
+ ret = gpio_request(gpio, name);
+ if (ret) {
+ pr_err("%s: can not request gpio %d (%d)\n", name, gpio, ret);
+ return ret;
+ }
+
+ ret = gpio_direction_output(gpio, 1);
+ if (ret)
+ pr_err("%s: can not configure gpio %d as output (%d)\n", name, gpio, ret);
+ return ret;
+}
+
+static struct fb_videomode at91fb_default_monspecs[] = {
+ {
+ .name = "MULTEK",
+ .refresh = 60,
+ .xres = 800, .yres = 480,
+ .pixclock = KHZ2PICOS(15000),
+
+ .left_margin = 40, .right_margin = 40,
+ .upper_margin = 29, .lower_margin = 13,
+ .hsync_len = 48, .vsync_len = 3,
+
+ .sync = 0,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+};
+
+#define AT91SAM9G45_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
+ | ATMEL_LCDC_DISTYPE_TFT \
+ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
+
+static void at91_lcdc_power_control(int on)
+{
+ gpio_set_value(AT91_PIN_PE6, on);
+}
+
+/* Driver datas */
+static struct atmel_lcdfb_platform_data ek_lcdc_data = {
+ .lcdcon_is_backlight = true,
+ .default_bpp = 16,
+ .default_dmacon = ATMEL_LCDC_DMAEN,
+ .default_lcdcon2 = AT91SAM9G45_DEFAULT_LCDCON2,
+ .guard_time = 9,
+ .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
+ .mode_list = at91fb_default_monspecs,
+ .num_modes = ARRAY_SIZE(at91fb_default_monspecs),
+};
+
+static void ek_add_device_lcd(void)
+{
+ if (ek_gpio_request_output(AT91_PIN_PE6, "lcdc_power"))
+ return;
+
+ at91_add_device_lcdc(&ek_lcdc_data);
+}
+#else
+static void ek_add_device_lcd(void) {}
+#endif
+
static void ek_add_device_w1(void)
{
at91_set_gpio_input(w1_pdata.pin, 0);
@@ -191,6 +256,7 @@ static int at91sam9m10ihd_devices_init(void)
ek_add_device_spi();
ek_add_device_i2c();
ek_add_device_usb();
+ ek_add_device_lcd();
devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap");