From ef419021907b2daa51ac31bdc1f858b1b1338b07 Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:14 +0100 Subject: avr32: fix 15-bit LCDC pin mask to use MSB lines This patch corrects the 15-bit LCDC pin mask definitions to select the five upper lines in each color byte from the LCDC data output. When reducing the color depth the LCDC will start filling MSB and downwards. Also only enable 5 bits per color as the define indicates. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen --- arch/avr32/mach-at32ap/include/mach/at32ap700x.h | 34 +++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'arch') diff --git a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h index 5c4c971eed8..f07fcd7390b 100644 --- a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h +++ b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h @@ -172,24 +172,26 @@ ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) #define ATMEL_LCDC_PRI_15B_DATA ( \ - ATMEL_LCDC(PC, DATA0) | ATMEL_LCDC(PC, DATA1) | \ - ATMEL_LCDC(PC, DATA2) | ATMEL_LCDC(PC, DATA3) | \ - ATMEL_LCDC(PC, DATA4) | ATMEL_LCDC(PC, DATA5) | \ - ATMEL_LCDC(PD, DATA8) | ATMEL_LCDC(PD, DATA9) | \ - ATMEL_LCDC(PD, DATA10) | ATMEL_LCDC(PD, DATA11) | \ - ATMEL_LCDC(PD, DATA12) | ATMEL_LCDC(PD, DATA16) | \ - ATMEL_LCDC(PD, DATA17) | ATMEL_LCDC(PD, DATA18) | \ - ATMEL_LCDC(PD, DATA19) | ATMEL_LCDC(PD, DATA20)) + ATMEL_LCDC(PC, DATA3) | ATMEL_LCDC(PC, DATA4) | \ + ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \ + ATMEL_LCDC(PD, DATA7) | \ + ATMEL_LCDC(PD, DATA11) | ATMEL_LCDC(PD, DATA12) | \ + ATMEL_LCDC(PD, DATA13) | ATMEL_LCDC(PD, DATA14) | \ + ATMEL_LCDC(PD, DATA15) | \ + ATMEL_LCDC(PD, DATA19) | ATMEL_LCDC(PD, DATA20) | \ + ATMEL_LCDC(PD, DATA21) | ATMEL_LCDC(PD, DATA22) | \ + ATMEL_LCDC(PD, DATA23)) #define ATMEL_LCDC_ALT_15B_DATA ( \ - ATMEL_LCDC(PE, DATA0) | ATMEL_LCDC(PE, DATA1) | \ - ATMEL_LCDC(PE, DATA2) | ATMEL_LCDC(PE, DATA3) | \ - ATMEL_LCDC(PE, DATA4) | ATMEL_LCDC(PC, DATA5) | \ - ATMEL_LCDC(PE, DATA8) | ATMEL_LCDC(PE, DATA9) | \ - ATMEL_LCDC(PE, DATA10) | ATMEL_LCDC(PE, DATA11) | \ - ATMEL_LCDC(PE, DATA12) | ATMEL_LCDC(PE, DATA16) | \ - ATMEL_LCDC(PE, DATA17) | ATMEL_LCDC(PE, DATA18) | \ - ATMEL_LCDC(PE, DATA19) | ATMEL_LCDC(PE, DATA20)) + ATMEL_LCDC(PE, DATA3) | ATMEL_LCDC(PE, DATA4) | \ + ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \ + ATMEL_LCDC(PD, DATA7) | \ + ATMEL_LCDC(PE, DATA11) | ATMEL_LCDC(PE, DATA12) | \ + ATMEL_LCDC(PD, DATA13) | ATMEL_LCDC(PD, DATA14) | \ + ATMEL_LCDC(PD, DATA15) | \ + ATMEL_LCDC(PE, DATA19) | ATMEL_LCDC(PE, DATA20) | \ + ATMEL_LCDC(PE, DATA21) | ATMEL_LCDC(PD, DATA22) | \ + ATMEL_LCDC(PD, DATA23)) #define ATMEL_LCDC_PRI_CONTROL ( \ ATMEL_LCDC(PC, CC) | ATMEL_LCDC(PC, DVAL) | \ -- cgit v1.2.3-70-g09d2 From 2ae6d5d8f067753e29248863ad7a242eff6fdb0b Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:15 +0100 Subject: avr32: add pin mask for 18-bit color on the LCD controller This patch adds two defines for setting a pin mask for 18-bit LCD panels connected to the LCD controller. One mask for primary output and one mask for alternative output. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen --- arch/avr32/mach-at32ap/include/mach/at32ap700x.h | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'arch') diff --git a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h index f07fcd7390b..b9222bf895b 100644 --- a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h +++ b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h @@ -171,6 +171,28 @@ ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \ ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) +#define ATMEL_LCDC_PRI_18B_DATA ( \ + ATMEL_LCDC(PC, DATA2) | ATMEL_LCDC(PC, DATA3) | \ + ATMEL_LCDC(PC, DATA4) | ATMEL_LCDC(PC, DATA5) | \ + ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \ + ATMEL_LCDC(PD, DATA10) | ATMEL_LCDC(PD, DATA11) | \ + ATMEL_LCDC(PD, DATA12) | ATMEL_LCDC(PD, DATA13) | \ + ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \ + ATMEL_LCDC(PD, DATA18) | ATMEL_LCDC(PD, DATA19) | \ + ATMEL_LCDC(PD, DATA20) | ATMEL_LCDC(PD, DATA21) | \ + ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) + +#define ATMEL_LCDC_ALT_18B_DATA ( \ + ATMEL_LCDC(PE, DATA2) | ATMEL_LCDC(PE, DATA3) | \ + ATMEL_LCDC(PE, DATA4) | ATMEL_LCDC(PC, DATA5) | \ + ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \ + ATMEL_LCDC(PE, DATA10) | ATMEL_LCDC(PE, DATA11) | \ + ATMEL_LCDC(PE, DATA12) | ATMEL_LCDC(PD, DATA13) | \ + ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \ + ATMEL_LCDC(PE, DATA18) | ATMEL_LCDC(PE, DATA19) | \ + ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \ + ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23)) + #define ATMEL_LCDC_PRI_15B_DATA ( \ ATMEL_LCDC(PC, DATA3) | ATMEL_LCDC(PC, DATA4) | \ ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \ @@ -209,6 +231,10 @@ #define ATMEL_LCDC_ALT_24BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_24B_DATA) +#define ATMEL_LCDC_PRI_18BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_18B_DATA) + +#define ATMEL_LCDC_ALT_18BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_18B_DATA) + #define ATMEL_LCDC_PRI_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_15B_DATA) #define ATMEL_LCDC_ALT_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_15B_DATA) -- cgit v1.2.3-70-g09d2 From ecb1bd894e7238acfc6174602c29190d239be9b1 Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:16 +0100 Subject: avr32: set pin mask to alternative 18 bpp for EVKLCD10x boards This patch will set the pin mask to alternative 18 bits per pixel output for EVKLCD10x boards. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen --- arch/avr32/boards/atngw100/evklcd10x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/avr32/boards/atngw100/evklcd10x.c b/arch/avr32/boards/atngw100/evklcd10x.c index 8140b22b346..fbc7b03ef88 100644 --- a/arch/avr32/boards/atngw100/evklcd10x.c +++ b/arch/avr32/boards/atngw100/evklcd10x.c @@ -149,7 +149,8 @@ static int __init atevklcd10x_init(void) at32_add_device_ac97c(0, &ac97c0_data); at32_add_device_lcdc(0, &atevklcd10x_lcdc_data, - fbmem_start, fbmem_size, 1); + fbmem_start, fbmem_size, + ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL); return 0; } postcore_initcall(atevklcd10x_init); -- cgit v1.2.3-70-g09d2 From fe272b5bd13d3522f9d1ed35425f1c7af4d8343f Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:17 +0100 Subject: avr32: configure MCI detect and write protect pins for EVKLCD10x boards This patch removes the special handling of MCI platform data for EVKLCD10x boards. This is now possible since the pin mask for the LCD controller is no longer reserving the I/O lines used for MCI card detection and write protect. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen --- arch/avr32/boards/atngw100/setup.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch') diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index 05d3722fff1..feac0035800 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c @@ -56,13 +56,8 @@ static struct spi_board_info spi0_board_info[] __initdata = { static struct mci_platform_data __initdata mci0_data = { .slot[0] = { .bus_width = 4, -#ifndef CONFIG_BOARD_ATNGW100_EVKLCD10X .detect_pin = GPIO_PIN_PC(25), .wp_pin = GPIO_PIN_PE(0), -#else - .detect_pin = GPIO_PIN_NONE, - .wp_pin = GPIO_PIN_NONE, -#endif }, }; -- cgit v1.2.3-70-g09d2 From 30754acf29a9329185ffd8dffbb0c83b5a539818 Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:18 +0100 Subject: avr32: use GPIO line PB15 on EVKLCD10x boards for backlight The PB15 GPIO line is used to control the enable and disable signal for the backlight regulator on EVKLCD10x boards. This patch hands the I/O line over to the LCDC driver, which will control when to enable and disable the backlight. Signed-off-by: Hans-Christian Egtvedt [haavard.skinnemoen@atmel.com: reverted ac97c change] Signed-off-by: Haavard Skinnemoen --- arch/avr32/boards/atngw100/evklcd10x.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/avr32/boards/atngw100/evklcd10x.c b/arch/avr32/boards/atngw100/evklcd10x.c index fbc7b03ef88..4e3ab8e0800 100644 --- a/arch/avr32/boards/atngw100/evklcd10x.c +++ b/arch/avr32/boards/atngw100/evklcd10x.c @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -19,6 +20,7 @@ #include #include +#include #include static struct ac97c_platform_data __initdata ac97c0_data = { @@ -144,13 +146,29 @@ static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { }; #endif +static void atevklcd10x_lcdc_power_control(int on) +{ + gpio_set_value(GPIO_PIN_PB(15), on); +} + static int __init atevklcd10x_init(void) { - at32_add_device_ac97c(0, &ac97c0_data); + /* PB15 is connected to the enable line on the boost regulator + * controlling the backlight for the LCD panel. + */ + at32_select_gpio(GPIO_PIN_PB(15), AT32_GPIOF_OUTPUT); + gpio_request(GPIO_PIN_PB(15), "backlight"); + gpio_direction_output(GPIO_PIN_PB(15), 0); + + atevklcd10x_lcdc_data.atmel_lcdfb_power_control = + atevklcd10x_lcdc_power_control; at32_add_device_lcdc(0, &atevklcd10x_lcdc_data, fbmem_start, fbmem_size, ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL); + + at32_add_device_ac97c(0, &ac97c0_data); + return 0; } postcore_initcall(atevklcd10x_init); -- cgit v1.2.3-70-g09d2 From b2a49ed0083ec5f51e9e0ed2e739b9b6259e330c Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:19 +0100 Subject: avr32: fix timing LCD parameters for EVKLCD10X boards This patch adjusts the timing parameters for the Kyocera LCD panels connected on the EVKLCD10X addon boards. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen --- arch/avr32/boards/atngw100/evklcd10x.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'arch') diff --git a/arch/avr32/boards/atngw100/evklcd10x.c b/arch/avr32/boards/atngw100/evklcd10x.c index 4e3ab8e0800..ae699120540 100644 --- a/arch/avr32/boards/atngw100/evklcd10x.c +++ b/arch/avr32/boards/atngw100/evklcd10x.c @@ -33,14 +33,14 @@ static struct ac97c_platform_data __initdata ac97c0_data = { #ifdef CONFIG_BOARD_ATNGW100_EVKLCD10X_VGA static struct fb_videomode __initdata tcg057vglad_modes[] = { { - .name = "640x480 @ 60", - .refresh = 60, + .name = "640x480 @ 50", + .refresh = 50, .xres = 640, .yres = 480, .pixclock = KHZ2PICOS(25180), - .left_margin = 64, .right_margin = 31, - .upper_margin = 34, .lower_margin = 2, - .hsync_len = 96, .vsync_len = 4, + .left_margin = 64, .right_margin = 96, + .upper_margin = 34, .lower_margin = 11, + .hsync_len = 64, .vsync_len = 15, .sync = 0, .vmode = FB_VMODE_NONINTERLACED, @@ -71,14 +71,14 @@ static struct atmel_lcdfb_info __initdata atevklcd10x_lcdc_data = { #elif CONFIG_BOARD_ATNGW100_EVKLCD10X_QVGA static struct fb_videomode __initdata tcg057qvlad_modes[] = { { - .name = "320x240 @ 60", - .refresh = 60, + .name = "320x240 @ 50", + .refresh = 50, .xres = 320, .yres = 240, .pixclock = KHZ2PICOS(6300), - .left_margin = 52, .right_margin = 28, - .upper_margin = 7, .lower_margin = 2, - .hsync_len = 96, .vsync_len = 4, + .left_margin = 34, .right_margin = 46, + .upper_margin = 7, .lower_margin = 15, + .hsync_len = 64, .vsync_len = 12, .sync = 0, .vmode = FB_VMODE_NONINTERLACED, -- cgit v1.2.3-70-g09d2 From 9477ab2b2ae098423af2ed4fb1f7b864abfc14fc Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Tue, 24 Mar 2009 15:45:21 +0100 Subject: avr32: use gpio_is_valid() to check USBA vbus_pin I/O line This patch will use gpio_is_valid() to check the vbus_pin I/O line. Signed-off-by: Hans-Christian Egtvedt Signed-off-by: Haavard Skinnemoen --- arch/avr32/mach-at32ap/at32ap700x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 3fbfd1e32a9..402cae8f920 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c @@ -1753,7 +1753,7 @@ at32_add_device_usba(unsigned int id, struct usba_platform_data *data) if (platform_device_add_data(pdev, data, sizeof(usba_data))) goto out_free_pdev; - if (data->vbus_pin >= 0) + if (gpio_is_valid(data->vbus_pin)) at32_select_gpio(data->vbus_pin, 0); usba0_pclk.dev = &pdev->dev; -- cgit v1.2.3-70-g09d2 From a16fffdd8eb95ebab7dc22414896fe6493951e0e Mon Sep 17 00:00:00 2001 From: Jonas Larsson Date: Fri, 27 Mar 2009 10:18:14 +0100 Subject: Add Merisc board support Merisc is the family name for a range of AVR32-based boards. The boards are designed to be used in a man-machine interfacing environment, utilizing a touch-based graphical user interface. They host a vast range of I/O peripherals as well as a large SDRAM & Flash memory bank. For more information see: http://www.martinsson.se/merisc Signed-off-by: Jonas Larsson Signed-off-by: Haavard Skinnemoen --- arch/avr32/Kconfig | 14 + arch/avr32/Makefile | 1 + arch/avr32/boards/merisc/Kconfig | 5 + arch/avr32/boards/merisc/Makefile | 1 + arch/avr32/boards/merisc/display.c | 65 ++ arch/avr32/boards/merisc/flash.c | 139 ++++ arch/avr32/boards/merisc/merisc.h | 18 + arch/avr32/boards/merisc/merisc_sysfs.c | 65 ++ arch/avr32/boards/merisc/setup.c | 289 ++++++++ arch/avr32/configs/merisc_defconfig | 1237 +++++++++++++++++++++++++++++++ 10 files changed, 1834 insertions(+) create mode 100644 arch/avr32/boards/merisc/Kconfig create mode 100644 arch/avr32/boards/merisc/Makefile create mode 100644 arch/avr32/boards/merisc/display.c create mode 100644 arch/avr32/boards/merisc/flash.c create mode 100644 arch/avr32/boards/merisc/merisc.h create mode 100644 arch/avr32/boards/merisc/merisc_sysfs.c create mode 100644 arch/avr32/boards/merisc/setup.c create mode 100644 arch/avr32/configs/merisc_defconfig (limited to 'arch') diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig index b189680d18b..8cee7842d0b 100644 --- a/arch/avr32/Kconfig +++ b/arch/avr32/Kconfig @@ -144,6 +144,19 @@ config BOARD_FAVR_32 bool "Favr-32 LCD-board" select CPU_AT32AP7000 +config BOARD_MERISC + bool "Merisc board" + select CPU_AT32AP7000 + help + Merisc is the family name for a range of AVR32-based boards. + + The boards are designed to be used in a man-machine + interfacing environment, utilizing a touch-based graphical + user interface. They host a vast range of I/O peripherals as + well as a large SDRAM & Flash memory bank. + + For more information see: http://www.martinsson.se/merisc + config BOARD_MIMC200 bool "MIMC200 CPU board" select CPU_AT32AP7000 @@ -153,6 +166,7 @@ source "arch/avr32/boards/atstk1000/Kconfig" source "arch/avr32/boards/atngw100/Kconfig" source "arch/avr32/boards/hammerhead/Kconfig" source "arch/avr32/boards/favr-32/Kconfig" +source "arch/avr32/boards/merisc/Kconfig" choice prompt "Boot loader type" diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index f3ef3bbf797..0b97e14f73f 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile @@ -35,6 +35,7 @@ core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/ core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/ core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/ +core-$(CONFIG_BOARD_MERISC) += arch/avr32/boards/merisc/ core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/ core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ core-y += arch/avr32/kernel/ diff --git a/arch/avr32/boards/merisc/Kconfig b/arch/avr32/boards/merisc/Kconfig new file mode 100644 index 00000000000..7e043275d5a --- /dev/null +++ b/arch/avr32/boards/merisc/Kconfig @@ -0,0 +1,5 @@ +# Merisc customization + +if BOARD_MERISC + +endif # BOARD_MERISC diff --git a/arch/avr32/boards/merisc/Makefile b/arch/avr32/boards/merisc/Makefile new file mode 100644 index 00000000000..d24c78729bd --- /dev/null +++ b/arch/avr32/boards/merisc/Makefile @@ -0,0 +1 @@ +obj-y += setup.o flash.o display.o merisc_sysfs.o diff --git a/arch/avr32/boards/merisc/display.c b/arch/avr32/boards/merisc/display.c new file mode 100644 index 00000000000..85a543cd4ab --- /dev/null +++ b/arch/avr32/boards/merisc/display.c @@ -0,0 +1,65 @@ +/* + * Display setup code for the Merisc board + * + * Copyright (C) 2008 Martinsson Elektronik AB + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include +#include +#include