1 /* File: arch/blackfin/mach-bf527/boards/tll6527m.c
2 * Based on: arch/blackfin/mach-bf527/boards/ezkit.c
5 * Copyright: 2010 - The Learning Labs Inc.
7 * Licensed under the GPL-2 or later.
10 #include <linux/device.h>
11 #include <linux/export.h>
12 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/partitions.h>
15 #include <linux/mtd/physmap.h>
16 #include <linux/spi/spi.h>
17 #include <linux/spi/flash.h>
18 #include <linux/i2c.h>
19 #include <linux/irq.h>
20 #include <linux/interrupt.h>
21 #include <linux/usb/musb.h>
22 #include <linux/leds.h>
23 #include <linux/input.h>
25 #include <asm/bfin5xx_spi.h>
26 #include <asm/reboot.h>
28 #include <asm/portmux.h>
31 #if defined(CONFIG_TOUCHSCREEN_AD7879) \
32 || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
33 #include <linux/spi/ad7879.h>
34 #define LCD_BACKLIGHT_GPIO 0x40
35 /* TLL6527M uses TLL7UIQ35 / ADI LCD EZ Extender. AD7879 AUX GPIO is used for
36 * LCD Backlight Enable
41 * Name the Board for the /proc/cpuinfo
43 const char bfin_board_name
[] = "TLL6527M";
45 * Driver needs to know address, irq and flag pin.
48 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
49 static struct resource musb_resources
[] = {
53 .flags
= IORESOURCE_MEM
,
55 [1] = { /* general IRQ */
56 .start
= IRQ_USB_INT0
,
58 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
63 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
67 static struct musb_hdrc_config musb_config
= {
74 /*.gpio_vrsel = GPIO_PG13,*/
75 /* Some custom boards need to be active low, just set it to "0"
78 .gpio_vrsel_active
= 1,
81 static struct musb_hdrc_platform_data musb_plat
= {
82 #if defined(CONFIG_USB_MUSB_OTG)
84 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
86 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
87 .mode
= MUSB_PERIPHERAL
,
89 .config
= &musb_config
,
92 static u64 musb_dmamask
= ~(u32
)0;
94 static struct platform_device musb_device
= {
95 .name
= "musb-blackfin",
98 .dma_mask
= &musb_dmamask
,
99 .coherent_dma_mask
= 0xffffffff,
100 .platform_data
= &musb_plat
,
102 .num_resources
= ARRAY_SIZE(musb_resources
),
103 .resource
= musb_resources
,
107 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
108 #include <asm/bfin-lq035q1.h>
110 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data
= {
111 .mode
= LQ035_NORM
| LQ035_RGB
| LQ035_RL
| LQ035_TB
,
112 .ppi_mode
= USE_RGB565_16_BIT_PPI
,
114 .gpio_bl
= LCD_BACKLIGHT_GPIO
,
117 static struct resource bfin_lq035q1_resources
[] = {
119 .start
= IRQ_PPI_ERROR
,
120 .end
= IRQ_PPI_ERROR
,
121 .flags
= IORESOURCE_IRQ
,
125 static struct platform_device bfin_lq035q1_device
= {
126 .name
= "bfin-lq035q1",
128 .num_resources
= ARRAY_SIZE(bfin_lq035q1_resources
),
129 .resource
= bfin_lq035q1_resources
,
131 .platform_data
= &bfin_lq035q1_data
,
136 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
137 static struct mtd_partition tll6527m_partitions
[] = {
139 .name
= "bootloader(nor)",
143 .name
= "linux kernel(nor)",
145 .offset
= MTDPART_OFS_APPEND
,
147 .name
= "file system(nor)",
148 .size
= MTDPART_SIZ_FULL
,
149 .offset
= MTDPART_OFS_APPEND
,
153 static struct physmap_flash_data tll6527m_flash_data
= {
155 .parts
= tll6527m_partitions
,
156 .nr_parts
= ARRAY_SIZE(tll6527m_partitions
),
159 static unsigned tll6527m_flash_gpios
[] = { GPIO_PG11
, GPIO_PH11
, GPIO_PH12
};
161 static struct resource tll6527m_flash_resource
[] = {
166 .flags
= IORESOURCE_MEM
,
168 .start
= (unsigned long)tll6527m_flash_gpios
,
169 .end
= ARRAY_SIZE(tll6527m_flash_gpios
),
170 .flags
= IORESOURCE_IRQ
,
174 static struct platform_device tll6527m_flash_device
= {
175 .name
= "gpio-addr-flash",
178 .platform_data
= &tll6527m_flash_data
,
180 .num_resources
= ARRAY_SIZE(tll6527m_flash_resource
),
181 .resource
= tll6527m_flash_resource
,
185 #if defined(CONFIG_GPIO_DECODER) || defined(CONFIG_GPIO_DECODER_MODULE)
186 /* An SN74LVC138A 3:8 decoder chip has been used to generate 7 augmented
187 * outputs used as SPI CS lines for all SPI SLAVE devices on TLL6527v1-0.
188 * EXP_GPIO_SPISEL_BASE is the base number for the expanded outputs being
189 * used as SPI CS lines, this should be > MAX_BLACKFIN_GPIOS
191 #include <linux/gpio-decoder.h>
192 #define EXP_GPIO_SPISEL_BASE 0x64
193 static unsigned gpio_addr_inputs
[] = {
194 GPIO_PG1
, GPIO_PH9
, GPIO_PH10
197 static struct gpio_decoder_platform_data spi_decoded_cs
= {
198 .base
= EXP_GPIO_SPISEL_BASE
,
199 .input_addrs
= gpio_addr_inputs
,
200 .nr_input_addrs
= ARRAY_SIZE(gpio_addr_inputs
),
202 /* .default_output = (1 << ARRAY_SIZE(gpio_addr_inputs)) - 1 */
205 static struct platform_device spi_decoded_gpio
= {
206 .name
= "gpio-decoder",
209 .platform_data
= &spi_decoded_cs
,
214 #define EXP_GPIO_SPISEL_BASE 0x0
218 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
219 #include <linux/input/adxl34x.h>
220 static const struct adxl34x_platform_data adxl345_info
= {
224 .tap_threshold
= 0x31,
225 .tap_duration
= 0x10,
228 .tap_axis_control
= ADXL_TAP_X_EN
| ADXL_TAP_Y_EN
| ADXL_TAP_Z_EN
,
229 .act_axis_control
= 0xFF,
230 .activity_threshold
= 5,
231 .inactivity_threshold
= 2,
232 .inactivity_time
= 2,
233 .free_fall_threshold
= 0x7,
234 .free_fall_time
= 0x20,
236 .data_range
= ADXL_FULL_RES
,
239 .ev_code_x
= ABS_X
, /* EV_REL */
240 .ev_code_y
= ABS_Y
, /* EV_REL */
241 .ev_code_z
= ABS_Z
, /* EV_REL */
243 .ev_code_tap
= {BTN_TOUCH
, BTN_TOUCH
, BTN_TOUCH
}, /* EV_KEY x,y,z */
245 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
246 .ev_code_act_inactivity
= KEY_A
, /* EV_KEY */
248 .power_mode
= ADXL_AUTO_SLEEP
| ADXL_LINK
,
249 .fifo_mode
= ADXL_FIFO_STREAM
,
253 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
254 static struct platform_device rtc_device
= {
260 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
261 #include <linux/bfin_mac.h>
262 static const unsigned short bfin_mac_peripherals
[] = P_RMII0
;
264 static struct bfin_phydev_platform_data bfin_phydev_data
[] = {
267 .irq
= IRQ_MAC_PHYINT
,
271 static struct bfin_mii_bus_platform_data bfin_mii_bus_data
= {
273 .phydev_data
= bfin_phydev_data
,
274 .phy_mode
= PHY_INTERFACE_MODE_RMII
,
275 .mac_peripherals
= bfin_mac_peripherals
,
278 static struct platform_device bfin_mii_bus
= {
279 .name
= "bfin_mii_bus",
281 .platform_data
= &bfin_mii_bus_data
,
285 static struct platform_device bfin_mac_device
= {
288 .platform_data
= &bfin_mii_bus
,
293 #if defined(CONFIG_MTD_M25P80) \
294 || defined(CONFIG_MTD_M25P80_MODULE)
295 static struct mtd_partition bfin_spi_flash_partitions
[] = {
297 .name
= "bootloader(spi)",
300 .mask_flags
= MTD_CAP_ROM
302 .name
= "linux kernel(spi)",
303 .size
= MTDPART_SIZ_FULL
,
304 .offset
= MTDPART_OFS_APPEND
,
308 static struct flash_platform_data bfin_spi_flash_data
= {
310 .parts
= bfin_spi_flash_partitions
,
311 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
315 /* SPI flash chip (m25p64) */
316 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
317 .enable_dma
= 0, /* use dma transfer with this chip*/
321 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
322 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
327 #if defined(CONFIG_TOUCHSCREEN_AD7879) \
328 || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
329 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
330 .model
= 7879, /* Model = AD7879 */
331 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
332 .pressure_max
= 10000,
334 .first_conversion_delay
= 3,
335 /* wait 512us before do a first conversion */
336 .acquisition_time
= 1, /* 4us acquisition time per sample */
337 .median
= 2, /* do 8 measurements */
339 /* take the average of 4 middle samples */
340 .pen_down_acc_interval
= 255, /* 9.4 ms */
341 .gpio_export
= 1, /* configure AUX as GPIO output*/
342 .gpio_base
= LCD_BACKLIGHT_GPIO
,
346 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
347 static struct platform_device bfin_i2s
= {
349 .id
= CONFIG_SND_BF5XX_SPORT_NUM
,
350 /* TODO: add platform data here */
354 #if defined(CONFIG_GPIO_MCP23S08) || defined(CONFIG_GPIO_MCP23S08_MODULE)
355 #include <linux/spi/mcp23s08.h>
356 static const struct mcp23s08_platform_data bfin_mcp23s08_sys_gpio_info
= {
357 .chip
[0].is_present
= true,
360 static const struct mcp23s08_platform_data bfin_mcp23s08_usr_gpio_info
= {
361 .chip
[2].is_present
= true,
366 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
367 #if defined(CONFIG_MTD_M25P80) \
368 || defined(CONFIG_MTD_M25P80_MODULE)
370 /* the modalias must be the same as spi device driver name */
371 .modalias
= "m25p80", /* Name of spi_driver for this device */
372 .max_speed_hz
= 25000000,
373 /* max spi clock (SCK) speed in HZ */
374 .bus_num
= 0, /* Framework bus number */
375 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x04 + MAX_CTRL_CS
,
376 /* Can be connected to TLL6527M GPIO connector */
377 /* Either SPI_ADC or M25P80 FLASH can be installed at a time */
378 .platform_data
= &bfin_spi_flash_data
,
379 .controller_data
= &spi_flash_chip_info
,
384 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
386 .modalias
= "mmc_spi",
388 * TLL6527M V1.0 does not support SD Card at SPI Clock > 10 MHz due to
389 * SPI buffer limitations
391 .max_speed_hz
= 10000000,
392 /* max spi clock (SCK) speed in HZ */
394 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x05 + MAX_CTRL_CS
,
395 .controller_data
= &mmc_spi_chip_info
,
399 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) \
400 || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
402 .modalias
= "ad7879",
403 .platform_data
= &bfin_ad7879_ts_info
,
405 .max_speed_hz
= 5000000,
406 /* max spi clock (SCK) speed in HZ */
408 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x07 + MAX_CTRL_CS
,
409 .mode
= SPI_CPHA
| SPI_CPOL
,
412 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
414 .modalias
= "spidev",
415 .max_speed_hz
= 10000000,
416 /* TLL6527Mv1-0 supports max spi clock (SCK) speed = 10 MHz */
418 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x03 + MAX_CTRL_CS
,
419 .mode
= SPI_CPHA
| SPI_CPOL
,
422 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
424 .modalias
= "bfin-lq035q1-spi",
425 .max_speed_hz
= 20000000,
427 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x06 + MAX_CTRL_CS
,
428 .mode
= SPI_CPHA
| SPI_CPOL
,
431 #if defined(CONFIG_GPIO_MCP23S08) || defined(CONFIG_GPIO_MCP23S08_MODULE)
433 .modalias
= "mcp23s08",
434 .platform_data
= &bfin_mcp23s08_sys_gpio_info
,
435 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
437 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x01 + MAX_CTRL_CS
,
438 .mode
= SPI_CPHA
| SPI_CPOL
,
441 .modalias
= "mcp23s08",
442 .platform_data
= &bfin_mcp23s08_usr_gpio_info
,
443 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
445 .chip_select
= EXP_GPIO_SPISEL_BASE
+ 0x02 + MAX_CTRL_CS
,
446 .mode
= SPI_CPHA
| SPI_CPOL
,
451 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
452 /* SPI controller data */
453 static struct bfin5xx_spi_master bfin_spi0_info
= {
454 .num_chipselect
= EXP_GPIO_SPISEL_BASE
+ 8 + MAX_CTRL_CS
,
455 /* EXP_GPIO_SPISEL_BASE will be > MAX_BLACKFIN_GPIOS */
456 .enable_dma
= 1, /* master has the ability to do dma transfer */
457 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
461 static struct resource bfin_spi0_resource
[] = {
463 .start
= SPI0_REGBASE
,
464 .end
= SPI0_REGBASE
+ 0xFF,
465 .flags
= IORESOURCE_MEM
,
470 .flags
= IORESOURCE_DMA
,
475 .flags
= IORESOURCE_IRQ
,
479 static struct platform_device bfin_spi0_device
= {
481 .id
= 0, /* Bus number */
482 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
483 .resource
= bfin_spi0_resource
,
485 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
488 #endif /* spi master and devices */
490 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
491 #ifdef CONFIG_SERIAL_BFIN_UART0
492 static struct resource bfin_uart0_resources
[] = {
496 .flags
= IORESOURCE_MEM
,
499 .start
= IRQ_UART0_TX
,
501 .flags
= IORESOURCE_IRQ
,
504 .start
= IRQ_UART0_RX
,
506 .flags
= IORESOURCE_IRQ
,
509 .start
= IRQ_UART0_ERROR
,
510 .end
= IRQ_UART0_ERROR
,
511 .flags
= IORESOURCE_IRQ
,
514 .start
= CH_UART0_TX
,
516 .flags
= IORESOURCE_DMA
,
519 .start
= CH_UART0_RX
,
521 .flags
= IORESOURCE_DMA
,
525 static unsigned short bfin_uart0_peripherals
[] = {
526 P_UART0_TX
, P_UART0_RX
, 0
529 static struct platform_device bfin_uart0_device
= {
532 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
533 .resource
= bfin_uart0_resources
,
535 .platform_data
= &bfin_uart0_peripherals
,
536 /* Passed to driver */
540 #ifdef CONFIG_SERIAL_BFIN_UART1
541 static struct resource bfin_uart1_resources
[] = {
545 .flags
= IORESOURCE_MEM
,
548 .start
= IRQ_UART1_TX
,
550 .flags
= IORESOURCE_IRQ
,
553 .start
= IRQ_UART1_RX
,
555 .flags
= IORESOURCE_IRQ
,
558 .start
= IRQ_UART1_ERROR
,
559 .end
= IRQ_UART1_ERROR
,
560 .flags
= IORESOURCE_IRQ
,
563 .start
= CH_UART1_TX
,
565 .flags
= IORESOURCE_DMA
,
568 .start
= CH_UART1_RX
,
570 .flags
= IORESOURCE_DMA
,
572 #ifdef CONFIG_BFIN_UART1_CTSRTS
576 .flags
= IORESOURCE_IO
,
581 .flags
= IORESOURCE_IO
,
586 static unsigned short bfin_uart1_peripherals
[] = {
587 P_UART1_TX
, P_UART1_RX
, 0
590 static struct platform_device bfin_uart1_device
= {
593 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
594 .resource
= bfin_uart1_resources
,
596 .platform_data
= &bfin_uart1_peripherals
,
597 /* Passed to driver */
603 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
604 #ifdef CONFIG_BFIN_SIR0
605 static struct resource bfin_sir0_resources
[] = {
609 .flags
= IORESOURCE_MEM
,
612 .start
= IRQ_UART0_RX
,
613 .end
= IRQ_UART0_RX
+1,
614 .flags
= IORESOURCE_IRQ
,
617 .start
= CH_UART0_RX
,
618 .end
= CH_UART0_RX
+1,
619 .flags
= IORESOURCE_DMA
,
623 static struct platform_device bfin_sir0_device
= {
626 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
627 .resource
= bfin_sir0_resources
,
630 #ifdef CONFIG_BFIN_SIR1
631 static struct resource bfin_sir1_resources
[] = {
635 .flags
= IORESOURCE_MEM
,
638 .start
= IRQ_UART1_RX
,
639 .end
= IRQ_UART1_RX
+1,
640 .flags
= IORESOURCE_IRQ
,
643 .start
= CH_UART1_RX
,
644 .end
= CH_UART1_RX
+1,
645 .flags
= IORESOURCE_DMA
,
649 static struct platform_device bfin_sir1_device
= {
652 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
653 .resource
= bfin_sir1_resources
,
658 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
659 static const u16 bfin_twi0_pins
[] = {P_TWI0_SCL
, P_TWI0_SDA
, 0};
661 static struct resource bfin_twi0_resource
[] = {
663 .start
= TWI0_REGBASE
,
665 .flags
= IORESOURCE_MEM
,
670 .flags
= IORESOURCE_IRQ
,
674 static struct platform_device i2c_bfin_twi_device
= {
675 .name
= "i2c-bfin-twi",
677 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
678 .resource
= bfin_twi0_resource
,
680 .platform_data
= &bfin_twi0_pins
,
685 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
686 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
688 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
692 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
694 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
697 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) \
698 || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
700 I2C_BOARD_INFO("ad7879", 0x2C),
702 .platform_data
= (void *)&bfin_ad7879_ts_info
,
705 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
707 I2C_BOARD_INFO("ssm2602", 0x1b),
711 I2C_BOARD_INFO("adm1192", 0x2e),
715 I2C_BOARD_INFO("ltc3576", 0x09),
717 #if defined(CONFIG_INPUT_ADXL34X_I2C) \
718 || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
720 I2C_BOARD_INFO("adxl34x", 0x53),
722 .platform_data
= (void *)&adxl345_info
,
727 #if defined(CONFIG_SERIAL_BFIN_SPORT) \
728 || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
729 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
730 static struct resource bfin_sport0_uart_resources
[] = {
732 .start
= SPORT0_TCR1
,
733 .end
= SPORT0_MRCS3
+4,
734 .flags
= IORESOURCE_MEM
,
737 .start
= IRQ_SPORT0_RX
,
738 .end
= IRQ_SPORT0_RX
+1,
739 .flags
= IORESOURCE_IRQ
,
742 .start
= IRQ_SPORT0_ERROR
,
743 .end
= IRQ_SPORT0_ERROR
,
744 .flags
= IORESOURCE_IRQ
,
748 static unsigned short bfin_sport0_peripherals
[] = {
749 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
750 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, 0
753 static struct platform_device bfin_sport0_uart_device
= {
754 .name
= "bfin-sport-uart",
756 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
757 .resource
= bfin_sport0_uart_resources
,
759 .platform_data
= &bfin_sport0_peripherals
,
760 /* Passed to driver */
764 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
765 static struct resource bfin_sport1_uart_resources
[] = {
767 .start
= SPORT1_TCR1
,
768 .end
= SPORT1_MRCS3
+4,
769 .flags
= IORESOURCE_MEM
,
772 .start
= IRQ_SPORT1_RX
,
773 .end
= IRQ_SPORT1_RX
+1,
774 .flags
= IORESOURCE_IRQ
,
777 .start
= IRQ_SPORT1_ERROR
,
778 .end
= IRQ_SPORT1_ERROR
,
779 .flags
= IORESOURCE_IRQ
,
783 static unsigned short bfin_sport1_peripherals
[] = {
784 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
785 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, 0
788 static struct platform_device bfin_sport1_uart_device
= {
789 .name
= "bfin-sport-uart",
791 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
792 .resource
= bfin_sport1_uart_resources
,
794 .platform_data
= &bfin_sport1_peripherals
,
795 /* Passed to driver */
801 static const unsigned int cclk_vlev_datasheet
[] = {
802 VRPAIR(VLEV_100
, 400000000),
803 VRPAIR(VLEV_105
, 426000000),
804 VRPAIR(VLEV_110
, 500000000),
805 VRPAIR(VLEV_115
, 533000000),
806 VRPAIR(VLEV_120
, 600000000),
809 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
810 .tuple_tab
= cclk_vlev_datasheet
,
811 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
812 .vr_settling_time
= 25 /* us */,
815 static struct platform_device bfin_dpmc
= {
818 .platform_data
= &bfin_dmpc_vreg_data
,
822 static struct platform_device
*tll6527m_devices
[] __initdata
= {
826 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
830 #if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
834 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
839 #if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
843 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
844 &bfin_lq035q1_device
,
847 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
848 #ifdef CONFIG_SERIAL_BFIN_UART0
851 #ifdef CONFIG_SERIAL_BFIN_UART1
856 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
857 #ifdef CONFIG_BFIN_SIR0
860 #ifdef CONFIG_BFIN_SIR1
865 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
866 &i2c_bfin_twi_device
,
869 #if defined(CONFIG_SERIAL_BFIN_SPORT) \
870 || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
871 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
872 &bfin_sport0_uart_device
,
874 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
875 &bfin_sport1_uart_device
,
879 #if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
880 &tll6527m_flash_device
,
883 #if defined(CONFIG_SND_BF5XX_I2S) || defined(CONFIG_SND_BF5XX_I2S_MODULE)
887 #if defined(CONFIG_GPIO_DECODER) || defined(CONFIG_GPIO_DECODER_MODULE)
892 static int __init
tll6527m_init(void)
894 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
895 i2c_register_board_info(0, bfin_i2c_board_info
,
896 ARRAY_SIZE(bfin_i2c_board_info
));
897 platform_add_devices(tll6527m_devices
, ARRAY_SIZE(tll6527m_devices
));
898 spi_register_board_info(bfin_spi_board_info
,
899 ARRAY_SIZE(bfin_spi_board_info
));
903 arch_initcall(tll6527m_init
);
905 static struct platform_device
*tll6527m_early_devices
[] __initdata
= {
906 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
907 #ifdef CONFIG_SERIAL_BFIN_UART0
910 #ifdef CONFIG_SERIAL_BFIN_UART1
915 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
916 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
917 &bfin_sport0_uart_device
,
919 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
920 &bfin_sport1_uart_device
,
925 void __init
native_machine_early_platform_add_devices(void)
927 printk(KERN_INFO
"register early platform devices\n");
928 early_platform_add_devices(tll6527m_early_devices
,
929 ARRAY_SIZE(tll6527m_early_devices
));
932 void native_machine_restart(char *cmd
)
934 /* workaround reboot hang when booting from SPI */
935 if ((bfin_read_SYSCR() & 0x7) == 0x3)
936 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
939 int bfin_get_ether_addr(char *addr
)
941 /* the MAC is stored in OTP memory page 0xDF */
944 u32 (*otp_read
)(u32 page
, u32 flags
,
945 u64
*page_content
) = (void *)0xEF00001A;
947 ret
= otp_read(0xDF, 0x00, &otp_mac
);
949 char *otp_mac_p
= (char *)&otp_mac
;
950 for (ret
= 0; ret
< 6; ++ret
)
951 addr
[ret
] = otp_mac_p
[5 - ret
];
955 EXPORT_SYMBOL(bfin_get_ether_addr
);