1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#include <linux/types.h>
28#include <linux/init.h>
29#include <linux/mm.h>
30#include <linux/module.h>
31#include <linux/platform_device.h>
32#include <linux/spi/spi.h>
33#include <linux/clk.h>
34#include <linux/dma-mapping.h>
35
36#include <mach/hardware.h>
37#include <asm/setup.h>
38#include <asm/mach-types.h>
39#include <asm/irq.h>
40
41#include <asm/mach/arch.h>
42#include <asm/mach/map.h>
43#include <asm/mach/irq.h>
44
45#include <mach/board.h>
46#include <mach/gpio.h>
47
48#include "generic.h"
49
50
51static void __init afeb9260_map_io(void)
52{
53
54 at91sam9260_initialize(18432000);
55
56
57 at91_register_uart(0, 0, 0);
58
59
60 at91_register_uart(AT91SAM9260_ID_US0, 1,
61 ATMEL_UART_CTS | ATMEL_UART_RTS
62 | ATMEL_UART_DTR | ATMEL_UART_DSR
63 | ATMEL_UART_DCD | ATMEL_UART_RI);
64
65
66 at91_register_uart(AT91SAM9260_ID_US1, 2,
67 ATMEL_UART_CTS | ATMEL_UART_RTS);
68
69
70 at91_set_serial_console(0);
71}
72
73static void __init afeb9260_init_irq(void)
74{
75 at91sam9260_init_interrupts(NULL);
76}
77
78
79
80
81
82static struct at91_usbh_data __initdata afeb9260_usbh_data = {
83 .ports = 1,
84};
85
86
87
88
89static struct at91_udc_data __initdata afeb9260_udc_data = {
90 .vbus_pin = AT91_PIN_PC5,
91 .pullup_pin = 0,
92};
93
94
95
96
97
98
99static struct spi_board_info afeb9260_spi_devices[] = {
100 {
101 .modalias = "mtd_dataflash",
102 .chip_select = 1,
103 .max_speed_hz = 15 * 1000 * 1000,
104 .bus_num = 0,
105 },
106};
107
108
109
110
111
112static struct at91_eth_data __initdata afeb9260_macb_data = {
113 .phy_irq_pin = AT91_PIN_PA9,
114 .is_rmii = 0,
115};
116
117
118
119
120
121static struct mtd_partition __initdata afeb9260_nand_partition[] = {
122 {
123 .name = "bootloader",
124 .offset = 0,
125 .size = (640 * SZ_1K),
126 },
127 {
128 .name = "kernel",
129 .offset = MTDPART_OFS_NXTBLK,
130 .size = SZ_2M,
131 },
132 {
133 .name = "rootfs",
134 .offset = MTDPART_OFS_NXTBLK,
135 .size = MTDPART_SIZ_FULL,
136 },
137};
138
139static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
140{
141 *num_partitions = ARRAY_SIZE(afeb9260_nand_partition);
142 return afeb9260_nand_partition;
143}
144
145static struct atmel_nand_data __initdata afeb9260_nand_data = {
146 .ale = 21,
147 .cle = 22,
148 .rdy_pin = AT91_PIN_PC13,
149 .enable_pin = AT91_PIN_PC14,
150 .partition_info = nand_partitions,
151 .bus_width_16 = 0,
152};
153
154
155
156
157
158static struct at91_mmc_data __initdata afeb9260_mmc_data = {
159 .det_pin = AT91_PIN_PC9,
160 .wp_pin = AT91_PIN_PC4,
161 .slot_b = 1,
162 .wire4 = 1,
163};
164
165
166
167static struct i2c_board_info __initdata afeb9260_i2c_devices[] = {
168 {
169 I2C_BOARD_INFO("tlv320aic23", 0x1a),
170 }, {
171 I2C_BOARD_INFO("fm3130", 0x68),
172 }, {
173 I2C_BOARD_INFO("24c64", 0x50),
174 },
175};
176
177
178
179
180static struct at91_cf_data afeb9260_cf_data = {
181 .chipselect = 4,
182 .irq_pin = AT91_PIN_PA6,
183 .rst_pin = AT91_PIN_PA7,
184 .flags = AT91_CF_TRUE_IDE,
185};
186
187static void __init afeb9260_board_init(void)
188{
189
190 at91_add_device_serial();
191
192 at91_add_device_usbh(&afeb9260_usbh_data);
193
194 at91_add_device_udc(&afeb9260_udc_data);
195
196 at91_add_device_spi(afeb9260_spi_devices,
197 ARRAY_SIZE(afeb9260_spi_devices));
198
199 at91_add_device_nand(&afeb9260_nand_data);
200
201 at91_add_device_eth(&afeb9260_macb_data);
202
203
204
205
206 at91_set_B_periph(AT91_PIN_PA10, 0);
207 at91_set_B_periph(AT91_PIN_PA11, 0);
208
209 at91_add_device_mmc(0, &afeb9260_mmc_data);
210
211 at91_add_device_i2c(afeb9260_i2c_devices,
212 ARRAY_SIZE(afeb9260_i2c_devices));
213
214 at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
215
216 at91_add_device_cf(&afeb9260_cf_data);
217}
218
219MACHINE_START(AFEB9260, "Custom afeb9260 board")
220
221 .boot_params = AT91_SDRAM_BASE + 0x100,
222 .timer = &at91sam926x_timer,
223 .map_io = afeb9260_map_io,
224 .init_irq = afeb9260_init_irq,
225 .init_machine = afeb9260_board_init,
226MACHINE_END
227
228