Maxim Osipov | 8ed9059 | 2010-09-15 11:54:49 +0100 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-at91/board-flexibity.c |
| 3 | * |
| 4 | * Copyright (C) 2010 Flexibity |
| 5 | * Copyright (C) 2005 SAN People |
| 6 | * Copyright (C) 2006 Atmel |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | */ |
| 22 | |
| 23 | #include <linux/init.h> |
| 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/spi/spi.h> |
| 26 | #include <linux/input.h> |
| 27 | #include <linux/gpio.h> |
| 28 | |
| 29 | #include <asm/mach-types.h> |
| 30 | |
| 31 | #include <asm/mach/arch.h> |
| 32 | #include <asm/mach/map.h> |
| 33 | #include <asm/mach/irq.h> |
| 34 | |
| 35 | #include <mach/hardware.h> |
| 36 | #include <mach/board.h> |
| 37 | |
| 38 | #include "generic.h" |
| 39 | |
| 40 | static void __init flexibity_map_io(void) |
| 41 | { |
| 42 | /* Initialize processor: 18.432 MHz crystal */ |
| 43 | at91sam9260_initialize(18432000); |
| 44 | |
| 45 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 46 | at91_register_uart(0, 0, 0); |
| 47 | |
| 48 | /* set serial console to ttyS0 (ie, DBGU) */ |
| 49 | at91_set_serial_console(0); |
| 50 | } |
| 51 | |
| 52 | static void __init flexibity_init_irq(void) |
| 53 | { |
| 54 | at91sam9260_init_interrupts(NULL); |
| 55 | } |
| 56 | |
| 57 | /* USB Host port */ |
| 58 | static struct at91_usbh_data __initdata flexibity_usbh_data = { |
| 59 | .ports = 2, |
| 60 | }; |
| 61 | |
| 62 | /* USB Device port */ |
| 63 | static struct at91_udc_data __initdata flexibity_udc_data = { |
| 64 | .vbus_pin = AT91_PIN_PC5, |
| 65 | .pullup_pin = 0, /* pull-up driven by UDC */ |
| 66 | }; |
| 67 | |
| 68 | /* SPI devices */ |
| 69 | static struct spi_board_info flexibity_spi_devices[] = { |
| 70 | { /* DataFlash chip */ |
| 71 | .modalias = "mtd_dataflash", |
| 72 | .chip_select = 1, |
| 73 | .max_speed_hz = 15 * 1000 * 1000, |
| 74 | .bus_num = 0, |
| 75 | }, |
| 76 | }; |
| 77 | |
| 78 | /* MCI (SD/MMC) */ |
| 79 | static struct at91_mmc_data __initdata flexibity_mmc_data = { |
| 80 | .slot_b = 0, |
| 81 | .wire4 = 1, |
| 82 | .det_pin = AT91_PIN_PC9, |
| 83 | .wp_pin = AT91_PIN_PC4, |
| 84 | }; |
| 85 | |
| 86 | /* LEDs */ |
| 87 | static struct gpio_led flexibity_leds[] = { |
| 88 | { |
| 89 | .name = "usb1:green", |
| 90 | .gpio = AT91_PIN_PA12, |
| 91 | .active_low = 1, |
| 92 | .default_trigger = "default-on", |
| 93 | }, |
| 94 | { |
| 95 | .name = "usb1:red", |
| 96 | .gpio = AT91_PIN_PA13, |
| 97 | .active_low = 1, |
| 98 | .default_trigger = "default-on", |
| 99 | }, |
| 100 | { |
| 101 | .name = "usb2:green", |
| 102 | .gpio = AT91_PIN_PB26, |
| 103 | .active_low = 1, |
| 104 | .default_trigger = "default-on", |
| 105 | }, |
| 106 | { |
| 107 | .name = "usb2:red", |
| 108 | .gpio = AT91_PIN_PB27, |
| 109 | .active_low = 1, |
| 110 | .default_trigger = "default-on", |
| 111 | }, |
| 112 | { |
| 113 | .name = "usb3:green", |
| 114 | .gpio = AT91_PIN_PC8, |
| 115 | .active_low = 1, |
| 116 | .default_trigger = "default-on", |
| 117 | }, |
| 118 | { |
| 119 | .name = "usb3:red", |
| 120 | .gpio = AT91_PIN_PC6, |
| 121 | .active_low = 1, |
| 122 | .default_trigger = "default-on", |
| 123 | }, |
| 124 | { |
| 125 | .name = "usb4:green", |
| 126 | .gpio = AT91_PIN_PB4, |
| 127 | .active_low = 1, |
| 128 | .default_trigger = "default-on", |
| 129 | }, |
| 130 | { |
| 131 | .name = "usb4:red", |
| 132 | .gpio = AT91_PIN_PB5, |
| 133 | .active_low = 1, |
| 134 | .default_trigger = "default-on", |
| 135 | } |
| 136 | }; |
| 137 | |
| 138 | static void __init flexibity_board_init(void) |
| 139 | { |
| 140 | /* Serial */ |
| 141 | at91_add_device_serial(); |
| 142 | /* USB Host */ |
| 143 | at91_add_device_usbh(&flexibity_usbh_data); |
| 144 | /* USB Device */ |
| 145 | at91_add_device_udc(&flexibity_udc_data); |
| 146 | /* SPI */ |
| 147 | at91_add_device_spi(flexibity_spi_devices, |
| 148 | ARRAY_SIZE(flexibity_spi_devices)); |
| 149 | /* MMC */ |
| 150 | at91_add_device_mmc(0, &flexibity_mmc_data); |
| 151 | /* LEDs */ |
| 152 | at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds)); |
| 153 | } |
| 154 | |
| 155 | MACHINE_START(FLEXIBITY, "Flexibity Connect") |
| 156 | /* Maintainer: Maxim Osipov */ |
Maxim Osipov | 8ed9059 | 2010-09-15 11:54:49 +0100 | [diff] [blame] | 157 | .boot_params = AT91_SDRAM_BASE + 0x100, |
| 158 | .timer = &at91sam926x_timer, |
| 159 | .map_io = flexibity_map_io, |
| 160 | .init_irq = flexibity_init_irq, |
| 161 | .init_machine = flexibity_board_init, |
| 162 | MACHINE_END |