1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/types.h>
23#include <linux/gpio.h>
24#include <linux/init.h>
25#include <linux/mm.h>
26#include <linux/module.h>
27#include <linux/platform_device.h>
28#include <linux/spi/spi.h>
29#include <linux/spi/flash.h>
30
31#include <mach/hardware.h>
32#include <asm/setup.h>
33#include <asm/mach-types.h>
34#include <asm/irq.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/map.h>
38#include <asm/mach/irq.h>
39
40#include <mach/cpu.h>
41
42#include "at91_aic.h"
43#include "board.h"
44#include "generic.h"
45
46
47static void __init ecb_at91init_early(void)
48{
49
50 at91rm9200_set_type(ARCH_REVISON_9200_PQFP);
51
52
53 at91_initialize(18432000);
54}
55
56static struct macb_platform_data __initdata ecb_at91eth_data = {
57 .phy_irq_pin = AT91_PIN_PC4,
58 .is_rmii = 0,
59};
60
61static struct at91_usbh_data __initdata ecb_at91usbh_data = {
62 .ports = 1,
63 .vbus_pin = {-EINVAL, -EINVAL},
64 .overcurrent_pin= {-EINVAL, -EINVAL},
65};
66
67static struct mci_platform_data __initdata ecbat91_mci0_data = {
68 .slot[0] = {
69 .bus_width = 4,
70 .detect_pin = -EINVAL,
71 .wp_pin = -EINVAL,
72 },
73};
74
75
76#if defined(CONFIG_MTD_DATAFLASH)
77static struct mtd_partition __initdata my_flash0_partitions[] =
78{
79 {
80 .name = "Darrell-loader",
81 .offset = 0,
82 .size = 12 * 1056,
83 },
84 {
85 .name = "U-boot",
86 .offset = MTDPART_OFS_NXTBLK,
87 .size = 110 * 1056,
88 },
89 {
90 .name = "UBoot-env",
91 .offset = MTDPART_OFS_NXTBLK,
92 .size = 8 * 1056,
93 },
94 {
95 .name = "Kernel",
96 .offset = MTDPART_OFS_NXTBLK,
97 .size = 1534 * 1056,
98 },
99 {
100 .name = "Filesystem",
101 .offset = MTDPART_OFS_NXTBLK,
102 .size = MTDPART_SIZ_FULL,
103 }
104};
105
106static 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)
110};
111
112#endif
113
114static struct spi_board_info __initdata ecb_at91spi_devices[] = {
115 {
116 .modalias = "mtd_dataflash",
117 .chip_select = 0,
118 .max_speed_hz = 10 * 1000 * 1000,
119 .bus_num = 0,
120#if defined(CONFIG_MTD_DATAFLASH)
121 .platform_data = &my_flash0_platform,
122#endif
123 },
124 {
125 .modalias = "spi-cs1",
126 .chip_select = 1,
127 .max_speed_hz = 250 * 1000,
128 },
129 {
130 .modalias = "spi-cs2",
131 .chip_select = 2,
132 .max_speed_hz = 1 * 1000 * 1000,
133 },
134 {
135 .modalias = "spi-cs3",
136 .chip_select = 3,
137 .max_speed_hz = 10 * 1000 * 1000,
138 },
139};
140
141
142
143
144static struct gpio_led ecb_leds[] = {
145 {
146 .name = "led1",
147 .gpio = AT91_PIN_PC7,
148 .active_low = 1,
149 .default_trigger = "heartbeat",
150 }
151};
152
153static void __init ecb_at91board_init(void)
154{
155
156
157 at91_register_uart(0, 0, 0);
158
159
160 at91_register_uart(AT91RM9200_ID_US0, 1, 0);
161 at91_add_device_serial();
162
163
164 at91_add_device_eth(&ecb_at91eth_data);
165
166
167 at91_add_device_usbh(&ecb_at91usbh_data);
168
169
170 at91_add_device_i2c(NULL, 0);
171
172
173 at91_add_device_mci(0, &ecbat91_mci0_data);
174
175
176 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
177
178
179 at91_gpio_leds(ecb_leds, ARRAY_SIZE(ecb_leds));
180}
181
182MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
183
184 .init_time = at91rm9200_timer_init,
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,
190MACHINE_END
191