Skip to contentSkip to conversation

at91: add atmel lcdc framebuffer support

PATCH Applied Jean-Christophe PLAGNIOL-VILLARD 2 participants 12 messages Jan 27, 2013 – Jan 28, 2013

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover at91: add atmel lcdc framebuffer support

HI,

this patch serie add the lcdc framebuffer support

v2:
- drop board splash.png (we need to create a sub repo for theme)
- add sam9261ek
- add sam9263ek
- add sam9m10ihd

The following changes since commit cd1c289b2a4949e8acb235d4847419bde784a9d6:

Merge branch 'for-next/misc' into next (2013-01-25 19:51:11 +0100)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git delivery/atmel_fb

for you to fetch changes up to 4e93093ab5465fdb72526d353e0e05ddad27d38e:

at91sam9263ek: add lcd support (2013-01-23 13:39:04 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (8):
video: add atmel lcdc frambuffer support
at91sam9263: add atmel lcdc frambuffer support
at91sam9261: add atmel lcdc frambuffer support
at91sam9g45: add atmel lcdc frambuffer support
at91sam9m10g45ek: add lcdc support
at91sam9m10ihd: add lcd support
at91sam9261ek: add lcd support
at91sam9263ek: add lcd support

 arch/arm/boards/at91sam9261ek/env/bin/init_board    |    7 ++
 arch/arm/boards/at91sam9261ek/init.c                |   83 ++++++++++++++++-
 arch/arm/boards/at91sam9263ek/env/bin/init_board    |    7 ++
 arch/arm/boards/at91sam9263ek/init.c                |   72 ++++++++++++++-
 arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board |    7 ++
 arch/arm/boards/at91sam9m10g45ek/init.c             |   43 +++++++++
 arch/arm/boards/at91sam9m10ihd/env/init/splash      |    8 ++
 arch/arm/boards/at91sam9m10ihd/init.c               |   65 ++++++++++++++
 arch/arm/configs/at91sam9261ek_defconfig            |    4 +
 arch/arm/configs/at91sam9263ek_defconfig            |    4 +
 arch/arm/configs/at91sam9m10g45ek_defconfig         |   11 ++-
 arch/arm/configs/at91sam9m10ihd_defconfig           |    5 ++
 arch/arm/mach-at91/at91sam9261_devices.c            |   53 +++++++++++
 arch/arm/mach-at91/at91sam9263.c                    |    1 +
 arch/arm/mach-at91/at91sam9263_devices.c            |   42 +++++++++
 arch/arm/mach-at91/at91sam9g45.c                    |    1 +
 arch/arm/mach-at91/at91sam9g45_devices.c            |   49 ++++++++++
 arch/arm/mach-at91/include/mach/board.h             |    4 +
 drivers/video/Kconfig                               |    4 +
 drivers/video/Makefile                              |    1 +
 drivers/video/atmel_lcdfb.c                         |  507 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/video/atmel_lcdc.h                          |  206 ++++++++++++++++++++++++++++++++++++++++++
 22 files changed, 1179 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boards/at91sam9m10ihd/env/init/splash
 create mode 100644 drivers/video/atmel_lcdfb.c
 create mode 100644 include/video/atmel_lcdc.h

Best Regards,
J,

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#1 lore raw

PATCH v2 1/8 video: add atmel lcdc frambuffer support

This IP is present on the at91sam9 until the sam9g45, on the sam9x5 we use a new IP.

This driver is based on the linux one.

---
 arch/arm/mach-at91/include/mach/board.h |    4 +
 drivers/video/Kconfig                   |    4 +
 drivers/video/Makefile                  |    1 +
 drivers/video/atmel_lcdfb.c             |  507 +++++++++++++++++++++++++++++++
 include/video/atmel_lcdc.h              |  206 +++++++++++++
 5 files changed, 722 insertions(+)
 create mode 100644 drivers/video/atmel_lcdfb.c
 create mode 100644 include/video/atmel_lcdc.h
arch/arm/mach-at91/include/mach/board.h +4 -0
index b0afcf9..83404cc 100644
@@ -24,6 +24,8 @@
 #include <i2c/i2c.h>
 #include <spi/spi.h>
 #include <linux/mtd/mtd.h>
+#include <fb.h>
+#include <video/atmel_lcdc.h>
 
  /* USB Host */
 struct at91_usbh_data {
@@ -163,4 +165,6 @@ struct at91_spi_platform_data {
 };
 
 void at91_add_device_spi(int spi_id, struct at91_spi_platform_data *pdata);
+
+void __init at91_add_device_lcdc(struct atmel_lcdfb_platform_data *data);
 #endif
drivers/video/Kconfig +4 -0
index 354e68b..fcf9425 100644
@@ -5,6 +5,10 @@ menuconfig VIDEO
 
 if VIDEO
 
+config DRIVER_VIDEO_ATMEL
+	bool "Atmel LCDC framebuffer driver"
+	depends on ARCH_AT91
+
 config DRIVER_VIDEO_IMX
 	bool "i.MX framebuffer driver"
 	depends on ARCH_IMX1 || ARCH_IMX21 || ARCH_IMX25 || ARCH_IMX27
drivers/video/Makefile +1 -0
index 77f6682..1953307 100644
@@ -1,5 +1,6 @@
 obj-$(CONFIG_VIDEO) += fb.o
 
+obj-$(CONFIG_DRIVER_VIDEO_ATMEL) += atmel_lcdfb.o
 obj-$(CONFIG_DRIVER_VIDEO_STM) += stm.o
 obj-$(CONFIG_DRIVER_VIDEO_IMX) += imx.o
 obj-$(CONFIG_DRIVER_VIDEO_IMX_IPU) += imx-ipu-fb.o
drivers/video/atmel_lcdfb.c new file +507 -0

507 lines not on this page · raw message

include/video/atmel_lcdc.h new file +206 -0

206 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH v2 2/8 at91sam9263: add atmel lcdc frambuffer support

---
 arch/arm/mach-at91/at91sam9263.c         |    1 +
 arch/arm/mach-at91/at91sam9263_devices.c |   42 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
arch/arm/mach-at91/at91sam9263.c +1 -0
index eeea1ce..49d280d 100644
@@ -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[] = {
arch/arm/mach-at91/at91sam9263_devices.c +42 -0

48 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#3 lore raw

PATCH v2 3/8 at91sam9261: add atmel lcdc frambuffer support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 arch/arm/mach-at91/at91sam9261_devices.c |   53 ++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
arch/arm/mach-at91/at91sam9261_devices.c +53 -0
index 5241894..e9ca51c 100644
@@ -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 */
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw

PATCH v2 4/8 at91sam9g45: add atmel lcdc frambuffer support

In reply to Jean-Christophe PLAGNIOL-VILLARD

Nicolas Ferre <[email protected]>

---
 arch/arm/mach-at91/at91sam9g45.c         |    1 +
 arch/arm/mach-at91/at91sam9g45_devices.c |   49 ++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
arch/arm/mach-at91/at91sam9g45.c +1 -0
index 6e88bf1..deb9b62 100644
@@ -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[] = {
arch/arm/mach-at91/at91sam9g45_devices.c +49 -0

52 lines not on this page · raw message

Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#5 lore raw

PATCH v2 5/8 at91sam9m10g45ek: add lcdc support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 .../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(-)
arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board +7 -0
index 3d7426f..73daecc 100644
@@ -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)             "
arch/arm/boards/at91sam9m10g45ek/init.c +43 -0

55 lines not on this page · raw message

arch/arm/configs/at91sam9m10g45ek_defconfig +8 -3
index 29b9f32..1df34f7 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#6 lore raw

PATCH v2 6/8 at91sam9m10ihd: add lcd support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 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
arch/arm/boards/at91sam9m10ihd/env/init/splash new file +8 -0
new file mode 100644
index 0000000..18e74df
@@ -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
arch/arm/boards/at91sam9m10ihd/init.c +65 -0

77 lines not on this page · raw message

arch/arm/configs/at91sam9m10ihd_defconfig +5 -0
index f6c3ef7..2faaa68 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#7 lore raw

Re: [PATCH 6/8] at91sam9m10ihd: add lcd support

Quoted 61 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 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
arch/arm/boards/at91sam9m10ihd/env/init/splash new file +8 -0
new file mode 100644
index 0000000..18e74df
@@ -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
arch/arm/boards/at91sam9m10ihd/init.c +31 -0
index beede0b..da32a04 100644
@@ -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,
+	},

arch/arm/boards/at91sam9m10ihd/init.c static int at91sam9m10g45ek_mem_init(void) · line 216

Quoted 10 lines
arch/arm/boards/at91sam9m10ihd/init.c +10 -0
+};
+
+#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.

Quoted 13 lines
arch/arm/boards/at91sam9m10ihd/init.c +13 -0
+
+/* 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),
+};
+

arch/arm/boards/at91sam9m10ihd/init.c static int at91sam9m10g45ek_mem_init(void) · line 239

Quoted 10 lines
arch/arm/boards/at91sam9m10ihd/init.c +10 -0
+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

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#8 lore raw

Re: [PATCH 6/8] at91sam9m10ihd: add lcd support

Quoted 101 lines · Sascha Hauer
Quoted 61 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 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
arch/arm/boards/at91sam9m10ihd/env/init/splash new file +8 -0
new file mode 100644
index 0000000..18e74df
@@ -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
arch/arm/boards/at91sam9m10ihd/init.c +31 -0
index beede0b..da32a04 100644
@@ -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,
+	},

arch/arm/boards/at91sam9m10ihd/init.c static int at91sam9m10g45ek_mem_init(void) · line 216

Quoted 10 lines
arch/arm/boards/at91sam9m10ihd/init.c +10 -0
+};
+
+#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.

Quoted 13 lines
arch/arm/boards/at91sam9m10ihd/init.c +13 -0
+
+/* 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),
+};
+

arch/arm/boards/at91sam9m10ihd/init.c static int at91sam9m10g45ek_mem_init(void) · line 239

Quoted 10 lines
arch/arm/boards/at91sam9m10ihd/init.c +10 -0
+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.

Quoted 2 lines

This leaves the unused function producing a compiler warning. Can you provide a fixup patch?

ok

Best Regards,
J.

Quoted 9 lines

Sascha

Signature · 4 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#9 lore raw

PATCH v2 7/8 at91sam9261ek: add lcd support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 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(-)
arch/arm/boards/at91sam9261ek/env/bin/init_board +7 -0
index a76a660..8e849c6 100644
@@ -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
 
arch/arm/boards/at91sam9261ek/init.c +82 -1

101 lines not on this page · raw message

arch/arm/configs/at91sam9261ek_defconfig +4 -0
index 5daa47b..9c955b4 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#10 lore raw

PATCH v2 8/8 at91sam9263ek: add lcd support

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 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(-)
arch/arm/boards/at91sam9263ek/env/bin/init_board +7 -0
index ae2ac7d..f2e6294 100644
@@ -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
 
arch/arm/boards/at91sam9263ek/init.c +71 -1

90 lines not on this page · raw message

arch/arm/configs/at91sam9263ek_defconfig +4 -0
index 5d44052..e78849a 100644
@@ -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
Signature · 7 lines
1.7.10.4


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#11 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · Jean-Christophe PLAGNIOL-VILLARD

HI,

this patch serie add the lcdc framebuffer support

v2:
- drop board splash.png (we need to create a sub repo for theme)
- add sam9261ek
- add sam9263ek
- add sam9m10ihd

Quoted 8 lines

The following changes since commit cd1c289b2a4949e8acb235d4847419bde784a9d6:

Merge branch 'for-next/misc' into next (2013-01-25 19:51:11 +0100)

are available in the git repository at:

git://git.jcrosoft.org/barebox.git delivery/atmel_fb

Applied, thanks

Sascha

Quoted 51 lines

for you to fetch changes up to 4e93093ab5465fdb72526d353e0e05ddad27d38e:

at91sam9263ek: add lcd support (2013-01-23 13:39:04 +0800)

----------------------------------------------------------------
Jean-Christophe PLAGNIOL-VILLARD (8):
video: add atmel lcdc frambuffer support
at91sam9263: add atmel lcdc frambuffer support
at91sam9261: add atmel lcdc frambuffer support
at91sam9g45: add atmel lcdc frambuffer support
at91sam9m10g45ek: add lcdc support
at91sam9m10ihd: add lcd support
at91sam9261ek: add lcd support
at91sam9263ek: add lcd support

 arch/arm/boards/at91sam9261ek/env/bin/init_board    |    7 ++
 arch/arm/boards/at91sam9261ek/init.c                |   83 ++++++++++++++++-
 arch/arm/boards/at91sam9263ek/env/bin/init_board    |    7 ++
 arch/arm/boards/at91sam9263ek/init.c                |   72 ++++++++++++++-
 arch/arm/boards/at91sam9m10g45ek/env/bin/boot_board |    7 ++
 arch/arm/boards/at91sam9m10g45ek/init.c             |   43 +++++++++
 arch/arm/boards/at91sam9m10ihd/env/init/splash      |    8 ++
 arch/arm/boards/at91sam9m10ihd/init.c               |   65 ++++++++++++++
 arch/arm/configs/at91sam9261ek_defconfig            |    4 +
 arch/arm/configs/at91sam9263ek_defconfig            |    4 +
 arch/arm/configs/at91sam9m10g45ek_defconfig         |   11 ++-
 arch/arm/configs/at91sam9m10ihd_defconfig           |    5 ++
 arch/arm/mach-at91/at91sam9261_devices.c            |   53 +++++++++++
 arch/arm/mach-at91/at91sam9263.c                    |    1 +
 arch/arm/mach-at91/at91sam9263_devices.c            |   42 +++++++++
 arch/arm/mach-at91/at91sam9g45.c                    |    1 +
 arch/arm/mach-at91/at91sam9g45_devices.c            |   49 ++++++++++
 arch/arm/mach-at91/include/mach/board.h             |    4 +
 drivers/video/Kconfig                               |    4 +
 drivers/video/Makefile                              |    1 +
 drivers/video/atmel_lcdfb.c                         |  507 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/video/atmel_lcdc.h                          |  206 ++++++++++++++++++++++++++++++++++++++++++
 22 files changed, 1179 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boards/at91sam9m10ihd/env/init/splash
 create mode 100644 drivers/video/atmel_lcdfb.c
 create mode 100644 include/video/atmel_lcdc.h

Best Regards,
J,

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Signature · 9 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox