]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/board-carmeva.c
[ARM] 5261/1: [AT91] Support for LEDs on Conitec ARM&EVA board
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / board-carmeva.c
index 0f0878294a67c660a8bb2e3b291f5c85212cd3f6..db1f9544d2e0f9af8cb9ef46b8a3d2a126408c27 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 
-#include <asm/hardware.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 
-#include <asm/arch/board.h>
-#include <asm/arch/gpio.h>
+#include <mach/hardware.h>
+#include <mach/board.h>
+#include <mach/gpio.h>
 
 #include "generic.h"
 
 
-/*
- * Serial port configuration.
- *    0 .. 3 = USART0 .. USART3
- *    4      = DBGU
- */
-static struct at91_uart_config __initdata carmeva_uart_config = {
-       .console_tty    = 0,                            /* ttyS0 */
-       .nr_tty         = 2,
-       .tty_map        = { 4, 1, -1, -1, -1 }          /* ttyS0, ..., ttyS4 */
-};
-
 static void __init carmeva_map_io(void)
 {
        /* Initialize processor: 20.000 MHz crystal */
        at91rm9200_initialize(20000000, AT91RM9200_BGA);
 
-       /* Setup the serial ports and console */
-       at91_init_serial(&carmeva_uart_config);
+       /* DBGU on ttyS0. (Rx & Tx only) */
+       at91_register_uart(0, 0, 0);
+
+       /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */
+       at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS
+                          | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD
+                          | ATMEL_UART_RI);
+
+       /* set serial console to ttyS0 (ie, DBGU) */
+       at91_set_serial_console(0);
 }
 
 static void __init carmeva_init_irq(void)
@@ -117,6 +114,30 @@ static struct spi_board_info carmeva_spi_devices[] = {
        },
 };
 
+static struct gpio_led carmeva_leds[] = {
+       { /* "user led 1", LED9 */
+               .name                   = "led9",
+               .gpio                   = AT91_PIN_PA21,
+               .active_low             = 1,
+               .default_trigger        = "heartbeat",
+       },
+       { /* "user led 2", LED10 */
+               .name                   = "led10",
+               .gpio                   = AT91_PIN_PA25,
+               .active_low             = 1,
+       },
+       { /* "user led 3", LED11 */
+               .name                   = "led11",
+               .gpio                   = AT91_PIN_PA26,
+               .active_low             = 1,
+       },
+       { /* "user led 4", LED12 */
+               .name                   = "led12",
+               .gpio                   = AT91_PIN_PA18,
+               .active_low             = 1,
+       }
+};
+
 static void __init carmeva_board_init(void)
 {
        /* Serial */
@@ -135,6 +156,8 @@ static void __init carmeva_board_init(void)
 //     at91_add_device_cf(&carmeva_cf_data);
        /* MMC */
        at91_add_device_mmc(0, &carmeva_mmc_data);
+       /* LEDs */
+       at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));
 }
 
 MACHINE_START(CARMEVA, "Carmeva")