blob: 5ea6ecac35e2c7573e3e9752c984000ec5328d70 [file] [log] [blame]
Roy Huang24a07a12007-07-12 22:41:45 +08001/*
Robin Getz96f10502009-09-24 14:11:24 +00002 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
Roy Huang24a07a12007-07-12 22:41:45 +08005 *
Robin Getz96f10502009-09-24 14:11:24 +00006 * Licensed under the GPL-2 or later.
Roy Huang24a07a12007-07-12 22:41:45 +08007 */
8
9#include <linux/device.h>
10#include <linux/platform_device.h>
11#include <linux/mtd/mtd.h>
12#include <linux/mtd/partitions.h>
Mike Frysingerde8c43f2008-01-24 17:14:04 +080013#include <linux/mtd/physmap.h>
Roy Huang24a07a12007-07-12 22:41:45 +080014#include <linux/spi/spi.h>
15#include <linux/spi/flash.h>
Mike Frysinger1f83b8f2007-07-12 22:58:21 +080016#include <linux/irq.h>
Bryan Wu81d9c7f2008-03-26 10:02:13 +080017#include <linux/i2c.h>
Roy Huang24a07a12007-07-12 22:41:45 +080018#include <linux/interrupt.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080019#include <linux/usb/musb.h>
Roy Huang24a07a12007-07-12 22:41:45 +080020#include <asm/bfin5xx_spi.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080021#include <asm/dma.h>
22#include <asm/gpio.h>
23#include <asm/nand.h>
Michael Hennerich14b03202008-05-07 11:41:26 +080024#include <asm/dpmc.h>
Scott Jiang6f53dbb2011-03-01 09:43:50 +000025#include <asm/bfin_sport.h>
Bryan Wu5d448dd2007-11-12 23:24:42 +080026#include <asm/portmux.h>
Cliff Cai501674a2009-01-07 23:14:38 +080027#include <asm/bfin_sdh.h>
Bryan Wu639f6572008-08-27 10:51:02 +080028#include <mach/bf54x_keys.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080029#include <linux/input.h>
30#include <linux/spi/ad7877.h>
Roy Huang24a07a12007-07-12 22:41:45 +080031
32/*
33 * Name the Board for the /proc/cpuinfo
34 */
Mike Frysingerfe85cad2008-11-18 17:48:22 +080035const char bfin_board_name[] = "ADI BF548-EZKIT";
Roy Huang24a07a12007-07-12 22:41:45 +080036
37/*
38 * Driver needs to know address, irq and flag pin.
39 */
40
Michael Hennerich0a6304a2008-07-26 16:14:57 +080041#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
Michael Hennerich3f375692008-11-18 17:48:22 +080042#include <linux/usb/isp1760.h>
43static struct resource bfin_isp1760_resources[] = {
Michael Hennerich0a6304a2008-07-26 16:14:57 +080044 [0] = {
Michael Hennerich0a6304a2008-07-26 16:14:57 +080045 .start = 0x2C0C0000,
46 .end = 0x2C0C0000 + 0xfffff,
47 .flags = IORESOURCE_MEM,
48 },
49 [1] = {
50 .start = IRQ_PG7,
51 .end = IRQ_PG7,
52 .flags = IORESOURCE_IRQ,
53 },
54};
55
Michael Hennerich3f375692008-11-18 17:48:22 +080056static struct isp1760_platform_data isp1760_priv = {
57 .is_isp1761 = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080058 .bus_width_16 = 1,
59 .port1_otg = 0,
60 .analog_oc = 0,
61 .dack_polarity_high = 0,
62 .dreq_polarity_high = 0,
63};
64
65static struct platform_device bfin_isp1760_device = {
Michael Hennerichc6feb7682009-10-15 10:37:33 +000066 .name = "isp1760",
Michael Hennerich0a6304a2008-07-26 16:14:57 +080067 .id = 0,
Michael Hennerich3f375692008-11-18 17:48:22 +080068 .dev = {
69 .platform_data = &isp1760_priv,
70 },
71 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
72 .resource = bfin_isp1760_resources,
Michael Hennerich0a6304a2008-07-26 16:14:57 +080073};
Michael Hennerich0a6304a2008-07-26 16:14:57 +080074#endif
75
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080076#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
77
Bryan Wu639f6572008-08-27 10:51:02 +080078#include <mach/bf54x-lq043.h>
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080079
80static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
Stefan Pledl0e101ec2009-07-29 08:09:45 +000081 .width = 95,
82 .height = 54,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +080083 .xres = {480, 480, 480},
84 .yres = {272, 272, 272},
85 .bpp = {24, 24, 24},
86 .disp = GPIO_PE3,
87};
88
89static struct resource bf54x_lq043_resources[] = {
90 {
91 .start = IRQ_EPPI0_ERR,
92 .end = IRQ_EPPI0_ERR,
93 .flags = IORESOURCE_IRQ,
94 },
95};
96
97static struct platform_device bf54x_lq043_device = {
98 .name = "bf54x-lq043",
99 .id = -1,
100 .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
101 .resource = bf54x_lq043_resources,
102 .dev = {
103 .platform_data = &bf54x_lq043_data,
104 },
105};
106#endif
107
108#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
Michael Hennerich8f740ef2007-10-13 00:36:46 -0400109static const unsigned int bf548_keymap[] = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800110 KEYVAL(0, 0, KEY_ENTER),
111 KEYVAL(0, 1, KEY_HELP),
112 KEYVAL(0, 2, KEY_0),
113 KEYVAL(0, 3, KEY_BACKSPACE),
114 KEYVAL(1, 0, KEY_TAB),
115 KEYVAL(1, 1, KEY_9),
116 KEYVAL(1, 2, KEY_8),
117 KEYVAL(1, 3, KEY_7),
118 KEYVAL(2, 0, KEY_DOWN),
119 KEYVAL(2, 1, KEY_6),
120 KEYVAL(2, 2, KEY_5),
121 KEYVAL(2, 3, KEY_4),
122 KEYVAL(3, 0, KEY_UP),
123 KEYVAL(3, 1, KEY_3),
124 KEYVAL(3, 2, KEY_2),
125 KEYVAL(3, 3, KEY_1),
126};
127
128static struct bfin_kpad_platform_data bf54x_kpad_data = {
129 .rows = 4,
130 .cols = 4,
Michael Hennerich8f740ef2007-10-13 00:36:46 -0400131 .keymap = bf548_keymap,
132 .keymapsize = ARRAY_SIZE(bf548_keymap),
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800133 .repeat = 0,
134 .debounce_time = 5000, /* ns (5ms) */
135 .coldrive_time = 1000, /* ns (1ms) */
136 .keyup_test_interval = 50, /* ms (50ms) */
137};
138
139static struct resource bf54x_kpad_resources[] = {
140 {
141 .start = IRQ_KEY,
142 .end = IRQ_KEY,
143 .flags = IORESOURCE_IRQ,
144 },
145};
146
147static struct platform_device bf54x_kpad_device = {
148 .name = "bf54x-keys",
149 .id = -1,
150 .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
151 .resource = bf54x_kpad_resources,
152 .dev = {
153 .platform_data = &bf54x_kpad_data,
154 },
155};
156#endif
157
Michael Hennerichadfc0462009-10-09 07:37:03 +0000158#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
Michael Hennerichaca5e4a2008-10-08 14:27:59 +0800159#include <asm/bfin_rotary.h>
160
161static struct bfin_rotary_platform_data bfin_rotary_data = {
162 /*.rotary_up_key = KEY_UP,*/
163 /*.rotary_down_key = KEY_DOWN,*/
164 .rotary_rel_code = REL_WHEEL,
165 .rotary_button_key = KEY_ENTER,
166 .debounce = 10, /* 0..17 */
167 .mode = ROT_QUAD_ENC | ROT_DEBE,
168};
169
170static struct resource bfin_rotary_resources[] = {
171 {
172 .start = IRQ_CNT,
173 .end = IRQ_CNT,
174 .flags = IORESOURCE_IRQ,
175 },
176};
177
178static struct platform_device bfin_rotary_device = {
179 .name = "bfin-rotary",
180 .id = -1,
181 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
182 .resource = bfin_rotary_resources,
183 .dev = {
184 .platform_data = &bfin_rotary_data,
185 },
186};
187#endif
188
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000189#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000190#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000191static const struct adxl34x_platform_data adxl34x_info = {
192 .x_axis_offset = 0,
193 .y_axis_offset = 0,
194 .z_axis_offset = 0,
195 .tap_threshold = 0x31,
196 .tap_duration = 0x10,
197 .tap_latency = 0x60,
198 .tap_window = 0xF0,
199 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
200 .act_axis_control = 0xFF,
201 .activity_threshold = 5,
202 .inactivity_threshold = 3,
203 .inactivity_time = 4,
204 .free_fall_threshold = 0x7,
205 .free_fall_time = 0x20,
206 .data_rate = 0x8,
207 .data_range = ADXL_FULL_RES,
208
209 .ev_type = EV_ABS,
210 .ev_code_x = ABS_X, /* EV_REL */
211 .ev_code_y = ABS_Y, /* EV_REL */
212 .ev_code_z = ABS_Z, /* EV_REL */
213
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000214 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000215
216/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
217/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
218 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
219 .fifo_mode = ADXL_FIFO_STREAM,
Michael Hennerich5db40362009-10-29 13:48:10 +0000220 .orientation_enable = ADXL_EN_ORIENTATION_3D,
221 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
222 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
223 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
224 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000225};
226#endif
227
Roy Huang24a07a12007-07-12 22:41:45 +0800228#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
229static struct platform_device rtc_device = {
230 .name = "rtc-bfin",
231 .id = -1,
232};
233#endif
234
235#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Roy Huang24a07a12007-07-12 22:41:45 +0800236#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000237static struct resource bfin_uart0_resources[] = {
Roy Huang24a07a12007-07-12 22:41:45 +0800238 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000239 .start = UART0_DLL,
240 .end = UART0_RBR+2,
Roy Huang24a07a12007-07-12 22:41:45 +0800241 .flags = IORESOURCE_MEM,
242 },
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000243 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800244 .start = IRQ_UART0_TX,
245 .end = IRQ_UART0_TX,
246 .flags = IORESOURCE_IRQ,
247 },
248 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000249 .start = IRQ_UART0_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800250 .end = IRQ_UART0_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000251 .flags = IORESOURCE_IRQ,
252 },
253 {
254 .start = IRQ_UART0_ERROR,
255 .end = IRQ_UART0_ERROR,
256 .flags = IORESOURCE_IRQ,
257 },
258 {
259 .start = CH_UART0_TX,
260 .end = CH_UART0_TX,
261 .flags = IORESOURCE_DMA,
262 },
263 {
264 .start = CH_UART0_RX,
265 .end = CH_UART0_RX,
266 .flags = IORESOURCE_DMA,
267 },
268};
269
Mike Frysingera8b19882010-11-24 09:23:04 +0000270static unsigned short bfin_uart0_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000271 P_UART0_TX, P_UART0_RX, 0
272};
273
274static struct platform_device bfin_uart0_device = {
275 .name = "bfin-uart",
276 .id = 0,
277 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
278 .resource = bfin_uart0_resources,
279 .dev = {
280 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
281 },
282};
Roy Huang24a07a12007-07-12 22:41:45 +0800283#endif
284#ifdef CONFIG_SERIAL_BFIN_UART1
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000285static struct resource bfin_uart1_resources[] = {
Roy Huang24a07a12007-07-12 22:41:45 +0800286 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000287 .start = UART1_DLL,
288 .end = UART1_RBR+2,
Roy Huang24a07a12007-07-12 22:41:45 +0800289 .flags = IORESOURCE_MEM,
290 },
Roy Huang24a07a12007-07-12 22:41:45 +0800291 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800292 .start = IRQ_UART1_TX,
293 .end = IRQ_UART1_TX,
294 .flags = IORESOURCE_IRQ,
295 },
296 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000297 .start = IRQ_UART1_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800298 .end = IRQ_UART1_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000299 .flags = IORESOURCE_IRQ,
Roy Huang24a07a12007-07-12 22:41:45 +0800300 },
Roy Huang24a07a12007-07-12 22:41:45 +0800301 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000302 .start = IRQ_UART1_ERROR,
303 .end = IRQ_UART1_ERROR,
304 .flags = IORESOURCE_IRQ,
305 },
306 {
307 .start = CH_UART1_TX,
308 .end = CH_UART1_TX,
309 .flags = IORESOURCE_DMA,
310 },
311 {
312 .start = CH_UART1_RX,
313 .end = CH_UART1_RX,
314 .flags = IORESOURCE_DMA,
315 },
316#ifdef CONFIG_BFIN_UART1_CTSRTS
317 { /* CTS pin -- 0 means not supported */
318 .start = GPIO_PE10,
319 .end = GPIO_PE10,
320 .flags = IORESOURCE_IO,
321 },
322 { /* RTS pin -- 0 means not supported */
323 .start = GPIO_PE9,
324 .end = GPIO_PE9,
325 .flags = IORESOURCE_IO,
Roy Huang24a07a12007-07-12 22:41:45 +0800326 },
327#endif
328};
329
Mike Frysingera8b19882010-11-24 09:23:04 +0000330static unsigned short bfin_uart1_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000331 P_UART1_TX, P_UART1_RX,
332#ifdef CONFIG_BFIN_UART1_CTSRTS
333 P_UART1_RTS, P_UART1_CTS,
334#endif
335 0
336};
337
338static struct platform_device bfin_uart1_device = {
Roy Huang24a07a12007-07-12 22:41:45 +0800339 .name = "bfin-uart",
340 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000341 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
342 .resource = bfin_uart1_resources,
343 .dev = {
344 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
345 },
Roy Huang24a07a12007-07-12 22:41:45 +0800346};
347#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000348#ifdef CONFIG_SERIAL_BFIN_UART2
349static struct resource bfin_uart2_resources[] = {
350 {
351 .start = UART2_DLL,
352 .end = UART2_RBR+2,
353 .flags = IORESOURCE_MEM,
354 },
355 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800356 .start = IRQ_UART2_TX,
357 .end = IRQ_UART2_TX,
358 .flags = IORESOURCE_IRQ,
359 },
360 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000361 .start = IRQ_UART2_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800362 .end = IRQ_UART2_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000363 .flags = IORESOURCE_IRQ,
364 },
365 {
366 .start = IRQ_UART2_ERROR,
367 .end = IRQ_UART2_ERROR,
368 .flags = IORESOURCE_IRQ,
369 },
370 {
371 .start = CH_UART2_TX,
372 .end = CH_UART2_TX,
373 .flags = IORESOURCE_DMA,
374 },
375 {
376 .start = CH_UART2_RX,
377 .end = CH_UART2_RX,
378 .flags = IORESOURCE_DMA,
379 },
380};
381
Mike Frysingera8b19882010-11-24 09:23:04 +0000382static unsigned short bfin_uart2_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000383 P_UART2_TX, P_UART2_RX, 0
384};
385
386static struct platform_device bfin_uart2_device = {
387 .name = "bfin-uart",
388 .id = 2,
389 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
390 .resource = bfin_uart2_resources,
391 .dev = {
392 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
393 },
394};
395#endif
396#ifdef CONFIG_SERIAL_BFIN_UART3
397static struct resource bfin_uart3_resources[] = {
398 {
399 .start = UART3_DLL,
400 .end = UART3_RBR+2,
401 .flags = IORESOURCE_MEM,
402 },
403 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800404 .start = IRQ_UART3_TX,
405 .end = IRQ_UART3_TX,
406 .flags = IORESOURCE_IRQ,
407 },
408 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000409 .start = IRQ_UART3_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800410 .end = IRQ_UART3_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000411 .flags = IORESOURCE_IRQ,
412 },
413 {
414 .start = IRQ_UART3_ERROR,
415 .end = IRQ_UART3_ERROR,
416 .flags = IORESOURCE_IRQ,
417 },
418 {
419 .start = CH_UART3_TX,
420 .end = CH_UART3_TX,
421 .flags = IORESOURCE_DMA,
422 },
423 {
424 .start = CH_UART3_RX,
425 .end = CH_UART3_RX,
426 .flags = IORESOURCE_DMA,
427 },
428#ifdef CONFIG_BFIN_UART3_CTSRTS
429 { /* CTS pin -- 0 means not supported */
430 .start = GPIO_PB3,
431 .end = GPIO_PB3,
432 .flags = IORESOURCE_IO,
433 },
434 { /* RTS pin -- 0 means not supported */
435 .start = GPIO_PB2,
436 .end = GPIO_PB2,
437 .flags = IORESOURCE_IO,
438 },
439#endif
440};
441
Mike Frysingera8b19882010-11-24 09:23:04 +0000442static unsigned short bfin_uart3_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000443 P_UART3_TX, P_UART3_RX,
444#ifdef CONFIG_BFIN_UART3_CTSRTS
445 P_UART3_RTS, P_UART3_CTS,
446#endif
447 0
448};
449
450static struct platform_device bfin_uart3_device = {
451 .name = "bfin-uart",
452 .id = 3,
453 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
454 .resource = bfin_uart3_resources,
455 .dev = {
456 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
457 },
458};
459#endif
460#endif
Roy Huang24a07a12007-07-12 22:41:45 +0800461
Graf Yang5be36d22008-04-25 03:09:15 +0800462#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800463#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800464static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800465 {
466 .start = 0xFFC00400,
467 .end = 0xFFC004FF,
468 .flags = IORESOURCE_MEM,
469 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800470 {
471 .start = IRQ_UART0_RX,
472 .end = IRQ_UART0_RX+1,
473 .flags = IORESOURCE_IRQ,
474 },
475 {
476 .start = CH_UART0_RX,
477 .end = CH_UART0_RX+1,
478 .flags = IORESOURCE_DMA,
479 },
480};
481static struct platform_device bfin_sir0_device = {
482 .name = "bfin_sir",
483 .id = 0,
484 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
485 .resource = bfin_sir0_resources,
486};
Graf Yang5be36d22008-04-25 03:09:15 +0800487#endif
488#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800489static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800490 {
491 .start = 0xFFC02000,
492 .end = 0xFFC020FF,
493 .flags = IORESOURCE_MEM,
494 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800495 {
496 .start = IRQ_UART1_RX,
497 .end = IRQ_UART1_RX+1,
498 .flags = IORESOURCE_IRQ,
499 },
500 {
501 .start = CH_UART1_RX,
502 .end = CH_UART1_RX+1,
503 .flags = IORESOURCE_DMA,
504 },
505};
506static struct platform_device bfin_sir1_device = {
507 .name = "bfin_sir",
508 .id = 1,
509 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
510 .resource = bfin_sir1_resources,
511};
Graf Yang5be36d22008-04-25 03:09:15 +0800512#endif
513#ifdef CONFIG_BFIN_SIR2
Graf Yang42bd8bc2009-01-07 23:14:39 +0800514static struct resource bfin_sir2_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800515 {
516 .start = 0xFFC02100,
517 .end = 0xFFC021FF,
518 .flags = IORESOURCE_MEM,
519 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800520 {
521 .start = IRQ_UART2_RX,
522 .end = IRQ_UART2_RX+1,
523 .flags = IORESOURCE_IRQ,
524 },
525 {
526 .start = CH_UART2_RX,
527 .end = CH_UART2_RX+1,
528 .flags = IORESOURCE_DMA,
529 },
530};
531static struct platform_device bfin_sir2_device = {
532 .name = "bfin_sir",
533 .id = 2,
534 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
535 .resource = bfin_sir2_resources,
536};
Graf Yang5be36d22008-04-25 03:09:15 +0800537#endif
538#ifdef CONFIG_BFIN_SIR3
Graf Yang42bd8bc2009-01-07 23:14:39 +0800539static struct resource bfin_sir3_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800540 {
541 .start = 0xFFC03100,
542 .end = 0xFFC031FF,
543 .flags = IORESOURCE_MEM,
544 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800545 {
546 .start = IRQ_UART3_RX,
547 .end = IRQ_UART3_RX+1,
548 .flags = IORESOURCE_IRQ,
549 },
550 {
551 .start = CH_UART3_RX,
552 .end = CH_UART3_RX+1,
553 .flags = IORESOURCE_DMA,
554 },
Graf Yang5be36d22008-04-25 03:09:15 +0800555};
Graf Yang42bd8bc2009-01-07 23:14:39 +0800556static struct platform_device bfin_sir3_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800557 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800558 .id = 3,
559 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
560 .resource = bfin_sir3_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800561};
562#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800563#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800564
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800565#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400566#include <linux/smsc911x.h>
567
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800568static struct resource smsc911x_resources[] = {
569 {
570 .name = "smsc911x-memory",
571 .start = 0x24000000,
572 .end = 0x24000000 + 0xFF,
573 .flags = IORESOURCE_MEM,
574 },
575 {
576 .start = IRQ_PE8,
577 .end = IRQ_PE8,
578 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
579 },
580};
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400581
582static struct smsc911x_platform_config smsc911x_config = {
583 .flags = SMSC911X_USE_32BIT,
584 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
585 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
586 .phy_interface = PHY_INTERFACE_MODE_MII,
587};
588
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800589static struct platform_device smsc911x_device = {
590 .name = "smsc911x",
591 .id = 0,
592 .num_resources = ARRAY_SIZE(smsc911x_resources),
593 .resource = smsc911x_resources,
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400594 .dev = {
595 .platform_data = &smsc911x_config,
596 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800597};
598#endif
599
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800600#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
601static struct resource musb_resources[] = {
602 [0] = {
603 .start = 0xFFC03C00,
604 .end = 0xFFC040FF,
605 .flags = IORESOURCE_MEM,
606 },
607 [1] = { /* general IRQ */
608 .start = IRQ_USB_INT0,
609 .end = IRQ_USB_INT0,
610 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
Hema Kalliguddifcf173e2010-09-29 11:26:39 -0500611 .name = "mc"
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800612 },
613 [2] = { /* DMA IRQ */
614 .start = IRQ_USB_DMA,
615 .end = IRQ_USB_DMA,
616 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
Hema Kalliguddifcf173e2010-09-29 11:26:39 -0500617 .name = "dma"
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800618 },
619};
620
Bryan Wu50041ac2008-10-08 13:39:40 +0800621static struct musb_hdrc_config musb_config = {
622 .multipoint = 0,
623 .dyn_fifo = 0,
624 .soft_con = 1,
625 .dma = 1,
Bryan Wufea05da2009-01-07 23:14:39 +0800626 .num_eps = 8,
627 .dma_channels = 8,
Bryan Wu50041ac2008-10-08 13:39:40 +0800628 .gpio_vrsel = GPIO_PE7,
Cliff Cai85eb0e42010-01-22 04:02:46 +0000629 /* Some custom boards need to be active low, just set it to "0"
630 * if it is the case.
631 */
632 .gpio_vrsel_active = 1,
Bob Liu759a3f32010-09-17 11:09:57 +0000633 .clkin = 24, /* musb CLKIN in MHZ */
Bryan Wu50041ac2008-10-08 13:39:40 +0800634};
635
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800636static struct musb_hdrc_platform_data musb_plat = {
Bryan Wu29350772007-12-24 12:20:19 +0800637#if defined(CONFIG_USB_MUSB_OTG)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800638 .mode = MUSB_OTG,
Bryan Wu29350772007-12-24 12:20:19 +0800639#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800640 .mode = MUSB_HOST,
Bryan Wu29350772007-12-24 12:20:19 +0800641#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800642 .mode = MUSB_PERIPHERAL,
643#endif
Bryan Wu50041ac2008-10-08 13:39:40 +0800644 .config = &musb_config,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800645};
646
647static u64 musb_dmamask = ~(u32)0;
648
649static struct platform_device musb_device = {
Felipe Balbi9cb03082010-12-02 09:21:05 +0200650 .name = "musb-blackfin",
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800651 .id = 0,
652 .dev = {
653 .dma_mask = &musb_dmamask,
654 .coherent_dma_mask = 0xffffffff,
655 .platform_data = &musb_plat,
656 },
657 .num_resources = ARRAY_SIZE(musb_resources),
658 .resource = musb_resources,
659};
660#endif
661
Sonic Zhangdf5de262009-09-23 05:01:56 +0000662#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
663#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
664static struct resource bfin_sport0_uart_resources[] = {
665 {
666 .start = SPORT0_TCR1,
667 .end = SPORT0_MRCS3+4,
668 .flags = IORESOURCE_MEM,
669 },
670 {
671 .start = IRQ_SPORT0_RX,
672 .end = IRQ_SPORT0_RX+1,
673 .flags = IORESOURCE_IRQ,
674 },
675 {
676 .start = IRQ_SPORT0_ERROR,
677 .end = IRQ_SPORT0_ERROR,
678 .flags = IORESOURCE_IRQ,
679 },
680};
681
Mike Frysingera8b19882010-11-24 09:23:04 +0000682static unsigned short bfin_sport0_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000683 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000684 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
Sonic Zhangdf5de262009-09-23 05:01:56 +0000685};
686
687static struct platform_device bfin_sport0_uart_device = {
688 .name = "bfin-sport-uart",
689 .id = 0,
690 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
691 .resource = bfin_sport0_uart_resources,
692 .dev = {
693 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
694 },
695};
696#endif
697#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
698static struct resource bfin_sport1_uart_resources[] = {
699 {
700 .start = SPORT1_TCR1,
701 .end = SPORT1_MRCS3+4,
702 .flags = IORESOURCE_MEM,
703 },
704 {
705 .start = IRQ_SPORT1_RX,
706 .end = IRQ_SPORT1_RX+1,
707 .flags = IORESOURCE_IRQ,
708 },
709 {
710 .start = IRQ_SPORT1_ERROR,
711 .end = IRQ_SPORT1_ERROR,
712 .flags = IORESOURCE_IRQ,
713 },
714};
715
Mike Frysingera8b19882010-11-24 09:23:04 +0000716static unsigned short bfin_sport1_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000717 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000718 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
Sonic Zhangdf5de262009-09-23 05:01:56 +0000719};
720
721static struct platform_device bfin_sport1_uart_device = {
722 .name = "bfin-sport-uart",
723 .id = 1,
724 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
725 .resource = bfin_sport1_uart_resources,
726 .dev = {
727 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
728 },
729};
730#endif
731#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
732static struct resource bfin_sport2_uart_resources[] = {
733 {
734 .start = SPORT2_TCR1,
735 .end = SPORT2_MRCS3+4,
736 .flags = IORESOURCE_MEM,
737 },
738 {
739 .start = IRQ_SPORT2_RX,
740 .end = IRQ_SPORT2_RX+1,
741 .flags = IORESOURCE_IRQ,
742 },
743 {
744 .start = IRQ_SPORT2_ERROR,
745 .end = IRQ_SPORT2_ERROR,
746 .flags = IORESOURCE_IRQ,
747 },
748};
749
Mike Frysingera8b19882010-11-24 09:23:04 +0000750static unsigned short bfin_sport2_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000751 P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
752 P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0
753};
754
755static struct platform_device bfin_sport2_uart_device = {
756 .name = "bfin-sport-uart",
757 .id = 2,
758 .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
759 .resource = bfin_sport2_uart_resources,
760 .dev = {
761 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
762 },
763};
764#endif
765#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
766static struct resource bfin_sport3_uart_resources[] = {
767 {
768 .start = SPORT3_TCR1,
769 .end = SPORT3_MRCS3+4,
770 .flags = IORESOURCE_MEM,
771 },
772 {
773 .start = IRQ_SPORT3_RX,
774 .end = IRQ_SPORT3_RX+1,
775 .flags = IORESOURCE_IRQ,
776 },
777 {
778 .start = IRQ_SPORT3_ERROR,
779 .end = IRQ_SPORT3_ERROR,
780 .flags = IORESOURCE_IRQ,
781 },
782};
783
Mike Frysingera8b19882010-11-24 09:23:04 +0000784static unsigned short bfin_sport3_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000785 P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
786 P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0
787};
788
789static struct platform_device bfin_sport3_uart_device = {
790 .name = "bfin-sport-uart",
791 .id = 3,
792 .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
793 .resource = bfin_sport3_uart_resources,
794 .dev = {
795 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
796 },
797};
798#endif
799#endif
800
Barry Song706a01b2009-11-02 07:29:07 +0000801#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
Aaron Wu4c131c82010-12-22 06:21:03 +0000802
803static unsigned short bfin_can0_peripherals[] = {
Barry Song706a01b2009-11-02 07:29:07 +0000804 P_CAN0_RX, P_CAN0_TX, 0
805};
806
Aaron Wu4c131c82010-12-22 06:21:03 +0000807static struct resource bfin_can0_resources[] = {
Barry Song706a01b2009-11-02 07:29:07 +0000808 {
809 .start = 0xFFC02A00,
810 .end = 0xFFC02FFF,
811 .flags = IORESOURCE_MEM,
812 },
813 {
814 .start = IRQ_CAN0_RX,
815 .end = IRQ_CAN0_RX,
816 .flags = IORESOURCE_IRQ,
817 },
818 {
819 .start = IRQ_CAN0_TX,
820 .end = IRQ_CAN0_TX,
821 .flags = IORESOURCE_IRQ,
822 },
823 {
824 .start = IRQ_CAN0_ERROR,
825 .end = IRQ_CAN0_ERROR,
826 .flags = IORESOURCE_IRQ,
827 },
828};
829
Aaron Wu4c131c82010-12-22 06:21:03 +0000830static struct platform_device bfin_can0_device = {
Barry Song706a01b2009-11-02 07:29:07 +0000831 .name = "bfin_can",
Aaron Wu4c131c82010-12-22 06:21:03 +0000832 .id = 0,
833 .num_resources = ARRAY_SIZE(bfin_can0_resources),
834 .resource = bfin_can0_resources,
Barry Song706a01b2009-11-02 07:29:07 +0000835 .dev = {
Aaron Wu4c131c82010-12-22 06:21:03 +0000836 .platform_data = &bfin_can0_peripherals, /* Passed to driver */
Barry Song706a01b2009-11-02 07:29:07 +0000837 },
838};
Aaron Wu4c131c82010-12-22 06:21:03 +0000839
840static unsigned short bfin_can1_peripherals[] = {
841 P_CAN1_RX, P_CAN1_TX, 0
842};
843
844static struct resource bfin_can1_resources[] = {
845 {
846 .start = 0xFFC03200,
847 .end = 0xFFC037FF,
848 .flags = IORESOURCE_MEM,
849 },
850 {
851 .start = IRQ_CAN1_RX,
852 .end = IRQ_CAN1_RX,
853 .flags = IORESOURCE_IRQ,
854 },
855 {
856 .start = IRQ_CAN1_TX,
857 .end = IRQ_CAN1_TX,
858 .flags = IORESOURCE_IRQ,
859 },
860 {
861 .start = IRQ_CAN1_ERROR,
862 .end = IRQ_CAN1_ERROR,
863 .flags = IORESOURCE_IRQ,
864 },
865};
866
867static struct platform_device bfin_can1_device = {
868 .name = "bfin_can",
869 .id = 1,
870 .num_resources = ARRAY_SIZE(bfin_can1_resources),
871 .resource = bfin_can1_resources,
872 .dev = {
873 .platform_data = &bfin_can1_peripherals, /* Passed to driver */
874 },
875};
876
Barry Song706a01b2009-11-02 07:29:07 +0000877#endif
878
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800879#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
880static struct resource bfin_atapi_resources[] = {
881 {
882 .start = 0xFFC03800,
883 .end = 0xFFC0386F,
884 .flags = IORESOURCE_MEM,
885 },
886 {
887 .start = IRQ_ATAPI_ERR,
888 .end = IRQ_ATAPI_ERR,
889 .flags = IORESOURCE_IRQ,
890 },
891};
892
893static struct platform_device bfin_atapi_device = {
894 .name = "pata-bf54x",
895 .id = -1,
896 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
897 .resource = bfin_atapi_resources,
898};
899#endif
900
901#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
902static struct mtd_partition partition_info[] = {
903 {
Mike Frysinger73775b82010-08-27 20:43:39 +0000904 .name = "bootloader(nand)",
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800905 .offset = 0,
Mike Frysinger73775b82010-08-27 20:43:39 +0000906 .size = 0x80000,
907 }, {
908 .name = "linux kernel(nand)",
909 .offset = MTDPART_OFS_APPEND,
Mike Frysingerf4585a02008-10-13 14:45:21 +0800910 .size = 4 * 1024 * 1024,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800911 },
912 {
Robin Getzaa582972008-08-05 17:47:29 +0800913 .name = "file system(nand)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800914 .offset = MTDPART_OFS_APPEND,
915 .size = MTDPART_SIZ_FULL,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800916 },
917};
918
919static struct bf5xx_nand_platform bf5xx_nand_platform = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800920 .data_width = NFC_NWIDTH_8,
921 .partitions = partition_info,
922 .nr_partitions = ARRAY_SIZE(partition_info),
923 .rd_dly = 3,
924 .wr_dly = 3,
925};
926
927static struct resource bf5xx_nand_resources[] = {
928 {
929 .start = 0xFFC03B00,
930 .end = 0xFFC03B4F,
931 .flags = IORESOURCE_MEM,
932 },
933 {
934 .start = CH_NFC,
935 .end = CH_NFC,
936 .flags = IORESOURCE_IRQ,
937 },
938};
939
940static struct platform_device bf5xx_nand_device = {
941 .name = "bf5xx-nand",
942 .id = 0,
943 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
944 .resource = bf5xx_nand_resources,
945 .dev = {
946 .platform_data = &bf5xx_nand_platform,
947 },
948};
949#endif
950
Michael Hennerich3d7e6cf2008-03-03 17:40:28 -0700951#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
Cliff Cai501674a2009-01-07 23:14:38 +0800952
953static struct bfin_sd_host bfin_sdh_data = {
954 .dma_chan = CH_SDH,
955 .irq_int0 = IRQ_SDH_MASK0,
956 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
957};
958
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800959static struct platform_device bf54x_sdh_device = {
960 .name = "bfin-sdh",
961 .id = 0,
Cliff Cai501674a2009-01-07 23:14:38 +0800962 .dev = {
963 .platform_data = &bfin_sdh_data,
964 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800965};
966#endif
967
Mike Frysinger793dc272008-03-26 08:09:12 +0800968#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800969static struct mtd_partition ezkit_partitions[] = {
970 {
Robin Getzaa582972008-08-05 17:47:29 +0800971 .name = "bootloader(nor)",
Mike Frysinger73775b82010-08-27 20:43:39 +0000972 .size = 0x80000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800973 .offset = 0,
974 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800975 .name = "linux kernel(nor)",
Mike Frysinger664d0402008-10-09 17:28:36 +0800976 .size = 0x400000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800977 .offset = MTDPART_OFS_APPEND,
978 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800979 .name = "file system(nor)",
Mike Frysinger56072042011-05-09 18:46:17 -0400980 .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4,
981 .offset = MTDPART_OFS_APPEND,
982 }, {
983 .name = "config(nor)",
984 .size = 0x8000 * 3,
985 .offset = MTDPART_OFS_APPEND,
986 }, {
987 .name = "u-boot env(nor)",
988 .size = 0x8000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800989 .offset = MTDPART_OFS_APPEND,
990 }
991};
992
993static struct physmap_flash_data ezkit_flash_data = {
994 .width = 2,
995 .parts = ezkit_partitions,
996 .nr_parts = ARRAY_SIZE(ezkit_partitions),
997};
998
999static struct resource ezkit_flash_resource = {
1000 .start = 0x20000000,
Mike Frysinger664d0402008-10-09 17:28:36 +08001001 .end = 0x21ffffff,
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001002 .flags = IORESOURCE_MEM,
1003};
1004
1005static struct platform_device ezkit_flash_device = {
1006 .name = "physmap-flash",
1007 .id = 0,
1008 .dev = {
1009 .platform_data = &ezkit_flash_data,
1010 },
1011 .num_resources = 1,
1012 .resource = &ezkit_flash_resource,
1013};
Mike Frysinger793dc272008-03-26 08:09:12 +08001014#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001015
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001016#if defined(CONFIG_MTD_M25P80) \
1017 || defined(CONFIG_MTD_M25P80_MODULE)
1018/* SPI flash chip (m25p16) */
1019static struct mtd_partition bfin_spi_flash_partitions[] = {
1020 {
Robin Getzaa582972008-08-05 17:47:29 +08001021 .name = "bootloader(spi)",
Mike Frysinger73775b82010-08-27 20:43:39 +00001022 .size = 0x00080000,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001023 .offset = 0,
1024 .mask_flags = MTD_CAP_ROM
1025 }, {
Robin Getzaa582972008-08-05 17:47:29 +08001026 .name = "linux kernel(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +08001027 .size = MTDPART_SIZ_FULL,
1028 .offset = MTDPART_OFS_APPEND,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001029 }
1030};
1031
1032static struct flash_platform_data bfin_spi_flash_data = {
1033 .name = "m25p80",
1034 .parts = bfin_spi_flash_partitions,
1035 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
1036 .type = "m25p16",
1037};
1038
1039static struct bfin5xx_spi_chip spi_flash_chip_info = {
1040 .enable_dma = 0, /* use dma transfer with this chip*/
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001041};
1042#endif
1043
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001044#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001045static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1046 .model = 7877,
1047 .vref_delay_usecs = 50, /* internal, no capacitor */
1048 .x_plate_ohms = 419,
1049 .y_plate_ohms = 486,
1050 .pressure_max = 1000,
1051 .pressure_min = 0,
1052 .stopacq_polarity = 1,
1053 .first_conversion_delay = 3,
1054 .acquisition_time = 1,
1055 .averaging = 1,
1056 .pen_down_acc_interval = 1,
1057};
1058#endif
1059
Mike Frysinger5bda2722008-06-07 15:03:01 +08001060static struct spi_board_info bfin_spi_board_info[] __initdata = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001061#if defined(CONFIG_MTD_M25P80) \
1062 || defined(CONFIG_MTD_M25P80_MODULE)
1063 {
1064 /* the modalias must be the same as spi device driver name */
1065 .modalias = "m25p80", /* Name of spi_driver for this device */
1066 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1067 .bus_num = 0, /* Framework bus number */
1068 .chip_select = 1, /* SPI_SSEL1*/
1069 .platform_data = &bfin_spi_flash_data,
1070 .controller_data = &spi_flash_chip_info,
1071 .mode = SPI_MODE_3,
1072 },
1073#endif
Barry Song7ba80062010-01-28 09:37:21 +00001074#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1075 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001076 {
Barry Song7ba80062010-01-28 09:37:21 +00001077 .modalias = "ad183x",
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001078 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1079 .bus_num = 1,
Barry Song7ba80062010-01-28 09:37:21 +00001080 .chip_select = 4,
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001081 },
1082#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001083#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001084 {
1085 .modalias = "ad7877",
1086 .platform_data = &bfin_ad7877_ts_info,
1087 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
1088 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1089 .bus_num = 0,
1090 .chip_select = 2,
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001091 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001092#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001093#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1094 {
1095 .modalias = "spidev",
1096 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1097 .bus_num = 0,
1098 .chip_select = 1,
Michael Hennerich6e668932008-02-09 01:54:09 +08001099 },
1100#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001101#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1102 {
1103 .modalias = "adxl34x",
1104 .platform_data = &adxl34x_info,
1105 .irq = IRQ_PC5,
1106 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1107 .bus_num = 1,
1108 .chip_select = 2,
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001109 .mode = SPI_MODE_3,
1110 },
1111#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001112};
Sonic Zhang7d157fb2011-11-07 18:40:10 +08001113#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001114/* SPI (0) */
1115static struct resource bfin_spi0_resource[] = {
1116 [0] = {
1117 .start = SPI0_REGBASE,
1118 .end = SPI0_REGBASE + 0xFF,
1119 .flags = IORESOURCE_MEM,
1120 },
1121 [1] = {
1122 .start = CH_SPI0,
1123 .end = CH_SPI0,
Yi Li53122692009-06-05 12:11:11 +00001124 .flags = IORESOURCE_DMA,
1125 },
1126 [2] = {
1127 .start = IRQ_SPI0,
1128 .end = IRQ_SPI0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001129 .flags = IORESOURCE_IRQ,
1130 }
1131};
1132
1133/* SPI (1) */
1134static struct resource bfin_spi1_resource[] = {
1135 [0] = {
1136 .start = SPI1_REGBASE,
1137 .end = SPI1_REGBASE + 0xFF,
1138 .flags = IORESOURCE_MEM,
1139 },
1140 [1] = {
1141 .start = CH_SPI1,
1142 .end = CH_SPI1,
Yi Li53122692009-06-05 12:11:11 +00001143 .flags = IORESOURCE_DMA,
1144 },
1145 [2] = {
1146 .start = IRQ_SPI1,
1147 .end = IRQ_SPI1,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001148 .flags = IORESOURCE_IRQ,
1149 }
1150};
1151
1152/* SPI controller data */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001153static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
Mike Frysingerc5af5452010-06-16 19:29:51 +00001154 .num_chipselect = 4,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001155 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001156 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001157};
1158
1159static struct platform_device bf54x_spi_master0 = {
1160 .name = "bfin-spi",
1161 .id = 0, /* Bus number */
1162 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1163 .resource = bfin_spi0_resource,
1164 .dev = {
Bryan Wu5d448dd2007-11-12 23:24:42 +08001165 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001166 },
1167};
1168
Bryan Wu5d448dd2007-11-12 23:24:42 +08001169static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
Mike Frysingerc5af5452010-06-16 19:29:51 +00001170 .num_chipselect = 4,
Bryan Wu5d448dd2007-11-12 23:24:42 +08001171 .enable_dma = 1, /* master has the ability to do dma transfer */
1172 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1173};
1174
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001175static struct platform_device bf54x_spi_master1 = {
1176 .name = "bfin-spi",
1177 .id = 1, /* Bus number */
1178 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
1179 .resource = bfin_spi1_resource,
1180 .dev = {
Bryan Wu5d448dd2007-11-12 23:24:42 +08001181 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001182 },
1183};
1184#endif /* spi master and devices */
1185
1186#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1187static struct resource bfin_twi0_resource[] = {
1188 [0] = {
1189 .start = TWI0_REGBASE,
1190 .end = TWI0_REGBASE + 0xFF,
1191 .flags = IORESOURCE_MEM,
1192 },
1193 [1] = {
1194 .start = IRQ_TWI0,
1195 .end = IRQ_TWI0,
1196 .flags = IORESOURCE_IRQ,
1197 },
1198};
1199
1200static struct platform_device i2c_bfin_twi0_device = {
1201 .name = "i2c-bfin-twi",
1202 .id = 0,
1203 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1204 .resource = bfin_twi0_resource,
1205};
1206
Mike Frysinger7160e952007-11-21 16:03:07 +08001207#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001208static struct resource bfin_twi1_resource[] = {
1209 [0] = {
1210 .start = TWI1_REGBASE,
1211 .end = TWI1_REGBASE + 0xFF,
1212 .flags = IORESOURCE_MEM,
1213 },
1214 [1] = {
1215 .start = IRQ_TWI1,
1216 .end = IRQ_TWI1,
1217 .flags = IORESOURCE_IRQ,
1218 },
1219};
1220
1221static struct platform_device i2c_bfin_twi1_device = {
1222 .name = "i2c-bfin-twi",
1223 .id = 1,
1224 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
1225 .resource = bfin_twi1_resource,
1226};
1227#endif
Mike Frysinger7160e952007-11-21 16:03:07 +08001228#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001229
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001230static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1231};
1232
1233#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1234static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
Michael Hennerichebd58332009-07-02 11:00:38 +00001235#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001236 {
1237 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001238 },
1239#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00001240#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001241 {
1242 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001243 .irq = 212,
1244 },
1245#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001246#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1247 {
1248 I2C_BOARD_INFO("adxl34x", 0x53),
1249 .irq = IRQ_PC5,
1250 .platform_data = (void *)&adxl34x_info,
1251 },
1252#endif
steven miao39d3c1c2010-08-26 08:25:13 +00001253#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1254 {
1255 I2C_BOARD_INFO("ad5252", 0x2f),
1256 },
1257#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001258};
1259#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001260
Michael Hennerich2463ef22008-01-27 16:49:48 +08001261#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1262#include <linux/gpio_keys.h>
1263
1264static struct gpio_keys_button bfin_gpio_keys_table[] = {
1265 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
1266 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
1267 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
1268 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
1269};
1270
1271static struct gpio_keys_platform_data bfin_gpio_keys_data = {
1272 .buttons = bfin_gpio_keys_table,
1273 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
1274};
1275
1276static struct platform_device bfin_device_gpiokeys = {
1277 .name = "gpio-keys",
1278 .dev = {
1279 .platform_data = &bfin_gpio_keys_data,
1280 },
1281};
1282#endif
1283
Michael Hennerich14b03202008-05-07 11:41:26 +08001284static const unsigned int cclk_vlev_datasheet[] =
1285{
1286/*
1287 * Internal VLEV BF54XSBBC1533
1288 ****temporarily using these values until data sheet is updated
1289 */
1290 VRPAIR(VLEV_085, 150000000),
1291 VRPAIR(VLEV_090, 250000000),
1292 VRPAIR(VLEV_110, 276000000),
1293 VRPAIR(VLEV_115, 301000000),
1294 VRPAIR(VLEV_120, 525000000),
1295 VRPAIR(VLEV_125, 550000000),
1296 VRPAIR(VLEV_130, 600000000),
1297};
1298
1299static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1300 .tuple_tab = cclk_vlev_datasheet,
1301 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1302 .vr_settling_time = 25 /* us */,
1303};
1304
1305static struct platform_device bfin_dpmc = {
1306 .name = "bfin dpmc",
1307 .dev = {
1308 .platform_data = &bfin_dmpc_vreg_data,
1309 },
1310};
1311
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001312#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
1313 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \
1314 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1315
1316#define SPORT_REQ(x) \
1317 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \
1318 P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0}
1319
1320static const u16 bfin_snd_pin[][7] = {
1321 SPORT_REQ(0),
1322 SPORT_REQ(1),
1323};
1324
1325static struct bfin_snd_platform_data bfin_snd_data[] = {
1326 {
1327 .pin_req = &bfin_snd_pin[0][0],
1328 },
1329 {
1330 .pin_req = &bfin_snd_pin[1][0],
1331 },
1332};
1333
1334#define BFIN_SND_RES(x) \
1335 [x] = { \
1336 { \
1337 .start = SPORT##x##_TCR1, \
1338 .end = SPORT##x##_TCR1, \
1339 .flags = IORESOURCE_MEM \
1340 }, \
1341 { \
1342 .start = CH_SPORT##x##_RX, \
1343 .end = CH_SPORT##x##_RX, \
1344 .flags = IORESOURCE_DMA, \
1345 }, \
1346 { \
1347 .start = CH_SPORT##x##_TX, \
1348 .end = CH_SPORT##x##_TX, \
1349 .flags = IORESOURCE_DMA, \
1350 }, \
1351 { \
1352 .start = IRQ_SPORT##x##_ERROR, \
1353 .end = IRQ_SPORT##x##_ERROR, \
1354 .flags = IORESOURCE_IRQ, \
1355 } \
1356 }
1357
1358static struct resource bfin_snd_resources[][4] = {
1359 BFIN_SND_RES(0),
1360 BFIN_SND_RES(1),
1361};
1362
1363static struct platform_device bfin_pcm = {
1364 .name = "bfin-pcm-audio",
1365 .id = -1,
1366};
1367#endif
1368
1369#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
1370static struct platform_device bfin_ad73311_codec_device = {
1371 .name = "ad73311",
1372 .id = -1,
1373};
1374#endif
1375
1376#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1377static struct platform_device bfin_ad1980_codec_device = {
1378 .name = "ad1980",
1379 .id = -1,
1380};
1381#endif
1382
1383#if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
Barry Song439b4862009-11-13 02:41:07 +00001384static struct platform_device bfin_i2s = {
1385 .name = "bfin-i2s",
1386 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001387 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1388 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1389 .dev = {
1390 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1391 },
Barry Song439b4862009-11-13 02:41:07 +00001392};
1393#endif
1394
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001395#if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
Barry Song439b4862009-11-13 02:41:07 +00001396static struct platform_device bfin_tdm = {
1397 .name = "bfin-tdm",
1398 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001399 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1400 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1401 .dev = {
1402 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1403 },
Barry Song439b4862009-11-13 02:41:07 +00001404};
1405#endif
1406
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001407#if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
Barry Song439b4862009-11-13 02:41:07 +00001408static struct platform_device bfin_ac97 = {
1409 .name = "bfin-ac97",
1410 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001411 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1412 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1413 .dev = {
1414 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1415 },
Barry Song439b4862009-11-13 02:41:07 +00001416};
1417#endif
1418
Roy Huang24a07a12007-07-12 22:41:45 +08001419static struct platform_device *ezkit_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08001420
1421 &bfin_dpmc,
1422
Roy Huang24a07a12007-07-12 22:41:45 +08001423#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1424 &rtc_device,
1425#endif
1426
1427#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001428#ifdef CONFIG_SERIAL_BFIN_UART0
1429 &bfin_uart0_device,
1430#endif
1431#ifdef CONFIG_SERIAL_BFIN_UART1
1432 &bfin_uart1_device,
1433#endif
1434#ifdef CONFIG_SERIAL_BFIN_UART2
1435 &bfin_uart2_device,
1436#endif
1437#ifdef CONFIG_SERIAL_BFIN_UART3
1438 &bfin_uart3_device,
1439#endif
Roy Huang24a07a12007-07-12 22:41:45 +08001440#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001441
Graf Yang5be36d22008-04-25 03:09:15 +08001442#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08001443#ifdef CONFIG_BFIN_SIR0
1444 &bfin_sir0_device,
1445#endif
1446#ifdef CONFIG_BFIN_SIR1
1447 &bfin_sir1_device,
1448#endif
1449#ifdef CONFIG_BFIN_SIR2
1450 &bfin_sir2_device,
1451#endif
1452#ifdef CONFIG_BFIN_SIR3
1453 &bfin_sir3_device,
1454#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001455#endif
1456
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001457#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
1458 &bf54x_lq043_device,
1459#endif
1460
1461#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
1462 &smsc911x_device,
1463#endif
1464
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001465#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1466 &musb_device,
1467#endif
1468
Michael Hennerich3f375692008-11-18 17:48:22 +08001469#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1470 &bfin_isp1760_device,
1471#endif
1472
Sonic Zhangdf5de262009-09-23 05:01:56 +00001473#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1474#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1475 &bfin_sport0_uart_device,
1476#endif
1477#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1478 &bfin_sport1_uart_device,
1479#endif
1480#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1481 &bfin_sport2_uart_device,
1482#endif
1483#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1484 &bfin_sport3_uart_device,
1485#endif
1486#endif
1487
Barry Song706a01b2009-11-02 07:29:07 +00001488#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
Aaron Wu4c131c82010-12-22 06:21:03 +00001489 &bfin_can0_device,
1490 &bfin_can1_device,
Barry Song706a01b2009-11-02 07:29:07 +00001491#endif
1492
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001493#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
1494 &bfin_atapi_device,
1495#endif
1496
1497#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1498 &bf5xx_nand_device,
1499#endif
1500
Michael Hennerich3d7e6cf2008-03-03 17:40:28 -07001501#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001502 &bf54x_sdh_device,
1503#endif
1504
Sonic Zhang7d157fb2011-11-07 18:40:10 +08001505#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001506 &bf54x_spi_master0,
Bryan Wud4b1d272007-10-21 17:03:55 +08001507 &bf54x_spi_master1,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001508#endif
1509
1510#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1511 &bf54x_kpad_device,
1512#endif
1513
Michael Hennerichadfc0462009-10-09 07:37:03 +00001514#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
Michael Hennerichaca5e4a2008-10-08 14:27:59 +08001515 &bfin_rotary_device,
1516#endif
1517
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001518#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1519 &i2c_bfin_twi0_device,
Mike Frysinger7160e952007-11-21 16:03:07 +08001520#if !defined(CONFIG_BF542)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001521 &i2c_bfin_twi1_device,
1522#endif
Mike Frysinger7160e952007-11-21 16:03:07 +08001523#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08001524
1525#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1526 &bfin_device_gpiokeys,
1527#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08001528
Mike Frysinger793dc272008-03-26 08:09:12 +08001529#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001530 &ezkit_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08001531#endif
Barry Song439b4862009-11-13 02:41:07 +00001532
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001533#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
1534 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \
1535 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1536 &bfin_pcm,
1537#endif
1538
1539#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1540 &bfin_ad1980_codec_device,
1541#endif
1542
Barry Song439b4862009-11-13 02:41:07 +00001543#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1544 &bfin_i2s,
1545#endif
1546
1547#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1548 &bfin_tdm,
1549#endif
1550
1551#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1552 &bfin_ac97,
1553#endif
Roy Huang24a07a12007-07-12 22:41:45 +08001554};
1555
Mike Frysingera01d7a72008-02-02 15:34:56 +08001556static int __init ezkit_init(void)
Roy Huang24a07a12007-07-12 22:41:45 +08001557{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08001558 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001559
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001560 i2c_register_board_info(0, bfin_i2c_board_info0,
1561 ARRAY_SIZE(bfin_i2c_board_info0));
1562#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1563 i2c_register_board_info(1, bfin_i2c_board_info1,
1564 ARRAY_SIZE(bfin_i2c_board_info1));
1565#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001566
Roy Huang24a07a12007-07-12 22:41:45 +08001567 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001568
Mike Frysinger5bda2722008-06-07 15:03:01 +08001569 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001570
Roy Huang24a07a12007-07-12 22:41:45 +08001571 return 0;
1572}
1573
Mike Frysingera01d7a72008-02-02 15:34:56 +08001574arch_initcall(ezkit_init);
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00001575
1576static struct platform_device *ezkit_early_devices[] __initdata = {
1577#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1578#ifdef CONFIG_SERIAL_BFIN_UART0
1579 &bfin_uart0_device,
1580#endif
1581#ifdef CONFIG_SERIAL_BFIN_UART1
1582 &bfin_uart1_device,
1583#endif
1584#ifdef CONFIG_SERIAL_BFIN_UART2
1585 &bfin_uart2_device,
1586#endif
1587#ifdef CONFIG_SERIAL_BFIN_UART3
1588 &bfin_uart3_device,
1589#endif
1590#endif
1591
1592#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1593#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1594 &bfin_sport0_uart_device,
1595#endif
1596#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1597 &bfin_sport1_uart_device,
1598#endif
1599#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1600 &bfin_sport2_uart_device,
1601#endif
1602#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1603 &bfin_sport3_uart_device,
1604#endif
1605#endif
1606};
1607
1608void __init native_machine_early_platform_add_devices(void)
1609{
1610 printk(KERN_INFO "register early platform devices\n");
1611 early_platform_add_devices(ezkit_early_devices,
1612 ARRAY_SIZE(ezkit_early_devices));
1613}