include: replace linux/module.h with "struct module" wherever possible
[linux-2.6/next.git] / arch / blackfin / mach-bf548 / boards / ezkit.c
blobcd9cbb68de692d1243d1c11dbb54f1d0e7bfa379
1 /*
2 * Copyright 2004-2009 Analog Devices Inc.
3 * 2005 National ICT Australia (NICTA)
4 * Aidan Williams <aidan@nicta.com.au>
6 * Licensed under the GPL-2 or later.
7 */
9 #include <linux/device.h>
10 #include <linux/platform_device.h>
11 #include <linux/mtd/mtd.h>
12 #include <linux/mtd/partitions.h>
13 #include <linux/mtd/physmap.h>
14 #include <linux/spi/spi.h>
15 #include <linux/spi/flash.h>
16 #include <linux/irq.h>
17 #include <linux/i2c.h>
18 #include <linux/interrupt.h>
19 #include <linux/usb/musb.h>
20 #include <asm/bfin5xx_spi.h>
21 #include <asm/dma.h>
22 #include <asm/gpio.h>
23 #include <asm/nand.h>
24 #include <asm/dpmc.h>
25 #include <asm/bfin_sport.h>
26 #include <asm/portmux.h>
27 #include <asm/bfin_sdh.h>
28 #include <mach/bf54x_keys.h>
29 #include <linux/input.h>
30 #include <linux/spi/ad7877.h>
33 * Name the Board for the /proc/cpuinfo
35 const char bfin_board_name[] = "ADI BF548-EZKIT";
38 * Driver needs to know address, irq and flag pin.
41 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
42 #include <linux/usb/isp1760.h>
43 static struct resource bfin_isp1760_resources[] = {
44 [0] = {
45 .start = 0x2C0C0000,
46 .end = 0x2C0C0000 + 0xfffff,
47 .flags = IORESOURCE_MEM,
49 [1] = {
50 .start = IRQ_PG7,
51 .end = IRQ_PG7,
52 .flags = IORESOURCE_IRQ,
56 static struct isp1760_platform_data isp1760_priv = {
57 .is_isp1761 = 0,
58 .bus_width_16 = 1,
59 .port1_otg = 0,
60 .analog_oc = 0,
61 .dack_polarity_high = 0,
62 .dreq_polarity_high = 0,
65 static struct platform_device bfin_isp1760_device = {
66 .name = "isp1760",
67 .id = 0,
68 .dev = {
69 .platform_data = &isp1760_priv,
71 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
72 .resource = bfin_isp1760_resources,
74 #endif
76 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
78 #include <mach/bf54x-lq043.h>
80 static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
81 .width = 95,
82 .height = 54,
83 .xres = {480, 480, 480},
84 .yres = {272, 272, 272},
85 .bpp = {24, 24, 24},
86 .disp = GPIO_PE3,
89 static struct resource bf54x_lq043_resources[] = {
91 .start = IRQ_EPPI0_ERR,
92 .end = IRQ_EPPI0_ERR,
93 .flags = IORESOURCE_IRQ,
97 static 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,
106 #endif
108 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
109 static const unsigned int bf548_keymap[] = {
110 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),
128 static struct bfin_kpad_platform_data bf54x_kpad_data = {
129 .rows = 4,
130 .cols = 4,
131 .keymap = bf548_keymap,
132 .keymapsize = ARRAY_SIZE(bf548_keymap),
133 .repeat = 0,
134 .debounce_time = 5000, /* ns (5ms) */
135 .coldrive_time = 1000, /* ns (1ms) */
136 .keyup_test_interval = 50, /* ms (50ms) */
139 static struct resource bf54x_kpad_resources[] = {
141 .start = IRQ_KEY,
142 .end = IRQ_KEY,
143 .flags = IORESOURCE_IRQ,
147 static 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,
156 #endif
158 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
159 #include <asm/bfin_rotary.h>
161 static 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,
170 static struct resource bfin_rotary_resources[] = {
172 .start = IRQ_CNT,
173 .end = IRQ_CNT,
174 .flags = IORESOURCE_IRQ,
178 static 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,
187 #endif
189 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
190 #include <linux/input/adxl34x.h>
191 static 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,
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 */
214 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
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,
220 .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},
226 #endif
228 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
229 static struct platform_device rtc_device = {
230 .name = "rtc-bfin",
231 .id = -1,
233 #endif
235 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
236 #ifdef CONFIG_SERIAL_BFIN_UART0
237 static struct resource bfin_uart0_resources[] = {
239 .start = UART0_DLL,
240 .end = UART0_RBR+2,
241 .flags = IORESOURCE_MEM,
244 .start = IRQ_UART0_RX,
245 .end = IRQ_UART0_RX+1,
246 .flags = IORESOURCE_IRQ,
249 .start = IRQ_UART0_ERROR,
250 .end = IRQ_UART0_ERROR,
251 .flags = IORESOURCE_IRQ,
254 .start = CH_UART0_TX,
255 .end = CH_UART0_TX,
256 .flags = IORESOURCE_DMA,
259 .start = CH_UART0_RX,
260 .end = CH_UART0_RX,
261 .flags = IORESOURCE_DMA,
265 static unsigned short bfin_uart0_peripherals[] = {
266 P_UART0_TX, P_UART0_RX, 0
269 static struct platform_device bfin_uart0_device = {
270 .name = "bfin-uart",
271 .id = 0,
272 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
273 .resource = bfin_uart0_resources,
274 .dev = {
275 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
278 #endif
279 #ifdef CONFIG_SERIAL_BFIN_UART1
280 static struct resource bfin_uart1_resources[] = {
282 .start = UART1_DLL,
283 .end = UART1_RBR+2,
284 .flags = IORESOURCE_MEM,
287 .start = IRQ_UART1_RX,
288 .end = IRQ_UART1_RX+1,
289 .flags = IORESOURCE_IRQ,
292 .start = IRQ_UART1_ERROR,
293 .end = IRQ_UART1_ERROR,
294 .flags = IORESOURCE_IRQ,
297 .start = CH_UART1_TX,
298 .end = CH_UART1_TX,
299 .flags = IORESOURCE_DMA,
302 .start = CH_UART1_RX,
303 .end = CH_UART1_RX,
304 .flags = IORESOURCE_DMA,
306 #ifdef CONFIG_BFIN_UART1_CTSRTS
307 { /* CTS pin -- 0 means not supported */
308 .start = GPIO_PE10,
309 .end = GPIO_PE10,
310 .flags = IORESOURCE_IO,
312 { /* RTS pin -- 0 means not supported */
313 .start = GPIO_PE9,
314 .end = GPIO_PE9,
315 .flags = IORESOURCE_IO,
317 #endif
320 static unsigned short bfin_uart1_peripherals[] = {
321 P_UART1_TX, P_UART1_RX,
322 #ifdef CONFIG_BFIN_UART1_CTSRTS
323 P_UART1_RTS, P_UART1_CTS,
324 #endif
328 static struct platform_device bfin_uart1_device = {
329 .name = "bfin-uart",
330 .id = 1,
331 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
332 .resource = bfin_uart1_resources,
333 .dev = {
334 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
337 #endif
338 #ifdef CONFIG_SERIAL_BFIN_UART2
339 static struct resource bfin_uart2_resources[] = {
341 .start = UART2_DLL,
342 .end = UART2_RBR+2,
343 .flags = IORESOURCE_MEM,
346 .start = IRQ_UART2_RX,
347 .end = IRQ_UART2_RX+1,
348 .flags = IORESOURCE_IRQ,
351 .start = IRQ_UART2_ERROR,
352 .end = IRQ_UART2_ERROR,
353 .flags = IORESOURCE_IRQ,
356 .start = CH_UART2_TX,
357 .end = CH_UART2_TX,
358 .flags = IORESOURCE_DMA,
361 .start = CH_UART2_RX,
362 .end = CH_UART2_RX,
363 .flags = IORESOURCE_DMA,
367 static unsigned short bfin_uart2_peripherals[] = {
368 P_UART2_TX, P_UART2_RX, 0
371 static struct platform_device bfin_uart2_device = {
372 .name = "bfin-uart",
373 .id = 2,
374 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
375 .resource = bfin_uart2_resources,
376 .dev = {
377 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
380 #endif
381 #ifdef CONFIG_SERIAL_BFIN_UART3
382 static struct resource bfin_uart3_resources[] = {
384 .start = UART3_DLL,
385 .end = UART3_RBR+2,
386 .flags = IORESOURCE_MEM,
389 .start = IRQ_UART3_RX,
390 .end = IRQ_UART3_RX+1,
391 .flags = IORESOURCE_IRQ,
394 .start = IRQ_UART3_ERROR,
395 .end = IRQ_UART3_ERROR,
396 .flags = IORESOURCE_IRQ,
399 .start = CH_UART3_TX,
400 .end = CH_UART3_TX,
401 .flags = IORESOURCE_DMA,
404 .start = CH_UART3_RX,
405 .end = CH_UART3_RX,
406 .flags = IORESOURCE_DMA,
408 #ifdef CONFIG_BFIN_UART3_CTSRTS
409 { /* CTS pin -- 0 means not supported */
410 .start = GPIO_PB3,
411 .end = GPIO_PB3,
412 .flags = IORESOURCE_IO,
414 { /* RTS pin -- 0 means not supported */
415 .start = GPIO_PB2,
416 .end = GPIO_PB2,
417 .flags = IORESOURCE_IO,
419 #endif
422 static unsigned short bfin_uart3_peripherals[] = {
423 P_UART3_TX, P_UART3_RX,
424 #ifdef CONFIG_BFIN_UART3_CTSRTS
425 P_UART3_RTS, P_UART3_CTS,
426 #endif
430 static struct platform_device bfin_uart3_device = {
431 .name = "bfin-uart",
432 .id = 3,
433 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
434 .resource = bfin_uart3_resources,
435 .dev = {
436 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
439 #endif
440 #endif
442 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
443 #ifdef CONFIG_BFIN_SIR0
444 static struct resource bfin_sir0_resources[] = {
446 .start = 0xFFC00400,
447 .end = 0xFFC004FF,
448 .flags = IORESOURCE_MEM,
451 .start = IRQ_UART0_RX,
452 .end = IRQ_UART0_RX+1,
453 .flags = IORESOURCE_IRQ,
456 .start = CH_UART0_RX,
457 .end = CH_UART0_RX+1,
458 .flags = IORESOURCE_DMA,
461 static struct platform_device bfin_sir0_device = {
462 .name = "bfin_sir",
463 .id = 0,
464 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
465 .resource = bfin_sir0_resources,
467 #endif
468 #ifdef CONFIG_BFIN_SIR1
469 static struct resource bfin_sir1_resources[] = {
471 .start = 0xFFC02000,
472 .end = 0xFFC020FF,
473 .flags = IORESOURCE_MEM,
476 .start = IRQ_UART1_RX,
477 .end = IRQ_UART1_RX+1,
478 .flags = IORESOURCE_IRQ,
481 .start = CH_UART1_RX,
482 .end = CH_UART1_RX+1,
483 .flags = IORESOURCE_DMA,
486 static struct platform_device bfin_sir1_device = {
487 .name = "bfin_sir",
488 .id = 1,
489 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
490 .resource = bfin_sir1_resources,
492 #endif
493 #ifdef CONFIG_BFIN_SIR2
494 static struct resource bfin_sir2_resources[] = {
496 .start = 0xFFC02100,
497 .end = 0xFFC021FF,
498 .flags = IORESOURCE_MEM,
501 .start = IRQ_UART2_RX,
502 .end = IRQ_UART2_RX+1,
503 .flags = IORESOURCE_IRQ,
506 .start = CH_UART2_RX,
507 .end = CH_UART2_RX+1,
508 .flags = IORESOURCE_DMA,
511 static struct platform_device bfin_sir2_device = {
512 .name = "bfin_sir",
513 .id = 2,
514 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
515 .resource = bfin_sir2_resources,
517 #endif
518 #ifdef CONFIG_BFIN_SIR3
519 static struct resource bfin_sir3_resources[] = {
521 .start = 0xFFC03100,
522 .end = 0xFFC031FF,
523 .flags = IORESOURCE_MEM,
526 .start = IRQ_UART3_RX,
527 .end = IRQ_UART3_RX+1,
528 .flags = IORESOURCE_IRQ,
531 .start = CH_UART3_RX,
532 .end = CH_UART3_RX+1,
533 .flags = IORESOURCE_DMA,
536 static struct platform_device bfin_sir3_device = {
537 .name = "bfin_sir",
538 .id = 3,
539 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
540 .resource = bfin_sir3_resources,
542 #endif
543 #endif
545 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
546 #include <linux/smsc911x.h>
548 static struct resource smsc911x_resources[] = {
550 .name = "smsc911x-memory",
551 .start = 0x24000000,
552 .end = 0x24000000 + 0xFF,
553 .flags = IORESOURCE_MEM,
556 .start = IRQ_PE8,
557 .end = IRQ_PE8,
558 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
562 static struct smsc911x_platform_config smsc911x_config = {
563 .flags = SMSC911X_USE_32BIT,
564 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
565 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
566 .phy_interface = PHY_INTERFACE_MODE_MII,
569 static struct platform_device smsc911x_device = {
570 .name = "smsc911x",
571 .id = 0,
572 .num_resources = ARRAY_SIZE(smsc911x_resources),
573 .resource = smsc911x_resources,
574 .dev = {
575 .platform_data = &smsc911x_config,
578 #endif
580 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
581 static struct resource musb_resources[] = {
582 [0] = {
583 .start = 0xFFC03C00,
584 .end = 0xFFC040FF,
585 .flags = IORESOURCE_MEM,
587 [1] = { /* general IRQ */
588 .start = IRQ_USB_INT0,
589 .end = IRQ_USB_INT0,
590 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
591 .name = "mc"
593 [2] = { /* DMA IRQ */
594 .start = IRQ_USB_DMA,
595 .end = IRQ_USB_DMA,
596 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
597 .name = "dma"
601 static struct musb_hdrc_config musb_config = {
602 .multipoint = 0,
603 .dyn_fifo = 0,
604 .soft_con = 1,
605 .dma = 1,
606 .num_eps = 8,
607 .dma_channels = 8,
608 .gpio_vrsel = GPIO_PE7,
609 /* Some custom boards need to be active low, just set it to "0"
610 * if it is the case.
612 .gpio_vrsel_active = 1,
613 .clkin = 24, /* musb CLKIN in MHZ */
616 static struct musb_hdrc_platform_data musb_plat = {
617 #if defined(CONFIG_USB_MUSB_OTG)
618 .mode = MUSB_OTG,
619 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
620 .mode = MUSB_HOST,
621 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
622 .mode = MUSB_PERIPHERAL,
623 #endif
624 .config = &musb_config,
627 static u64 musb_dmamask = ~(u32)0;
629 static struct platform_device musb_device = {
630 .name = "musb-blackfin",
631 .id = 0,
632 .dev = {
633 .dma_mask = &musb_dmamask,
634 .coherent_dma_mask = 0xffffffff,
635 .platform_data = &musb_plat,
637 .num_resources = ARRAY_SIZE(musb_resources),
638 .resource = musb_resources,
640 #endif
642 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
643 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
644 static struct resource bfin_sport0_uart_resources[] = {
646 .start = SPORT0_TCR1,
647 .end = SPORT0_MRCS3+4,
648 .flags = IORESOURCE_MEM,
651 .start = IRQ_SPORT0_RX,
652 .end = IRQ_SPORT0_RX+1,
653 .flags = IORESOURCE_IRQ,
656 .start = IRQ_SPORT0_ERROR,
657 .end = IRQ_SPORT0_ERROR,
658 .flags = IORESOURCE_IRQ,
662 static unsigned short bfin_sport0_peripherals[] = {
663 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
664 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
667 static struct platform_device bfin_sport0_uart_device = {
668 .name = "bfin-sport-uart",
669 .id = 0,
670 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
671 .resource = bfin_sport0_uart_resources,
672 .dev = {
673 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
676 #endif
677 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
678 static struct resource bfin_sport1_uart_resources[] = {
680 .start = SPORT1_TCR1,
681 .end = SPORT1_MRCS3+4,
682 .flags = IORESOURCE_MEM,
685 .start = IRQ_SPORT1_RX,
686 .end = IRQ_SPORT1_RX+1,
687 .flags = IORESOURCE_IRQ,
690 .start = IRQ_SPORT1_ERROR,
691 .end = IRQ_SPORT1_ERROR,
692 .flags = IORESOURCE_IRQ,
696 static unsigned short bfin_sport1_peripherals[] = {
697 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
698 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
701 static struct platform_device bfin_sport1_uart_device = {
702 .name = "bfin-sport-uart",
703 .id = 1,
704 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
705 .resource = bfin_sport1_uart_resources,
706 .dev = {
707 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
710 #endif
711 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
712 static struct resource bfin_sport2_uart_resources[] = {
714 .start = SPORT2_TCR1,
715 .end = SPORT2_MRCS3+4,
716 .flags = IORESOURCE_MEM,
719 .start = IRQ_SPORT2_RX,
720 .end = IRQ_SPORT2_RX+1,
721 .flags = IORESOURCE_IRQ,
724 .start = IRQ_SPORT2_ERROR,
725 .end = IRQ_SPORT2_ERROR,
726 .flags = IORESOURCE_IRQ,
730 static unsigned short bfin_sport2_peripherals[] = {
731 P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
732 P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0
735 static struct platform_device bfin_sport2_uart_device = {
736 .name = "bfin-sport-uart",
737 .id = 2,
738 .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
739 .resource = bfin_sport2_uart_resources,
740 .dev = {
741 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
744 #endif
745 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
746 static struct resource bfin_sport3_uart_resources[] = {
748 .start = SPORT3_TCR1,
749 .end = SPORT3_MRCS3+4,
750 .flags = IORESOURCE_MEM,
753 .start = IRQ_SPORT3_RX,
754 .end = IRQ_SPORT3_RX+1,
755 .flags = IORESOURCE_IRQ,
758 .start = IRQ_SPORT3_ERROR,
759 .end = IRQ_SPORT3_ERROR,
760 .flags = IORESOURCE_IRQ,
764 static unsigned short bfin_sport3_peripherals[] = {
765 P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
766 P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0
769 static struct platform_device bfin_sport3_uart_device = {
770 .name = "bfin-sport-uart",
771 .id = 3,
772 .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
773 .resource = bfin_sport3_uart_resources,
774 .dev = {
775 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
778 #endif
779 #endif
781 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
783 static unsigned short bfin_can0_peripherals[] = {
784 P_CAN0_RX, P_CAN0_TX, 0
787 static struct resource bfin_can0_resources[] = {
789 .start = 0xFFC02A00,
790 .end = 0xFFC02FFF,
791 .flags = IORESOURCE_MEM,
794 .start = IRQ_CAN0_RX,
795 .end = IRQ_CAN0_RX,
796 .flags = IORESOURCE_IRQ,
799 .start = IRQ_CAN0_TX,
800 .end = IRQ_CAN0_TX,
801 .flags = IORESOURCE_IRQ,
804 .start = IRQ_CAN0_ERROR,
805 .end = IRQ_CAN0_ERROR,
806 .flags = IORESOURCE_IRQ,
810 static struct platform_device bfin_can0_device = {
811 .name = "bfin_can",
812 .id = 0,
813 .num_resources = ARRAY_SIZE(bfin_can0_resources),
814 .resource = bfin_can0_resources,
815 .dev = {
816 .platform_data = &bfin_can0_peripherals, /* Passed to driver */
820 static unsigned short bfin_can1_peripherals[] = {
821 P_CAN1_RX, P_CAN1_TX, 0
824 static struct resource bfin_can1_resources[] = {
826 .start = 0xFFC03200,
827 .end = 0xFFC037FF,
828 .flags = IORESOURCE_MEM,
831 .start = IRQ_CAN1_RX,
832 .end = IRQ_CAN1_RX,
833 .flags = IORESOURCE_IRQ,
836 .start = IRQ_CAN1_TX,
837 .end = IRQ_CAN1_TX,
838 .flags = IORESOURCE_IRQ,
841 .start = IRQ_CAN1_ERROR,
842 .end = IRQ_CAN1_ERROR,
843 .flags = IORESOURCE_IRQ,
847 static struct platform_device bfin_can1_device = {
848 .name = "bfin_can",
849 .id = 1,
850 .num_resources = ARRAY_SIZE(bfin_can1_resources),
851 .resource = bfin_can1_resources,
852 .dev = {
853 .platform_data = &bfin_can1_peripherals, /* Passed to driver */
857 #endif
859 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
860 static struct resource bfin_atapi_resources[] = {
862 .start = 0xFFC03800,
863 .end = 0xFFC0386F,
864 .flags = IORESOURCE_MEM,
867 .start = IRQ_ATAPI_ERR,
868 .end = IRQ_ATAPI_ERR,
869 .flags = IORESOURCE_IRQ,
873 static struct platform_device bfin_atapi_device = {
874 .name = "pata-bf54x",
875 .id = -1,
876 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
877 .resource = bfin_atapi_resources,
879 #endif
881 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
882 static struct mtd_partition partition_info[] = {
884 .name = "bootloader(nand)",
885 .offset = 0,
886 .size = 0x80000,
887 }, {
888 .name = "linux kernel(nand)",
889 .offset = MTDPART_OFS_APPEND,
890 .size = 4 * 1024 * 1024,
893 .name = "file system(nand)",
894 .offset = MTDPART_OFS_APPEND,
895 .size = MTDPART_SIZ_FULL,
899 static struct bf5xx_nand_platform bf5xx_nand_platform = {
900 .data_width = NFC_NWIDTH_8,
901 .partitions = partition_info,
902 .nr_partitions = ARRAY_SIZE(partition_info),
903 .rd_dly = 3,
904 .wr_dly = 3,
907 static struct resource bf5xx_nand_resources[] = {
909 .start = 0xFFC03B00,
910 .end = 0xFFC03B4F,
911 .flags = IORESOURCE_MEM,
914 .start = CH_NFC,
915 .end = CH_NFC,
916 .flags = IORESOURCE_IRQ,
920 static struct platform_device bf5xx_nand_device = {
921 .name = "bf5xx-nand",
922 .id = 0,
923 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
924 .resource = bf5xx_nand_resources,
925 .dev = {
926 .platform_data = &bf5xx_nand_platform,
929 #endif
931 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
933 static struct bfin_sd_host bfin_sdh_data = {
934 .dma_chan = CH_SDH,
935 .irq_int0 = IRQ_SDH_MASK0,
936 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
939 static struct platform_device bf54x_sdh_device = {
940 .name = "bfin-sdh",
941 .id = 0,
942 .dev = {
943 .platform_data = &bfin_sdh_data,
946 #endif
948 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
949 static struct mtd_partition ezkit_partitions[] = {
951 .name = "bootloader(nor)",
952 .size = 0x80000,
953 .offset = 0,
954 }, {
955 .name = "linux kernel(nor)",
956 .size = 0x400000,
957 .offset = MTDPART_OFS_APPEND,
958 }, {
959 .name = "file system(nor)",
960 .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4,
961 .offset = MTDPART_OFS_APPEND,
962 }, {
963 .name = "config(nor)",
964 .size = 0x8000 * 3,
965 .offset = MTDPART_OFS_APPEND,
966 }, {
967 .name = "u-boot env(nor)",
968 .size = 0x8000,
969 .offset = MTDPART_OFS_APPEND,
973 static struct physmap_flash_data ezkit_flash_data = {
974 .width = 2,
975 .parts = ezkit_partitions,
976 .nr_parts = ARRAY_SIZE(ezkit_partitions),
979 static struct resource ezkit_flash_resource = {
980 .start = 0x20000000,
981 .end = 0x21ffffff,
982 .flags = IORESOURCE_MEM,
985 static struct platform_device ezkit_flash_device = {
986 .name = "physmap-flash",
987 .id = 0,
988 .dev = {
989 .platform_data = &ezkit_flash_data,
991 .num_resources = 1,
992 .resource = &ezkit_flash_resource,
994 #endif
996 #if defined(CONFIG_MTD_M25P80) \
997 || defined(CONFIG_MTD_M25P80_MODULE)
998 /* SPI flash chip (m25p16) */
999 static struct mtd_partition bfin_spi_flash_partitions[] = {
1001 .name = "bootloader(spi)",
1002 .size = 0x00080000,
1003 .offset = 0,
1004 .mask_flags = MTD_CAP_ROM
1005 }, {
1006 .name = "linux kernel(spi)",
1007 .size = MTDPART_SIZ_FULL,
1008 .offset = MTDPART_OFS_APPEND,
1012 static struct flash_platform_data bfin_spi_flash_data = {
1013 .name = "m25p80",
1014 .parts = bfin_spi_flash_partitions,
1015 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
1016 .type = "m25p16",
1019 static struct bfin5xx_spi_chip spi_flash_chip_info = {
1020 .enable_dma = 0, /* use dma transfer with this chip*/
1022 #endif
1024 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1025 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1026 .model = 7877,
1027 .vref_delay_usecs = 50, /* internal, no capacitor */
1028 .x_plate_ohms = 419,
1029 .y_plate_ohms = 486,
1030 .pressure_max = 1000,
1031 .pressure_min = 0,
1032 .stopacq_polarity = 1,
1033 .first_conversion_delay = 3,
1034 .acquisition_time = 1,
1035 .averaging = 1,
1036 .pen_down_acc_interval = 1,
1038 #endif
1040 static struct spi_board_info bfin_spi_board_info[] __initdata = {
1041 #if defined(CONFIG_MTD_M25P80) \
1042 || defined(CONFIG_MTD_M25P80_MODULE)
1044 /* the modalias must be the same as spi device driver name */
1045 .modalias = "m25p80", /* Name of spi_driver for this device */
1046 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1047 .bus_num = 0, /* Framework bus number */
1048 .chip_select = 1, /* SPI_SSEL1*/
1049 .platform_data = &bfin_spi_flash_data,
1050 .controller_data = &spi_flash_chip_info,
1051 .mode = SPI_MODE_3,
1053 #endif
1054 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1055 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1057 .modalias = "ad183x",
1058 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1059 .bus_num = 1,
1060 .chip_select = 4,
1062 #endif
1063 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1065 .modalias = "ad7877",
1066 .platform_data = &bfin_ad7877_ts_info,
1067 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
1068 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1069 .bus_num = 0,
1070 .chip_select = 2,
1072 #endif
1073 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1075 .modalias = "spidev",
1076 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1077 .bus_num = 0,
1078 .chip_select = 1,
1080 #endif
1081 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1083 .modalias = "adxl34x",
1084 .platform_data = &adxl34x_info,
1085 .irq = IRQ_PC5,
1086 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1087 .bus_num = 1,
1088 .chip_select = 2,
1089 .mode = SPI_MODE_3,
1091 #endif
1093 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1094 /* SPI (0) */
1095 static struct resource bfin_spi0_resource[] = {
1096 [0] = {
1097 .start = SPI0_REGBASE,
1098 .end = SPI0_REGBASE + 0xFF,
1099 .flags = IORESOURCE_MEM,
1101 [1] = {
1102 .start = CH_SPI0,
1103 .end = CH_SPI0,
1104 .flags = IORESOURCE_DMA,
1106 [2] = {
1107 .start = IRQ_SPI0,
1108 .end = IRQ_SPI0,
1109 .flags = IORESOURCE_IRQ,
1113 /* SPI (1) */
1114 static struct resource bfin_spi1_resource[] = {
1115 [0] = {
1116 .start = SPI1_REGBASE,
1117 .end = SPI1_REGBASE + 0xFF,
1118 .flags = IORESOURCE_MEM,
1120 [1] = {
1121 .start = CH_SPI1,
1122 .end = CH_SPI1,
1123 .flags = IORESOURCE_DMA,
1125 [2] = {
1126 .start = IRQ_SPI1,
1127 .end = IRQ_SPI1,
1128 .flags = IORESOURCE_IRQ,
1132 /* SPI controller data */
1133 static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
1134 .num_chipselect = 4,
1135 .enable_dma = 1, /* master has the ability to do dma transfer */
1136 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1139 static struct platform_device bf54x_spi_master0 = {
1140 .name = "bfin-spi",
1141 .id = 0, /* Bus number */
1142 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1143 .resource = bfin_spi0_resource,
1144 .dev = {
1145 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
1149 static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
1150 .num_chipselect = 4,
1151 .enable_dma = 1, /* master has the ability to do dma transfer */
1152 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1155 static struct platform_device bf54x_spi_master1 = {
1156 .name = "bfin-spi",
1157 .id = 1, /* Bus number */
1158 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
1159 .resource = bfin_spi1_resource,
1160 .dev = {
1161 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
1164 #endif /* spi master and devices */
1166 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1167 static struct resource bfin_twi0_resource[] = {
1168 [0] = {
1169 .start = TWI0_REGBASE,
1170 .end = TWI0_REGBASE + 0xFF,
1171 .flags = IORESOURCE_MEM,
1173 [1] = {
1174 .start = IRQ_TWI0,
1175 .end = IRQ_TWI0,
1176 .flags = IORESOURCE_IRQ,
1180 static struct platform_device i2c_bfin_twi0_device = {
1181 .name = "i2c-bfin-twi",
1182 .id = 0,
1183 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1184 .resource = bfin_twi0_resource,
1187 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1188 static struct resource bfin_twi1_resource[] = {
1189 [0] = {
1190 .start = TWI1_REGBASE,
1191 .end = TWI1_REGBASE + 0xFF,
1192 .flags = IORESOURCE_MEM,
1194 [1] = {
1195 .start = IRQ_TWI1,
1196 .end = IRQ_TWI1,
1197 .flags = IORESOURCE_IRQ,
1201 static struct platform_device i2c_bfin_twi1_device = {
1202 .name = "i2c-bfin-twi",
1203 .id = 1,
1204 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
1205 .resource = bfin_twi1_resource,
1207 #endif
1208 #endif
1210 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1213 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1214 static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
1215 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1217 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1219 #endif
1220 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1222 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1223 .irq = 212,
1225 #endif
1226 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1228 I2C_BOARD_INFO("adxl34x", 0x53),
1229 .irq = IRQ_PC5,
1230 .platform_data = (void *)&adxl34x_info,
1232 #endif
1233 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1235 I2C_BOARD_INFO("ad5252", 0x2f),
1237 #endif
1239 #endif
1241 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1242 #include <linux/gpio_keys.h>
1244 static struct gpio_keys_button bfin_gpio_keys_table[] = {
1245 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
1246 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
1247 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
1248 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
1251 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
1252 .buttons = bfin_gpio_keys_table,
1253 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
1256 static struct platform_device bfin_device_gpiokeys = {
1257 .name = "gpio-keys",
1258 .dev = {
1259 .platform_data = &bfin_gpio_keys_data,
1262 #endif
1264 static const unsigned int cclk_vlev_datasheet[] =
1267 * Internal VLEV BF54XSBBC1533
1268 ****temporarily using these values until data sheet is updated
1270 VRPAIR(VLEV_085, 150000000),
1271 VRPAIR(VLEV_090, 250000000),
1272 VRPAIR(VLEV_110, 276000000),
1273 VRPAIR(VLEV_115, 301000000),
1274 VRPAIR(VLEV_120, 525000000),
1275 VRPAIR(VLEV_125, 550000000),
1276 VRPAIR(VLEV_130, 600000000),
1279 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1280 .tuple_tab = cclk_vlev_datasheet,
1281 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1282 .vr_settling_time = 25 /* us */,
1285 static struct platform_device bfin_dpmc = {
1286 .name = "bfin dpmc",
1287 .dev = {
1288 .platform_data = &bfin_dmpc_vreg_data,
1292 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
1293 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \
1294 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1296 #define SPORT_REQ(x) \
1297 [x] = {P_SPORT##x##_TFS, P_SPORT##x##_DTPRI, P_SPORT##x##_TSCLK, \
1298 P_SPORT##x##_RFS, P_SPORT##x##_DRPRI, P_SPORT##x##_RSCLK, 0}
1300 static const u16 bfin_snd_pin[][7] = {
1301 SPORT_REQ(0),
1302 SPORT_REQ(1),
1305 static struct bfin_snd_platform_data bfin_snd_data[] = {
1307 .pin_req = &bfin_snd_pin[0][0],
1310 .pin_req = &bfin_snd_pin[1][0],
1314 #define BFIN_SND_RES(x) \
1315 [x] = { \
1317 .start = SPORT##x##_TCR1, \
1318 .end = SPORT##x##_TCR1, \
1319 .flags = IORESOURCE_MEM \
1320 }, \
1322 .start = CH_SPORT##x##_RX, \
1323 .end = CH_SPORT##x##_RX, \
1324 .flags = IORESOURCE_DMA, \
1325 }, \
1327 .start = CH_SPORT##x##_TX, \
1328 .end = CH_SPORT##x##_TX, \
1329 .flags = IORESOURCE_DMA, \
1330 }, \
1332 .start = IRQ_SPORT##x##_ERROR, \
1333 .end = IRQ_SPORT##x##_ERROR, \
1334 .flags = IORESOURCE_IRQ, \
1338 static struct resource bfin_snd_resources[][4] = {
1339 BFIN_SND_RES(0),
1340 BFIN_SND_RES(1),
1343 static struct platform_device bfin_pcm = {
1344 .name = "bfin-pcm-audio",
1345 .id = -1,
1347 #endif
1349 #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
1350 static struct platform_device bfin_ad73311_codec_device = {
1351 .name = "ad73311",
1352 .id = -1,
1354 #endif
1356 #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1357 static struct platform_device bfin_ad1980_codec_device = {
1358 .name = "ad1980",
1359 .id = -1,
1361 #endif
1363 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
1364 static struct platform_device bfin_i2s = {
1365 .name = "bfin-i2s",
1366 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1367 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1368 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1369 .dev = {
1370 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1373 #endif
1375 #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
1376 static struct platform_device bfin_tdm = {
1377 .name = "bfin-tdm",
1378 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1379 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1380 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1381 .dev = {
1382 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1385 #endif
1387 #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
1388 static struct platform_device bfin_ac97 = {
1389 .name = "bfin-ac97",
1390 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1391 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1392 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1393 .dev = {
1394 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1397 #endif
1399 static struct platform_device *ezkit_devices[] __initdata = {
1401 &bfin_dpmc,
1403 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1404 &rtc_device,
1405 #endif
1407 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1408 #ifdef CONFIG_SERIAL_BFIN_UART0
1409 &bfin_uart0_device,
1410 #endif
1411 #ifdef CONFIG_SERIAL_BFIN_UART1
1412 &bfin_uart1_device,
1413 #endif
1414 #ifdef CONFIG_SERIAL_BFIN_UART2
1415 &bfin_uart2_device,
1416 #endif
1417 #ifdef CONFIG_SERIAL_BFIN_UART3
1418 &bfin_uart3_device,
1419 #endif
1420 #endif
1422 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1423 #ifdef CONFIG_BFIN_SIR0
1424 &bfin_sir0_device,
1425 #endif
1426 #ifdef CONFIG_BFIN_SIR1
1427 &bfin_sir1_device,
1428 #endif
1429 #ifdef CONFIG_BFIN_SIR2
1430 &bfin_sir2_device,
1431 #endif
1432 #ifdef CONFIG_BFIN_SIR3
1433 &bfin_sir3_device,
1434 #endif
1435 #endif
1437 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
1438 &bf54x_lq043_device,
1439 #endif
1441 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
1442 &smsc911x_device,
1443 #endif
1445 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1446 &musb_device,
1447 #endif
1449 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1450 &bfin_isp1760_device,
1451 #endif
1453 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1454 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1455 &bfin_sport0_uart_device,
1456 #endif
1457 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1458 &bfin_sport1_uart_device,
1459 #endif
1460 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1461 &bfin_sport2_uart_device,
1462 #endif
1463 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1464 &bfin_sport3_uart_device,
1465 #endif
1466 #endif
1468 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
1469 &bfin_can0_device,
1470 &bfin_can1_device,
1471 #endif
1473 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
1474 &bfin_atapi_device,
1475 #endif
1477 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1478 &bf5xx_nand_device,
1479 #endif
1481 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
1482 &bf54x_sdh_device,
1483 #endif
1485 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1486 &bf54x_spi_master0,
1487 &bf54x_spi_master1,
1488 #endif
1490 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1491 &bf54x_kpad_device,
1492 #endif
1494 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1495 &bfin_rotary_device,
1496 #endif
1498 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1499 &i2c_bfin_twi0_device,
1500 #if !defined(CONFIG_BF542)
1501 &i2c_bfin_twi1_device,
1502 #endif
1503 #endif
1505 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1506 &bfin_device_gpiokeys,
1507 #endif
1509 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1510 &ezkit_flash_device,
1511 #endif
1513 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE) || \
1514 defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE) || \
1515 defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1516 &bfin_pcm,
1517 #endif
1519 #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1520 &bfin_ad1980_codec_device,
1521 #endif
1523 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1524 &bfin_i2s,
1525 #endif
1527 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1528 &bfin_tdm,
1529 #endif
1531 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1532 &bfin_ac97,
1533 #endif
1536 static int __init ezkit_init(void)
1538 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1540 i2c_register_board_info(0, bfin_i2c_board_info0,
1541 ARRAY_SIZE(bfin_i2c_board_info0));
1542 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1543 i2c_register_board_info(1, bfin_i2c_board_info1,
1544 ARRAY_SIZE(bfin_i2c_board_info1));
1545 #endif
1547 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
1549 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1551 return 0;
1554 arch_initcall(ezkit_init);
1556 static struct platform_device *ezkit_early_devices[] __initdata = {
1557 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1558 #ifdef CONFIG_SERIAL_BFIN_UART0
1559 &bfin_uart0_device,
1560 #endif
1561 #ifdef CONFIG_SERIAL_BFIN_UART1
1562 &bfin_uart1_device,
1563 #endif
1564 #ifdef CONFIG_SERIAL_BFIN_UART2
1565 &bfin_uart2_device,
1566 #endif
1567 #ifdef CONFIG_SERIAL_BFIN_UART3
1568 &bfin_uart3_device,
1569 #endif
1570 #endif
1572 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1573 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1574 &bfin_sport0_uart_device,
1575 #endif
1576 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1577 &bfin_sport1_uart_device,
1578 #endif
1579 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1580 &bfin_sport2_uart_device,
1581 #endif
1582 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1583 &bfin_sport3_uart_device,
1584 #endif
1585 #endif
1588 void __init native_machine_early_platform_add_devices(void)
1590 printk(KERN_INFO "register early platform devices\n");
1591 early_platform_add_devices(ezkit_early_devices,
1592 ARRAY_SIZE(ezkit_early_devices));