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/init.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/platform_device.h>
27#include <linux/spi/spi.h>
28#include <linux/spi/flash.h>
29
30#include <mach/hardware.h>
31#include <asm/setup.h>
32#include <asm/mach-types.h>
33#include <asm/irq.h>
34
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37#include <asm/mach/irq.h>
38
39#include <mach/board.h>
40#include <mach/gpio.h>
41
42#include "generic.h"
43
44
45static void __init ecb_at91map_io(void)
46{
47
48 at91rm9200_initialize(18432000, AT91RM9200_PQFP);
49
50
51 at91_init_leds(AT91_PIN_PC7, AT91_PIN_PC7);
52
53
54 at91_register_uart(0, 0, 0);
55
56
57 at91_register_uart(AT91RM9200_ID_US0, 1, 0);
58
59
60 at91_set_serial_console(0);
61}
62
63static void __init ecb_at91init_irq(void)
64{
65 at91rm9200_init_interrupts(NULL);
66}
67
68static struct at91_eth_data __initdata ecb_at91eth_data = {
69 .phy_irq_pin = AT91_PIN_PC4,
70 .is_rmii = 0,
71};
72
73static struct at91_usbh_data __initdata ecb_at91usbh_data = {
74 .ports = 1,
75};
76
77static struct at91_mmc_data __initdata ecb_at91mmc_data = {
78 .slot_b = 0,
79 .wire4 = 1,
80};
81
82
83#if defined(CONFIG_MTD_DATAFLASH)
84static struct mtd_partition __initdata my_flash0_partitions[] =
85{
86 {
87 .name = "Darrell-loader",
88 .offset = 0,
89 .size = 12 * 1056,
90 },
91 {
92 .name = "U-boot",
93 .offset = MTDPART_OFS_NXTBLK,
94 .size = 110 * 1056,
95 },
96 {
97 .name = "UBoot-env",
98 .offset = MTDPART_OFS_NXTBLK,
99 .size = 8 * 1056,
100 },
101 {
102 .name = "Kernel",
103 .offset = MTDPART_OFS_NXTBLK,
104 .size = 1534 * 1056,
105 },
106 {
107 .name = "Filesystem",
108 .offset = MTDPART_OFS_NXTBLK,
109 .size = MTDPART_SIZ_FULL,
110 }
111};
112
113static struct flash_platform_data __initdata my_flash0_platform = {
114 .name = "Removable flash card",
115 .parts = my_flash0_partitions,
116 .nr_parts = ARRAY_SIZE(my_flash0_partitions)
117};
118
119#endif
120
121static struct spi_board_info __initdata ecb_at91spi_devices[] = {
122 {
123 .modalias = "mtd_dataflash",
124 .chip_select = 0,
125 .max_speed_hz = 10 * 1000 * 1000,
126 .bus_num = 0,
127#if defined(CONFIG_MTD_DATAFLASH)
128 .platform_data = &my_flash0_platform,
129#endif
130 },
131 {
132 .modalias = "spi-cs1",
133 .chip_select = 1,
134 .max_speed_hz = 250 * 1000,
135 },
136 {
137 .modalias = "spi-cs2",
138 .chip_select = 2,
139 .max_speed_hz = 1 * 1000 * 1000,
140 },
141 {
142 .modalias = "spi-cs3",
143 .chip_select = 3,
144 .max_speed_hz = 10 * 1000 * 1000,
145 },
146};
147
148static void __init ecb_at91board_init(void)
149{
150
151 at91_add_device_serial();
152
153
154 at91_add_device_eth(&ecb_at91eth_data);
155
156
157 at91_add_device_usbh(&ecb_at91usbh_data);
158
159
160 at91_add_device_i2c(NULL, 0);
161
162
163 at91_add_device_mmc(0, &ecb_at91mmc_data);
164
165
166 at91_add_device_spi(ecb_at91spi_devices, ARRAY_SIZE(ecb_at91spi_devices));
167}
168
169MACHINE_START(ECBAT91, "emQbit's ECB_AT91")
170
171 .phys_io = AT91_BASE_SYS,
172 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
173 .boot_params = AT91_SDRAM_BASE + 0x100,
174 .timer = &at91rm9200_timer,
175 .map_io = ecb_at91map_io,
176 .init_irq = ecb_at91init_irq,
177 .init_machine = ecb_at91board_init,
178MACHINE_END
179