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.
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>
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[] = {
46 .end = 0x2C0C0000 + 0xfffff,
47 .flags = IORESOURCE_MEM,
52 .flags = IORESOURCE_IRQ,
56 static struct isp1760_platform_data isp1760_priv = {
61 .dack_polarity_high = 0,
62 .dreq_polarity_high = 0,
65 static struct platform_device bfin_isp1760_device = {
69 .platform_data = &isp1760_priv,
71 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
72 .resource = bfin_isp1760_resources,
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 = {
83 .xres = {480, 480, 480},
84 .yres = {272, 272, 272},
89 static struct resource bf54x_lq043_resources[] = {
91 .start = IRQ_EPPI0_ERR,
93 .flags = IORESOURCE_IRQ,
97 static struct platform_device bf54x_lq043_device = {
98 .name = "bf54x-lq043",
100 .num_resources = ARRAY_SIZE(bf54x_lq043_resources),
101 .resource = bf54x_lq043_resources,
103 .platform_data = &bf54x_lq043_data,
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),
113 KEYVAL(0, 3, KEY_BACKSPACE),
114 KEYVAL(1, 0, KEY_TAB),
118 KEYVAL(2, 0, KEY_DOWN),
122 KEYVAL(3, 0, KEY_UP),
128 static struct bfin_kpad_platform_data bf54x_kpad_data = {
131 .keymap = bf548_keymap,
132 .keymapsize = ARRAY_SIZE(bf548_keymap),
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[] = {
143 .flags = IORESOURCE_IRQ,
147 static struct platform_device bf54x_kpad_device = {
148 .name = "bf54x-keys",
150 .num_resources = ARRAY_SIZE(bf54x_kpad_resources),
151 .resource = bf54x_kpad_resources,
153 .platform_data = &bf54x_kpad_data,
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,
171 static struct resource bfin_rotary_resources[] = {
175 .flags = IORESOURCE_IRQ,
179 static struct platform_device bfin_rotary_device = {
180 .name = "bfin-rotary",
182 .num_resources = ARRAY_SIZE(bfin_rotary_resources),
183 .resource = bfin_rotary_resources,
185 .platform_data = &bfin_rotary_data,
190 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
191 #include <linux/input/adxl34x.h>
192 static const struct adxl34x_platform_data adxl34x_info = {
196 .tap_threshold = 0x31,
197 .tap_duration = 0x10,
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,
208 .data_range = ADXL_FULL_RES,
211 .ev_code_x = ABS_X, /* EV_REL */
212 .ev_code_y = ABS_Y, /* EV_REL */
213 .ev_code_z = ABS_Z, /* EV_REL */
215 .ev_code_tap = {BTN_TOUCH, BTN_TOUCH, BTN_TOUCH}, /* EV_KEY x,y,z */
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,
221 .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},
229 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
230 static struct platform_device rtc_device = {
236 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
237 #ifdef CONFIG_SERIAL_BFIN_UART0
238 static struct resource bfin_uart0_resources[] = {
242 .flags = IORESOURCE_MEM,
245 .start = IRQ_UART0_TX,
247 .flags = IORESOURCE_IRQ,
250 .start = IRQ_UART0_RX,
252 .flags = IORESOURCE_IRQ,
255 .start = IRQ_UART0_ERROR,
256 .end = IRQ_UART0_ERROR,
257 .flags = IORESOURCE_IRQ,
260 .start = CH_UART0_TX,
262 .flags = IORESOURCE_DMA,
265 .start = CH_UART0_RX,
267 .flags = IORESOURCE_DMA,
271 static unsigned short bfin_uart0_peripherals[] = {
272 P_UART0_TX, P_UART0_RX, 0
275 static struct platform_device bfin_uart0_device = {
278 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
279 .resource = bfin_uart0_resources,
281 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
285 #ifdef CONFIG_SERIAL_BFIN_UART1
286 static struct resource bfin_uart1_resources[] = {
290 .flags = IORESOURCE_MEM,
293 .start = IRQ_UART1_TX,
295 .flags = IORESOURCE_IRQ,
298 .start = IRQ_UART1_RX,
300 .flags = IORESOURCE_IRQ,
303 .start = IRQ_UART1_ERROR,
304 .end = IRQ_UART1_ERROR,
305 .flags = IORESOURCE_IRQ,
308 .start = CH_UART1_TX,
310 .flags = IORESOURCE_DMA,
313 .start = CH_UART1_RX,
315 .flags = IORESOURCE_DMA,
317 #ifdef CONFIG_BFIN_UART1_CTSRTS
318 { /* CTS pin -- 0 means not supported */
321 .flags = IORESOURCE_IO,
323 { /* RTS pin -- 0 means not supported */
326 .flags = IORESOURCE_IO,
331 static unsigned short bfin_uart1_peripherals[] = {
332 P_UART1_TX, P_UART1_RX,
333 #ifdef CONFIG_BFIN_UART1_CTSRTS
334 P_UART1_RTS, P_UART1_CTS,
339 static struct platform_device bfin_uart1_device = {
342 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
343 .resource = bfin_uart1_resources,
345 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
349 #ifdef CONFIG_SERIAL_BFIN_UART2
350 static struct resource bfin_uart2_resources[] = {
354 .flags = IORESOURCE_MEM,
357 .start = IRQ_UART2_TX,
359 .flags = IORESOURCE_IRQ,
362 .start = IRQ_UART2_RX,
364 .flags = IORESOURCE_IRQ,
367 .start = IRQ_UART2_ERROR,
368 .end = IRQ_UART2_ERROR,
369 .flags = IORESOURCE_IRQ,
372 .start = CH_UART2_TX,
374 .flags = IORESOURCE_DMA,
377 .start = CH_UART2_RX,
379 .flags = IORESOURCE_DMA,
383 static unsigned short bfin_uart2_peripherals[] = {
384 P_UART2_TX, P_UART2_RX, 0
387 static struct platform_device bfin_uart2_device = {
390 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
391 .resource = bfin_uart2_resources,
393 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
397 #ifdef CONFIG_SERIAL_BFIN_UART3
398 static struct resource bfin_uart3_resources[] = {
402 .flags = IORESOURCE_MEM,
405 .start = IRQ_UART3_TX,
407 .flags = IORESOURCE_IRQ,
410 .start = IRQ_UART3_RX,
412 .flags = IORESOURCE_IRQ,
415 .start = IRQ_UART3_ERROR,
416 .end = IRQ_UART3_ERROR,
417 .flags = IORESOURCE_IRQ,
420 .start = CH_UART3_TX,
422 .flags = IORESOURCE_DMA,
425 .start = CH_UART3_RX,
427 .flags = IORESOURCE_DMA,
429 #ifdef CONFIG_BFIN_UART3_CTSRTS
430 { /* CTS pin -- 0 means not supported */
433 .flags = IORESOURCE_IO,
435 { /* RTS pin -- 0 means not supported */
438 .flags = IORESOURCE_IO,
443 static unsigned short bfin_uart3_peripherals[] = {
444 P_UART3_TX, P_UART3_RX,
445 #ifdef CONFIG_BFIN_UART3_CTSRTS
446 P_UART3_RTS, P_UART3_CTS,
451 static struct platform_device bfin_uart3_device = {
454 .num_resources = ARRAY_SIZE(bfin_uart3_resources),
455 .resource = bfin_uart3_resources,
457 .platform_data = &bfin_uart3_peripherals, /* Passed to driver */
463 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
464 #ifdef CONFIG_BFIN_SIR0
465 static struct resource bfin_sir0_resources[] = {
469 .flags = IORESOURCE_MEM,
472 .start = IRQ_UART0_RX,
473 .end = IRQ_UART0_RX+1,
474 .flags = IORESOURCE_IRQ,
477 .start = CH_UART0_RX,
478 .end = CH_UART0_RX+1,
479 .flags = IORESOURCE_DMA,
482 static struct platform_device bfin_sir0_device = {
485 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
486 .resource = bfin_sir0_resources,
489 #ifdef CONFIG_BFIN_SIR1
490 static struct resource bfin_sir1_resources[] = {
494 .flags = IORESOURCE_MEM,
497 .start = IRQ_UART1_RX,
498 .end = IRQ_UART1_RX+1,
499 .flags = IORESOURCE_IRQ,
502 .start = CH_UART1_RX,
503 .end = CH_UART1_RX+1,
504 .flags = IORESOURCE_DMA,
507 static struct platform_device bfin_sir1_device = {
510 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
511 .resource = bfin_sir1_resources,
514 #ifdef CONFIG_BFIN_SIR2
515 static struct resource bfin_sir2_resources[] = {
519 .flags = IORESOURCE_MEM,
522 .start = IRQ_UART2_RX,
523 .end = IRQ_UART2_RX+1,
524 .flags = IORESOURCE_IRQ,
527 .start = CH_UART2_RX,
528 .end = CH_UART2_RX+1,
529 .flags = IORESOURCE_DMA,
532 static struct platform_device bfin_sir2_device = {
535 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
536 .resource = bfin_sir2_resources,
539 #ifdef CONFIG_BFIN_SIR3
540 static struct resource bfin_sir3_resources[] = {
544 .flags = IORESOURCE_MEM,
547 .start = IRQ_UART3_RX,
548 .end = IRQ_UART3_RX+1,
549 .flags = IORESOURCE_IRQ,
552 .start = CH_UART3_RX,
553 .end = CH_UART3_RX+1,
554 .flags = IORESOURCE_DMA,
557 static struct platform_device bfin_sir3_device = {
560 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
561 .resource = bfin_sir3_resources,
566 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
567 #include <linux/smsc911x.h>
569 static struct resource smsc911x_resources[] = {
571 .name = "smsc911x-memory",
573 .end = 0x24000000 + 0xFF,
574 .flags = IORESOURCE_MEM,
579 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
583 static 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,
590 static struct platform_device smsc911x_device = {
593 .num_resources = ARRAY_SIZE(smsc911x_resources),
594 .resource = smsc911x_resources,
596 .platform_data = &smsc911x_config,
601 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
602 static struct resource musb_resources[] = {
606 .flags = IORESOURCE_MEM,
608 [1] = { /* general IRQ */
609 .start = IRQ_USB_INT0,
611 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
614 [2] = { /* DMA IRQ */
615 .start = IRQ_USB_DMA,
617 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
622 static struct musb_hdrc_config musb_config = {
629 .gpio_vrsel = GPIO_PE7,
630 /* Some custom boards need to be active low, just set it to "0"
633 .gpio_vrsel_active = 1,
634 .clkin = 24, /* musb CLKIN in MHZ */
637 static struct musb_hdrc_platform_data musb_plat = {
638 #if defined(CONFIG_USB_MUSB_HDRC) && defined(CONFIG_USB_GADGET_MUSB_HDRC)
640 #elif defined(CONFIG_USB_MUSB_HDRC)
642 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
643 .mode = MUSB_PERIPHERAL,
645 .config = &musb_config,
648 static u64 musb_dmamask = ~(u32)0;
650 static struct platform_device musb_device = {
651 .name = "musb-blackfin",
654 .dma_mask = &musb_dmamask,
655 .coherent_dma_mask = 0xffffffff,
656 .platform_data = &musb_plat,
658 .num_resources = ARRAY_SIZE(musb_resources),
659 .resource = musb_resources,
663 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
664 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
665 static struct resource bfin_sport0_uart_resources[] = {
667 .start = SPORT0_TCR1,
668 .end = SPORT0_MRCS3+4,
669 .flags = IORESOURCE_MEM,
672 .start = IRQ_SPORT0_RX,
673 .end = IRQ_SPORT0_RX+1,
674 .flags = IORESOURCE_IRQ,
677 .start = IRQ_SPORT0_ERROR,
678 .end = IRQ_SPORT0_ERROR,
679 .flags = IORESOURCE_IRQ,
683 static unsigned short bfin_sport0_peripherals[] = {
684 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
685 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
688 static struct platform_device bfin_sport0_uart_device = {
689 .name = "bfin-sport-uart",
691 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
692 .resource = bfin_sport0_uart_resources,
694 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
698 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
699 static struct resource bfin_sport1_uart_resources[] = {
701 .start = SPORT1_TCR1,
702 .end = SPORT1_MRCS3+4,
703 .flags = IORESOURCE_MEM,
706 .start = IRQ_SPORT1_RX,
707 .end = IRQ_SPORT1_RX+1,
708 .flags = IORESOURCE_IRQ,
711 .start = IRQ_SPORT1_ERROR,
712 .end = IRQ_SPORT1_ERROR,
713 .flags = IORESOURCE_IRQ,
717 static unsigned short bfin_sport1_peripherals[] = {
718 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
719 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
722 static struct platform_device bfin_sport1_uart_device = {
723 .name = "bfin-sport-uart",
725 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
726 .resource = bfin_sport1_uart_resources,
728 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
732 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
733 static struct resource bfin_sport2_uart_resources[] = {
735 .start = SPORT2_TCR1,
736 .end = SPORT2_MRCS3+4,
737 .flags = IORESOURCE_MEM,
740 .start = IRQ_SPORT2_RX,
741 .end = IRQ_SPORT2_RX+1,
742 .flags = IORESOURCE_IRQ,
745 .start = IRQ_SPORT2_ERROR,
746 .end = IRQ_SPORT2_ERROR,
747 .flags = IORESOURCE_IRQ,
751 static unsigned short bfin_sport2_peripherals[] = {
752 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
756 static struct platform_device bfin_sport2_uart_device = {
757 .name = "bfin-sport-uart",
759 .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources),
760 .resource = bfin_sport2_uart_resources,
762 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
766 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
767 static struct resource bfin_sport3_uart_resources[] = {
769 .start = SPORT3_TCR1,
770 .end = SPORT3_MRCS3+4,
771 .flags = IORESOURCE_MEM,
774 .start = IRQ_SPORT3_RX,
775 .end = IRQ_SPORT3_RX+1,
776 .flags = IORESOURCE_IRQ,
779 .start = IRQ_SPORT3_ERROR,
780 .end = IRQ_SPORT3_ERROR,
781 .flags = IORESOURCE_IRQ,
785 static unsigned short bfin_sport3_peripherals[] = {
786 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
790 static struct platform_device bfin_sport3_uart_device = {
791 .name = "bfin-sport-uart",
793 .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources),
794 .resource = bfin_sport3_uart_resources,
796 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
802 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
804 static unsigned short bfin_can0_peripherals[] = {
805 P_CAN0_RX, P_CAN0_TX, 0
808 static struct resource bfin_can0_resources[] = {
812 .flags = IORESOURCE_MEM,
815 .start = IRQ_CAN0_RX,
817 .flags = IORESOURCE_IRQ,
820 .start = IRQ_CAN0_TX,
822 .flags = IORESOURCE_IRQ,
825 .start = IRQ_CAN0_ERROR,
826 .end = IRQ_CAN0_ERROR,
827 .flags = IORESOURCE_IRQ,
831 static struct platform_device bfin_can0_device = {
834 .num_resources = ARRAY_SIZE(bfin_can0_resources),
835 .resource = bfin_can0_resources,
837 .platform_data = &bfin_can0_peripherals, /* Passed to driver */
841 static unsigned short bfin_can1_peripherals[] = {
842 P_CAN1_RX, P_CAN1_TX, 0
845 static struct resource bfin_can1_resources[] = {
849 .flags = IORESOURCE_MEM,
852 .start = IRQ_CAN1_RX,
854 .flags = IORESOURCE_IRQ,
857 .start = IRQ_CAN1_TX,
859 .flags = IORESOURCE_IRQ,
862 .start = IRQ_CAN1_ERROR,
863 .end = IRQ_CAN1_ERROR,
864 .flags = IORESOURCE_IRQ,
868 static struct platform_device bfin_can1_device = {
871 .num_resources = ARRAY_SIZE(bfin_can1_resources),
872 .resource = bfin_can1_resources,
874 .platform_data = &bfin_can1_peripherals, /* Passed to driver */
880 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
881 static struct resource bfin_atapi_resources[] = {
885 .flags = IORESOURCE_MEM,
888 .start = IRQ_ATAPI_ERR,
889 .end = IRQ_ATAPI_ERR,
890 .flags = IORESOURCE_IRQ,
894 static struct platform_device bfin_atapi_device = {
895 .name = "pata-bf54x",
897 .num_resources = ARRAY_SIZE(bfin_atapi_resources),
898 .resource = bfin_atapi_resources,
902 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
903 static struct mtd_partition partition_info[] = {
905 .name = "bootloader(nand)",
909 .name = "linux kernel(nand)",
910 .offset = MTDPART_OFS_APPEND,
911 .size = 4 * 1024 * 1024,
914 .name = "file system(nand)",
915 .offset = MTDPART_OFS_APPEND,
916 .size = MTDPART_SIZ_FULL,
920 static struct bf5xx_nand_platform bf5xx_nand_platform = {
921 .data_width = NFC_NWIDTH_8,
922 .partitions = partition_info,
923 .nr_partitions = ARRAY_SIZE(partition_info),
928 static struct resource bf5xx_nand_resources[] = {
932 .flags = IORESOURCE_MEM,
937 .flags = IORESOURCE_IRQ,
941 static struct platform_device bf5xx_nand_device = {
942 .name = "bf5xx-nand",
944 .num_resources = ARRAY_SIZE(bf5xx_nand_resources),
945 .resource = bf5xx_nand_resources,
947 .platform_data = &bf5xx_nand_platform,
952 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
954 static struct bfin_sd_host bfin_sdh_data = {
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},
960 static struct platform_device bf54x_sdh_device = {
964 .platform_data = &bfin_sdh_data,
969 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
970 static struct mtd_partition ezkit_partitions[] = {
972 .name = "bootloader(nor)",
976 .name = "linux kernel(nor)",
978 .offset = MTDPART_OFS_APPEND,
980 .name = "file system(nor)",
981 .size = 0x1000000 - 0x80000 - 0x400000 - 0x8000 * 4,
982 .offset = MTDPART_OFS_APPEND,
984 .name = "config(nor)",
986 .offset = MTDPART_OFS_APPEND,
988 .name = "u-boot env(nor)",
990 .offset = MTDPART_OFS_APPEND,
994 static struct physmap_flash_data ezkit_flash_data = {
996 .parts = ezkit_partitions,
997 .nr_parts = ARRAY_SIZE(ezkit_partitions),
1000 static struct resource ezkit_flash_resource = {
1001 .start = 0x20000000,
1003 .flags = IORESOURCE_MEM,
1006 static struct platform_device ezkit_flash_device = {
1007 .name = "physmap-flash",
1010 .platform_data = &ezkit_flash_data,
1013 .resource = &ezkit_flash_resource,
1017 #if defined(CONFIG_MTD_M25P80) \
1018 || defined(CONFIG_MTD_M25P80_MODULE)
1019 /* SPI flash chip (m25p16) */
1020 static struct mtd_partition bfin_spi_flash_partitions[] = {
1022 .name = "bootloader(spi)",
1025 .mask_flags = MTD_CAP_ROM
1027 .name = "linux kernel(spi)",
1028 .size = MTDPART_SIZ_FULL,
1029 .offset = MTDPART_OFS_APPEND,
1033 static struct flash_platform_data bfin_spi_flash_data = {
1035 .parts = bfin_spi_flash_partitions,
1036 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
1040 static struct bfin5xx_spi_chip spi_flash_chip_info = {
1041 .enable_dma = 0, /* use dma transfer with this chip*/
1045 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
1046 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
1048 .vref_delay_usecs = 50, /* internal, no capacitor */
1049 .x_plate_ohms = 419,
1050 .y_plate_ohms = 486,
1051 .pressure_max = 1000,
1053 .stopacq_polarity = 1,
1054 .first_conversion_delay = 3,
1055 .acquisition_time = 1,
1057 .pen_down_acc_interval = 1,
1061 static struct spi_board_info bfin_spi_board_info[] __initdata = {
1062 #if defined(CONFIG_MTD_M25P80) \
1063 || defined(CONFIG_MTD_M25P80_MODULE)
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,
1075 #if defined(CONFIG_SND_BF5XX_SOC_AD183X) \
1076 || defined(CONFIG_SND_BF5XX_SOC_AD183X_MODULE)
1078 .modalias = "ad183x",
1079 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1084 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
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 */
1094 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
1096 .modalias = "spidev",
1097 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
1102 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1104 .modalias = "adxl34x",
1105 .platform_data = &adxl34x_info,
1107 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
1114 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
1116 static struct resource bfin_spi0_resource[] = {
1118 .start = SPI0_REGBASE,
1119 .end = SPI0_REGBASE + 0xFF,
1120 .flags = IORESOURCE_MEM,
1125 .flags = IORESOURCE_DMA,
1130 .flags = IORESOURCE_IRQ,
1135 static struct resource bfin_spi1_resource[] = {
1137 .start = SPI1_REGBASE,
1138 .end = SPI1_REGBASE + 0xFF,
1139 .flags = IORESOURCE_MEM,
1144 .flags = IORESOURCE_DMA,
1149 .flags = IORESOURCE_IRQ,
1153 /* SPI controller data */
1154 static struct bfin5xx_spi_master bf54x_spi_master_info0 = {
1155 .num_chipselect = 4,
1156 .enable_dma = 1, /* master has the ability to do dma transfer */
1157 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
1160 static struct platform_device bf54x_spi_master0 = {
1162 .id = 0, /* Bus number */
1163 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
1164 .resource = bfin_spi0_resource,
1166 .platform_data = &bf54x_spi_master_info0, /* Passed to driver */
1170 static struct bfin5xx_spi_master bf54x_spi_master_info1 = {
1171 .num_chipselect = 4,
1172 .enable_dma = 1, /* master has the ability to do dma transfer */
1173 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
1176 static struct platform_device bf54x_spi_master1 = {
1178 .id = 1, /* Bus number */
1179 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
1180 .resource = bfin_spi1_resource,
1182 .platform_data = &bf54x_spi_master_info1, /* Passed to driver */
1185 #endif /* spi master and devices */
1187 #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>
1193 static 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,
1200 static const struct ppi_info ppi_info = {
1201 .type = PPI_TYPE_EPPI,
1203 .irq_err = IRQ_EPPI1_ERROR,
1204 .base = (void __iomem *)EPPI1_STATUS,
1208 #if defined(CONFIG_VIDEO_VS6624) \
1209 || defined(CONFIG_VIDEO_VS6624_MODULE)
1210 static struct v4l2_input vs6624_inputs[] = {
1214 .type = V4L2_INPUT_TYPE_CAMERA,
1215 .std = V4L2_STD_UNKNOWN,
1219 static struct bcap_route vs6624_routes[] = {
1226 static const unsigned vs6624_ce_pin = GPIO_PG6;
1228 static 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,
1237 .platform_data = (void *)&vs6624_ce_pin,
1239 .ppi_info = &ppi_info,
1240 .ppi_control = (POLC | PACKEN | DLEN_8 | XFR_TYPE | 0x20),
1241 .int_mask = 0xFFFFFFFF, /* disable error interrupt on eppi */
1242 .blank_clocks = 8, /* 8 clocks as SAV and EAV */
1246 static struct platform_device bfin_capture_device = {
1247 .name = "bfin_capture",
1249 .platform_data = &bfin_capture_data,
1254 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1255 static const u16 bfin_twi0_pins[] = {P_TWI0_SCL, P_TWI0_SDA, 0};
1257 static struct resource bfin_twi0_resource[] = {
1259 .start = TWI0_REGBASE,
1260 .end = TWI0_REGBASE + 0xFF,
1261 .flags = IORESOURCE_MEM,
1266 .flags = IORESOURCE_IRQ,
1270 static struct platform_device i2c_bfin_twi0_device = {
1271 .name = "i2c-bfin-twi",
1273 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
1274 .resource = bfin_twi0_resource,
1276 .platform_data = &bfin_twi0_pins,
1280 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1281 static const u16 bfin_twi1_pins[] = {P_TWI1_SCL, P_TWI1_SDA, 0};
1283 static struct resource bfin_twi1_resource[] = {
1285 .start = TWI1_REGBASE,
1286 .end = TWI1_REGBASE + 0xFF,
1287 .flags = IORESOURCE_MEM,
1292 .flags = IORESOURCE_IRQ,
1296 static struct platform_device i2c_bfin_twi1_device = {
1297 .name = "i2c-bfin-twi",
1299 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
1300 .resource = bfin_twi1_resource,
1302 .platform_data = &bfin_twi1_pins,
1308 static struct i2c_board_info __initdata bfin_i2c_board_info0[] = {
1309 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1311 I2C_BOARD_INFO("ssm2602", 0x1b),
1316 #if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
1317 static struct i2c_board_info __initdata bfin_i2c_board_info1[] = {
1318 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1320 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1323 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1325 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1329 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1331 I2C_BOARD_INFO("adxl34x", 0x53),
1333 .platform_data = (void *)&adxl34x_info,
1336 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1338 I2C_BOARD_INFO("ad5252", 0x2f),
1344 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1345 #include <linux/gpio_keys.h>
1347 static 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"},
1354 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
1355 .buttons = bfin_gpio_keys_table,
1356 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
1359 static struct platform_device bfin_device_gpiokeys = {
1360 .name = "gpio-keys",
1362 .platform_data = &bfin_gpio_keys_data,
1367 static const unsigned int cclk_vlev_datasheet[] =
1370 * Internal VLEV BF54XSBBC1533
1371 ****temporarily using these values until data sheet is updated
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),
1382 static 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 */,
1388 static struct platform_device bfin_dpmc = {
1389 .name = "bfin dpmc",
1391 .platform_data = &bfin_dmpc_vreg_data,
1395 #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)
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}
1403 static const u16 bfin_snd_pin[][7] = {
1410 static struct bfin_snd_platform_data bfin_snd_data[] = {
1412 .pin_req = &bfin_snd_pin[0][0],
1415 .pin_req = &bfin_snd_pin[1][0],
1418 .pin_req = &bfin_snd_pin[2][0],
1421 .pin_req = &bfin_snd_pin[3][0],
1425 #define BFIN_SND_RES(x) \
1428 .start = SPORT##x##_TCR1, \
1429 .end = SPORT##x##_TCR1, \
1430 .flags = IORESOURCE_MEM \
1433 .start = CH_SPORT##x##_RX, \
1434 .end = CH_SPORT##x##_RX, \
1435 .flags = IORESOURCE_DMA, \
1438 .start = CH_SPORT##x##_TX, \
1439 .end = CH_SPORT##x##_TX, \
1440 .flags = IORESOURCE_DMA, \
1443 .start = IRQ_SPORT##x##_ERROR, \
1444 .end = IRQ_SPORT##x##_ERROR, \
1445 .flags = IORESOURCE_IRQ, \
1449 static struct resource bfin_snd_resources[][4] = {
1457 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1458 static struct platform_device bfin_i2s_pcm = {
1459 .name = "bfin-i2s-pcm-audio",
1464 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1465 static struct platform_device bfin_tdm_pcm = {
1466 .name = "bfin-tdm-pcm-audio",
1471 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1472 static struct platform_device bfin_ac97_pcm = {
1473 .name = "bfin-ac97-pcm-audio",
1478 #if defined(CONFIG_SND_BF5XX_SOC_AD73311) || defined(CONFIG_SND_BF5XX_SOC_AD73311_MODULE)
1479 static struct platform_device bfin_ad73311_codec_device = {
1485 #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1486 static struct platform_device bfin_ad1980_codec_device = {
1492 #if defined(CONFIG_SND_BF5XX_SOC_I2S) || defined(CONFIG_SND_BF5XX_SOC_I2S_MODULE)
1493 static struct platform_device bfin_i2s = {
1495 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1496 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1497 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1499 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1504 #if defined(CONFIG_SND_BF5XX_SOC_TDM) || defined(CONFIG_SND_BF5XX_SOC_TDM_MODULE)
1505 static struct platform_device bfin_tdm = {
1507 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1508 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1509 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1511 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1516 #if defined(CONFIG_SND_BF5XX_SOC_AC97) || defined(CONFIG_SND_BF5XX_SOC_AC97_MODULE)
1517 static struct platform_device bfin_ac97 = {
1518 .name = "bfin-ac97",
1519 .id = CONFIG_SND_BF5XX_SPORT_NUM,
1520 .num_resources = ARRAY_SIZE(bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM]),
1521 .resource = bfin_snd_resources[CONFIG_SND_BF5XX_SPORT_NUM],
1523 .platform_data = &bfin_snd_data[CONFIG_SND_BF5XX_SPORT_NUM],
1528 static struct platform_device *ezkit_devices[] __initdata = {
1532 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1536 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1537 #ifdef CONFIG_SERIAL_BFIN_UART0
1540 #ifdef CONFIG_SERIAL_BFIN_UART1
1543 #ifdef CONFIG_SERIAL_BFIN_UART2
1546 #ifdef CONFIG_SERIAL_BFIN_UART3
1551 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1552 #ifdef CONFIG_BFIN_SIR0
1555 #ifdef CONFIG_BFIN_SIR1
1558 #ifdef CONFIG_BFIN_SIR2
1561 #ifdef CONFIG_BFIN_SIR3
1566 #if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
1567 &bf54x_lq043_device,
1570 #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
1574 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
1578 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1579 &bfin_isp1760_device,
1582 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1583 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1584 &bfin_sport0_uart_device,
1586 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1587 &bfin_sport1_uart_device,
1589 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1590 &bfin_sport2_uart_device,
1592 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1593 &bfin_sport3_uart_device,
1597 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
1602 #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
1606 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
1610 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
1614 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
1618 #if defined(CONFIG_VIDEO_BLACKFIN_CAPTURE) \
1619 || defined(CONFIG_VIDEO_BLACKFIN_CAPTURE_MODULE)
1620 &bfin_capture_device,
1623 #if defined(CONFIG_KEYBOARD_BFIN) || defined(CONFIG_KEYBOARD_BFIN_MODULE)
1627 #if defined(CONFIG_INPUT_BFIN_ROTARY) || defined(CONFIG_INPUT_BFIN_ROTARY_MODULE)
1628 &bfin_rotary_device,
1631 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1632 &i2c_bfin_twi0_device,
1633 #if !defined(CONFIG_BF542)
1634 &i2c_bfin_twi1_device,
1638 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1639 &bfin_device_gpiokeys,
1642 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1643 &ezkit_flash_device,
1646 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1649 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1652 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1656 #if defined(CONFIG_SND_BF5XX_SOC_AD1980) || defined(CONFIG_SND_BF5XX_SOC_AD1980_MODULE)
1657 &bfin_ad1980_codec_device,
1660 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
1664 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1668 #if defined(CONFIG_SND_BF5XX_AC97) || defined(CONFIG_SND_BF5XX_AC97_MODULE)
1673 static int __init ezkit_init(void)
1675 printk(KERN_INFO "%s(): registering device resources\n", __func__);
1677 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));
1684 platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices));
1686 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
1691 arch_initcall(ezkit_init);
1693 static struct platform_device *ezkit_early_devices[] __initdata = {
1694 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1695 #ifdef CONFIG_SERIAL_BFIN_UART0
1698 #ifdef CONFIG_SERIAL_BFIN_UART1
1701 #ifdef CONFIG_SERIAL_BFIN_UART2
1704 #ifdef CONFIG_SERIAL_BFIN_UART3
1709 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1710 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1711 &bfin_sport0_uart_device,
1713 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1714 &bfin_sport1_uart_device,
1716 #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
1717 &bfin_sport2_uart_device,
1719 #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
1720 &bfin_sport3_uart_device,
1725 void __init native_machine_early_platform_add_devices(void)
1727 printk(KERN_INFO "register early platform devices\n");
1728 early_platform_add_devices(ezkit_early_devices,
1729 ARRAY_SIZE(ezkit_early_devices));