ARM: at91: drop at91_set_serial_console
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-at91 / board-flexibity.c
1 /*
2  * linux/arch/arm/mach-at91/board-flexibity.c
3  *
4  *  Copyright (C) 2010-2011 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_init_early(void)
41 {
42         /* Initialize processor: 18.432 MHz crystal */
43         at91_initialize(18432000);
44
45         /* DBGU on ttyS0. (Rx & Tx only) */
46         at91_register_uart(0, 0, 0);
47 }
48
49 /* USB Host port */
50 static struct at91_usbh_data __initdata flexibity_usbh_data = {
51         .ports          = 2,
52         .vbus_pin       = {-EINVAL, -EINVAL},
53         .overcurrent_pin= {-EINVAL, -EINVAL},
54 };
55
56 /* USB Device port */
57 static struct at91_udc_data __initdata flexibity_udc_data = {
58         .vbus_pin       = AT91_PIN_PC5,
59         .pullup_pin     = -EINVAL,              /* pull-up driven by UDC */
60 };
61
62 /* I2C devices */
63 static struct i2c_board_info __initdata flexibity_i2c_devices[] = {
64         {
65                 I2C_BOARD_INFO("ds1307", 0x68),
66         },
67 };
68
69 /* SPI devices */
70 static struct spi_board_info flexibity_spi_devices[] = {
71         {       /* DataFlash chip */
72                 .modalias       = "mtd_dataflash",
73                 .chip_select    = 1,
74                 .max_speed_hz   = 15 * 1000 * 1000,
75                 .bus_num        = 0,
76         },
77 };
78
79 /* MCI (SD/MMC) */
80 static struct at91_mmc_data __initdata flexibity_mmc_data = {
81         .slot_b         = 0,
82         .wire4          = 1,
83         .det_pin        = AT91_PIN_PC9,
84         .wp_pin         = AT91_PIN_PC4,
85         .vcc_pin        = -EINVAL,
86 };
87
88 /* LEDs */
89 static struct gpio_led flexibity_leds[] = {
90         {
91                 .name                   = "usb1:green",
92                 .gpio                   = AT91_PIN_PA12,
93                 .active_low             = 1,
94                 .default_trigger        = "default-on",
95         },
96         {
97                 .name                   = "usb1:red",
98                 .gpio                   = AT91_PIN_PA13,
99                 .active_low             = 1,
100                 .default_trigger        = "default-on",
101         },
102         {
103                 .name                   = "usb2:green",
104                 .gpio                   = AT91_PIN_PB26,
105                 .active_low             = 1,
106                 .default_trigger        = "default-on",
107         },
108         {
109                 .name                   = "usb2:red",
110                 .gpio                   = AT91_PIN_PB27,
111                 .active_low             = 1,
112                 .default_trigger        = "default-on",
113         },
114         {
115                 .name                   = "usb3:green",
116                 .gpio                   = AT91_PIN_PC8,
117                 .active_low             = 1,
118                 .default_trigger        = "default-on",
119         },
120         {
121                 .name                   = "usb3:red",
122                 .gpio                   = AT91_PIN_PC6,
123                 .active_low             = 1,
124                 .default_trigger        = "default-on",
125         },
126         {
127                 .name                   = "usb4:green",
128                 .gpio                   = AT91_PIN_PB4,
129                 .active_low             = 1,
130                 .default_trigger        = "default-on",
131         },
132         {
133                 .name                   = "usb4:red",
134                 .gpio                   = AT91_PIN_PB5,
135                 .active_low             = 1,
136                 .default_trigger        = "default-on",
137         }
138 };
139
140 static void __init flexibity_board_init(void)
141 {
142         /* Serial */
143         at91_add_device_serial();
144         /* USB Host */
145         at91_add_device_usbh(&flexibity_usbh_data);
146         /* USB Device */
147         at91_add_device_udc(&flexibity_udc_data);
148         /* I2C */
149         at91_add_device_i2c(flexibity_i2c_devices,
150                 ARRAY_SIZE(flexibity_i2c_devices));
151         /* SPI */
152         at91_add_device_spi(flexibity_spi_devices,
153                 ARRAY_SIZE(flexibity_spi_devices));
154         /* MMC */
155         at91_add_device_mmc(0, &flexibity_mmc_data);
156         /* LEDs */
157         at91_gpio_leds(flexibity_leds, ARRAY_SIZE(flexibity_leds));
158 }
159
160 MACHINE_START(FLEXIBITY, "Flexibity Connect")
161         /* Maintainer: Maxim Osipov */
162         .timer          = &at91sam926x_timer,
163         .map_io         = at91_map_io,
164         .init_early     = flexibity_init_early,
165         .init_irq       = at91_init_irq_default,
166         .init_machine   = flexibity_board_init,
167 MACHINE_END