Skip to content

Commit

Permalink
Merge branch 'avr32-arch' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/hskinnemoen/avr32-2.6

* 'avr32-arch' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
  avr32: add hardware handshake support to atmel_serial
  avr32: add RTS/CTS/CLK pin selection for the USARTs
  Add RTC support for Merisc boards
  avr32: at32ap700x: setup DMA for AC97C in the machine code
  avr32: at32ap700x: setup DMA for ABDAC in the machine code
  Add Merisc board support
  avr32: use gpio_is_valid() to check USBA vbus_pin I/O line
  atmel-usba-udc: use gpio_is_valid() to check vbus_pin I/O line
  avr32: fix timing LCD parameters for EVKLCD10X boards
  avr32: use GPIO line PB15 on EVKLCD10x boards for backlight
  avr32: configure MCI detect and write protect pins for EVKLCD10x boards
  avr32: set pin mask to alternative 18 bpp for EVKLCD10x boards
  avr32: add pin mask for 18-bit color on the LCD controller
  avr32: fix 15-bit LCDC pin mask to use MSB lines
  • Loading branch information
Linus Torvalds committed Apr 5, 2009
2 parents 3516c6a + 8e706c4 commit 87fc94d
Show file tree
Hide file tree
Showing 23 changed files with 2,049 additions and 102 deletions.
14 changes: 14 additions & 0 deletions arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions arch/avr32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
50 changes: 34 additions & 16 deletions arch/avr32/boards/atngw100/evklcd10x.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/init.h>
#include <linux/linkage.h>
#include <linux/gpio.h>
#include <linux/fb.h>
#include <linux/platform_device.h>

Expand All @@ -19,26 +20,26 @@
#include <asm/setup.h>

#include <mach/at32ap700x.h>
#include <mach/portmux.h>
#include <mach/board.h>

#include <sound/atmel-ac97c.h>

static struct ac97c_platform_data __initdata ac97c0_data = {
.dma_rx_periph_id = 3,
.dma_tx_periph_id = 4,
.dma_controller_id = 0,
.reset_pin = GPIO_PIN_PB(19),
.reset_pin = GPIO_PIN_PB(19),
};

#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,
Expand Down Expand Up @@ -69,14 +70,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,
Expand Down Expand Up @@ -144,12 +145,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, 1);
fbmem_start, fbmem_size,
ATMEL_LCDC_ALT_18BIT | ATMEL_LCDC_PE_DVAL);

at32_add_device_ac97c(0, &ac97c0_data, AC97C_BOTH);

return 0;
}
postcore_initcall(atevklcd10x_init);
7 changes: 1 addition & 6 deletions arch/avr32/boards/atngw100/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
};

Expand Down Expand Up @@ -123,7 +118,7 @@ static void __init set_hw_addr(struct platform_device *pdev)

void __init setup_board(void)
{
at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */
at32_map_usart(1, 0, 0); /* USART 1: /dev/ttyS0, DB9 */
at32_setup_serial_console(0);
}

Expand Down
6 changes: 3 additions & 3 deletions arch/avr32/boards/atstk1000/atstk1002.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ static void __init atstk1002_setup_extdac(void)
void __init setup_board(void)
{
#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
#else
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
#endif
/* USART 2/unused: expansion connector */
at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */

at32_setup_serial_console(0);
}
Expand Down
6 changes: 3 additions & 3 deletions arch/avr32/boards/atstk1000/atstk1003.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ static void __init atstk1003_setup_extdac(void)
void __init setup_board(void)
{
#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
#else
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
#endif
/* USART 2/unused: expansion connector */
at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */

at32_setup_serial_console(0);
}
Expand Down
6 changes: 3 additions & 3 deletions arch/avr32/boards/atstk1000/atstk1004.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ static void __init atstk1004_setup_extdac(void)
void __init setup_board(void)
{
#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
at32_map_usart(0, 1); /* USART 0/B: /dev/ttyS1, IRDA */
at32_map_usart(0, 1, 0); /* USART 0/B: /dev/ttyS1, IRDA */
#else
at32_map_usart(1, 0); /* USART 1/A: /dev/ttyS0, DB9 */
at32_map_usart(1, 0, 0); /* USART 1/A: /dev/ttyS0, DB9 */
#endif
/* USART 2/unused: expansion connector */
at32_map_usart(3, 2); /* USART 3/C: /dev/ttyS2, DB9 */
at32_map_usart(3, 2, 0); /* USART 3/C: /dev/ttyS2, DB9 */

at32_setup_serial_console(0);
}
Expand Down
9 changes: 7 additions & 2 deletions arch/avr32/boards/favr-32/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>

#include <sound/atmel-abdac.h>

#include <video/atmel_lcdc.h>

#include <asm/setup.h>
Expand All @@ -41,6 +43,9 @@ unsigned long at32_board_osc_rates[3] = {
/* Initialized by bootloader-specific startup code. */
struct tag *bootloader_tags __initdata;

static struct atmel_abdac_pdata __initdata abdac0_data = {
};

struct eth_addr {
u8 addr[6];
};
Expand Down Expand Up @@ -245,7 +250,7 @@ static void __init favr32_setup_atmel_pwm_bl(void)

void __init setup_board(void)
{
at32_map_usart(3, 0); /* USART 3 => /dev/ttyS0 */
at32_map_usart(3, 0, 0); /* USART 3 => /dev/ttyS0 */
at32_setup_serial_console(0);
}

Expand Down Expand Up @@ -326,7 +331,7 @@ static int __init favr32_init(void)

spi1_board_info[0].irq = gpio_to_irq(GPIO_PIN_PB(3));

set_abdac_rate(at32_add_device_abdac(0));
set_abdac_rate(at32_add_device_abdac(0, &abdac0_data));

at32_add_device_pwm(1 << atmel_pwm_bl_pdata.pwm_channel);
at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
Expand Down
6 changes: 4 additions & 2 deletions arch/avr32/boards/hammerhead/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <mach/init.h>
#include <mach/portmux.h>

#include <sound/atmel-ac97c.h>

#include "../../mach-at32ap/clock.h"
#include "flash.h"

Expand Down Expand Up @@ -163,7 +165,7 @@ static void __init set_hw_addr(struct platform_device *pdev)

void __init setup_board(void)
{
at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */
at32_map_usart(1, 0, 0); /* USART 1: /dev/ttyS0, DB9 */
at32_setup_serial_console(0);
}

Expand Down Expand Up @@ -233,7 +235,7 @@ static int __init hammerhead_init(void)
i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info));

#ifdef CONFIG_BOARD_HAMMERHEAD_SND
at32_add_device_ac97c(0, &ac97c_data);
at32_add_device_ac97c(0, &ac97c_data, AC97C_BOTH);
#endif

/* Select the Touchscreen interrupt pin mode */
Expand Down
5 changes: 5 additions & 0 deletions arch/avr32/boards/merisc/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Merisc customization

if BOARD_MERISC

endif # BOARD_MERISC
1 change: 1 addition & 0 deletions arch/avr32/boards/merisc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj-y += setup.o flash.o display.o merisc_sysfs.o
65 changes: 65 additions & 0 deletions arch/avr32/boards/merisc/display.c
Original file line number Diff line number Diff line change
@@ -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 <linux/init.h>
#include <linux/platform_device.h>
#include <linux/fb.h>
#include <video/atmel_lcdc.h>
#include <asm/setup.h>
#include <mach/board.h>
#include "merisc.h"

static struct fb_videomode merisc_fb_videomode[] = {
{
.refresh = 44,
.xres = 640,
.yres = 480,
.left_margin = 96,
.right_margin = 96,
.upper_margin = 34,
.lower_margin = 8,
.hsync_len = 64,
.vsync_len = 64,
.name = "640x480 @ 44",
.pixclock = KHZ2PICOS(25180),
.sync = 0,
.vmode = FB_VMODE_NONINTERLACED,
},
};

static struct fb_monspecs merisc_fb_monspecs = {
.manufacturer = "Kyo",
.monitor = "TCG075VG2AD",
.modedb = merisc_fb_videomode,
.modedb_len = ARRAY_SIZE(merisc_fb_videomode),
.hfmin = 30000,
.hfmax = 33333,
.vfmin = 60,
.vfmax = 90,
.dclkmax = 30000000,
};

struct atmel_lcdfb_info merisc_lcdc_data = {
.default_bpp = 24,
.default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
.default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
| ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
| ATMEL_LCDC_MEMOR_BIG),
.default_monspecs = &merisc_fb_monspecs,
.guard_time = 2,
};

static int __init merisc_display_init(void)
{
at32_add_device_lcdc(0, &merisc_lcdc_data, fbmem_start,
fbmem_size, 0);

return 0;
}
device_initcall(merisc_display_init);
Loading

0 comments on commit 87fc94d

Please sign in to comment.