* [PATCH 2/8] at91sam9263: add atmel lcdc frambuffer support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 3/8] at91sam9261: " Jean-Christophe PLAGNIOL-VILLARD
` (5 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox; +Cc: Nicolas Ferre
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/mach-at91/at91sam9263.c | 1 +
arch/arm/mach-at91/at91sam9263_devices.c | 42 ++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index eeea1ce..49d280d 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -175,6 +175,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_DEV_ID("at91rm9200-gpio3", &pioCDE_clk),
CLKDEV_DEV_ID("at91rm9200-gpio4", &pioCDE_clk),
CLKDEV_DEV_ID("at91-pit", &mck),
+ CLKDEV_CON_DEV_ID("hck1", "atmel_lcdfb", &lcdc_clk),
};
static struct clk_lookup usart_clocks_lookups[] = {
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index c5efe9f..8f06821 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -250,6 +250,48 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
void __init at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) {}
#endif
+
+/* --------------------------------------------------------------------
+ * LCD Controller
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_DRIVER_VIDEO_ATMEL)
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data)
+{
+ BUG_ON(!data);
+
+ data->have_intensity_bit = true;
+
+ at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */
+ at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */
+ at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */
+ at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */
+ at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */
+ at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */
+ at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */
+ at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */
+ at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */
+ at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */
+ at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */
+ at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */
+ at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */
+ at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD13 */
+ at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */
+ at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */
+ at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */
+ at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */
+ at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */
+ at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD21 */
+ at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */
+ at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */
+
+ add_generic_device("atmel_lcdfb", DEVICE_ID_SINGLE, NULL, AT91SAM9263_LCDC_BASE, SZ_4K,
+ IORESOURCE_MEM, data);
+}
+#else
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data) {}
+#endif
+
resource_size_t __init at91_configure_dbgu(void)
{
at91_set_A_periph(AT91_PIN_PC30, 0); /* DRXD */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/8] at91sam9261: add atmel lcdc frambuffer support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 2/8] at91sam9263: " Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 4/8] at91sam9g45: " Jean-Christophe PLAGNIOL-VILLARD
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox; +Cc: Nicolas Ferre
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/mach-at91/at91sam9261_devices.c | 53 ++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index 5241894..e9ca51c 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -208,6 +208,59 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
void __init at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) {}
#endif
+/* --------------------------------------------------------------------
+ * LCD Controller
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_DRIVER_VIDEO_ATMEL)
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data)
+{
+ BUG_ON(!data);
+
+ data->have_intensity_bit = true;
+
+#if defined(CONFIG_FB_ATMEL_STN)
+ at91_set_A_periph(AT91_PIN_PB0, 0); /* LCDVSYNC */
+ at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */
+ at91_set_A_periph(AT91_PIN_PB2, 0); /* LCDDOTCK */
+ at91_set_A_periph(AT91_PIN_PB3, 0); /* LCDDEN */
+ at91_set_A_periph(AT91_PIN_PB4, 0); /* LCDCC */
+ at91_set_A_periph(AT91_PIN_PB5, 0); /* LCDD0 */
+ at91_set_A_periph(AT91_PIN_PB6, 0); /* LCDD1 */
+ at91_set_A_periph(AT91_PIN_PB7, 0); /* LCDD2 */
+ at91_set_A_periph(AT91_PIN_PB8, 0); /* LCDD3 */
+#else
+ at91_set_A_periph(AT91_PIN_PB1, 0); /* LCDHSYNC */
+ at91_set_A_periph(AT91_PIN_PB2, 0); /* LCDDOTCK */
+ at91_set_A_periph(AT91_PIN_PB3, 0); /* LCDDEN */
+ at91_set_A_periph(AT91_PIN_PB4, 0); /* LCDCC */
+ at91_set_A_periph(AT91_PIN_PB7, 0); /* LCDD2 */
+ at91_set_A_periph(AT91_PIN_PB8, 0); /* LCDD3 */
+ at91_set_A_periph(AT91_PIN_PB9, 0); /* LCDD4 */
+ at91_set_A_periph(AT91_PIN_PB10, 0); /* LCDD5 */
+ at91_set_A_periph(AT91_PIN_PB11, 0); /* LCDD6 */
+ at91_set_A_periph(AT91_PIN_PB12, 0); /* LCDD7 */
+ at91_set_A_periph(AT91_PIN_PB15, 0); /* LCDD10 */
+ at91_set_A_periph(AT91_PIN_PB16, 0); /* LCDD11 */
+ at91_set_A_periph(AT91_PIN_PB17, 0); /* LCDD12 */
+ at91_set_A_periph(AT91_PIN_PB18, 0); /* LCDD13 */
+ at91_set_A_periph(AT91_PIN_PB19, 0); /* LCDD14 */
+ at91_set_A_periph(AT91_PIN_PB20, 0); /* LCDD15 */
+ at91_set_B_periph(AT91_PIN_PB23, 0); /* LCDD18 */
+ at91_set_B_periph(AT91_PIN_PB24, 0); /* LCDD19 */
+ at91_set_B_periph(AT91_PIN_PB25, 0); /* LCDD20 */
+ at91_set_B_periph(AT91_PIN_PB26, 0); /* LCDD21 */
+ at91_set_B_periph(AT91_PIN_PB27, 0); /* LCDD22 */
+ at91_set_B_periph(AT91_PIN_PB28, 0); /* LCDD23 */
+#endif
+
+ add_generic_device("atmel_lcdfb", DEVICE_ID_SINGLE, NULL, AT91SAM9261_LCDC_BASE, SZ_4K,
+ IORESOURCE_MEM, data);
+}
+#else
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data) {}
+#endif
+
resource_size_t __init at91_configure_dbgu(void)
{
at91_set_A_periph(AT91_PIN_PA9, 0); /* DRXD */
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/8] at91sam9g45: add atmel lcdc frambuffer support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 2/8] at91sam9263: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 3/8] at91sam9261: " Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 5/8] at91sam9m10g45ek: add lcdc support Jean-Christophe PLAGNIOL-VILLARD
` (3 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Nicolas Ferre <nicolas.ferre@atmel.com>
---
arch/arm/mach-at91/at91sam9g45.c | 1 +
arch/arm/mach-at91/at91sam9g45_devices.c | 49 ++++++++++++++++++++++++++++++
2 files changed, 50 insertions(+)
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index 6e88bf1..deb9b62 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -198,6 +198,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
CLKDEV_DEV_ID("at91rm9200-gpio3", &pioDE_clk),
CLKDEV_DEV_ID("at91rm9200-gpio4", &pioDE_clk),
CLKDEV_DEV_ID("at91-pit", &mck),
+ CLKDEV_CON_DEV_ID("hck1", "atmel_lcdfb", &lcdc_clk),
};
static struct clk_lookup usart_clocks_lookups[] = {
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
index c4ca7c6..b8804c6 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -397,3 +397,52 @@ void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata)
#else
void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata) {}
#endif
+
+/* --------------------------------------------------------------------
+ * LCD Controller
+ * -------------------------------------------------------------------- */
+
+#if defined(CONFIG_DRIVER_VIDEO_ATMEL)
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data)
+{
+ BUG_ON(!data);
+
+ at91_set_A_periph(AT91_PIN_PE0, 0); /* LCDDPWR */
+
+ at91_set_A_periph(AT91_PIN_PE2, 0); /* LCDCC */
+ at91_set_A_periph(AT91_PIN_PE3, 0); /* LCDVSYNC */
+ at91_set_A_periph(AT91_PIN_PE4, 0); /* LCDHSYNC */
+ at91_set_A_periph(AT91_PIN_PE5, 0); /* LCDDOTCK */
+ at91_set_A_periph(AT91_PIN_PE6, 0); /* LCDDEN */
+ at91_set_A_periph(AT91_PIN_PE7, 0); /* LCDD0 */
+ at91_set_A_periph(AT91_PIN_PE8, 0); /* LCDD1 */
+ at91_set_A_periph(AT91_PIN_PE9, 0); /* LCDD2 */
+ at91_set_A_periph(AT91_PIN_PE10, 0); /* LCDD3 */
+ at91_set_A_periph(AT91_PIN_PE11, 0); /* LCDD4 */
+ at91_set_A_periph(AT91_PIN_PE12, 0); /* LCDD5 */
+ at91_set_A_periph(AT91_PIN_PE13, 0); /* LCDD6 */
+ at91_set_A_periph(AT91_PIN_PE14, 0); /* LCDD7 */
+ at91_set_A_periph(AT91_PIN_PE15, 0); /* LCDD8 */
+ at91_set_A_periph(AT91_PIN_PE16, 0); /* LCDD9 */
+ at91_set_A_periph(AT91_PIN_PE17, 0); /* LCDD10 */
+ at91_set_A_periph(AT91_PIN_PE18, 0); /* LCDD11 */
+ at91_set_A_periph(AT91_PIN_PE19, 0); /* LCDD12 */
+ at91_set_A_periph(AT91_PIN_PE20, 0); /* LCDD13 */
+ at91_set_A_periph(AT91_PIN_PE21, 0); /* LCDD14 */
+ at91_set_A_periph(AT91_PIN_PE22, 0); /* LCDD15 */
+ at91_set_A_periph(AT91_PIN_PE23, 0); /* LCDD16 */
+ at91_set_A_periph(AT91_PIN_PE24, 0); /* LCDD17 */
+ at91_set_A_periph(AT91_PIN_PE25, 0); /* LCDD18 */
+ at91_set_A_periph(AT91_PIN_PE26, 0); /* LCDD19 */
+ at91_set_A_periph(AT91_PIN_PE27, 0); /* LCDD20 */
+ at91_set_A_periph(AT91_PIN_PE28, 0); /* LCDD21 */
+ at91_set_A_periph(AT91_PIN_PE29, 0); /* LCDD22 */
+ at91_set_A_periph(AT91_PIN_PE30, 0); /* LCDD23 */
+
+ add_generic_device("atmel_lcdfb", DEVICE_ID_SINGLE, NULL, AT91SAM9G45_LCDC_BASE, SZ_4K,
+ IORESOURCE_MEM, data);
+}
+#else
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data) {}
+#endif
+
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/8] at91sam9m10g45ek: add lcdc support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
` (2 preceding siblings ...)
2013-01-27 11:20 ` [PATCH 4/8] at91sam9g45: " Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 6/8] at91sam9m10ihd: add lcd support Jean-Christophe PLAGNIOL-VILLARD
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
.../arm/boards/at91sam9m10g45ek/env/bin/boot_board | 7 ++++
arch/arm/boards/at91sam9m10g45ek/init.c | 43 ++++++++++++++++++++
arch/arm/configs/at91sam9m10g45ek_defconfig | 11 +++--
3 files changed, 58 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board b/arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board
index 3d7426f..73daecc 100644
--- a/arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board
+++ b/arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board
@@ -5,6 +5,13 @@ export PATH
. /env/config
+splash=/env/splash.png
+
+if [ -f ${splash} -a -e /dev/fb0 ]; then
+ splash -o ${splash}
+ fb0.enable=1
+fi
+
menu -r -m boot
menu -a -m boot -d "\e[1;36mWelcome on Barebox Boot Sequence\e[0m"
menu -e -a -m boot -c 'menu_boot' -d "boot (default) "
diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
index 214de96..1a7bda1 100644
--- a/arch/arm/boards/at91sam9m10g45ek/init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/init.c
@@ -236,6 +236,48 @@ static int at91sam9m10g45ek_mem_init(void)
}
mem_initcall(at91sam9m10g45ek_mem_init);
+#if defined(CONFIG_DRIVER_VIDEO_ATMEL)
+static struct fb_videomode at91_tft_vga_modes[] = {
+ {
+ .name = "LG",
+ .refresh = 60,
+ .xres = 480, .yres = 272,
+ .pixclock = KHZ2PICOS(9000),
+
+ .left_margin = 1, .right_margin = 1,
+ .upper_margin = 40, .lower_margin = 1,
+ .hsync_len = 45, .vsync_len = 1,
+
+ .sync = 0,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+};
+
+#define AT91SAM9G45_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
+ | ATMEL_LCDC_DISTYPE_TFT \
+ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
+
+/* Driver datas */
+static struct atmel_lcdfb_platform_data ek_lcdc_data = {
+ .lcdcon_is_backlight = true,
+ .default_bpp = 32,
+ .default_dmacon = ATMEL_LCDC_DMAEN,
+ .default_lcdcon2 = AT91SAM9G45_DEFAULT_LCDCON2,
+ .guard_time = 9,
+ .lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB,
+ .mode_list = at91_tft_vga_modes,
+ .num_modes = ARRAY_SIZE(at91_tft_vga_modes),
+};
+static void ek_add_device_lcdc(void)
+{
+ at91_add_device_lcdc(&ek_lcdc_data);
+}
+
+#else
+static void ek_add_device_lcdc(void) {}
+#endif
+
+
static int at91sam9m10g45ek_devices_init(void)
{
ek_add_device_nand();
@@ -244,6 +286,7 @@ static int at91sam9m10g45ek_devices_init(void)
ek_add_device_usb();
ek_device_add_leds();
ek_device_add_keyboard();
+ ek_add_device_lcdc();
devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap");
diff --git a/arch/arm/configs/at91sam9m10g45ek_defconfig b/arch/arm/configs/at91sam9m10g45ek_defconfig
index 29b9f32..1df34f7 100644
--- a/arch/arm/configs/at91sam9m10g45ek_defconfig
+++ b/arch/arm/configs/at91sam9m10g45ek_defconfig
@@ -6,6 +6,7 @@ CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_PBL_IMAGE=y
CONFIG_MMU=y
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0x40000
+CONFIG_MALLOC_SIZE=0x800000
CONFIG_MALLOC_TLSF=y
CONFIG_PROMPT="9M10G45-EK:"
CONFIG_LONGHELP=y
@@ -30,8 +31,6 @@ CONFIG_CMD_PASSWD=y
CONFIG_CMD_ECHO_E=y
CONFIG_CMD_LOADB=y
CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_MTEST=y
-CONFIG_CMD_MTEST_ALTERNATIVE=y
CONFIG_CMD_FLASH=y
CONFIG_CMD_BOOTM_SHOW_TYPE=y
CONFIG_CMD_BOOTM_VERBOSE=y
@@ -39,13 +38,17 @@ CONFIG_CMD_BOOTM_INITRD=y
CONFIG_CMD_BOOTM_OFTREE=y
CONFIG_CMD_BOOTM_OFTREE_UIMAGE=y
CONFIG_CMD_UIMAGE=y
+# CONFIG_CMD_BOOTU is not set
CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
CONFIG_CMD_OFTREE=y
+CONFIG_CMD_MTEST=y
+CONFIG_CMD_MTEST_ALTERNATIVE=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_MAGICVAR=y
CONFIG_CMD_MAGICVAR_HELP=y
+CONFIG_CMD_SPLASH=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_UNCOMPRESS=y
CONFIG_CMD_LED=y
@@ -73,6 +76,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI=y
CONFIG_USB_EHCI_ATMEL=y
CONFIG_USB_STORAGE=y
+CONFIG_VIDEO=y
+CONFIG_DRIVER_VIDEO_ATMEL=y
CONFIG_MCI=y
CONFIG_MCI_STARTUP=y
CONFIG_MCI_ATMEL=y
@@ -82,4 +87,4 @@ CONFIG_LED_TRIGGERS=y
CONFIG_FS_FAT=y
CONFIG_FS_FAT_WRITE=y
CONFIG_FS_FAT_LFN=y
-CONFIG_LZO_DECOMPRESS=y
+CONFIG_PNG=y
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6/8] at91sam9m10ihd: add lcd support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
` (3 preceding siblings ...)
2013-01-27 11:20 ` [PATCH 5/8] at91sam9m10g45ek: add lcdc support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-28 8:48 ` Sascha Hauer
2013-01-27 11:20 ` [PATCH 7/8] at91sam9261ek: " Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 8/8] at91sam9263ek: " Jean-Christophe PLAGNIOL-VILLARD
6 siblings, 1 reply; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/boards/at91sam9m10ihd/env/init/splash | 8 +++
arch/arm/boards/at91sam9m10ihd/init.c | 65 ++++++++++++++++++++++++
arch/arm/configs/at91sam9m10ihd_defconfig | 5 ++
3 files changed, 78 insertions(+)
create mode 100644 arch/arm/boards/at91sam9m10ihd/env/init/splash
diff --git a/arch/arm/boards/at91sam9m10ihd/env/init/splash b/arch/arm/boards/at91sam9m10ihd/env/init/splash
new file mode 100644
index 0000000..18e74df
--- /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 beede0b..da32a04 100644
--- a/arch/arm/boards/at91sam9m10ihd/init.c
+++ b/arch/arm/boards/at91sam9m10ihd/init.c
@@ -173,6 +173,70 @@ 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) {}
+
static void ek_add_device_w1(void)
{
at91_set_gpio_input(w1_pdata.pin, 0);
@@ -191,6 +255,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");
diff --git a/arch/arm/configs/at91sam9m10ihd_defconfig b/arch/arm/configs/at91sam9m10ihd_defconfig
index f6c3ef7..2faaa68 100644
--- a/arch/arm/configs/at91sam9m10ihd_defconfig
+++ b/arch/arm/configs/at91sam9m10ihd_defconfig
@@ -6,6 +6,7 @@ CONFIG_AEABI=y
CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_PBL_IMAGE=y
CONFIG_MMU=y
+CONFIG_MALLOC_SIZE=0xa00000
CONFIG_MALLOC_TLSF=y
CONFIG_PROMPT="9M10IHD:"
CONFIG_LONGHELP=y
@@ -45,6 +46,7 @@ CONFIG_CMD_GO=y
CONFIG_CMD_OFTREE=y
CONFIG_CMD_MTEST=y
CONFIG_CMD_MTEST_ALTERNATIVE=y
+CONFIG_CMD_SPLASH=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_MAGICVAR=y
@@ -78,6 +80,8 @@ CONFIG_USB=y
CONFIG_USB_EHCI=y
CONFIG_USB_EHCI_ATMEL=y
CONFIG_USB_STORAGE=y
+CONFIG_VIDEO=y
+CONFIG_DRIVER_VIDEO_ATMEL=y
CONFIG_MCI=y
CONFIG_MCI_STARTUP=y
CONFIG_MCI_ATMEL=y
@@ -92,3 +96,4 @@ CONFIG_FS_TFTP=y
CONFIG_FS_FAT=y
CONFIG_FS_FAT_WRITE=y
CONFIG_FS_FAT_LFN=y
+CONFIG_PNG=y
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 6/8] at91sam9m10ihd: add lcd support
2013-01-27 11:20 ` [PATCH 6/8] at91sam9m10ihd: add lcd support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-28 8:48 ` Sascha Hauer
2013-01-28 9:26 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2013-01-28 8:48 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Sun, Jan 27, 2013 at 12:20:47PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
> arch/arm/boards/at91sam9m10ihd/env/init/splash | 8 +++
> arch/arm/boards/at91sam9m10ihd/init.c | 65 ++++++++++++++++++++++++
> arch/arm/configs/at91sam9m10ihd_defconfig | 5 ++
> 3 files changed, 78 insertions(+)
> create mode 100644 arch/arm/boards/at91sam9m10ihd/env/init/splash
>
> diff --git a/arch/arm/boards/at91sam9m10ihd/env/init/splash b/arch/arm/boards/at91sam9m10ihd/env/init/splash
> new file mode 100644
> index 0000000..18e74df
> --- /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 beede0b..da32a04 100644
> --- a/arch/arm/boards/at91sam9m10ihd/init.c
> +++ b/arch/arm/boards/at91sam9m10ihd/init.c
> @@ -173,6 +173,70 @@ 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);
> +}
This function is unused.
> +
> +/* 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) {}
> +
unterminated ifdef. I fixed this while applying.
This leaves the unused function producing a compiler warning. Can you
provide a fixup patch?
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 6/8] at91sam9m10ihd: add lcd support
2013-01-28 8:48 ` Sascha Hauer
@ 2013-01-28 9:26 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-28 9:26 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 09:48 Mon 28 Jan , Sascha Hauer wrote:
> On Sun, Jan 27, 2013 at 12:20:47PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> > arch/arm/boards/at91sam9m10ihd/env/init/splash | 8 +++
> > arch/arm/boards/at91sam9m10ihd/init.c | 65 ++++++++++++++++++++++++
> > arch/arm/configs/at91sam9m10ihd_defconfig | 5 ++
> > 3 files changed, 78 insertions(+)
> > create mode 100644 arch/arm/boards/at91sam9m10ihd/env/init/splash
> >
> > diff --git a/arch/arm/boards/at91sam9m10ihd/env/init/splash b/arch/arm/boards/at91sam9m10ihd/env/init/splash
> > new file mode 100644
> > index 0000000..18e74df
> > --- /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 beede0b..da32a04 100644
> > --- a/arch/arm/boards/at91sam9m10ihd/init.c
> > +++ b/arch/arm/boards/at91sam9m10ihd/init.c
> > @@ -173,6 +173,70 @@ 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);
> > +}
>
> This function is unused.
>
> > +
> > +/* 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) {}
> > +
>
> unterminated ifdef. I fixed this while applying.
>
> This leaves the unused function producing a compiler warning. Can you
> provide a fixup patch?
ok
Best Regards,
J.
>
> Sascha
>
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 7/8] at91sam9261ek: add lcd support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
` (4 preceding siblings ...)
2013-01-27 11:20 ` [PATCH 6/8] at91sam9m10ihd: add lcd support Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-27 11:20 ` [PATCH 8/8] at91sam9263ek: " Jean-Christophe PLAGNIOL-VILLARD
6 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/boards/at91sam9261ek/env/bin/init_board | 7 ++
arch/arm/boards/at91sam9261ek/init.c | 83 +++++++++++++++++++++-
arch/arm/configs/at91sam9261ek_defconfig | 4 ++
3 files changed, 93 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boards/at91sam9261ek/env/bin/init_board b/arch/arm/boards/at91sam9261ek/env/bin/init_board
index a76a660..8e849c6 100644
--- a/arch/arm/boards/at91sam9261ek/env/bin/init_board
+++ b/arch/arm/boards/at91sam9261ek/env/bin/init_board
@@ -1,5 +1,12 @@
#!/bin/sh
+splash=/env/splash.png
+
+if [ -f ${splash} -a -e /dev/fb0 ]; then
+ splash -o ${splash}
+ fb0.enable=1
+fi
+
button_name="dfu_bp"
button_wait=5
diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index 7c95435..2597ff8 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -30,7 +30,7 @@
#include <linux/mtd/nand.h>
#include <mach/at91_pmc.h>
#include <mach/board.h>
-#include <mach/gpio.h>
+#include <gpio.h>
#include <mach/io.h>
#include <mach/at91sam9_smc.h>
#include <dm9000.h>
@@ -149,6 +149,86 @@ static void ek_add_device_udc(void)
static void ek_add_device_udc(void) {}
#endif
+/*
+ * LCD Controller
+ */
+#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;
+}
+
+/* TFT */
+static struct fb_videomode at91_tft_vga_modes[] = {
+ {
+ .name = "TX09D50VM1CCA @ 60",
+ .refresh = 60,
+ .xres = 240, .yres = 320,
+ .pixclock = KHZ2PICOS(4965),
+
+ .left_margin = 1, .right_margin = 33,
+ .upper_margin = 1, .lower_margin = 0,
+ .hsync_len = 5, .vsync_len = 1,
+
+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+};
+
+#define AT91SAM9261_DEFAULT_TFT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
+ | ATMEL_LCDC_DISTYPE_TFT \
+ | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
+
+static void at91_lcdc_tft_power_control(int on)
+{
+ if (on)
+ gpio_set_value(AT91_PIN_PA12, 0); /* power up */
+ else
+ gpio_set_value(AT91_PIN_PA12, 1); /* power down */
+}
+
+static struct atmel_lcdfb_platform_data ek_lcdc_data = {
+ .lcdcon_is_backlight = true,
+ .default_bpp = 16,
+ .default_dmacon = ATMEL_LCDC_DMAEN,
+ .default_lcdcon2 = AT91SAM9261_DEFAULT_TFT_LCDCON2,
+ .guard_time = 1,
+ .atmel_lcdfb_power_control = at91_lcdc_tft_power_control,
+ .mode_list = at91_tft_vga_modes,
+ .num_modes = ARRAY_SIZE(at91_tft_vga_modes),
+};
+
+static int at91_lcdc_gpio(void)
+{
+ return ek_gpio_request_output(AT91_PIN_PA12, "lcdc_tft_power");
+}
+
+static void ek_add_device_lcdc(void)
+{
+ if (at91_lcdc_gpio())
+ return;
+
+ if (machine_is_at91sam9g10ek())
+ ek_lcdc_data.lcd_wiring_mode = ATMEL_LCDC_WIRING_RGB;
+
+ at91_add_device_lcdc(&ek_lcdc_data);
+}
+
+#else
+static void ek_add_device_lcdc(void) {}
+#endif
+
#ifdef CONFIG_KEYBOARD_GPIO
struct gpio_keys_button keys[] = {
{
@@ -245,6 +325,7 @@ static int at91sam9261ek_devices_init(void)
ek_add_device_udc();
ek_add_device_buttons();
ek_device_add_leds();
+ ek_add_device_lcdc();
devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw");
diff --git a/arch/arm/configs/at91sam9261ek_defconfig b/arch/arm/configs/at91sam9261ek_defconfig
index 5daa47b..9c955b4 100644
--- a/arch/arm/configs/at91sam9261ek_defconfig
+++ b/arch/arm/configs/at91sam9261ek_defconfig
@@ -38,6 +38,7 @@ CONFIG_CMD_UIMAGE=y
# CONFIG_CMD_BOOTU is not set
CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
+CONFIG_CMD_SPLASH=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_GPIO=y
@@ -63,7 +64,10 @@ CONFIG_UBI=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DFU=y
CONFIG_USB_GADGET_SERIAL=y
+CONFIG_VIDEO=y
+CONFIG_DRIVER_VIDEO_ATMEL=y
CONFIG_LED=y
CONFIG_LED_GPIO=y
CONFIG_LED_TRIGGERS=y
CONFIG_KEYBOARD_GPIO=y
+CONFIG_PNG=y
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 8/8] at91sam9263ek: add lcd support
2013-01-27 11:20 ` [PATCH 1/8] video: add atmel lcdc frambuffer support Jean-Christophe PLAGNIOL-VILLARD
` (5 preceding siblings ...)
2013-01-27 11:20 ` [PATCH 7/8] at91sam9261ek: " Jean-Christophe PLAGNIOL-VILLARD
@ 2013-01-27 11:20 ` Jean-Christophe PLAGNIOL-VILLARD
6 siblings, 0 replies; 12+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-01-27 11:20 UTC (permalink / raw)
To: barebox
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/boards/at91sam9263ek/env/bin/init_board | 7 +++
arch/arm/boards/at91sam9263ek/init.c | 72 +++++++++++++++++++++-
arch/arm/configs/at91sam9263ek_defconfig | 4 ++
3 files changed, 82 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boards/at91sam9263ek/env/bin/init_board b/arch/arm/boards/at91sam9263ek/env/bin/init_board
index ae2ac7d..f2e6294 100644
--- a/arch/arm/boards/at91sam9263ek/env/bin/init_board
+++ b/arch/arm/boards/at91sam9263ek/env/bin/init_board
@@ -1,5 +1,12 @@
#!/bin/sh
+splash=/env/splash.png
+
+if [ -f ${splash} -a -e /dev/fb0 ]; then
+ splash -o ${splash}
+ fb0.enable=1
+fi
+
button_name="dfu_bp"
button_wait=5
diff --git a/arch/arm/boards/at91sam9263ek/init.c b/arch/arm/boards/at91sam9263ek/init.c
index a86c0fd..6db6a5b 100644
--- a/arch/arm/boards/at91sam9263ek/init.c
+++ b/arch/arm/boards/at91sam9263ek/init.c
@@ -32,7 +32,7 @@
#include <linux/mtd/nand.h>
#include <mach/at91_pmc.h>
#include <mach/board.h>
-#include <mach/gpio.h>
+#include <gpio.h>
#include <mach/io.h>
#include <mach/at91sam9_smc.h>
@@ -149,6 +149,75 @@ static void ek_add_device_udc(void)
static void ek_add_device_udc(void) {}
#endif
+/*
+ * LCD Controller
+ */
+#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 at91_tft_vga_modes[] = {
+ {
+ .name = "TX09D50VM1CCA @ 60",
+ .refresh = 60,
+ .xres = 240, .yres = 320,
+ .pixclock = KHZ2PICOS(4965),
+
+ .left_margin = 1, .right_margin = 33,
+ .upper_margin = 1, .lower_margin = 0,
+ .hsync_len = 5, .vsync_len = 1,
+
+ .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ .vmode = FB_VMODE_NONINTERLACED,
+ },
+};
+
+#define AT91SAM9263_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_PA30, 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 = AT91SAM9263_DEFAULT_LCDCON2,
+ .guard_time = 1,
+ .atmel_lcdfb_power_control = at91_lcdc_power_control,
+ .mode_list = at91_tft_vga_modes,
+ .num_modes = ARRAY_SIZE(at91_tft_vga_modes),
+};
+
+static void ek_add_device_lcdc(void)
+{
+ if (ek_gpio_request_output(AT91_PIN_PA30, "lcdc_power"))
+ return;
+
+ at91_add_device_lcdc(&ek_lcdc_data);
+}
+
+#else
+static void ek_add_device_lcdc(void) {}
+#endif
+
static void __init ek_add_device_buttons(void)
{
at91_set_gpio_input(AT91_PIN_PC5, 1);
@@ -184,6 +253,7 @@ static int at91sam9263ek_devices_init(void)
ek_device_add_leds();
ek_add_device_udc();
ek_add_device_buttons();
+ ek_add_device_lcdc();
if (IS_ENABLED(CONFIG_DRIVER_CFI) && cdev_by_name("nor0")) {
devfs_add_partition("nor0", 0x00000, 0x40000, DEVFS_PARTITION_FIXED, "self");
diff --git a/arch/arm/configs/at91sam9263ek_defconfig b/arch/arm/configs/at91sam9263ek_defconfig
index 5d44052..e78849a 100644
--- a/arch/arm/configs/at91sam9263ek_defconfig
+++ b/arch/arm/configs/at91sam9263ek_defconfig
@@ -36,6 +36,7 @@ CONFIG_CMD_UIMAGE=y
CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
CONFIG_CMD_OFTREE=y
+CONFIG_CMD_SPLASH=y
CONFIG_CMD_TIMEOUT=y
CONFIG_CMD_PARTITION=y
CONFIG_CMD_GPIO=y
@@ -63,6 +64,8 @@ CONFIG_UBI=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DFU=y
CONFIG_USB_GADGET_SERIAL=y
+CONFIG_VIDEO=y
+CONFIG_DRIVER_VIDEO_ATMEL=y
CONFIG_MCI=y
CONFIG_MCI_ATMEL=y
CONFIG_LED=y
@@ -70,3 +73,4 @@ CONFIG_LED_GPIO=y
CONFIG_LED_TRIGGERS=y
CONFIG_FS_FAT=y
CONFIG_FS_FAT_LFN=y
+CONFIG_PNG=y
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 12+ messages in thread