Add linux-next specific files for 20110426
[linux-2.6/next.git] / arch / blackfin / mach-bf518 / boards / tcm-bf518.c
blob50fc5c89e3790803d2f1cd7ce6bbe327a75fed15
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/etherdevice.h>
11 #include <linux/platform_device.h>
12 #include <linux/mtd/mtd.h>
13 #include <linux/mtd/partitions.h>
14 #include <linux/mtd/physmap.h>
15 #include <linux/spi/spi.h>
16 #include <linux/spi/flash.h>
18 #include <linux/i2c.h>
19 #include <linux/irq.h>
20 #include <linux/interrupt.h>
21 #include <asm/dma.h>
22 #include <asm/bfin5xx_spi.h>
23 #include <asm/reboot.h>
24 #include <asm/portmux.h>
25 #include <asm/dpmc.h>
26 #include <asm/bfin_sdh.h>
27 #include <linux/spi/ad7877.h>
28 #include <net/dsa.h>
31 * Name the Board for the /proc/cpuinfo
33 const char bfin_board_name[] = "Bluetechnix TCM-BF518";
36 * Driver needs to know address, irq and flag pin.
39 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
40 static struct mtd_partition tcm_partitions[] = {
42 .name = "bootloader(nor)",
43 .size = 0x40000,
44 .offset = 0,
47 .name = "linux(nor)",
48 .size = 0x1C0000,
49 .offset = MTDPART_OFS_APPEND,
53 static struct physmap_flash_data tcm_flash_data = {
54 .width = 2,
55 .parts = tcm_partitions,
56 .nr_parts = ARRAY_SIZE(tcm_partitions),
59 static struct resource tcm_flash_resource = {
60 .start = 0x20000000,
61 .end = 0x201fffff,
62 .flags = IORESOURCE_MEM,
65 static struct platform_device tcm_flash_device = {
66 .name = "physmap-flash",
67 .id = 0,
68 .dev = {
69 .platform_data = &tcm_flash_data,
71 .num_resources = 1,
72 .resource = &tcm_flash_resource,
74 #endif
76 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
77 static struct platform_device rtc_device = {
78 .name = "rtc-bfin",
79 .id = -1,
81 #endif
83 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
84 #include <linux/bfin_mac.h>
85 static const unsigned short bfin_mac_peripherals[] = P_MII0;
87 static struct bfin_phydev_platform_data bfin_phydev_data[] = {
89 .addr = 1,
90 .irq = IRQ_MAC_PHYINT,
94 static struct bfin_mii_bus_platform_data bfin_mii_bus_data = {
95 .phydev_number = 1,
96 .phydev_data = bfin_phydev_data,
97 .phy_mode = PHY_INTERFACE_MODE_MII,
98 .mac_peripherals = bfin_mac_peripherals,
101 static struct platform_device bfin_mii_bus = {
102 .name = "bfin_mii_bus",
103 .dev = {
104 .platform_data = &bfin_mii_bus_data,
108 static struct platform_device bfin_mac_device = {
109 .name = "bfin_mac",
110 .dev = {
111 .platform_data = &bfin_mii_bus,
114 #endif
116 #if defined(CONFIG_MTD_M25P80) \
117 || defined(CONFIG_MTD_M25P80_MODULE)
118 static struct mtd_partition bfin_spi_flash_partitions[] = {
120 .name = "bootloader(spi)",
121 .size = 0x00040000,
122 .offset = 0,
123 .mask_flags = MTD_CAP_ROM
124 }, {
125 .name = "linux kernel(spi)",
126 .size = MTDPART_SIZ_FULL,
127 .offset = MTDPART_OFS_APPEND,
131 static struct flash_platform_data bfin_spi_flash_data = {
132 .name = "m25p80",
133 .parts = bfin_spi_flash_partitions,
134 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
135 .type = "m25p16",
138 /* SPI flash chip (m25p64) */
139 static struct bfin5xx_spi_chip spi_flash_chip_info = {
140 .enable_dma = 0, /* use dma transfer with this chip*/
141 .bits_per_word = 8,
143 #endif
145 #if defined(CONFIG_BFIN_SPI_ADC) \
146 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
147 /* SPI ADC chip */
148 static struct bfin5xx_spi_chip spi_adc_chip_info = {
149 .enable_dma = 1, /* use dma transfer with this chip*/
150 .bits_per_word = 16,
152 #endif
154 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
155 static struct bfin5xx_spi_chip mmc_spi_chip_info = {
156 .enable_dma = 0,
157 .bits_per_word = 8,
159 #endif
161 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
162 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
163 .enable_dma = 0,
164 .bits_per_word = 16,
167 static const struct ad7877_platform_data bfin_ad7877_ts_info = {
168 .model = 7877,
169 .vref_delay_usecs = 50, /* internal, no capacitor */
170 .x_plate_ohms = 419,
171 .y_plate_ohms = 486,
172 .pressure_max = 1000,
173 .pressure_min = 0,
174 .stopacq_polarity = 1,
175 .first_conversion_delay = 3,
176 .acquisition_time = 1,
177 .averaging = 1,
178 .pen_down_acc_interval = 1,
180 #endif
182 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
183 && defined(CONFIG_SND_SOC_WM8731_SPI)
184 static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
185 .enable_dma = 0,
186 .bits_per_word = 16,
188 #endif
190 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
191 static struct bfin5xx_spi_chip spidev_chip_info = {
192 .enable_dma = 0,
193 .bits_per_word = 8,
195 #endif
197 static struct spi_board_info bfin_spi_board_info[] __initdata = {
198 #if defined(CONFIG_MTD_M25P80) \
199 || defined(CONFIG_MTD_M25P80_MODULE)
201 /* the modalias must be the same as spi device driver name */
202 .modalias = "m25p80", /* Name of spi_driver for this device */
203 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
204 .bus_num = 0, /* Framework bus number */
205 .chip_select = 2, /* SPI0_SSEL2 */
206 .platform_data = &bfin_spi_flash_data,
207 .controller_data = &spi_flash_chip_info,
208 .mode = SPI_MODE_3,
210 #endif
212 #if defined(CONFIG_BFIN_SPI_ADC) \
213 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
215 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
216 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
217 .bus_num = 0, /* Framework bus number */
218 .chip_select = 1, /* Framework chip select. */
219 .platform_data = NULL, /* No spi_driver specific config */
220 .controller_data = &spi_adc_chip_info,
222 #endif
224 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
226 .modalias = "mmc_spi",
227 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
228 .bus_num = 0,
229 .chip_select = 5,
230 .controller_data = &mmc_spi_chip_info,
231 .mode = SPI_MODE_3,
233 #endif
234 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
236 .modalias = "ad7877",
237 .platform_data = &bfin_ad7877_ts_info,
238 .irq = IRQ_PF8,
239 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
240 .bus_num = 0,
241 .chip_select = 2,
242 .controller_data = &spi_ad7877_chip_info,
244 #endif
245 #if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
246 && defined(CONFIG_SND_SOC_WM8731_SPI)
248 .modalias = "wm8731",
249 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
250 .bus_num = 0,
251 .chip_select = 5,
252 .controller_data = &spi_wm8731_chip_info,
253 .mode = SPI_MODE_0,
255 #endif
256 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
258 .modalias = "spidev",
259 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
260 .bus_num = 0,
261 .chip_select = 1,
262 .controller_data = &spidev_chip_info,
264 #endif
265 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
267 .modalias = "bfin-lq035q1-spi",
268 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
269 .bus_num = 0,
270 .chip_select = 1,
271 .controller_data = &lq035q1_spi_chip_info,
272 .mode = SPI_CPHA | SPI_CPOL,
274 #endif
277 /* SPI controller data */
278 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
279 /* SPI (0) */
280 static struct bfin5xx_spi_master bfin_spi0_info = {
281 .num_chipselect = 6,
282 .enable_dma = 1, /* master has the ability to do dma transfer */
283 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
286 static struct resource bfin_spi0_resource[] = {
287 [0] = {
288 .start = SPI0_REGBASE,
289 .end = SPI0_REGBASE + 0xFF,
290 .flags = IORESOURCE_MEM,
292 [1] = {
293 .start = CH_SPI0,
294 .end = CH_SPI0,
295 .flags = IORESOURCE_DMA,
297 [2] = {
298 .start = IRQ_SPI0,
299 .end = IRQ_SPI0,
300 .flags = IORESOURCE_IRQ,
304 static struct platform_device bfin_spi0_device = {
305 .name = "bfin-spi",
306 .id = 0, /* Bus number */
307 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
308 .resource = bfin_spi0_resource,
309 .dev = {
310 .platform_data = &bfin_spi0_info, /* Passed to driver */
314 /* SPI (1) */
315 static struct bfin5xx_spi_master bfin_spi1_info = {
316 .num_chipselect = 6,
317 .enable_dma = 1, /* master has the ability to do dma transfer */
318 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
321 static struct resource bfin_spi1_resource[] = {
322 [0] = {
323 .start = SPI1_REGBASE,
324 .end = SPI1_REGBASE + 0xFF,
325 .flags = IORESOURCE_MEM,
327 [1] = {
328 .start = CH_SPI1,
329 .end = CH_SPI1,
330 .flags = IORESOURCE_DMA,
332 [2] = {
333 .start = IRQ_SPI1,
334 .end = IRQ_SPI1,
335 .flags = IORESOURCE_IRQ,
339 static struct platform_device bfin_spi1_device = {
340 .name = "bfin-spi",
341 .id = 1, /* Bus number */
342 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
343 .resource = bfin_spi1_resource,
344 .dev = {
345 .platform_data = &bfin_spi1_info, /* Passed to driver */
348 #endif /* spi master and devices */
350 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
351 #ifdef CONFIG_SERIAL_BFIN_UART0
352 static struct resource bfin_uart0_resources[] = {
354 .start = UART0_THR,
355 .end = UART0_GCTL+2,
356 .flags = IORESOURCE_MEM,
359 .start = IRQ_UART0_RX,
360 .end = IRQ_UART0_RX+1,
361 .flags = IORESOURCE_IRQ,
364 .start = IRQ_UART0_ERROR,
365 .end = IRQ_UART0_ERROR,
366 .flags = IORESOURCE_IRQ,
369 .start = CH_UART0_TX,
370 .end = CH_UART0_TX,
371 .flags = IORESOURCE_DMA,
374 .start = CH_UART0_RX,
375 .end = CH_UART0_RX,
376 .flags = IORESOURCE_DMA,
380 static unsigned short bfin_uart0_peripherals[] = {
381 P_UART0_TX, P_UART0_RX, 0
384 static struct platform_device bfin_uart0_device = {
385 .name = "bfin-uart",
386 .id = 0,
387 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
388 .resource = bfin_uart0_resources,
389 .dev = {
390 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
393 #endif
394 #ifdef CONFIG_SERIAL_BFIN_UART1
395 static struct resource bfin_uart1_resources[] = {
397 .start = UART1_THR,
398 .end = UART1_GCTL+2,
399 .flags = IORESOURCE_MEM,
402 .start = IRQ_UART1_RX,
403 .end = IRQ_UART1_RX+1,
404 .flags = IORESOURCE_IRQ,
407 .start = IRQ_UART1_ERROR,
408 .end = IRQ_UART1_ERROR,
409 .flags = IORESOURCE_IRQ,
412 .start = CH_UART1_TX,
413 .end = CH_UART1_TX,
414 .flags = IORESOURCE_DMA,
417 .start = CH_UART1_RX,
418 .end = CH_UART1_RX,
419 .flags = IORESOURCE_DMA,
423 static unsigned short bfin_uart1_peripherals[] = {
424 P_UART1_TX, P_UART1_RX, 0
427 static struct platform_device bfin_uart1_device = {
428 .name = "bfin-uart",
429 .id = 1,
430 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
431 .resource = bfin_uart1_resources,
432 .dev = {
433 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
436 #endif
437 #endif
439 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
440 #ifdef CONFIG_BFIN_SIR0
441 static struct resource bfin_sir0_resources[] = {
443 .start = 0xFFC00400,
444 .end = 0xFFC004FF,
445 .flags = IORESOURCE_MEM,
448 .start = IRQ_UART0_RX,
449 .end = IRQ_UART0_RX+1,
450 .flags = IORESOURCE_IRQ,
453 .start = CH_UART0_RX,
454 .end = CH_UART0_RX+1,
455 .flags = IORESOURCE_DMA,
459 static struct platform_device bfin_sir0_device = {
460 .name = "bfin_sir",
461 .id = 0,
462 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
463 .resource = bfin_sir0_resources,
465 #endif
466 #ifdef CONFIG_BFIN_SIR1
467 static struct resource bfin_sir1_resources[] = {
469 .start = 0xFFC02000,
470 .end = 0xFFC020FF,
471 .flags = IORESOURCE_MEM,
474 .start = IRQ_UART1_RX,
475 .end = IRQ_UART1_RX+1,
476 .flags = IORESOURCE_IRQ,
479 .start = CH_UART1_RX,
480 .end = CH_UART1_RX+1,
481 .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 #endif
494 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
495 static struct resource bfin_twi0_resource[] = {
496 [0] = {
497 .start = TWI0_REGBASE,
498 .end = TWI0_REGBASE,
499 .flags = IORESOURCE_MEM,
501 [1] = {
502 .start = IRQ_TWI,
503 .end = IRQ_TWI,
504 .flags = IORESOURCE_IRQ,
508 static struct platform_device i2c_bfin_twi_device = {
509 .name = "i2c-bfin-twi",
510 .id = 0,
511 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
512 .resource = bfin_twi0_resource,
514 #endif
516 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
517 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
519 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
521 #endif
522 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
524 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
525 .irq = IRQ_PF8,
527 #endif
530 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
531 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
532 static struct resource bfin_sport0_uart_resources[] = {
534 .start = SPORT0_TCR1,
535 .end = SPORT0_MRCS3+4,
536 .flags = IORESOURCE_MEM,
539 .start = IRQ_SPORT0_RX,
540 .end = IRQ_SPORT0_RX+1,
541 .flags = IORESOURCE_IRQ,
544 .start = IRQ_SPORT0_ERROR,
545 .end = IRQ_SPORT0_ERROR,
546 .flags = IORESOURCE_IRQ,
550 static unsigned short bfin_sport0_peripherals[] = {
551 P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS,
552 P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0
555 static struct platform_device bfin_sport0_uart_device = {
556 .name = "bfin-sport-uart",
557 .id = 0,
558 .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources),
559 .resource = bfin_sport0_uart_resources,
560 .dev = {
561 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
564 #endif
565 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
566 static struct resource bfin_sport1_uart_resources[] = {
568 .start = SPORT1_TCR1,
569 .end = SPORT1_MRCS3+4,
570 .flags = IORESOURCE_MEM,
573 .start = IRQ_SPORT1_RX,
574 .end = IRQ_SPORT1_RX+1,
575 .flags = IORESOURCE_IRQ,
578 .start = IRQ_SPORT1_ERROR,
579 .end = IRQ_SPORT1_ERROR,
580 .flags = IORESOURCE_IRQ,
584 static unsigned short bfin_sport1_peripherals[] = {
585 P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS,
586 P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0
589 static struct platform_device bfin_sport1_uart_device = {
590 .name = "bfin-sport-uart",
591 .id = 1,
592 .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources),
593 .resource = bfin_sport1_uart_resources,
594 .dev = {
595 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
598 #endif
599 #endif
601 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
602 #include <linux/input.h>
603 #include <linux/gpio_keys.h>
605 static struct gpio_keys_button bfin_gpio_keys_table[] = {
606 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
607 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
610 static struct gpio_keys_platform_data bfin_gpio_keys_data = {
611 .buttons = bfin_gpio_keys_table,
612 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
615 static struct platform_device bfin_device_gpiokeys = {
616 .name = "gpio-keys",
617 .dev = {
618 .platform_data = &bfin_gpio_keys_data,
621 #endif
623 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
625 static struct bfin_sd_host bfin_sdh_data = {
626 .dma_chan = CH_RSI,
627 .irq_int0 = IRQ_RSI_INT0,
628 .pin_req = {P_RSI_DATA0, P_RSI_DATA1, P_RSI_DATA2, P_RSI_DATA3, P_RSI_CMD, P_RSI_CLK, 0},
631 static struct platform_device bf51x_sdh_device = {
632 .name = "bfin-sdh",
633 .id = 0,
634 .dev = {
635 .platform_data = &bfin_sdh_data,
638 #endif
640 static const unsigned int cclk_vlev_datasheet[] =
642 VRPAIR(VLEV_100, 400000000),
643 VRPAIR(VLEV_105, 426000000),
644 VRPAIR(VLEV_110, 500000000),
645 VRPAIR(VLEV_115, 533000000),
646 VRPAIR(VLEV_120, 600000000),
649 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
650 .tuple_tab = cclk_vlev_datasheet,
651 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
652 .vr_settling_time = 25 /* us */,
655 static struct platform_device bfin_dpmc = {
656 .name = "bfin dpmc",
657 .dev = {
658 .platform_data = &bfin_dmpc_vreg_data,
662 static struct platform_device *tcm_devices[] __initdata = {
664 &bfin_dpmc,
666 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
667 &rtc_device,
668 #endif
670 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
671 &bfin_mii_bus,
672 &bfin_mac_device,
673 #endif
675 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
676 &bfin_spi0_device,
677 &bfin_spi1_device,
678 #endif
680 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
681 #ifdef CONFIG_SERIAL_BFIN_UART0
682 &bfin_uart0_device,
683 #endif
684 #ifdef CONFIG_SERIAL_BFIN_UART1
685 &bfin_uart1_device,
686 #endif
687 #endif
689 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
690 #ifdef CONFIG_BFIN_SIR0
691 &bfin_sir0_device,
692 #endif
693 #ifdef CONFIG_BFIN_SIR1
694 &bfin_sir1_device,
695 #endif
696 #endif
698 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
699 &i2c_bfin_twi_device,
700 #endif
702 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
703 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
704 &bfin_sport0_uart_device,
705 #endif
706 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
707 &bfin_sport1_uart_device,
708 #endif
709 #endif
711 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
712 &bfin_device_gpiokeys,
713 #endif
715 #if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
716 &bf51x_sdh_device,
717 #endif
719 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
720 &tcm_flash_device,
721 #endif
724 static int __init tcm_init(void)
726 printk(KERN_INFO "%s(): registering device resources\n", __func__);
727 i2c_register_board_info(0, bfin_i2c_board_info,
728 ARRAY_SIZE(bfin_i2c_board_info));
729 platform_add_devices(tcm_devices, ARRAY_SIZE(tcm_devices));
730 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
731 return 0;
734 arch_initcall(tcm_init);
736 static struct platform_device *tcm_early_devices[] __initdata = {
737 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
738 #ifdef CONFIG_SERIAL_BFIN_UART0
739 &bfin_uart0_device,
740 #endif
741 #ifdef CONFIG_SERIAL_BFIN_UART1
742 &bfin_uart1_device,
743 #endif
744 #endif
746 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
747 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
748 &bfin_sport0_uart_device,
749 #endif
750 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
751 &bfin_sport1_uart_device,
752 #endif
753 #endif
756 void __init native_machine_early_platform_add_devices(void)
758 printk(KERN_INFO "register early platform devices\n");
759 early_platform_add_devices(tcm_early_devices,
760 ARRAY_SIZE(tcm_early_devices));
763 void native_machine_restart(char *cmd)
765 /* workaround reboot hang when booting from SPI */
766 if ((bfin_read_SYSCR() & 0x7) == 0x3)
767 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS);
770 void bfin_get_ether_addr(char *addr)
772 random_ether_addr(addr);
773 printk(KERN_WARNING "%s:%s: Setting Ethernet MAC to a random one\n", __FILE__, __func__);
775 EXPORT_SYMBOL(bfin_get_ether_addr);