Path: blob/master/arch/arm/mach-at91/board-carmeva.c
10817 views
/*1* linux/arch/arm/mach-at91/board-carmeva.c2*3* Copyright (c) 2005 Peer Georgi4* Conitec Datasystems5*6* This program is free software; you can redistribute it and/or modify7* it under the terms of the GNU General Public License as published by8* the Free Software Foundation; either version 2 of the License, or9* (at your option) any later version.10*11* This program is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14* GNU General Public License for more details.15*16* You should have received a copy of the GNU General Public License17* along with this program; if not, write to the Free Software18* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA19*/2021#include <linux/types.h>22#include <linux/init.h>23#include <linux/mm.h>24#include <linux/module.h>25#include <linux/platform_device.h>2627#include <asm/setup.h>28#include <asm/mach-types.h>29#include <asm/irq.h>3031#include <asm/mach/arch.h>32#include <asm/mach/map.h>33#include <asm/mach/irq.h>3435#include <mach/hardware.h>36#include <mach/board.h>37#include <mach/gpio.h>3839#include "generic.h"404142static void __init carmeva_init_early(void)43{44/* Initialize processor: 20.000 MHz crystal */45at91rm9200_initialize(20000000);4647/* DBGU on ttyS0. (Rx & Tx only) */48at91_register_uart(0, 0, 0);4950/* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */51at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS52| ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD53| ATMEL_UART_RI);5455/* set serial console to ttyS0 (ie, DBGU) */56at91_set_serial_console(0);57}5859static void __init carmeva_init_irq(void)60{61at91rm9200_init_interrupts(NULL);62}6364static struct at91_eth_data __initdata carmeva_eth_data = {65.phy_irq_pin = AT91_PIN_PC4,66.is_rmii = 1,67};6869static struct at91_usbh_data __initdata carmeva_usbh_data = {70.ports = 2,71};7273static struct at91_udc_data __initdata carmeva_udc_data = {74.vbus_pin = AT91_PIN_PD12,75.pullup_pin = AT91_PIN_PD9,76};7778/* FIXME: user dependent */79// static struct at91_cf_data __initdata carmeva_cf_data = {80// .det_pin = AT91_PIN_PB0,81// .rst_pin = AT91_PIN_PC5,82// .irq_pin = ... not connected83// .vcc_pin = ... always powered84// };8586static struct at91_mmc_data __initdata carmeva_mmc_data = {87.slot_b = 0,88.wire4 = 1,89.det_pin = AT91_PIN_PB10,90.wp_pin = AT91_PIN_PC14,91};9293static struct spi_board_info carmeva_spi_devices[] = {94{ /* DataFlash chip */95.modalias = "mtd_dataflash",96.chip_select = 0,97.max_speed_hz = 10 * 1000 * 1000,98},99{ /* User accessible spi - cs1 (250KHz) */100.modalias = "spi-cs1",101.chip_select = 1,102.max_speed_hz = 250 * 1000,103},104{ /* User accessible spi - cs2 (1MHz) */105.modalias = "spi-cs2",106.chip_select = 2,107.max_speed_hz = 1 * 1000 * 1000,108},109{ /* User accessible spi - cs3 (10MHz) */110.modalias = "spi-cs3",111.chip_select = 3,112.max_speed_hz = 10 * 1000 * 1000,113},114};115116static struct gpio_led carmeva_leds[] = {117{ /* "user led 1", LED9 */118.name = "led9",119.gpio = AT91_PIN_PA21,120.active_low = 1,121.default_trigger = "heartbeat",122},123{ /* "user led 2", LED10 */124.name = "led10",125.gpio = AT91_PIN_PA25,126.active_low = 1,127},128{ /* "user led 3", LED11 */129.name = "led11",130.gpio = AT91_PIN_PA26,131.active_low = 1,132},133{ /* "user led 4", LED12 */134.name = "led12",135.gpio = AT91_PIN_PA18,136.active_low = 1,137}138};139140static void __init carmeva_board_init(void)141{142/* Serial */143at91_add_device_serial();144/* Ethernet */145at91_add_device_eth(&carmeva_eth_data);146/* USB Host */147at91_add_device_usbh(&carmeva_usbh_data);148/* USB Device */149at91_add_device_udc(&carmeva_udc_data);150/* I2C */151at91_add_device_i2c(NULL, 0);152/* SPI */153at91_add_device_spi(carmeva_spi_devices, ARRAY_SIZE(carmeva_spi_devices));154/* Compact Flash */155// at91_add_device_cf(&carmeva_cf_data);156/* MMC */157at91_add_device_mmc(0, &carmeva_mmc_data);158/* LEDs */159at91_gpio_leds(carmeva_leds, ARRAY_SIZE(carmeva_leds));160}161162MACHINE_START(CARMEVA, "Carmeva")163/* Maintainer: Conitec Datasystems */164.timer = &at91rm9200_timer,165.map_io = at91rm9200_map_io,166.init_early = carmeva_init_early,167.init_irq = carmeva_init_irq,168.init_machine = carmeva_board_init,169MACHINE_END170171172