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.
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.
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
17 #include <linux/init.h>
18 #include <linux/platform_device.h>
19 #include <linux/mtd/physmap.h>
20 #include <linux/gpio.h>
22 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
27 #include <mach/at91rm9200_mc.h>
28 #include <mach/at91_ramc.h>
37 static void __init
eco920_init_early(void)
39 /* Set cpu type: PQFP */
40 at91rm9200_set_type(ARCH_REVISON_9200_PQFP
);
42 at91_initialize(18432000);
45 static struct macb_platform_data __initdata eco920_eth_data
= {
46 .phy_irq_pin
= AT91_PIN_PC2
,
50 static struct at91_usbh_data __initdata eco920_usbh_data
= {
52 .vbus_pin
= {-EINVAL
, -EINVAL
},
53 .overcurrent_pin
= {-EINVAL
, -EINVAL
},
56 static struct at91_udc_data __initdata eco920_udc_data
= {
57 .vbus_pin
= AT91_PIN_PB12
,
58 .pullup_pin
= AT91_PIN_PB13
,
61 static struct mci_platform_data __initdata eco920_mci0_data
= {
64 .detect_pin
= -EINVAL
,
69 static struct physmap_flash_data eco920_flash_data
= {
73 static struct resource eco920_flash_resource
= {
76 .flags
= IORESOURCE_MEM
,
79 static struct platform_device eco920_flash
= {
80 .name
= "physmap-flash",
83 .platform_data
= &eco920_flash_data
,
85 .resource
= &eco920_flash_resource
,
89 static struct spi_board_info eco920_spi_devices
[] = {
90 { /* CAN controller */
91 .modalias
= "tlv5638",
93 .max_speed_hz
= 20 * 1000 * 1000,
101 static struct gpio_led eco920_leds
[] = {
104 .gpio
= AT91_PIN_PB0
,
106 .default_trigger
= "heartbeat",
110 .gpio
= AT91_PIN_PB1
,
112 .default_trigger
= "timer",
116 static void __init
eco920_board_init(void)
118 /* DBGU on ttyS0. (Rx & Tx only */
119 at91_register_uart(0, 0, 0);
120 at91_add_device_serial();
121 at91_add_device_eth(&eco920_eth_data
);
122 at91_add_device_usbh(&eco920_usbh_data
);
123 at91_add_device_udc(&eco920_udc_data
);
125 at91_add_device_mci(0, &eco920_mci0_data
);
126 platform_device_register(&eco920_flash
);
128 at91_ramc_write(0, AT91_SMC_CSR(7), AT91_SMC_RWHOLD_(1)
129 | AT91_SMC_RWSETUP_(1)
132 | AT91_SMC_NWS_(15));
134 at91_set_A_periph(AT91_PIN_PC6
, 1);
136 at91_set_gpio_input(AT91_PIN_PA23
, 0);
137 at91_set_deglitch(AT91_PIN_PA23
, 1);
139 /* Initialization of the Static Memory Controller for Chip Select 3 */
140 at91_ramc_write(0, AT91_SMC_CSR(3),
141 AT91_SMC_DBW_16
| /* 16 bit */
143 AT91_SMC_NWS_(5) | /* wait states */
144 AT91_SMC_TDF_(1) /* float time */
147 at91_add_device_spi(eco920_spi_devices
, ARRAY_SIZE(eco920_spi_devices
));
149 at91_gpio_leds(eco920_leds
, ARRAY_SIZE(eco920_leds
));
152 MACHINE_START(ECO920
, "eco920")
153 /* Maintainer: Sascha Hauer */
154 .init_time
= at91rm9200_timer_init
,
155 .map_io
= at91_map_io
,
156 .handle_irq
= at91_aic_handle_irq
,
157 .init_early
= eco920_init_early
,
158 .init_irq
= at91_init_irq_default
,
159 .init_machine
= eco920_board_init
,