]> Pileus Git - ~andy/linux/blob - arch/arm/mach-at91/board-eco920.c
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / arch / arm / mach-at91 / board-eco920.c
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15  */
16
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/mtd/physmap.h>
20 #include <linux/gpio.h>
21
22 #include <asm/mach-types.h>
23
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26
27 #include <mach/board.h>
28 #include <mach/at91rm9200_mc.h>
29 #include <mach/at91_ramc.h>
30 #include <mach/cpu.h>
31
32 #include "generic.h"
33
34 static void __init eco920_init_early(void)
35 {
36         /* Set cpu type: PQFP */
37         at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
38
39         at91_initialize(18432000);
40
41         /* Setup the LEDs */
42         at91_init_leds(AT91_PIN_PB0, AT91_PIN_PB1);
43
44         /* DBGU on ttyS0. (Rx & Tx only */
45         at91_register_uart(0, 0, 0);
46
47         /* set serial console to ttyS0 (ie, DBGU) */
48         at91_set_serial_console(0);
49 }
50
51 static struct macb_platform_data __initdata eco920_eth_data = {
52         .phy_irq_pin    = AT91_PIN_PC2,
53         .is_rmii        = 1,
54 };
55
56 static struct at91_usbh_data __initdata eco920_usbh_data = {
57         .ports          = 1,
58         .vbus_pin       = {-EINVAL, -EINVAL},
59         .overcurrent_pin= {-EINVAL, -EINVAL},
60 };
61
62 static struct at91_udc_data __initdata eco920_udc_data = {
63         .vbus_pin       = AT91_PIN_PB12,
64         .pullup_pin     = AT91_PIN_PB13,
65 };
66
67 static struct at91_mmc_data __initdata eco920_mmc_data = {
68         .slot_b         = 0,
69         .wire4          = 0,
70         .det_pin        = -EINVAL,
71         .wp_pin         = -EINVAL,
72         .vcc_pin        = -EINVAL,
73 };
74
75 static struct physmap_flash_data eco920_flash_data = {
76         .width  = 2,
77 };
78
79 static struct resource eco920_flash_resource = {
80         .start          = 0x11000000,
81         .end            = 0x11ffffff,
82         .flags          = IORESOURCE_MEM,
83 };
84
85 static struct platform_device eco920_flash = {
86         .name           = "physmap-flash",
87         .id             = 0,
88         .dev            = {
89                 .platform_data  = &eco920_flash_data,
90         },
91         .resource       = &eco920_flash_resource,
92         .num_resources  = 1,
93 };
94
95 static struct spi_board_info eco920_spi_devices[] = {
96         {       /* CAN controller */
97                 .modalias       = "tlv5638",
98                 .chip_select    = 3,
99                 .max_speed_hz   = 20 * 1000 * 1000,
100                 .mode           = SPI_CPHA,
101         },
102 };
103
104 static void __init eco920_board_init(void)
105 {
106         at91_add_device_serial();
107         at91_add_device_eth(&eco920_eth_data);
108         at91_add_device_usbh(&eco920_usbh_data);
109         at91_add_device_udc(&eco920_udc_data);
110
111         at91_add_device_mmc(0, &eco920_mmc_data);
112         platform_device_register(&eco920_flash);
113
114         at91_ramc_write(0, AT91_SMC_CSR(7),     AT91_SMC_RWHOLD_(1)
115                                 | AT91_SMC_RWSETUP_(1)
116                                 | AT91_SMC_DBW_8
117                                 | AT91_SMC_WSEN
118                                 | AT91_SMC_NWS_(15));
119
120         at91_set_A_periph(AT91_PIN_PC6, 1);
121
122         at91_set_gpio_input(AT91_PIN_PA23, 0);
123         at91_set_deglitch(AT91_PIN_PA23, 1);
124
125 /* Initialization of the Static Memory Controller for Chip Select 3 */
126         at91_ramc_write(0, AT91_SMC_CSR(3),
127                 AT91_SMC_DBW_16  |      /* 16 bit */
128                 AT91_SMC_WSEN    |
129                 AT91_SMC_NWS_(5) |      /* wait states */
130                 AT91_SMC_TDF_(1)        /* float time */
131         );
132
133         at91_add_device_spi(eco920_spi_devices, ARRAY_SIZE(eco920_spi_devices));
134 }
135
136 MACHINE_START(ECO920, "eco920")
137         /* Maintainer: Sascha Hauer */
138         .timer          = &at91rm9200_timer,
139         .map_io         = at91_map_io,
140         .init_early     = eco920_init_early,
141         .init_irq       = at91_init_irq_default,
142         .init_machine   = eco920_board_init,
143 MACHINE_END