Path: blob/master/arch/arm/mach-at91/board-flexibity.c
10817 views
/*1* linux/arch/arm/mach-at91/board-flexibity.c2*3* Copyright (C) 2010 Flexibity4* Copyright (C) 2005 SAN People5* Copyright (C) 2006 Atmel6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License18* along with this program; if not, write to the Free Software19* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA20*/2122#include <linux/init.h>23#include <linux/platform_device.h>24#include <linux/spi/spi.h>25#include <linux/input.h>26#include <linux/gpio.h>2728#include <asm/mach-types.h>2930#include <asm/mach/arch.h>31#include <asm/mach/map.h>32#include <asm/mach/irq.h>3334#include <mach/hardware.h>35#include <mach/board.h>3637#include "generic.h"3839static void __init flexibity_init_early(void)40{41/* Initialize processor: 18.432 MHz crystal */42at91sam9260_initialize(18432000);4344/* DBGU on ttyS0. (Rx & Tx only) */45at91_register_uart(0, 0, 0);4647/* set serial console to ttyS0 (ie, DBGU) */48at91_set_serial_console(0);49}5051static void __init flexibity_init_irq(void)52{53at91sam9260_init_interrupts(NULL);54}5556/* USB Host port */57static struct at91_usbh_data __initdata flexibity_usbh_data = {58.ports = 2,59};6061/* USB Device port */62static struct at91_udc_data __initdata flexibity_udc_data = {63.vbus_pin = AT91_PIN_PC5,64.pullup_pin = 0, /* pull-up driven by UDC */65};6667/* SPI devices */68static struct spi_board_info flexibity_spi_devices[] = {69{ /* DataFlash chip */70.modalias = "mtd_dataflash",71.chip_select = 1,72.max_speed_hz = 15 * 1000 * 1000,73.bus_num = 0,74},75};7677/* MCI (SD/MMC) */78static struct at91_mmc_data __initdata flexibity_mmc_data = {79.slot_b = 0,80.wire4 = 1,81.det_pin = AT91_PIN_PC9,82.wp_pin = AT91_PIN_PC4,83};8485/* LEDs */86static struct gpio_led flexibity_leds[] = {87{88.name = "usb1:green",89.gpio = AT91_PIN_PA12,90.active_low = 1,91.default_trigger = "default-on",92},93{94.name = "usb1:red",95.gpio = AT91_PIN_PA13,96.active_low = 1,97.default_trigger = "default-on",98},99{100.name = "usb2:green",101.gpio = AT91_PIN_PB26,102.active_low = 1,103.default_trigger = "default-on",104},105{106.name = "usb2:red",107.gpio = AT91_PIN_PB27,108.active_low = 1,109.default_trigger = "default-on",110},111{112.name = "usb3:green",113.gpio = AT91_PIN_PC8,114.active_low = 1,115.default_trigger = "default-on",116},117{118.name = "usb3:red",119.gpio = AT91_PIN_PC6,120.active_low = 1,121.default_trigger = "default-on",122},123{124.name = "usb4:green",125.gpio = AT91_PIN_PB4,126.active_low = 1,127.default_trigger = "default-on",128},129{130.name = "usb4:red",131.gpio = AT91_PIN_PB5,132.active_low = 1,133.default_trigger = "default-on",134}135};136137static void __init flexibity_board_init(void)138{139/* Serial */140at91_add_device_serial();141/* USB Host */142at91_add_device_usbh(&flexibity_usbh_data);143/* USB Device */144at91_add_device_udc(&flexibity_udc_data);145/* SPI */146at91_add_device_spi(flexibity_spi_devices,147ARRAY_SIZE(flexibity_spi_devices));148/* MMC */149at91_add_device_mmc(0, &flexibity_mmc_data);150/* LEDs */151at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));152}153154MACHINE_START(FLEXIBITY, "Flexibity Connect")155/* Maintainer: Maxim Osipov */156.timer = &at91sam926x_timer,157.map_io = at91sam9260_map_io,158.init_early = flexibity_init_early,159.init_irq = flexibity_init_irq,160.init_machine = flexibity_board_init,161MACHINE_END162163164