2 * linux/arch/arm/mach-at91/board-flexibity.c
4 * Copyright (C) 2010-2011 Flexibity
5 * Copyright (C) 2005 SAN People
6 * Copyright (C) 2006 Atmel
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.
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.
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
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>
29 #include <asm/mach-types.h>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
33 #include <asm/mach/irq.h>
35 #include <mach/hardware.h>
41 static void __init
flexibity_init_early(void)
43 /* Initialize processor: 18.432 MHz crystal */
44 at91_initialize(18432000);
48 static struct at91_usbh_data __initdata flexibity_usbh_data
= {
50 .vbus_pin
= {-EINVAL
, -EINVAL
},
51 .overcurrent_pin
= {-EINVAL
, -EINVAL
},
55 static struct at91_udc_data __initdata flexibity_udc_data
= {
56 .vbus_pin
= AT91_PIN_PC5
,
57 .pullup_pin
= -EINVAL
, /* pull-up driven by UDC */
61 static struct i2c_board_info __initdata flexibity_i2c_devices
[] = {
63 I2C_BOARD_INFO("ds1307", 0x68),
68 static struct spi_board_info flexibity_spi_devices
[] = {
69 { /* DataFlash chip */
70 .modalias
= "mtd_dataflash",
72 .max_speed_hz
= 15 * 1000 * 1000,
78 static struct mci_platform_data __initdata flexibity_mci0_data
= {
81 .detect_pin
= AT91_PIN_PC9
,
82 .wp_pin
= AT91_PIN_PC4
,
87 static struct gpio_led flexibity_leds
[] = {
90 .gpio
= AT91_PIN_PA12
,
92 .default_trigger
= "default-on",
96 .gpio
= AT91_PIN_PA13
,
98 .default_trigger
= "default-on",
101 .name
= "usb2:green",
102 .gpio
= AT91_PIN_PB26
,
104 .default_trigger
= "default-on",
108 .gpio
= AT91_PIN_PB27
,
110 .default_trigger
= "default-on",
113 .name
= "usb3:green",
114 .gpio
= AT91_PIN_PC8
,
116 .default_trigger
= "default-on",
120 .gpio
= AT91_PIN_PC6
,
122 .default_trigger
= "default-on",
125 .name
= "usb4:green",
126 .gpio
= AT91_PIN_PB4
,
128 .default_trigger
= "default-on",
132 .gpio
= AT91_PIN_PB5
,
134 .default_trigger
= "default-on",
138 static void __init
flexibity_board_init(void)
141 /* DBGU on ttyS0. (Rx & Tx only) */
142 at91_register_uart(0, 0, 0);
143 at91_add_device_serial();
145 at91_add_device_usbh(&flexibity_usbh_data
);
147 at91_add_device_udc(&flexibity_udc_data
);
149 at91_add_device_i2c(flexibity_i2c_devices
,
150 ARRAY_SIZE(flexibity_i2c_devices
));
152 at91_add_device_spi(flexibity_spi_devices
,
153 ARRAY_SIZE(flexibity_spi_devices
));
155 at91_add_device_mci(0, &flexibity_mci0_data
);
157 at91_gpio_leds(flexibity_leds
, ARRAY_SIZE(flexibity_leds
));
160 MACHINE_START(FLEXIBITY
, "Flexibity Connect")
161 /* Maintainer: Maxim Osipov */
162 .timer
= &at91sam926x_timer
,
163 .map_io
= at91_map_io
,
164 .handle_irq
= at91_aic_handle_irq
,
165 .init_early
= flexibity_init_early
,
166 .init_irq
= at91_init_irq_default
,
167 .init_machine
= flexibity_board_init
,