Blame view

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