Blackfin: bf548-ezkit/bf561-ezkit: update nor flash layout
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / blackfin / mach-bf548 / boards / ezkit.c
blob0f44becafaa3c1a7cf8ec4ca19b7c4e48c85a3fa
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/portmux.h>
26 #include <asm/bfin_sdh.h>
27 #include <mach/bf54x_keys.h>
28 #include <linux/input.h>
29 #include <linux/spi/ad7877.h>
32 * Name the Board for the /proc/cpuinfo
34 const char bfin_board_name[] = "ADI BF548-EZKIT";
37 * Driver needs to know address, irq and flag pin.
40 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
41 #include <linux/usb/isp1760.h>
42 static struct resource bfin_isp1760_resources[] = {
43 [0] = {
44 .start = 0x2C0C0000,
45 .end = 0x2C0C0000 + 0xfffff,
46 .flags = IORESOURCE_MEM,
48 [1] = {
49 .start = IRQ_PG7,
50 .end = IRQ_PG7,
51 .flags = IORESOURCE_IRQ,
55 static struct isp1760_platform_data isp1760_priv = {
56 .is_isp1761 = 0,
57 .bus_width_16 = 1,
58 .port1_otg = 0,
59 .analog_oc = 0,
60 .dack_polarity_high = 0,
61 .dreq_polarity_high = 0,
64 static struct platform_device bfin_isp1760_device = {
65 .name = "isp1760",
66 .id = 0,
67 .dev = {
68 .platform_data = &isp1760_priv,
70 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
71 .resource = bfin_isp1760_resources,
73 #endif
75 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
77 #include <mach/bf54x-lq043.h>
79 static struct bfin_bf54xfb_mach_info bf54x_lq043_data = {
80 .width = 95,
81 .height = 54,
82 .xres = {480, 480, 480},
83 .yres = {272, 272, 272},
84 .bpp = {24, 24, 24},
85 .disp = GPIO_PE3,
88 static struct resource bf54x_lq043_resources[] = {
90 .start = IRQ_EPPI0_ERR,
91 .end = IRQ_EPPI0_ERR,
92 .flags = IORESOURCE_IRQ,
96 static struct platform_device bf54x_lq043_device = {
97 .name = "bf54x-lq043",
98 .id = -1,
99 .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
100 .resource = bf54x_lq043_resources,
101 .dev = {
102 .platform_data = &bf54x_lq043_data,
105 #endif
107 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
108 static const unsigned int bf548_keymap[] = {
109 KEYVAL(0, 0, KEY_ENTER),
110 KEYVAL(0, 1, KEY_HELP),
111 KEYVAL(0, 2, KEY_0),
112 KEYVAL(0, 3, KEY_BACKSPACE),
113 KEYVAL(1, 0, KEY_TAB),
114 KEYVAL(1, 1, KEY_9),
115 KEYVAL(1, 2, KEY_8),
116 KEYVAL(1, 3, KEY_7),
117 KEYVAL(2, 0, KEY_DOWN),
118 KEYVAL(2, 1, KEY_6),
119 KEYVAL(2, 2, KEY_5),
120 KEYVAL(2, 3, KEY_4),
121 KEYVAL(3, 0, KEY_UP),
122 KEYVAL(3, 1, KEY_3),
123 KEYVAL(3, 2, KEY_2),
124 KEYVAL(3, 3, KEY_1),
127 static struct bfin_kpad_platform_data bf54x_kpad_data = {
128 .rows = 4,
129 .cols = 4,
130 .keymap = bf548_keymap,
131 .keymapsize = ARRAY_SIZE(bf548_keymap),
132 .repeat = 0,
133 .debounce_time = 5000, /* ns (5ms) */
134 .coldrive_time = 1000, /* ns (1ms) */
135 .keyup_test_interval = 50, /* ms (50ms) */
138 static struct resource bf54x_kpad_resources[] = {
140 .start = IRQ_KEY,
141 .end = IRQ_KEY,
142 .flags = IORESOURCE_IRQ,
146 static struct platform_device bf54x_kpad_device = {
147 .name = "bf54x-keys",
148 .id = -1,
149 .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
150 .resource = bf54x_kpad_resources,
151 .dev = {
152 .platform_data = &bf54x_kpad_data,
155 #endif
157 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
158 #include <asm/bfin_rotary.h>
160 static struct bfin_rotary_platform_data bfin_rotary_data = {
161 /*.rotary_up_key = KEY_UP,*/
162 /*.rotary_down_key = KEY_DOWN,*/
163 .rotary_rel_code = REL_WHEEL,
164 .rotary_button_key = KEY_ENTER,
165 .debounce = 10, /* 0..17 */
166 .mode = ROT_QUAD_ENC | ROT_DEBE,
169 static struct resource bfin_rotary_resources[] = {
171 .start = IRQ_CNT,
172 .end = IRQ_CNT,
173 .flags = IORESOURCE_IRQ,
177 static struct platform_device bfin_rotary_device = {
178 .name = "bfin-rotary",
179 .id = -1,
180 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
181 .resource = bfin_rotary_resources,
182 .dev = {
183 .platform_data = &bfin_rotary_data,
186 #endif
188 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
189 #include <linux/input/adxl34x.h>
190 static const struct adxl34x_platform_data adxl34x_info = {
191 .x_axis_offset = 0,
192 .y_axis_offset = 0,
193 .z_axis_offset = 0,
194 .tap_threshold = 0x31,
195 .tap_duration = 0x10,
196 .tap_latency = 0x60,
197 .tap_window = 0xF0,
198 .tap_axis_control = ADXL_TAP_X_EN | ADXL_TAP_Y_EN | ADXL_TAP_Z_EN,
199 .act_axis_control = 0xFF,
200 .activity_threshold = 5,
201 .inactivity_threshold = 3,
202 .inactivity_time = 4,
203 .free_fall_threshold = 0x7,
204 .free_fall_time = 0x20,
205 .data_rate = 0x8,
206 .data_range = ADXL_FULL_RES,
208 .ev_type = EV_ABS,
209 .ev_code_x = ABS_X, /* EV_REL */
210 .ev_code_y = ABS_Y, /* EV_REL */
211 .ev_code_z = ABS_Z, /* EV_REL */
213 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
215 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
216 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
217 .power_mode = ADXL_AUTO_SLEEP | ADXL_LINK,
218 .fifo_mode = ADXL_FIFO_STREAM,
219 .orientation_enable = ADXL_EN_ORIENTATION_3D,
220 .deadzone_angle = ADXL_DEADZONE_ANGLE_10p8,
221 .divisor_length = ADXL_LP_FILTER_DIVISOR_16,
222 /* EV_KEY {+Z, +Y, +X, -X, -Y, -Z} */
223 .ev_codes_orient_3d = {BTN_Z, BTN_Y, BTN_X, BTN_A, BTN_B, BTN_C},
225 #endif
227 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
228 static struct platform_device rtc_device = {
229 .name = "rtc-bfin",
230 .id = -1,
232 #endif
234 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
235 #ifdef CONFIG_SERIAL_BFIN_UART0
236 static struct resource bfin_uart0_resources[] = {
238 .start = UART0_DLL,
239 .end = UART0_RBR+2,
240 .flags = IORESOURCE_MEM,
243 .start = IRQ_UART0_RX,
244 .end = IRQ_UART0_RX+1,
245 .flags = IORESOURCE_IRQ,
248 .start = IRQ_UART0_ERROR,
249 .end = IRQ_UART0_ERROR,
250 .flags = IORESOURCE_IRQ,
253 .start = CH_UART0_TX,
254 .end = CH_UART0_TX,
255 .flags = IORESOURCE_DMA,
258 .start = CH_UART0_RX,
259 .end = CH_UART0_RX,
260 .flags = IORESOURCE_DMA,
264 static unsigned short bfin_uart0_peripherals[] = {
265 P_UART0_TX, P_UART0_RX, 0
268 static struct platform_device bfin_uart0_device = {
269 .name = "bfin-uart",
270 .id = 0,
271 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
272 .resource = bfin_uart0_resources,
273 .dev = {
274 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
277 #endif
278 #ifdef CONFIG_SERIAL_BFIN_UART1
279 static struct resource bfin_uart1_resources[] = {
281 .start = UART1_DLL,
282 .end = UART1_RBR+2,
283 .flags = IORESOURCE_MEM,
286 .start = IRQ_UART1_RX,
287 .end = IRQ_UART1_RX+1,
288 .flags = IORESOURCE_IRQ,
291 .start = IRQ_UART1_ERROR,
292 .end = IRQ_UART1_ERROR,
293 .flags = IORESOURCE_IRQ,
296 .start = CH_UART1_TX,
297 .end = CH_UART1_TX,
298 .flags = IORESOURCE_DMA,
301 .start = CH_UART1_RX,
302 .end = CH_UART1_RX,
303 .flags = IORESOURCE_DMA,
305 #ifdef CONFIG_BFIN_UART1_CTSRTS
306 { /* CTS pin -- 0 means not supported */
307 .start = GPIO_PE10,
308 .end = GPIO_PE10,
309 .flags = IORESOURCE_IO,
311 { /* RTS pin -- 0 means not supported */
312 .start = GPIO_PE9,
313 .end = GPIO_PE9,
314 .flags = IORESOURCE_IO,
316 #endif
319 static unsigned short bfin_uart1_peripherals[] = {
320 P_UART1_TX, P_UART1_RX,
321 #ifdef CONFIG_BFIN_UART1_CTSRTS
322 P_UART1_RTS, P_UART1_CTS,
323 #endif
327 static struct platform_device bfin_uart1_device = {
328 .name = "bfin-uart",
329 .id = 1,
330 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
331 .resource = bfin_uart1_resources,
332 .dev = {
333 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
336 #endif
337 #ifdef CONFIG_SERIAL_BFIN_UART2
338 static struct resource bfin_uart2_resources[] = {
340 .start = UART2_DLL,
341 .end = UART2_RBR+2,
342 .flags = IORESOURCE_MEM,
345 .start = IRQ_UART2_RX,
346 .end = IRQ_UART2_RX+1,
347 .flags = IORESOURCE_IRQ,
350 .start = IRQ_UART2_ERROR,
351 .end = IRQ_UART2_ERROR,
352 .flags = IORESOURCE_IRQ,
355 .start = CH_UART2_TX,
356 .end = CH_UART2_TX,
357 .flags = IORESOURCE_DMA,
360 .start = CH_UART2_RX,
361 .end = CH_UART2_RX,
362 .flags = IORESOURCE_DMA,
366 static unsigned short bfin_uart2_peripherals[] = {
367 P_UART2_TX, P_UART2_RX, 0
370 static struct platform_device bfin_uart2_device = {
371 .name = "bfin-uart",
372 .id = 2,
373 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
374 .resource = bfin_uart2_resources,
375 .dev = {
376 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
379 #endif
380 #ifdef CONFIG_SERIAL_BFIN_UART3
381 static struct resource bfin_uart3_resources[] = {
383 .start = UART3_DLL,
384 .end = UART3_RBR+2,
385 .flags = IORESOURCE_MEM,
388 .start = IRQ_UART3_RX,
389 .end = IRQ_UART3_RX+1,
390 .flags = IORESOURCE_IRQ,
393 .start = IRQ_UART3_ERROR,
394 .end = IRQ_UART3_ERROR,
395 .flags = IORESOURCE_IRQ,
398 .start = CH_UART3_TX,
399 .end = CH_UART3_TX,
400 .flags = IORESOURCE_DMA,
403 .start = CH_UART3_RX,
404 .end = CH_UART3_RX,
405 .flags = IORESOURCE_DMA,
407 #ifdef CONFIG_BFIN_UART3_CTSRTS
408 { /* CTS pin -- 0 means not supported */
409 .start = GPIO_PB3,
410 .end = GPIO_PB3,
411 .flags = IORESOURCE_IO,
413 { /* RTS pin -- 0 means not supported */
414 .start = GPIO_PB2,
415 .end = GPIO_PB2,
416 .flags = IORESOURCE_IO,
418 #endif
421 static unsigned short bfin_uart3_peripherals[] = {
422 P_UART3_TX, P_UART3_RX,
423 #ifdef CONFIG_BFIN_UART3_CTSRTS
424 P_UART3_RTS, P_UART3_CTS,
425 #endif
429 static struct platform_device bfin_uart3_device = {
430 .name = "bfin-uart",
431 .id = 3,
432 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
433 .resource = bfin_uart3_resources,
434 .dev = {
435 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
438 #endif
439 #endif
441 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
442 #ifdef CONFIG_BFIN_SIR0
443 static struct resource bfin_sir0_resources[] = {
445 .start = 0xFFC00400,
446 .end = 0xFFC004FF,
447 .flags = IORESOURCE_MEM,
450 .start = IRQ_UART0_RX,
451 .end = IRQ_UART0_RX+1,
452 .flags = IORESOURCE_IRQ,
455 .start = CH_UART0_RX,
456 .end = CH_UART0_RX+1,
457 .flags = IORESOURCE_DMA,
460 static struct platform_device bfin_sir0_device = {
461 .name = "bfin_sir",
462 .id = 0,
463 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
464 .resource = bfin_sir0_resources,
466 #endif
467 #ifdef CONFIG_BFIN_SIR1
468 static struct resource bfin_sir1_resources[] = {
470 .start = 0xFFC02000,
471 .end = 0xFFC020FF,
472 .flags = IORESOURCE_MEM,
475 .start = IRQ_UART1_RX,
476 .end = IRQ_UART1_RX+1,
477 .flags = IORESOURCE_IRQ,
480 .start = CH_UART1_RX,
481 .end = CH_UART1_RX+1,
482 .flags = IORESOURCE_DMA,
485 static struct platform_device bfin_sir1_device = {
486 .name = "bfin_sir",
487 .id = 1,
488 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
489 .resource = bfin_sir1_resources,
491 #endif
492 #ifdef CONFIG_BFIN_SIR2
493 static struct resource bfin_sir2_resources[] = {
495 .start = 0xFFC02100,
496 .end = 0xFFC021FF,
497 .flags = IORESOURCE_MEM,
500 .start = IRQ_UART2_RX,
501 .end = IRQ_UART2_RX+1,
502 .flags = IORESOURCE_IRQ,
505 .start = CH_UART2_RX,
506 .end = CH_UART2_RX+1,
507 .flags = IORESOURCE_DMA,
510 static struct platform_device bfin_sir2_device = {
511 .name = "bfin_sir",
512 .id = 2,
513 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
514 .resource = bfin_sir2_resources,
516 #endif
517 #ifdef CONFIG_BFIN_SIR3
518 static struct resource bfin_sir3_resources[] = {
520 .start = 0xFFC03100,
521 .end = 0xFFC031FF,
522 .flags = IORESOURCE_MEM,
525 .start = IRQ_UART3_RX,
526 .end = IRQ_UART3_RX+1,
527 .flags = IORESOURCE_IRQ,
530 .start = CH_UART3_RX,
531 .end = CH_UART3_RX+1,
532 .flags = IORESOURCE_DMA,
535 static struct platform_device bfin_sir3_device = {
536 .name = "bfin_sir",
537 .id = 3,
538 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
539 .resource = bfin_sir3_resources,
541 #endif
542 #endif
544 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
545 #include <linux/smsc911x.h>
547 static struct resource smsc911x_resources[] = {
549 .name = "smsc911x-memory",
550 .start = 0x24000000,
551 .end = 0x24000000 + 0xFF,
552 .flags = IORESOURCE_MEM,
555 .start = IRQ_PE8,
556 .end = IRQ_PE8,
557 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
561 static struct smsc911x_platform_config smsc911x_config = {
562 .flags = SMSC911X_USE_32BIT,
563 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
564 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
565 .phy_interface = PHY_INTERFACE_MODE_MII,
568 static struct platform_device smsc911x_device = {
569 .name = "smsc911x",
570 .id = 0,
571 .num_resources = ARRAY_SIZE(smsc911x_resources),
572 .resource = smsc911x_resources,
573 .dev = {
574 .platform_data = &smsc911x_config,
577 #endif
579 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
580 static struct resource musb_resources[] = {
581 [0] = {
582 .start = 0xFFC03C00,
583 .end = 0xFFC040FF,
584 .flags = IORESOURCE_MEM,
586 [1] = { /* general IRQ */
587 .start = IRQ_USB_INT0,
588 .end = IRQ_USB_INT0,
589 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
590 .name = "mc"
592 [2] = { /* DMA IRQ */
593 .start = IRQ_USB_DMA,
594 .end = IRQ_USB_DMA,
595 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
596 .name = "dma"
600 static struct musb_hdrc_config musb_config = {
601 .multipoint = 0,
602 .dyn_fifo = 0,
603 .soft_con = 1,
604 .dma = 1,
605 .num_eps = 8,
606 .dma_channels = 8,
607 .gpio_vrsel = GPIO_PE7,
608 /* Some custom boards need to be active low, just set it to "0"
609 * if it is the case.
611 .gpio_vrsel_active = 1,
612 .clkin = 24, /* musb CLKIN in MHZ */
615 static struct musb_hdrc_platform_data musb_plat = {
616 #if defined(CONFIG_USB_MUSB_OTG)
617 .mode = MUSB_OTG,
618 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
619 .mode = MUSB_HOST,
620 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
621 .mode = MUSB_PERIPHERAL,
622 #endif
623 .config = &musb_config,
626 static u64 musb_dmamask = ~(u32)0;
628 static struct platform_device musb_device = {
629 .name = "musb-blackfin",
630 .id = 0,
631 .dev = {
632 .dma_mask = &musb_dmamask,
633 .coherent_dma_mask = 0xffffffff,
634 .platform_data = &musb_plat,
636 .num_resources = ARRAY_SIZE(musb_resources),
637 .resource = musb_resources,
639 #endif
641 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
642 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
643 static struct resource bfin_sport0_uart_resources[] = {
645 .start = SPORT0_TCR1,
646 .end = SPORT0_MRCS3+4,
647 .flags = IORESOURCE_MEM,
650 .start = IRQ_SPORT0_RX,
651 .end = IRQ_SPORT0_RX+1,
652 .flags = IORESOURCE_IRQ,
655 .start = IRQ_SPORT0_ERROR,
656 .end = IRQ_SPORT0_ERROR,
657 .flags = IORESOURCE_IRQ,
661 static unsigned short bfin_sport0_peripherals[] = {
662 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
663 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
666 static struct platform_device bfin_sport0_uart_device = {
667 .name = "bfin-sport-uart",
668 .id = 0,
669 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
670 .resource = bfin_sport0_uart_resources,
671 .dev = {
672 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
675 #endif
676 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
677 static struct resource bfin_sport1_uart_resources[] = {
679 .start = SPORT1_TCR1,
680 .end = SPORT1_MRCS3+4,
681 .flags = IORESOURCE_MEM,
684 .start = IRQ_SPORT1_RX,
685 .end = IRQ_SPORT1_RX+1,
686 .flags = IORESOURCE_IRQ,
689 .start = IRQ_SPORT1_ERROR,
690 .end = IRQ_SPORT1_ERROR,
691 .flags = IORESOURCE_IRQ,
695 static unsigned short bfin_sport1_peripherals[] = {
696 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
697 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
700 static struct platform_device bfin_sport1_uart_device = {
701 .name = "bfin-sport-uart",
702 .id = 1,
703 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
704 .resource = bfin_sport1_uart_resources,
705 .dev = {
706 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
709 #endif
710 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
711 static struct resource bfin_sport2_uart_resources[] = {
713 .start = SPORT2_TCR1,
714 .end = SPORT2_MRCS3+4,
715 .flags = IORESOURCE_MEM,
718 .start = IRQ_SPORT2_RX,
719 .end = IRQ_SPORT2_RX+1,
720 .flags = IORESOURCE_IRQ,
723 .start = IRQ_SPORT2_ERROR,
724 .end = IRQ_SPORT2_ERROR,
725 .flags = IORESOURCE_IRQ,
729 static unsigned short bfin_sport2_peripherals[] = {
730 P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS,
731 P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0
734 static struct platform_device bfin_sport2_uart_device = {
735 .name = "bfin-sport-uart",
736 .id = 2,
737 .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
738 .resource = bfin_sport2_uart_resources,
739 .dev = {
740 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
743 #endif
744 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
745 static struct resource bfin_sport3_uart_resources[] = {
747 .start = SPORT3_TCR1,
748 .end = SPORT3_MRCS3+4,
749 .flags = IORESOURCE_MEM,
752 .start = IRQ_SPORT3_RX,
753 .end = IRQ_SPORT3_RX+1,
754 .flags = IORESOURCE_IRQ,
757 .start = IRQ_SPORT3_ERROR,
758 .end = IRQ_SPORT3_ERROR,
759 .flags = IORESOURCE_IRQ,
763 static unsigned short bfin_sport3_peripherals[] = {
764 P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS,
765 P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0
768 static struct platform_device bfin_sport3_uart_device = {
769 .name = "bfin-sport-uart",
770 .id = 3,
771 .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
772 .resource = bfin_sport3_uart_resources,
773 .dev = {
774 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
777 #endif
778 #endif
780 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
782 static unsigned short bfin_can0_peripherals[] = {
783 P_CAN0_RX, P_CAN0_TX, 0
786 static struct resource bfin_can0_resources[] = {
788 .start = 0xFFC02A00,
789 .end = 0xFFC02FFF,
790 .flags = IORESOURCE_MEM,
793 .start = IRQ_CAN0_RX,
794 .end = IRQ_CAN0_RX,
795 .flags = IORESOURCE_IRQ,
798 .start = IRQ_CAN0_TX,
799 .end = IRQ_CAN0_TX,
800 .flags = IORESOURCE_IRQ,
803 .start = IRQ_CAN0_ERROR,
804 .end = IRQ_CAN0_ERROR,
805 .flags = IORESOURCE_IRQ,
809 static struct platform_device bfin_can0_device = {
810 .name = "bfin_can",
811 .id = 0,
812 .num_resources = ARRAY_SIZE(bfin_can0_resources),
813 .resource = bfin_can0_resources,
814 .dev = {
815 .platform_data = &bfin_can0_peripherals, /* Passed to driver */
819 static unsigned short bfin_can1_peripherals[] = {
820 P_CAN1_RX, P_CAN1_TX, 0
823 static struct resource bfin_can1_resources[] = {
825 .start = 0xFFC03200,
826 .end = 0xFFC037FF,
827 .flags = IORESOURCE_MEM,
830 .start = IRQ_CAN1_RX,
831 .end = IRQ_CAN1_RX,
832 .flags = IORESOURCE_IRQ,
835 .start = IRQ_CAN1_TX,
836 .end = IRQ_CAN1_TX,
837 .flags = IORESOURCE_IRQ,
840 .start = IRQ_CAN1_ERROR,
841 .end = IRQ_CAN1_ERROR,
842 .flags = IORESOURCE_IRQ,
846 static struct platform_device bfin_can1_device = {
847 .name = "bfin_can",
848 .id = 1,
849 .num_resources = ARRAY_SIZE(bfin_can1_resources),
850 .resource = bfin_can1_resources,
851 .dev = {
852 .platform_data = &bfin_can1_peripherals, /* Passed to driver */
856 #endif
858 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
859 static struct resource bfin_atapi_resources[] = {
861 .start = 0xFFC03800,
862 .end = 0xFFC0386F,
863 .flags = IORESOURCE_MEM,
866 .start = IRQ_ATAPI_ERR,
867 .end = IRQ_ATAPI_ERR,
868 .flags = IORESOURCE_IRQ,
872 static struct platform_device bfin_atapi_device = {
873 .name = "pata-bf54x",
874 .id = -1,
875 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
876 .resource = bfin_atapi_resources,
878 #endif
880 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
881 static struct mtd_partition partition_info[] = {
883 .name = "bootloader(nand)",
884 .offset = 0,
885 .size = 0x80000,
886 }, {
887 .name = "linux kernel(nand)",
888 .offset = MTDPART_OFS_APPEND,
889 .size = 4 * 1024 * 1024,
892 .name = "file system(nand)",
893 .offset = MTDPART_OFS_APPEND,
894 .size = MTDPART_SIZ_FULL,
898 static struct bf5xx_nand_platform bf5xx_nand_platform = {
899 .data_width = NFC_NWIDTH_8,
900 .partitions = partition_info,
901 .nr_partitions = ARRAY_SIZE(partition_info),
902 .rd_dly = 3,
903 .wr_dly = 3,
906 static struct resource bf5xx_nand_resources[] = {
908 .start = 0xFFC03B00,
909 .end = 0xFFC03B4F,
910 .flags = IORESOURCE_MEM,
913 .start = CH_NFC,
914 .end = CH_NFC,
915 .flags = IORESOURCE_IRQ,
919 static struct platform_device bf5xx_nand_device = {
920 .name = "bf5xx-nand",
921 .id = 0,
922 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
923 .resource = bf5xx_nand_resources,
924 .dev = {
925 .platform_data = &bf5xx_nand_platform,
928 #endif
930 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
932 static struct bfin_sd_host bfin_sdh_data = {
933 .dma_chan = CH_SDH,
934 .irq_int0 = IRQ_SDH_MASK0,
935 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
938 static struct platform_device bf54x_sdh_device = {
939 .name = "bfin-sdh",
940 .id = 0,
941 .dev = {
942 .platform_data = &bfin_sdh_data,
945 #endif
947 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
948 static struct mtd_partition ezkit_partitions[] = {
950 .name = "bootloader(nor)",
951 .size = 0x80000,
952 .offset = 0,
953 }, {
954 .name = "linux kernel(nor)",
955 .size = 0x400000,
956 .offset = MTDPART_OFS_APPEND,
957 }, {
958 .name = "file system(nor)",
959 .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4,
960 .offset = MTDPART_OFS_APPEND,
961 }, {
962 .name = "config(nor)",
963 .size = 0x8000 * 3,
964 .offset = MTDPART_OFS_APPEND,
965 }, {
966 .name = "u-boot env(nor)",
967 .size = 0x8000,
968 .offset = MTDPART_OFS_APPEND,
972 static struct physmap_flash_data ezkit_flash_data = {
973 .width = 2,
974 .parts = ezkit_partitions,
975 .nr_parts = ARRAY_SIZE(ezkit_partitions),
978 static struct resource ezkit_flash_resource = {
979 .start = 0x20000000,
980 .end = 0x21ffffff,
981 .flags = IORESOURCE_MEM,
984 static struct platform_device ezkit_flash_device = {
985 .name = "physmap-flash",
986 .id = 0,
987 .dev = {
988 .platform_data = &ezkit_flash_data,
990 .num_resources = 1,
991 .resource = &ezkit_flash_resource,
993 #endif
995 #if defined(CONFIG_MTD_M25P80) \
996 || defined(CONFIG_MTD_M25P80_MODULE)
997 /* SPI flash chip (m25p16) */
998 static struct mtd_partition bfin_spi_flash_partitions[] = {
1000 .name = "bootloader(spi)",
1001 .size = 0x00080000,
1002 .offset = 0,
1003 .mask_flags = MTD_CAP_ROM
1004 }, {
1005 .name = "linux kernel(spi)",
1006 .size = MTDPART_SIZ_FULL,
1007 .offset = MTDPART_OFS_APPEND,
1011 static struct flash_platform_data bfin_spi_flash_data = {
1012 .name = "m25p80",
1013 .parts = bfin_spi_flash_partitions,
1014 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
1015 .type = "m25p16",
1018 static struct bfin5xx_spi_chip spi_flash_chip_info = {
1019 .enable_dma = 0, /* use dma transfer with this chip*/
1020 .bits_per_word = 8,
1022 #endif
1024 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1025 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1026 static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
1027 .enable_dma = 0,
1028 .bits_per_word = 16,
1030 #endif
1032 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1033 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
1034 .enable_dma = 0,
1035 .bits_per_word = 16,
1038 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1039 .model = 7877,
1040 .vref_delay_usecs = 50, /* internal, no capacitor */
1041 .x_plate_ohms = 419,
1042 .y_plate_ohms = 486,
1043 .pressure_max = 1000,
1044 .pressure_min = 0,
1045 .stopacq_polarity = 1,
1046 .first_conversion_delay = 3,
1047 .acquisition_time = 1,
1048 .averaging = 1,
1049 .pen_down_acc_interval = 1,
1051 #endif
1053 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1054 static struct bfin5xx_spi_chip spidev_chip_info = {
1055 .enable_dma = 0,
1056 .bits_per_word = 8,
1058 #endif
1060 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1061 static struct bfin5xx_spi_chip spi_adxl34x_chip_info = {
1062 .enable_dma = 0, /* use dma transfer with this chip*/
1063 .bits_per_word = 8,
1065 #endif
1067 static struct spi_board_info bfin_spi_board_info[] __initdata = {
1068 #if defined(CONFIG_MTD_M25P80) \
1069 || defined(CONFIG_MTD_M25P80_MODULE)
1071 /* the modalias must be the same as spi device driver name */
1072 .modalias = "m25p80", /* Name of spi_driver for this device */
1073 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
1074 .bus_num = 0, /* Framework bus number */
1075 .chip_select = 1, /* SPI_SSEL1*/
1076 .platform_data = &bfin_spi_flash_data,
1077 .controller_data = &spi_flash_chip_info,
1078 .mode = SPI_MODE_3,
1080 #endif
1081 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1082 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1084 .modalias = "ad183x",
1085 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1086 .bus_num = 1,
1087 .chip_select = 4,
1088 .controller_data = &ad1836_spi_chip_info,
1090 #endif
1091 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1093 .modalias = "ad7877",
1094 .platform_data = &bfin_ad7877_ts_info,
1095 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
1096 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
1097 .bus_num = 0,
1098 .chip_select = 2,
1099 .controller_data = &spi_ad7877_chip_info,
1101 #endif
1102 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1104 .modalias = "spidev",
1105 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1106 .bus_num = 0,
1107 .chip_select = 1,
1108 .controller_data = &spidev_chip_info,
1110 #endif
1111 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1113 .modalias = "adxl34x",
1114 .platform_data = &adxl34x_info,
1115 .irq = IRQ_PC5,
1116 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1117 .bus_num = 1,
1118 .chip_select = 2,
1119 .controller_data = &spi_adxl34x_chip_info,
1120 .mode = SPI_MODE_3,
1122 #endif
1124 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1125 /* SPI (0) */
1126 static struct resource bfin_spi0_resource[] = {
1127 [0] = {
1128 .start = SPI0_REGBASE,
1129 .end = SPI0_REGBASE + 0xFF,
1130 .flags = IORESOURCE_MEM,
1132 [1] = {
1133 .start = CH_SPI0,
1134 .end = CH_SPI0,
1135 .flags = IORESOURCE_DMA,
1137 [2] = {
1138 .start = IRQ_SPI0,
1139 .end = IRQ_SPI0,
1140 .flags = IORESOURCE_IRQ,
1144 /* SPI (1) */
1145 static struct resource bfin_spi1_resource[] = {
1146 [0] = {
1147 .start = SPI1_REGBASE,
1148 .end = SPI1_REGBASE + 0xFF,
1149 .flags = IORESOURCE_MEM,
1151 [1] = {
1152 .start = CH_SPI1,
1153 .end = CH_SPI1,
1154 .flags = IORESOURCE_DMA,
1156 [2] = {
1157 .start = IRQ_SPI1,
1158 .end = IRQ_SPI1,
1159 .flags = IORESOURCE_IRQ,
1163 /* SPI controller data */
1164 static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
1165 .num_chipselect = 4,
1166 .enable_dma = 1, /* master has the ability to do dma transfer */
1167 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1170 static struct platform_device bf54x_spi_master0 = {
1171 .name = "bfin-spi",
1172 .id = 0, /* Bus number */
1173 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1174 .resource = bfin_spi0_resource,
1175 .dev = {
1176 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
1180 static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
1181 .num_chipselect = 4,
1182 .enable_dma = 1, /* master has the ability to do dma transfer */
1183 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1186 static struct platform_device bf54x_spi_master1 = {
1187 .name = "bfin-spi",
1188 .id = 1, /* Bus number */
1189 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
1190 .resource = bfin_spi1_resource,
1191 .dev = {
1192 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
1195 #endif /* spi master and devices */
1197 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1198 static struct resource bfin_twi0_resource[] = {
1199 [0] = {
1200 .start = TWI0_REGBASE,
1201 .end = TWI0_REGBASE + 0xFF,
1202 .flags = IORESOURCE_MEM,
1204 [1] = {
1205 .start = IRQ_TWI0,
1206 .end = IRQ_TWI0,
1207 .flags = IORESOURCE_IRQ,
1211 static struct platform_device i2c_bfin_twi0_device = {
1212 .name = "i2c-bfin-twi",
1213 .id = 0,
1214 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1215 .resource = bfin_twi0_resource,
1218 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1219 static struct resource bfin_twi1_resource[] = {
1220 [0] = {
1221 .start = TWI1_REGBASE,
1222 .end = TWI1_REGBASE + 0xFF,
1223 .flags = IORESOURCE_MEM,
1225 [1] = {
1226 .start = IRQ_TWI1,
1227 .end = IRQ_TWI1,
1228 .flags = IORESOURCE_IRQ,
1232 static struct platform_device i2c_bfin_twi1_device = {
1233 .name = "i2c-bfin-twi",
1234 .id = 1,
1235 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
1236 .resource = bfin_twi1_resource,
1238 #endif
1239 #endif
1241 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1244 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1245 static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
1246 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1248 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1250 #endif
1251 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1253 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1254 .irq = 212,
1256 #endif
1257 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1259 I2C_BOARD_INFO("adxl34x", 0x53),
1260 .irq = IRQ_PC5,
1261 .platform_data = (void *)&adxl34x_info,
1263 #endif
1264 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1266 I2C_BOARD_INFO("ad5252", 0x2f),
1268 #endif
1270 #endif
1272 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1273 #include <linux/gpio_keys.h>
1275 static struct gpio_keys_button bfin_gpio_keys_table[] = {
1276 {BTN_0, GPIO_PB8, 1, "gpio-keys: BTN0"},
1277 {BTN_1, GPIO_PB9, 1, "gpio-keys: BTN1"},
1278 {BTN_2, GPIO_PB10, 1, "gpio-keys: BTN2"},
1279 {BTN_3, GPIO_PB11, 1, "gpio-keys: BTN3"},
1282 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
1283 .buttons = bfin_gpio_keys_table,
1284 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
1287 static struct platform_device bfin_device_gpiokeys = {
1288 .name = "gpio-keys",
1289 .dev = {
1290 .platform_data = &bfin_gpio_keys_data,
1293 #endif
1295 static const unsigned int cclk_vlev_datasheet[] =
1298 * Internal VLEV BF54XSBBC1533
1299 ****temporarily using these values until data sheet is updated
1301 VRPAIR(VLEV_085, 150000000),
1302 VRPAIR(VLEV_090, 250000000),
1303 VRPAIR(VLEV_110, 276000000),
1304 VRPAIR(VLEV_115, 301000000),
1305 VRPAIR(VLEV_120, 525000000),
1306 VRPAIR(VLEV_125, 550000000),
1307 VRPAIR(VLEV_130, 600000000),
1310 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
1311 .tuple_tab = cclk_vlev_datasheet,
1312 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
1313 .vr_settling_time = 25 /* us */,
1316 static struct platform_device bfin_dpmc = {
1317 .name = "bfin dpmc",
1318 .dev = {
1319 .platform_data = &bfin_dmpc_vreg_data,
1323 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1324 static struct platform_device bfin_i2s = {
1325 .name = "bfin-i2s",
1326 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1327 /* TODO: add platform data here */
1329 #endif
1331 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1332 static struct platform_device bfin_tdm = {
1333 .name = "bfin-tdm",
1334 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1335 /* TODO: add platform data here */
1337 #endif
1339 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1340 static struct platform_device bfin_ac97 = {
1341 .name = "bfin-ac97",
1342 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1343 /* TODO: add platform data here */
1345 #endif
1347 static struct platform_device *ezkit_devices[] __initdata = {
1349 &bfin_dpmc,
1351 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1352 &rtc_device,
1353 #endif
1355 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1356 #ifdef CONFIG_SERIAL_BFIN_UART0
1357 &bfin_uart0_device,
1358 #endif
1359 #ifdef CONFIG_SERIAL_BFIN_UART1
1360 &bfin_uart1_device,
1361 #endif
1362 #ifdef CONFIG_SERIAL_BFIN_UART2
1363 &bfin_uart2_device,
1364 #endif
1365 #ifdef CONFIG_SERIAL_BFIN_UART3
1366 &bfin_uart3_device,
1367 #endif
1368 #endif
1370 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1371 #ifdef CONFIG_BFIN_SIR0
1372 &bfin_sir0_device,
1373 #endif
1374 #ifdef CONFIG_BFIN_SIR1
1375 &bfin_sir1_device,
1376 #endif
1377 #ifdef CONFIG_BFIN_SIR2
1378 &bfin_sir2_device,
1379 #endif
1380 #ifdef CONFIG_BFIN_SIR3
1381 &bfin_sir3_device,
1382 #endif
1383 #endif
1385 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
1386 &bf54x_lq043_device,
1387 #endif
1389 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
1390 &smsc911x_device,
1391 #endif
1393 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1394 &musb_device,
1395 #endif
1397 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1398 &bfin_isp1760_device,
1399 #endif
1401 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1402 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1403 &bfin_sport0_uart_device,
1404 #endif
1405 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1406 &bfin_sport1_uart_device,
1407 #endif
1408 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1409 &bfin_sport2_uart_device,
1410 #endif
1411 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1412 &bfin_sport3_uart_device,
1413 #endif
1414 #endif
1416 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
1417 &bfin_can0_device,
1418 &bfin_can1_device,
1419 #endif
1421 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
1422 &bfin_atapi_device,
1423 #endif
1425 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1426 &bf5xx_nand_device,
1427 #endif
1429 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
1430 &bf54x_sdh_device,
1431 #endif
1433 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1434 &bf54x_spi_master0,
1435 &bf54x_spi_master1,
1436 #endif
1438 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1439 &bf54x_kpad_device,
1440 #endif
1442 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1443 &bfin_rotary_device,
1444 #endif
1446 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1447 &i2c_bfin_twi0_device,
1448 #if !defined(CONFIG_BF542)
1449 &i2c_bfin_twi1_device,
1450 #endif
1451 #endif
1453 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1454 &bfin_device_gpiokeys,
1455 #endif
1457 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1458 &ezkit_flash_device,
1459 #endif
1461 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1462 &bfin_i2s,
1463 #endif
1465 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1466 &bfin_tdm,
1467 #endif
1469 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1470 &bfin_ac97,
1471 #endif
1474 static int __init ezkit_init(void)
1476 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1478 i2c_register_board_info(0, bfin_i2c_board_info0,
1479 ARRAY_SIZE(bfin_i2c_board_info0));
1480 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1481 i2c_register_board_info(1, bfin_i2c_board_info1,
1482 ARRAY_SIZE(bfin_i2c_board_info1));
1483 #endif
1485 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
1487 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1489 return 0;
1492 arch_initcall(ezkit_init);
1494 static struct platform_device *ezkit_early_devices[] __initdata = {
1495 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1496 #ifdef CONFIG_SERIAL_BFIN_UART0
1497 &bfin_uart0_device,
1498 #endif
1499 #ifdef CONFIG_SERIAL_BFIN_UART1
1500 &bfin_uart1_device,
1501 #endif
1502 #ifdef CONFIG_SERIAL_BFIN_UART2
1503 &bfin_uart2_device,
1504 #endif
1505 #ifdef CONFIG_SERIAL_BFIN_UART3
1506 &bfin_uart3_device,
1507 #endif
1508 #endif
1510 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1511 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1512 &bfin_sport0_uart_device,
1513 #endif
1514 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1515 &bfin_sport1_uart_device,
1516 #endif
1517 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1518 &bfin_sport2_uart_device,
1519 #endif
1520 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1521 &bfin_sport3_uart_device,
1522 #endif
1523 #endif
1526 void __init native_machine_early_platform_add_devices(void)
1528 printk(KERN_INFO "register early platform devices\n");
1529 early_platform_add_devices(ezkit_early_devices,
1530 ARRAY_SIZE(ezkit_early_devices));