blob: 3bd75bae750dd004f45d4ff3c8e6ede35b78a0b0 [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 Hennerichc6feb762009-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,
Sonic Zhang5b8163a2012-05-08 15:41:18 +0800168 .pm_wakeup = 1,
Michael Hennerichaca5e4a2008-10-08 14:27:59 +0800169};
170
171static struct resource bfin_rotary_resources[] = {
172 {
173 .start = IRQ_CNT,
174 .end = IRQ_CNT,
175 .flags = IORESOURCE_IRQ,
176 },
177};
178
179static struct platform_device bfin_rotary_device = {
180 .name = "bfin-rotary",
181 .id = -1,
182 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
183 .resource = bfin_rotary_resources,
184 .dev = {
185 .platform_data = &bfin_rotary_data,
186 },
187};
188#endif
189
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000190#if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000191#include <linux/input/adxl34x.h>
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000192static const struct adxl34x_platform_data adxl34x_info = {
193 .x_axis_offset = 0,
194 .y_axis_offset = 0,
195 .z_axis_offset = 0,
196 .tap_threshold = 0x31,
197 .tap_duration = 0x10,
198 .tap_latency = 0x60,
199 .tap_window = 0xF0,
200 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
201 .act_axis_control = 0xFF,
202 .activity_threshold = 5,
203 .inactivity_threshold = 3,
204 .inactivity_time = 4,
205 .free_fall_threshold = 0x7,
206 .free_fall_time = 0x20,
207 .data_rate = 0x8,
208 .data_range = ADXL_FULL_RES,
209
210 .ev_type = EV_ABS,
211 .ev_code_x = ABS_X, /* EV_REL */
212 .ev_code_y = ABS_Y, /* EV_REL */
213 .ev_code_z = ABS_Z, /* EV_REL */
214
Michael Hennerich57af8ed2009-10-16 12:35:20 +0000215 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000216
217/* .ev_code_ff = KEY_F,*/ /* EV_KEY */
218/* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
219 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
220 .fifo_mode = ADXL_FIFO_STREAM,
Michael Hennerich5db40362009-10-29 13:48:10 +0000221 .orientation_enable = ADXL_EN_ORIENTATION_3D,
222 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
223 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
224 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
225 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
Michael Hennerichffc4d8b2009-05-29 15:41:18 +0000226};
227#endif
228
Roy Huang24a07a12007-07-12 22:41:45 +0800229#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
230static struct platform_device rtc_device = {
231 .name = "rtc-bfin",
232 .id = -1,
233};
234#endif
235
236#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Roy Huang24a07a12007-07-12 22:41:45 +0800237#ifdef CONFIG_SERIAL_BFIN_UART0
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000238static struct resource bfin_uart0_resources[] = {
Roy Huang24a07a12007-07-12 22:41:45 +0800239 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000240 .start = UART0_DLL,
241 .end = UART0_RBR+2,
Roy Huang24a07a12007-07-12 22:41:45 +0800242 .flags = IORESOURCE_MEM,
243 },
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000244 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800245 .start = IRQ_UART0_TX,
246 .end = IRQ_UART0_TX,
247 .flags = IORESOURCE_IRQ,
248 },
249 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000250 .start = IRQ_UART0_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800251 .end = IRQ_UART0_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000252 .flags = IORESOURCE_IRQ,
253 },
254 {
255 .start = IRQ_UART0_ERROR,
256 .end = IRQ_UART0_ERROR,
257 .flags = IORESOURCE_IRQ,
258 },
259 {
260 .start = CH_UART0_TX,
261 .end = CH_UART0_TX,
262 .flags = IORESOURCE_DMA,
263 },
264 {
265 .start = CH_UART0_RX,
266 .end = CH_UART0_RX,
267 .flags = IORESOURCE_DMA,
268 },
269};
270
Mike Frysingera8b19882010-11-24 09:23:04 +0000271static unsigned short bfin_uart0_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000272 P_UART0_TX, P_UART0_RX, 0
273};
274
275static struct platform_device bfin_uart0_device = {
276 .name = "bfin-uart",
277 .id = 0,
278 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
279 .resource = bfin_uart0_resources,
280 .dev = {
281 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
282 },
283};
Roy Huang24a07a12007-07-12 22:41:45 +0800284#endif
285#ifdef CONFIG_SERIAL_BFIN_UART1
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000286static struct resource bfin_uart1_resources[] = {
Roy Huang24a07a12007-07-12 22:41:45 +0800287 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000288 .start = UART1_DLL,
289 .end = UART1_RBR+2,
Roy Huang24a07a12007-07-12 22:41:45 +0800290 .flags = IORESOURCE_MEM,
291 },
Roy Huang24a07a12007-07-12 22:41:45 +0800292 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800293 .start = IRQ_UART1_TX,
294 .end = IRQ_UART1_TX,
295 .flags = IORESOURCE_IRQ,
296 },
297 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000298 .start = IRQ_UART1_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800299 .end = IRQ_UART1_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000300 .flags = IORESOURCE_IRQ,
Roy Huang24a07a12007-07-12 22:41:45 +0800301 },
Roy Huang24a07a12007-07-12 22:41:45 +0800302 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000303 .start = IRQ_UART1_ERROR,
304 .end = IRQ_UART1_ERROR,
305 .flags = IORESOURCE_IRQ,
306 },
307 {
308 .start = CH_UART1_TX,
309 .end = CH_UART1_TX,
310 .flags = IORESOURCE_DMA,
311 },
312 {
313 .start = CH_UART1_RX,
314 .end = CH_UART1_RX,
315 .flags = IORESOURCE_DMA,
316 },
317#ifdef CONFIG_BFIN_UART1_CTSRTS
318 { /* CTS pin -- 0 means not supported */
319 .start = GPIO_PE10,
320 .end = GPIO_PE10,
321 .flags = IORESOURCE_IO,
322 },
323 { /* RTS pin -- 0 means not supported */
324 .start = GPIO_PE9,
325 .end = GPIO_PE9,
326 .flags = IORESOURCE_IO,
Roy Huang24a07a12007-07-12 22:41:45 +0800327 },
328#endif
329};
330
Mike Frysingera8b19882010-11-24 09:23:04 +0000331static unsigned short bfin_uart1_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000332 P_UART1_TX, P_UART1_RX,
333#ifdef CONFIG_BFIN_UART1_CTSRTS
334 P_UART1_RTS, P_UART1_CTS,
335#endif
336 0
337};
338
339static struct platform_device bfin_uart1_device = {
Roy Huang24a07a12007-07-12 22:41:45 +0800340 .name = "bfin-uart",
341 .id = 1,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000342 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
343 .resource = bfin_uart1_resources,
344 .dev = {
345 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
346 },
Roy Huang24a07a12007-07-12 22:41:45 +0800347};
348#endif
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000349#ifdef CONFIG_SERIAL_BFIN_UART2
350static struct resource bfin_uart2_resources[] = {
351 {
352 .start = UART2_DLL,
353 .end = UART2_RBR+2,
354 .flags = IORESOURCE_MEM,
355 },
356 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800357 .start = IRQ_UART2_TX,
358 .end = IRQ_UART2_TX,
359 .flags = IORESOURCE_IRQ,
360 },
361 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000362 .start = IRQ_UART2_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800363 .end = IRQ_UART2_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000364 .flags = IORESOURCE_IRQ,
365 },
366 {
367 .start = IRQ_UART2_ERROR,
368 .end = IRQ_UART2_ERROR,
369 .flags = IORESOURCE_IRQ,
370 },
371 {
372 .start = CH_UART2_TX,
373 .end = CH_UART2_TX,
374 .flags = IORESOURCE_DMA,
375 },
376 {
377 .start = CH_UART2_RX,
378 .end = CH_UART2_RX,
379 .flags = IORESOURCE_DMA,
380 },
381};
382
Mike Frysingera8b19882010-11-24 09:23:04 +0000383static unsigned short bfin_uart2_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000384 P_UART2_TX, P_UART2_RX, 0
385};
386
387static struct platform_device bfin_uart2_device = {
388 .name = "bfin-uart",
389 .id = 2,
390 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
391 .resource = bfin_uart2_resources,
392 .dev = {
393 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
394 },
395};
396#endif
397#ifdef CONFIG_SERIAL_BFIN_UART3
398static struct resource bfin_uart3_resources[] = {
399 {
400 .start = UART3_DLL,
401 .end = UART3_RBR+2,
402 .flags = IORESOURCE_MEM,
403 },
404 {
Sonic Zhangedb0a642011-08-01 17:53:21 +0800405 .start = IRQ_UART3_TX,
406 .end = IRQ_UART3_TX,
407 .flags = IORESOURCE_IRQ,
408 },
409 {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000410 .start = IRQ_UART3_RX,
Sonic Zhangedb0a642011-08-01 17:53:21 +0800411 .end = IRQ_UART3_RX,
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000412 .flags = IORESOURCE_IRQ,
413 },
414 {
415 .start = IRQ_UART3_ERROR,
416 .end = IRQ_UART3_ERROR,
417 .flags = IORESOURCE_IRQ,
418 },
419 {
420 .start = CH_UART3_TX,
421 .end = CH_UART3_TX,
422 .flags = IORESOURCE_DMA,
423 },
424 {
425 .start = CH_UART3_RX,
426 .end = CH_UART3_RX,
427 .flags = IORESOURCE_DMA,
428 },
429#ifdef CONFIG_BFIN_UART3_CTSRTS
430 { /* CTS pin -- 0 means not supported */
431 .start = GPIO_PB3,
432 .end = GPIO_PB3,
433 .flags = IORESOURCE_IO,
434 },
435 { /* RTS pin -- 0 means not supported */
436 .start = GPIO_PB2,
437 .end = GPIO_PB2,
438 .flags = IORESOURCE_IO,
439 },
440#endif
441};
442
Mike Frysingera8b19882010-11-24 09:23:04 +0000443static unsigned short bfin_uart3_peripherals[] = {
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +0000444 P_UART3_TX, P_UART3_RX,
445#ifdef CONFIG_BFIN_UART3_CTSRTS
446 P_UART3_RTS, P_UART3_CTS,
447#endif
448 0
449};
450
451static struct platform_device bfin_uart3_device = {
452 .name = "bfin-uart",
453 .id = 3,
454 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
455 .resource = bfin_uart3_resources,
456 .dev = {
457 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
458 },
459};
460#endif
461#endif
Roy Huang24a07a12007-07-12 22:41:45 +0800462
Graf Yang5be36d22008-04-25 03:09:15 +0800463#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang5be36d22008-04-25 03:09:15 +0800464#ifdef CONFIG_BFIN_SIR0
Graf Yang42bd8bc2009-01-07 23:14:39 +0800465static struct resource bfin_sir0_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800466 {
467 .start = 0xFFC00400,
468 .end = 0xFFC004FF,
469 .flags = IORESOURCE_MEM,
470 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800471 {
472 .start = IRQ_UART0_RX,
473 .end = IRQ_UART0_RX+1,
474 .flags = IORESOURCE_IRQ,
475 },
476 {
477 .start = CH_UART0_RX,
478 .end = CH_UART0_RX+1,
479 .flags = IORESOURCE_DMA,
480 },
481};
482static struct platform_device bfin_sir0_device = {
483 .name = "bfin_sir",
484 .id = 0,
485 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
486 .resource = bfin_sir0_resources,
487};
Graf Yang5be36d22008-04-25 03:09:15 +0800488#endif
489#ifdef CONFIG_BFIN_SIR1
Graf Yang42bd8bc2009-01-07 23:14:39 +0800490static struct resource bfin_sir1_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800491 {
492 .start = 0xFFC02000,
493 .end = 0xFFC020FF,
494 .flags = IORESOURCE_MEM,
495 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800496 {
497 .start = IRQ_UART1_RX,
498 .end = IRQ_UART1_RX+1,
499 .flags = IORESOURCE_IRQ,
500 },
501 {
502 .start = CH_UART1_RX,
503 .end = CH_UART1_RX+1,
504 .flags = IORESOURCE_DMA,
505 },
506};
507static struct platform_device bfin_sir1_device = {
508 .name = "bfin_sir",
509 .id = 1,
510 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
511 .resource = bfin_sir1_resources,
512};
Graf Yang5be36d22008-04-25 03:09:15 +0800513#endif
514#ifdef CONFIG_BFIN_SIR2
Graf Yang42bd8bc2009-01-07 23:14:39 +0800515static struct resource bfin_sir2_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800516 {
517 .start = 0xFFC02100,
518 .end = 0xFFC021FF,
519 .flags = IORESOURCE_MEM,
520 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800521 {
522 .start = IRQ_UART2_RX,
523 .end = IRQ_UART2_RX+1,
524 .flags = IORESOURCE_IRQ,
525 },
526 {
527 .start = CH_UART2_RX,
528 .end = CH_UART2_RX+1,
529 .flags = IORESOURCE_DMA,
530 },
531};
532static struct platform_device bfin_sir2_device = {
533 .name = "bfin_sir",
534 .id = 2,
535 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
536 .resource = bfin_sir2_resources,
537};
Graf Yang5be36d22008-04-25 03:09:15 +0800538#endif
539#ifdef CONFIG_BFIN_SIR3
Graf Yang42bd8bc2009-01-07 23:14:39 +0800540static struct resource bfin_sir3_resources[] = {
Graf Yang5be36d22008-04-25 03:09:15 +0800541 {
542 .start = 0xFFC03100,
543 .end = 0xFFC031FF,
544 .flags = IORESOURCE_MEM,
545 },
Graf Yang42bd8bc2009-01-07 23:14:39 +0800546 {
547 .start = IRQ_UART3_RX,
548 .end = IRQ_UART3_RX+1,
549 .flags = IORESOURCE_IRQ,
550 },
551 {
552 .start = CH_UART3_RX,
553 .end = CH_UART3_RX+1,
554 .flags = IORESOURCE_DMA,
555 },
Graf Yang5be36d22008-04-25 03:09:15 +0800556};
Graf Yang42bd8bc2009-01-07 23:14:39 +0800557static struct platform_device bfin_sir3_device = {
Graf Yang5be36d22008-04-25 03:09:15 +0800558 .name = "bfin_sir",
Graf Yang42bd8bc2009-01-07 23:14:39 +0800559 .id = 3,
560 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
561 .resource = bfin_sir3_resources,
Graf Yang5be36d22008-04-25 03:09:15 +0800562};
563#endif
Graf Yang42bd8bc2009-01-07 23:14:39 +0800564#endif
Graf Yang5be36d22008-04-25 03:09:15 +0800565
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800566#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400567#include <linux/smsc911x.h>
568
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800569static struct resource smsc911x_resources[] = {
570 {
571 .name = "smsc911x-memory",
572 .start = 0x24000000,
573 .end = 0x24000000 + 0xFF,
574 .flags = IORESOURCE_MEM,
575 },
576 {
577 .start = IRQ_PE8,
578 .end = IRQ_PE8,
579 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
580 },
581};
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400582
583static struct smsc911x_platform_config smsc911x_config = {
584 .flags = SMSC911X_USE_32BIT,
585 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
586 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
587 .phy_interface = PHY_INTERFACE_MODE_MII,
588};
589
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800590static struct platform_device smsc911x_device = {
591 .name = "smsc911x",
592 .id = 0,
593 .num_resources = ARRAY_SIZE(smsc911x_resources),
594 .resource = smsc911x_resources,
Mike Frysinger7a8b71d2009-06-05 20:41:17 -0400595 .dev = {
596 .platform_data = &smsc911x_config,
597 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800598};
599#endif
600
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800601#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
602static struct resource musb_resources[] = {
603 [0] = {
604 .start = 0xFFC03C00,
605 .end = 0xFFC040FF,
606 .flags = IORESOURCE_MEM,
607 },
608 [1] = { /* general IRQ */
609 .start = IRQ_USB_INT0,
610 .end = IRQ_USB_INT0,
611 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
Hema Kalliguddifcf173e2010-09-29 11:26:39 -0500612 .name = "mc"
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800613 },
614 [2] = { /* DMA IRQ */
615 .start = IRQ_USB_DMA,
616 .end = IRQ_USB_DMA,
617 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
Hema Kalliguddifcf173e2010-09-29 11:26:39 -0500618 .name = "dma"
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800619 },
620};
621
Bryan Wu50041ac2008-10-08 13:39:40 +0800622static struct musb_hdrc_config musb_config = {
623 .multipoint = 0,
624 .dyn_fifo = 0,
625 .soft_con = 1,
626 .dma = 1,
Bryan Wufea05da2009-01-07 23:14:39 +0800627 .num_eps = 8,
628 .dma_channels = 8,
Bryan Wu50041ac2008-10-08 13:39:40 +0800629 .gpio_vrsel = GPIO_PE7,
Cliff Cai85eb0e42010-01-22 04:02:46 +0000630 /* Some custom boards need to be active low, just set it to "0"
631 * if it is the case.
632 */
633 .gpio_vrsel_active = 1,
Bob Liu759a3f32010-09-17 11:09:57 +0000634 .clkin = 24, /* musb CLKIN in MHZ */
Bryan Wu50041ac2008-10-08 13:39:40 +0800635};
636
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800637static struct musb_hdrc_platform_data musb_plat = {
Bryan Wu29350772007-12-24 12:20:19 +0800638#if defined(CONFIG_USB_MUSB_OTG)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800639 .mode = MUSB_OTG,
Bryan Wu29350772007-12-24 12:20:19 +0800640#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800641 .mode = MUSB_HOST,
Bryan Wu29350772007-12-24 12:20:19 +0800642#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800643 .mode = MUSB_PERIPHERAL,
644#endif
Bryan Wu50041ac2008-10-08 13:39:40 +0800645 .config = &musb_config,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800646};
647
648static u64 musb_dmamask = ~(u32)0;
649
650static struct platform_device musb_device = {
Felipe Balbi9cb03082010-12-02 09:21:05 +0200651 .name = "musb-blackfin",
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800652 .id = 0,
653 .dev = {
654 .dma_mask = &musb_dmamask,
655 .coherent_dma_mask = 0xffffffff,
656 .platform_data = &musb_plat,
657 },
658 .num_resources = ARRAY_SIZE(musb_resources),
659 .resource = musb_resources,
660};
661#endif
662
Sonic Zhangdf5de262009-09-23 05:01:56 +0000663#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
664#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
665static struct resource bfin_sport0_uart_resources[] = {
666 {
667 .start = SPORT0_TCR1,
668 .end = SPORT0_MRCS3+4,
669 .flags = IORESOURCE_MEM,
670 },
671 {
672 .start = IRQ_SPORT0_RX,
673 .end = IRQ_SPORT0_RX+1,
674 .flags = IORESOURCE_IRQ,
675 },
676 {
677 .start = IRQ_SPORT0_ERROR,
678 .end = IRQ_SPORT0_ERROR,
679 .flags = IORESOURCE_IRQ,
680 },
681};
682
Mike Frysingera8b19882010-11-24 09:23:04 +0000683static unsigned short bfin_sport0_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000684 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000685 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
Sonic Zhangdf5de262009-09-23 05:01:56 +0000686};
687
688static struct platform_device bfin_sport0_uart_device = {
689 .name = "bfin-sport-uart",
690 .id = 0,
691 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
692 .resource = bfin_sport0_uart_resources,
693 .dev = {
694 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
695 },
696};
697#endif
698#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
699static struct resource bfin_sport1_uart_resources[] = {
700 {
701 .start = SPORT1_TCR1,
702 .end = SPORT1_MRCS3+4,
703 .flags = IORESOURCE_MEM,
704 },
705 {
706 .start = IRQ_SPORT1_RX,
707 .end = IRQ_SPORT1_RX+1,
708 .flags = IORESOURCE_IRQ,
709 },
710 {
711 .start = IRQ_SPORT1_ERROR,
712 .end = IRQ_SPORT1_ERROR,
713 .flags = IORESOURCE_IRQ,
714 },
715};
716
Mike Frysingera8b19882010-11-24 09:23:04 +0000717static unsigned short bfin_sport1_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000718 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
Sonic Zhange54b6732010-11-12 02:45:38 +0000719 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
Sonic Zhangdf5de262009-09-23 05:01:56 +0000720};
721
722static struct platform_device bfin_sport1_uart_device = {
723 .name = "bfin-sport-uart",
724 .id = 1,
725 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
726 .resource = bfin_sport1_uart_resources,
727 .dev = {
728 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
729 },
730};
731#endif
732#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
733static struct resource bfin_sport2_uart_resources[] = {
734 {
735 .start = SPORT2_TCR1,
736 .end = SPORT2_MRCS3+4,
737 .flags = IORESOURCE_MEM,
738 },
739 {
740 .start = IRQ_SPORT2_RX,
741 .end = IRQ_SPORT2_RX+1,
742 .flags = IORESOURCE_IRQ,
743 },
744 {
745 .start = IRQ_SPORT2_ERROR,
746 .end = IRQ_SPORT2_ERROR,
747 .flags = IORESOURCE_IRQ,
748 },
749};
750
Mike Frysingera8b19882010-11-24 09:23:04 +0000751static unsigned short bfin_sport2_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000752 P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
753 P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0
754};
755
756static struct platform_device bfin_sport2_uart_device = {
757 .name = "bfin-sport-uart",
758 .id = 2,
759 .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
760 .resource = bfin_sport2_uart_resources,
761 .dev = {
762 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
763 },
764};
765#endif
766#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
767static struct resource bfin_sport3_uart_resources[] = {
768 {
769 .start = SPORT3_TCR1,
770 .end = SPORT3_MRCS3+4,
771 .flags = IORESOURCE_MEM,
772 },
773 {
774 .start = IRQ_SPORT3_RX,
775 .end = IRQ_SPORT3_RX+1,
776 .flags = IORESOURCE_IRQ,
777 },
778 {
779 .start = IRQ_SPORT3_ERROR,
780 .end = IRQ_SPORT3_ERROR,
781 .flags = IORESOURCE_IRQ,
782 },
783};
784
Mike Frysingera8b19882010-11-24 09:23:04 +0000785static unsigned short bfin_sport3_peripherals[] = {
Sonic Zhangdf5de262009-09-23 05:01:56 +0000786 P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
787 P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0
788};
789
790static struct platform_device bfin_sport3_uart_device = {
791 .name = "bfin-sport-uart",
792 .id = 3,
793 .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
794 .resource = bfin_sport3_uart_resources,
795 .dev = {
796 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
797 },
798};
799#endif
800#endif
801
Barry Song706a01b2009-11-02 07:29:07 +0000802#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
Aaron Wu4c131c82010-12-22 06:21:03 +0000803
804static unsigned short bfin_can0_peripherals[] = {
Barry Song706a01b2009-11-02 07:29:07 +0000805 P_CAN0_RX, P_CAN0_TX, 0
806};
807
Aaron Wu4c131c82010-12-22 06:21:03 +0000808static struct resource bfin_can0_resources[] = {
Barry Song706a01b2009-11-02 07:29:07 +0000809 {
810 .start = 0xFFC02A00,
811 .end = 0xFFC02FFF,
812 .flags = IORESOURCE_MEM,
813 },
814 {
815 .start = IRQ_CAN0_RX,
816 .end = IRQ_CAN0_RX,
817 .flags = IORESOURCE_IRQ,
818 },
819 {
820 .start = IRQ_CAN0_TX,
821 .end = IRQ_CAN0_TX,
822 .flags = IORESOURCE_IRQ,
823 },
824 {
825 .start = IRQ_CAN0_ERROR,
826 .end = IRQ_CAN0_ERROR,
827 .flags = IORESOURCE_IRQ,
828 },
829};
830
Aaron Wu4c131c82010-12-22 06:21:03 +0000831static struct platform_device bfin_can0_device = {
Barry Song706a01b2009-11-02 07:29:07 +0000832 .name = "bfin_can",
Aaron Wu4c131c82010-12-22 06:21:03 +0000833 .id = 0,
834 .num_resources = ARRAY_SIZE(bfin_can0_resources),
835 .resource = bfin_can0_resources,
Barry Song706a01b2009-11-02 07:29:07 +0000836 .dev = {
Aaron Wu4c131c82010-12-22 06:21:03 +0000837 .platform_data = &bfin_can0_peripherals, /* Passed to driver */
Barry Song706a01b2009-11-02 07:29:07 +0000838 },
839};
Aaron Wu4c131c82010-12-22 06:21:03 +0000840
841static unsigned short bfin_can1_peripherals[] = {
842 P_CAN1_RX, P_CAN1_TX, 0
843};
844
845static struct resource bfin_can1_resources[] = {
846 {
847 .start = 0xFFC03200,
848 .end = 0xFFC037FF,
849 .flags = IORESOURCE_MEM,
850 },
851 {
852 .start = IRQ_CAN1_RX,
853 .end = IRQ_CAN1_RX,
854 .flags = IORESOURCE_IRQ,
855 },
856 {
857 .start = IRQ_CAN1_TX,
858 .end = IRQ_CAN1_TX,
859 .flags = IORESOURCE_IRQ,
860 },
861 {
862 .start = IRQ_CAN1_ERROR,
863 .end = IRQ_CAN1_ERROR,
864 .flags = IORESOURCE_IRQ,
865 },
866};
867
868static struct platform_device bfin_can1_device = {
869 .name = "bfin_can",
870 .id = 1,
871 .num_resources = ARRAY_SIZE(bfin_can1_resources),
872 .resource = bfin_can1_resources,
873 .dev = {
874 .platform_data = &bfin_can1_peripherals, /* Passed to driver */
875 },
876};
877
Barry Song706a01b2009-11-02 07:29:07 +0000878#endif
879
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800880#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
881static struct resource bfin_atapi_resources[] = {
882 {
883 .start = 0xFFC03800,
884 .end = 0xFFC0386F,
885 .flags = IORESOURCE_MEM,
886 },
887 {
888 .start = IRQ_ATAPI_ERR,
889 .end = IRQ_ATAPI_ERR,
890 .flags = IORESOURCE_IRQ,
891 },
892};
893
894static struct platform_device bfin_atapi_device = {
895 .name = "pata-bf54x",
896 .id = -1,
897 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
898 .resource = bfin_atapi_resources,
899};
900#endif
901
902#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
903static struct mtd_partition partition_info[] = {
904 {
Mike Frysinger73775b82010-08-27 20:43:39 +0000905 .name = "bootloader(nand)",
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800906 .offset = 0,
Mike Frysinger73775b82010-08-27 20:43:39 +0000907 .size = 0x80000,
908 }, {
909 .name = "linux kernel(nand)",
910 .offset = MTDPART_OFS_APPEND,
Mike Frysingerf4585a02008-10-13 14:45:21 +0800911 .size = 4 * 1024 * 1024,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800912 },
913 {
Robin Getzaa582972008-08-05 17:47:29 +0800914 .name = "file system(nand)",
Mike Frysingeredf05642008-02-25 11:38:11 +0800915 .offset = MTDPART_OFS_APPEND,
916 .size = MTDPART_SIZ_FULL,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800917 },
918};
919
920static struct bf5xx_nand_platform bf5xx_nand_platform = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800921 .data_width = NFC_NWIDTH_8,
922 .partitions = partition_info,
923 .nr_partitions = ARRAY_SIZE(partition_info),
924 .rd_dly = 3,
925 .wr_dly = 3,
926};
927
928static struct resource bf5xx_nand_resources[] = {
929 {
930 .start = 0xFFC03B00,
931 .end = 0xFFC03B4F,
932 .flags = IORESOURCE_MEM,
933 },
934 {
935 .start = CH_NFC,
936 .end = CH_NFC,
937 .flags = IORESOURCE_IRQ,
938 },
939};
940
941static struct platform_device bf5xx_nand_device = {
942 .name = "bf5xx-nand",
943 .id = 0,
944 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
945 .resource = bf5xx_nand_resources,
946 .dev = {
947 .platform_data = &bf5xx_nand_platform,
948 },
949};
950#endif
951
Michael Hennerich3d7e6cf2008-03-03 17:40:28 -0700952#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
Cliff Cai501674a2009-01-07 23:14:38 +0800953
954static struct bfin_sd_host bfin_sdh_data = {
955 .dma_chan = CH_SDH,
956 .irq_int0 = IRQ_SDH_MASK0,
957 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
958};
959
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800960static struct platform_device bf54x_sdh_device = {
961 .name = "bfin-sdh",
962 .id = 0,
Cliff Cai501674a2009-01-07 23:14:38 +0800963 .dev = {
964 .platform_data = &bfin_sdh_data,
965 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +0800966};
967#endif
968
Mike Frysinger793dc272008-03-26 08:09:12 +0800969#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800970static struct mtd_partition ezkit_partitions[] = {
971 {
Robin Getzaa582972008-08-05 17:47:29 +0800972 .name = "bootloader(nor)",
Mike Frysinger73775b82010-08-27 20:43:39 +0000973 .size = 0x80000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800974 .offset = 0,
975 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800976 .name = "linux kernel(nor)",
Mike Frysinger664d0402008-10-09 17:28:36 +0800977 .size = 0x400000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800978 .offset = MTDPART_OFS_APPEND,
979 }, {
Robin Getzaa582972008-08-05 17:47:29 +0800980 .name = "file system(nor)",
Mike Frysinger56072042011-05-09 18:46:17 -0400981 .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4,
982 .offset = MTDPART_OFS_APPEND,
983 }, {
984 .name = "config(nor)",
985 .size = 0x8000 * 3,
986 .offset = MTDPART_OFS_APPEND,
987 }, {
988 .name = "u-boot env(nor)",
989 .size = 0x8000,
Mike Frysingerde8c43f2008-01-24 17:14:04 +0800990 .offset = MTDPART_OFS_APPEND,
991 }
992};
993
994static struct physmap_flash_data ezkit_flash_data = {
995 .width = 2,
996 .parts = ezkit_partitions,
997 .nr_parts = ARRAY_SIZE(ezkit_partitions),
998};
999
1000static struct resource ezkit_flash_resource = {
1001 .start = 0x20000000,
Mike Frysinger664d0402008-10-09 17:28:36 +08001002 .end = 0x21ffffff,
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001003 .flags = IORESOURCE_MEM,
1004};
1005
1006static struct platform_device ezkit_flash_device = {
1007 .name = "physmap-flash",
1008 .id = 0,
1009 .dev = {
1010 .platform_data = &ezkit_flash_data,
1011 },
1012 .num_resources = 1,
1013 .resource = &ezkit_flash_resource,
1014};
Mike Frysinger793dc272008-03-26 08:09:12 +08001015#endif
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001016
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001017#if defined(CONFIG_MTD_M25P80) \
1018 || defined(CONFIG_MTD_M25P80_MODULE)
1019/* SPI flash chip (m25p16) */
1020static struct mtd_partition bfin_spi_flash_partitions[] = {
1021 {
Robin Getzaa582972008-08-05 17:47:29 +08001022 .name = "bootloader(spi)",
Mike Frysinger73775b82010-08-27 20:43:39 +00001023 .size = 0x00080000,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001024 .offset = 0,
1025 .mask_flags = MTD_CAP_ROM
1026 }, {
Robin Getzaa582972008-08-05 17:47:29 +08001027 .name = "linux kernel(spi)",
Mike Frysingeredf05642008-02-25 11:38:11 +08001028 .size = MTDPART_SIZ_FULL,
1029 .offset = MTDPART_OFS_APPEND,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001030 }
1031};
1032
1033static struct flash_platform_data bfin_spi_flash_data = {
1034 .name = "m25p80",
1035 .parts = bfin_spi_flash_partitions,
1036 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
1037 .type = "m25p16",
1038};
1039
1040static struct bfin5xx_spi_chip spi_flash_chip_info = {
1041 .enable_dma = 0, /* use dma transfer with this chip*/
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001042};
1043#endif
1044
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001045#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001046static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1047 .model = 7877,
1048 .vref_delay_usecs = 50, /* internal, no capacitor */
1049 .x_plate_ohms = 419,
1050 .y_plate_ohms = 486,
1051 .pressure_max = 1000,
1052 .pressure_min = 0,
1053 .stopacq_polarity = 1,
1054 .first_conversion_delay = 3,
1055 .acquisition_time = 1,
1056 .averaging = 1,
1057 .pen_down_acc_interval = 1,
1058};
1059#endif
1060
Mike Frysinger5bda2722008-06-07 15:03:01 +08001061static struct spi_board_info bfin_spi_board_info[] __initdata = {
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001062#if defined(CONFIG_MTD_M25P80) \
1063 || defined(CONFIG_MTD_M25P80_MODULE)
1064 {
1065 /* the modalias must be the same as spi device driver name */
1066 .modalias = "m25p80", /* Name of spi_driver for this device */
1067 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1068 .bus_num = 0, /* Framework bus number */
1069 .chip_select = 1, /* SPI_SSEL1*/
1070 .platform_data = &bfin_spi_flash_data,
1071 .controller_data = &spi_flash_chip_info,
1072 .mode = SPI_MODE_3,
1073 },
1074#endif
Barry Song7ba80062010-01-28 09:37:21 +00001075#if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1076 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001077 {
Barry Song7ba80062010-01-28 09:37:21 +00001078 .modalias = "ad183x",
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001079 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1080 .bus_num = 1,
Barry Song7ba80062010-01-28 09:37:21 +00001081 .chip_select = 4,
Bernd Schmidt37fa2422008-04-24 05:19:02 +08001082 },
1083#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001084#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001085 {
1086 .modalias = "ad7877",
1087 .platform_data = &bfin_ad7877_ts_info,
1088 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
1089 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1090 .bus_num = 0,
1091 .chip_select = 2,
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001092 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001093#endif
Michael Hennerich6e668932008-02-09 01:54:09 +08001094#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1095 {
1096 .modalias = "spidev",
1097 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1098 .bus_num = 0,
1099 .chip_select = 1,
Michael Hennerich6e668932008-02-09 01:54:09 +08001100 },
1101#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001102#if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1103 {
1104 .modalias = "adxl34x",
1105 .platform_data = &adxl34x_info,
1106 .irq = IRQ_PC5,
1107 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1108 .bus_num = 1,
1109 .chip_select = 2,
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001110 .mode = SPI_MODE_3,
1111 },
1112#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001113};
Sonic Zhang7d157fb2011-11-07 18:40:10 +08001114#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001115/* SPI (0) */
1116static struct resource bfin_spi0_resource[] = {
1117 [0] = {
1118 .start = SPI0_REGBASE,
1119 .end = SPI0_REGBASE + 0xFF,
1120 .flags = IORESOURCE_MEM,
1121 },
1122 [1] = {
1123 .start = CH_SPI0,
1124 .end = CH_SPI0,
Yi Li53122692009-06-05 12:11:11 +00001125 .flags = IORESOURCE_DMA,
1126 },
1127 [2] = {
1128 .start = IRQ_SPI0,
1129 .end = IRQ_SPI0,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001130 .flags = IORESOURCE_IRQ,
1131 }
1132};
1133
1134/* SPI (1) */
1135static struct resource bfin_spi1_resource[] = {
1136 [0] = {
1137 .start = SPI1_REGBASE,
1138 .end = SPI1_REGBASE + 0xFF,
1139 .flags = IORESOURCE_MEM,
1140 },
1141 [1] = {
1142 .start = CH_SPI1,
1143 .end = CH_SPI1,
Yi Li53122692009-06-05 12:11:11 +00001144 .flags = IORESOURCE_DMA,
1145 },
1146 [2] = {
1147 .start = IRQ_SPI1,
1148 .end = IRQ_SPI1,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001149 .flags = IORESOURCE_IRQ,
1150 }
1151};
1152
1153/* SPI controller data */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001154static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
Mike Frysingerc5af5452010-06-16 19:29:51 +00001155 .num_chipselect = 4,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001156 .enable_dma = 1, /* master has the ability to do dma transfer */
Bryan Wu5d448dd2007-11-12 23:24:42 +08001157 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001158};
1159
1160static struct platform_device bf54x_spi_master0 = {
1161 .name = "bfin-spi",
1162 .id = 0, /* Bus number */
1163 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1164 .resource = bfin_spi0_resource,
1165 .dev = {
Bryan Wu5d448dd2007-11-12 23:24:42 +08001166 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001167 },
1168};
1169
Bryan Wu5d448dd2007-11-12 23:24:42 +08001170static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
Mike Frysingerc5af5452010-06-16 19:29:51 +00001171 .num_chipselect = 4,
Bryan Wu5d448dd2007-11-12 23:24:42 +08001172 .enable_dma = 1, /* master has the ability to do dma transfer */
1173 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1174};
1175
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001176static struct platform_device bf54x_spi_master1 = {
1177 .name = "bfin-spi",
1178 .id = 1, /* Bus number */
1179 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
1180 .resource = bfin_spi1_resource,
1181 .dev = {
Bryan Wu5d448dd2007-11-12 23:24:42 +08001182 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001183 },
1184};
1185#endif /* spi master and devices */
1186
Scott Jiangdf864c32011-12-31 14:08:38 -05001187#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
1188 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
1189#include <linux/videodev2.h>
1190#include <media/blackfin/bfin_capture.h>
1191#include <media/blackfin/ppi.h>
1192
1193static const unsigned short ppi_req[] = {
1194 P_PPI1_D0, P_PPI1_D1, P_PPI1_D2, P_PPI1_D3,
1195 P_PPI1_D4, P_PPI1_D5, P_PPI1_D6, P_PPI1_D7,
1196 P_PPI1_CLK, P_PPI1_FS1, P_PPI1_FS2,
1197 0,
1198};
1199
1200static const struct ppi_info ppi_info = {
1201 .type = PPI_TYPE_EPPI,
1202 .dma_ch = CH_EPPI1,
1203 .irq_err = IRQ_EPPI1_ERROR,
1204 .base = (void __iomem *)EPPI1_STATUS,
1205 .pin_req = ppi_req,
1206};
1207
1208#if defined(CONFIG_VIDEO_VS6624) \
1209 || defined(CONFIG_VIDEO_VS6624_MODULE)
1210static struct v4l2_input vs6624_inputs[] = {
1211 {
1212 .index = 0,
1213 .name = "Camera",
1214 .type = V4L2_INPUT_TYPE_CAMERA,
1215 .std = V4L2_STD_UNKNOWN,
1216 },
1217};
1218
1219static struct bcap_route vs6624_routes[] = {
1220 {
1221 .input = 0,
1222 .output = 0,
1223 },
1224};
1225
1226static const unsigned vs6624_ce_pin = GPIO_PG6;
1227
1228static struct bfin_capture_config bfin_capture_data = {
1229 .card_name = "BF548",
1230 .inputs = vs6624_inputs,
1231 .num_inputs = ARRAY_SIZE(vs6624_inputs),
1232 .routes = vs6624_routes,
1233 .i2c_adapter_id = 0,
1234 .board_info = {
1235 .type = "vs6624",
1236 .addr = 0x10,
1237 .platform_data = (void *)&vs6624_ce_pin,
1238 },
1239 .ppi_info = &ppi_info,
1240 .ppi_control = (POLC | PACKEN | DLEN_8 | XFR_TYPE | 0x20),
Scott Jiang4e937ac2012-01-09 17:06:56 -05001241 .int_mask = 0xFFFFFFFF, /* disable error interrupt on eppi */
1242 .blank_clocks = 8, /* 8 clocks as SAV and EAV */
Scott Jiangdf864c32011-12-31 14:08:38 -05001243};
1244#endif
1245
1246static struct platform_device bfin_capture_device = {
1247 .name = "bfin_capture",
1248 .dev = {
1249 .platform_data = &bfin_capture_data,
1250 },
1251};
1252#endif
1253
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001254#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
Sonic Zhangcf93feb2012-05-15 15:25:50 +08001255static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
1256
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001257static struct resource bfin_twi0_resource[] = {
1258 [0] = {
1259 .start = TWI0_REGBASE,
1260 .end = TWI0_REGBASE + 0xFF,
1261 .flags = IORESOURCE_MEM,
1262 },
1263 [1] = {
1264 .start = IRQ_TWI0,
1265 .end = IRQ_TWI0,
1266 .flags = IORESOURCE_IRQ,
1267 },
1268};
1269
1270static struct platform_device i2c_bfin_twi0_device = {
1271 .name = "i2c-bfin-twi",
1272 .id = 0,
1273 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1274 .resource = bfin_twi0_resource,
Sonic Zhangcf93feb2012-05-15 15:25:50 +08001275 .dev = {
1276 .platform_data = &bfin_twi0_pins,
1277 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001278};
1279
Mike Frysinger7160e952007-11-21 16:03:07 +08001280#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
Sonic Zhangcf93feb2012-05-15 15:25:50 +08001281static const u16 bfin_twi1_pins[] = {P_TWI1_SCL, P_TWI1_SDA, 0};
1282
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001283static struct resource bfin_twi1_resource[] = {
1284 [0] = {
1285 .start = TWI1_REGBASE,
1286 .end = TWI1_REGBASE + 0xFF,
1287 .flags = IORESOURCE_MEM,
1288 },
1289 [1] = {
1290 .start = IRQ_TWI1,
1291 .end = IRQ_TWI1,
1292 .flags = IORESOURCE_IRQ,
1293 },
1294};
1295
1296static struct platform_device i2c_bfin_twi1_device = {
1297 .name = "i2c-bfin-twi",
1298 .id = 1,
1299 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
1300 .resource = bfin_twi1_resource,
Sonic Zhangcf93feb2012-05-15 15:25:50 +08001301 .dev = {
1302 .platform_data = &bfin_twi1_pins,
1303 },
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001304};
1305#endif
Mike Frysinger7160e952007-11-21 16:03:07 +08001306#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001307
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001308static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001309#if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1310 {
1311 I2C_BOARD_INFO("ssm2602", 0x1b),
1312 },
1313#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001314};
1315
1316#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1317static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
Michael Hennerichebd58332009-07-02 11:00:38 +00001318#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001319 {
1320 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001321 },
1322#endif
Michael Hennerich204844e2009-06-30 14:57:22 +00001323#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001324 {
1325 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001326 .irq = 212,
1327 },
1328#endif
Michael Hennerichffc4d8b2009-05-29 15:41:18 +00001329#if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1330 {
1331 I2C_BOARD_INFO("adxl34x", 0x53),
1332 .irq = IRQ_PC5,
1333 .platform_data = (void *)&adxl34x_info,
1334 },
1335#endif
steven miao39d3c1c2010-08-26 08:25:13 +00001336#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1337 {
1338 I2C_BOARD_INFO("ad5252", 0x2f),
1339 },
1340#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001341};
1342#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001343
Michael Hennerich2463ef22008-01-27 16:49:48 +08001344#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1345#include <linux/gpio_keys.h>
1346
1347static struct gpio_keys_button bfin_gpio_keys_table[] = {
1348 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
1349 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
1350 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
1351 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
1352};
1353
1354static struct gpio_keys_platform_data bfin_gpio_keys_data = {
1355 .buttons = bfin_gpio_keys_table,
1356 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
1357};
1358
1359static struct platform_device bfin_device_gpiokeys = {
1360 .name = "gpio-keys",
1361 .dev = {
1362 .platform_data = &bfin_gpio_keys_data,
1363 },
1364};
1365#endif
1366
Michael Hennerich14b03202008-05-07 11:41:26 +08001367static const unsigned int cclk_vlev_datasheet[] =
1368{
1369/*
1370 * Internal VLEV BF54XSBBC1533
1371 ****temporarily using these values until data sheet is updated
1372 */
1373 VRPAIR(VLEV_085, 150000000),
1374 VRPAIR(VLEV_090, 250000000),
1375 VRPAIR(VLEV_110, 276000000),
1376 VRPAIR(VLEV_115, 301000000),
1377 VRPAIR(VLEV_120, 525000000),
1378 VRPAIR(VLEV_125, 550000000),
1379 VRPAIR(VLEV_130, 600000000),
1380};
1381
1382static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1383 .tuple_tab = cclk_vlev_datasheet,
1384 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1385 .vr_settling_time = 25 /* us */,
1386};
1387
1388static struct platform_device bfin_dpmc = {
1389 .name = "bfin dpmc",
1390 .dev = {
1391 .platform_data = &bfin_dmpc_vreg_data,
1392 },
1393};
1394
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001395#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
1396 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \
1397 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1398
1399#define SPORT_REQ(x) \
1400 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \
1401 P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0}
1402
1403static const u16 bfin_snd_pin[][7] = {
1404 SPORT_REQ(0),
1405 SPORT_REQ(1),
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001406 SPORT_REQ(2),
1407 SPORT_REQ(3),
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001408};
1409
1410static struct bfin_snd_platform_data bfin_snd_data[] = {
1411 {
1412 .pin_req = &bfin_snd_pin[0][0],
1413 },
1414 {
1415 .pin_req = &bfin_snd_pin[1][0],
1416 },
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001417 {
1418 .pin_req = &bfin_snd_pin[2][0],
1419 },
1420 {
1421 .pin_req = &bfin_snd_pin[3][0],
1422 },
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001423};
1424
1425#define BFIN_SND_RES(x) \
1426 [x] = { \
1427 { \
1428 .start = SPORT##x##_TCR1, \
1429 .end = SPORT##x##_TCR1, \
1430 .flags = IORESOURCE_MEM \
1431 }, \
1432 { \
1433 .start = CH_SPORT##x##_RX, \
1434 .end = CH_SPORT##x##_RX, \
1435 .flags = IORESOURCE_DMA, \
1436 }, \
1437 { \
1438 .start = CH_SPORT##x##_TX, \
1439 .end = CH_SPORT##x##_TX, \
1440 .flags = IORESOURCE_DMA, \
1441 }, \
1442 { \
1443 .start = IRQ_SPORT##x##_ERROR, \
1444 .end = IRQ_SPORT##x##_ERROR, \
1445 .flags = IORESOURCE_IRQ, \
1446 } \
1447 }
1448
1449static struct resource bfin_snd_resources[][4] = {
1450 BFIN_SND_RES(0),
1451 BFIN_SND_RES(1),
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001452 BFIN_SND_RES(2),
1453 BFIN_SND_RES(3),
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001454};
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001455#endif
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001456
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001457#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1458static struct platform_device bfin_i2s_pcm = {
1459 .name = "bfin-i2s-pcm-audio",
1460 .id = -1,
1461};
1462#endif
1463
1464#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1465static struct platform_device bfin_tdm_pcm = {
1466 .name = "bfin-tdm-pcm-audio",
1467 .id = -1,
1468};
1469#endif
1470
1471#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1472static struct platform_device bfin_ac97_pcm = {
1473 .name = "bfin-ac97-pcm-audio",
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001474 .id = -1,
1475};
1476#endif
1477
1478#if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
1479static struct platform_device bfin_ad73311_codec_device = {
1480 .name = "ad73311",
1481 .id = -1,
1482};
1483#endif
1484
1485#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1486static struct platform_device bfin_ad1980_codec_device = {
1487 .name = "ad1980",
1488 .id = -1,
1489};
1490#endif
1491
1492#if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
Barry Song439b4862009-11-13 02:41:07 +00001493static struct platform_device bfin_i2s = {
1494 .name = "bfin-i2s",
1495 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001496 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1497 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1498 .dev = {
1499 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1500 },
Barry Song439b4862009-11-13 02:41:07 +00001501};
1502#endif
1503
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001504#if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
Barry Song439b4862009-11-13 02:41:07 +00001505static struct platform_device bfin_tdm = {
1506 .name = "bfin-tdm",
1507 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001508 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1509 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1510 .dev = {
1511 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1512 },
Barry Song439b4862009-11-13 02:41:07 +00001513};
1514#endif
1515
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001516#if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
Barry Song439b4862009-11-13 02:41:07 +00001517static struct platform_device bfin_ac97 = {
1518 .name = "bfin-ac97",
1519 .id = CONFIG_SND_BF5XX_SPORT_NUM,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001520 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1521 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1522 .dev = {
1523 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1524 },
Barry Song439b4862009-11-13 02:41:07 +00001525};
1526#endif
1527
Roy Huang24a07a12007-07-12 22:41:45 +08001528static struct platform_device *ezkit_devices[] __initdata = {
Michael Hennerich14b03202008-05-07 11:41:26 +08001529
1530 &bfin_dpmc,
1531
Roy Huang24a07a12007-07-12 22:41:45 +08001532#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1533 &rtc_device,
1534#endif
1535
1536#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
Sonic Zhang6bd1fbe2009-09-09 10:46:19 +00001537#ifdef CONFIG_SERIAL_BFIN_UART0
1538 &bfin_uart0_device,
1539#endif
1540#ifdef CONFIG_SERIAL_BFIN_UART1
1541 &bfin_uart1_device,
1542#endif
1543#ifdef CONFIG_SERIAL_BFIN_UART2
1544 &bfin_uart2_device,
1545#endif
1546#ifdef CONFIG_SERIAL_BFIN_UART3
1547 &bfin_uart3_device,
1548#endif
Roy Huang24a07a12007-07-12 22:41:45 +08001549#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001550
Graf Yang5be36d22008-04-25 03:09:15 +08001551#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
Graf Yang42bd8bc2009-01-07 23:14:39 +08001552#ifdef CONFIG_BFIN_SIR0
1553 &bfin_sir0_device,
1554#endif
1555#ifdef CONFIG_BFIN_SIR1
1556 &bfin_sir1_device,
1557#endif
1558#ifdef CONFIG_BFIN_SIR2
1559 &bfin_sir2_device,
1560#endif
1561#ifdef CONFIG_BFIN_SIR3
1562 &bfin_sir3_device,
1563#endif
Graf Yang5be36d22008-04-25 03:09:15 +08001564#endif
1565
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001566#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
1567 &bf54x_lq043_device,
1568#endif
1569
1570#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
1571 &smsc911x_device,
1572#endif
1573
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001574#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1575 &musb_device,
1576#endif
1577
Michael Hennerich3f375692008-11-18 17:48:22 +08001578#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1579 &bfin_isp1760_device,
1580#endif
1581
Sonic Zhangdf5de262009-09-23 05:01:56 +00001582#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1583#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1584 &bfin_sport0_uart_device,
1585#endif
1586#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1587 &bfin_sport1_uart_device,
1588#endif
1589#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1590 &bfin_sport2_uart_device,
1591#endif
1592#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1593 &bfin_sport3_uart_device,
1594#endif
1595#endif
1596
Barry Song706a01b2009-11-02 07:29:07 +00001597#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
Aaron Wu4c131c82010-12-22 06:21:03 +00001598 &bfin_can0_device,
1599 &bfin_can1_device,
Barry Song706a01b2009-11-02 07:29:07 +00001600#endif
1601
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001602#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
1603 &bfin_atapi_device,
1604#endif
1605
1606#if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1607 &bf5xx_nand_device,
1608#endif
1609
Michael Hennerich3d7e6cf2008-03-03 17:40:28 -07001610#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001611 &bf54x_sdh_device,
1612#endif
1613
Sonic Zhang7d157fb2011-11-07 18:40:10 +08001614#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001615 &bf54x_spi_master0,
Bryan Wud4b1d272007-10-21 17:03:55 +08001616 &bf54x_spi_master1,
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001617#endif
Scott Jiangdf864c32011-12-31 14:08:38 -05001618#if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
1619 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
1620 &bfin_capture_device,
1621#endif
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001622
1623#if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1624 &bf54x_kpad_device,
1625#endif
1626
Michael Hennerichadfc0462009-10-09 07:37:03 +00001627#if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
Michael Hennerichaca5e4a2008-10-08 14:27:59 +08001628 &bfin_rotary_device,
1629#endif
1630
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001631#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1632 &i2c_bfin_twi0_device,
Mike Frysinger7160e952007-11-21 16:03:07 +08001633#if !defined(CONFIG_BF542)
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001634 &i2c_bfin_twi1_device,
1635#endif
Mike Frysinger7160e952007-11-21 16:03:07 +08001636#endif
Michael Hennerich2463ef22008-01-27 16:49:48 +08001637
1638#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1639 &bfin_device_gpiokeys,
1640#endif
Mike Frysingercad2ab62008-02-22 17:01:31 +08001641
Mike Frysinger793dc272008-03-26 08:09:12 +08001642#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
Mike Frysingerde8c43f2008-01-24 17:14:04 +08001643 &ezkit_flash_device,
Mike Frysinger793dc272008-03-26 08:09:12 +08001644#endif
Barry Song439b4862009-11-13 02:41:07 +00001645
Sonic Zhangeeec0a12012-03-16 12:52:34 +08001646#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1647 &bfin_i2s_pcm,
1648#endif
1649#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1650 &bfin_tdm_pcm,
1651#endif
1652#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1653 &bfin_ac97_pcm,
Scott Jiang6f53dbb2011-03-01 09:43:50 +00001654#endif
1655
1656#if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1657 &bfin_ad1980_codec_device,
1658#endif
1659
Barry Song439b4862009-11-13 02:41:07 +00001660#if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1661 &bfin_i2s,
1662#endif
1663
1664#if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1665 &bfin_tdm,
1666#endif
1667
1668#if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1669 &bfin_ac97,
1670#endif
Roy Huang24a07a12007-07-12 22:41:45 +08001671};
1672
Mike Frysingera01d7a72008-02-02 15:34:56 +08001673static int __init ezkit_init(void)
Roy Huang24a07a12007-07-12 22:41:45 +08001674{
Harvey Harrisonb85d8582008-04-23 09:39:01 +08001675 printk(KERN_INFO "%s(): registering device resources\n", __func__);
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001676
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001677 i2c_register_board_info(0, bfin_i2c_board_info0,
1678 ARRAY_SIZE(bfin_i2c_board_info0));
1679#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1680 i2c_register_board_info(1, bfin_i2c_board_info1,
1681 ARRAY_SIZE(bfin_i2c_board_info1));
1682#endif
Bryan Wu81d9c7f2008-03-26 10:02:13 +08001683
Roy Huang24a07a12007-07-12 22:41:45 +08001684 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001685
Mike Frysinger5bda2722008-06-07 15:03:01 +08001686 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
Bryan Wuc6c4d7b2007-10-11 01:20:06 +08001687
Roy Huang24a07a12007-07-12 22:41:45 +08001688 return 0;
1689}
1690
Mike Frysingera01d7a72008-02-02 15:34:56 +08001691arch_initcall(ezkit_init);
Sonic Zhangc13ce9f2009-09-23 09:37:46 +00001692
1693static struct platform_device *ezkit_early_devices[] __initdata = {
1694#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1695#ifdef CONFIG_SERIAL_BFIN_UART0
1696 &bfin_uart0_device,
1697#endif
1698#ifdef CONFIG_SERIAL_BFIN_UART1
1699 &bfin_uart1_device,
1700#endif
1701#ifdef CONFIG_SERIAL_BFIN_UART2
1702 &bfin_uart2_device,
1703#endif
1704#ifdef CONFIG_SERIAL_BFIN_UART3
1705 &bfin_uart3_device,
1706#endif
1707#endif
1708
1709#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1710#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1711 &bfin_sport0_uart_device,
1712#endif
1713#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1714 &bfin_sport1_uart_device,
1715#endif
1716#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1717 &bfin_sport2_uart_device,
1718#endif
1719#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1720 &bfin_sport3_uart_device,
1721#endif
1722#endif
1723};
1724
1725void __init native_machine_early_platform_add_devices(void)
1726{
1727 printk(KERN_INFO "register early platform devices\n");
1728 early_platform_add_devices(ezkit_early_devices,
1729 ARRAY_SIZE(ezkit_early_devices));
1730}