2 * linux/arch/arm/mach-at91rm9200/board-ecbat91.c
3 * Copyright (C) 2007 emQbit.com.
5 * We started from board-dk.c, which is Copyright (C) 2005 SAN People.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <linux/types.h>
23 #include <linux/gpio.h>
24 #include <linux/init.h>
26 #include <linux/module.h>
27 #include <linux/platform_device.h>
28 #include <linux/spi/spi.h>
29 #include <linux/spi/flash.h>
31 #include <mach/hardware.h>
32 #include <asm/setup.h>
33 #include <asm/mach-types.h>
36 #include <asm/mach/arch.h>
37 #include <asm/mach/map.h>
38 #include <asm/mach/irq.h>
47 static void __init
ecb_at91init_early(void)
49 /* Set cpu type: PQFP */
50 at91rm9200_set_type(ARCH_REVISON_9200_PQFP
);
52 /* Initialize processor: 18.432 MHz crystal */
53 at91_initialize(18432000);
56 static struct macb_platform_data __initdata ecb_at91eth_data
= {
57 .phy_irq_pin
= AT91_PIN_PC4
,
61 static struct at91_usbh_data __initdata ecb_at91usbh_data
= {
63 .vbus_pin
= {-EINVAL
, -EINVAL
},
64 .overcurrent_pin
= {-EINVAL
, -EINVAL
},
67 static struct mci_platform_data __initdata ecbat91_mci0_data
= {
70 .detect_pin
= -EINVAL
,
76 #if defined(CONFIG_MTD_DATAFLASH)
77 static struct mtd_partition __initdata my_flash0_partitions
[] =
80 .name
= "Darrell-loader",
86 .offset
= MTDPART_OFS_NXTBLK
,
89 { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
91 .offset
= MTDPART_OFS_NXTBLK
,
94 { /* 1336 (167 blocks) pages * 1056 bytes = 0x158700 bytes */
96 .offset
= MTDPART_OFS_NXTBLK
,
99 { /* 190200 - jffs2 root filesystem */
100 .name
= "Filesystem",
101 .offset
= MTDPART_OFS_NXTBLK
,
102 .size
= MTDPART_SIZ_FULL
, /* 26 sectors */
106 static struct flash_platform_data __initdata my_flash0_platform
= {
107 .name
= "Removable flash card",
108 .parts
= my_flash0_partitions
,
109 .nr_parts
= ARRAY_SIZE(my_flash0_partitions
)
114 static struct spi_board_info __initdata ecb_at91spi_devices
[] = {
115 { /* DataFlash chip */
116 .modalias
= "mtd_dataflash",
118 .max_speed_hz
= 10 * 1000 * 1000,
120 #if defined(CONFIG_MTD_DATAFLASH)
121 .platform_data
= &my_flash0_platform
,
124 { /* User accessible spi - cs1 (250KHz) */
125 .modalias
= "spi-cs1",
127 .max_speed_hz
= 250 * 1000,
129 { /* User accessible spi - cs2 (1MHz) */
130 .modalias
= "spi-cs2",
132 .max_speed_hz
= 1 * 1000 * 1000,
134 { /* User accessible spi - cs3 (10MHz) */
135 .modalias
= "spi-cs3",
137 .max_speed_hz
= 10 * 1000 * 1000,
144 static struct gpio_led ecb_leds
[] = {
147 .gpio
= AT91_PIN_PC7
,
149 .default_trigger
= "heartbeat",
153 static void __init
ecb_at91board_init(void)
156 /* DBGU on ttyS0. (Rx & Tx only) */
157 at91_register_uart(0, 0, 0);
159 /* USART0 on ttyS1. (Rx & Tx only) */
160 at91_register_uart(AT91RM9200_ID_US0
, 1, 0);
161 at91_add_device_serial();
164 at91_add_device_eth(&ecb_at91eth_data
);
167 at91_add_device_usbh(&ecb_at91usbh_data
);
170 at91_add_device_i2c(NULL
, 0);
173 at91_add_device_mci(0, &ecbat91_mci0_data
);
176 at91_add_device_spi(ecb_at91spi_devices
, ARRAY_SIZE(ecb_at91spi_devices
));
179 at91_gpio_leds(ecb_leds
, ARRAY_SIZE(ecb_leds
));
182 MACHINE_START(ECBAT91
, "emQbit's ECB_AT91")
183 /* Maintainer: emQbit.com */
184 .timer
= &at91rm9200_timer
,
185 .map_io
= at91_map_io
,
186 .handle_irq
= at91_aic_handle_irq
,
187 .init_early
= ecb_at91init_early
,
188 .init_irq
= at91_init_irq_default
,
189 .init_machine
= ecb_at91board_init
,