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/kernel.h>
11 #include <linux/platform_device.h>
13 #include <linux/mtd/mtd.h>
14 #include <linux/mtd/nand.h>
15 #include <linux/mtd/partitions.h>
16 #include <linux/mtd/plat-ram.h>
17 #include <linux/mtd/physmap.h>
18 #include <linux/spi/spi.h>
19 #include <linux/spi/flash.h>
20 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
21 #include <linux/usb/isp1362.h>
23 #include <linux/i2c.h>
24 #include <linux/i2c/adp5588.h>
25 #include <linux/etherdevice.h>
26 #include <linux/ata_platform.h>
27 #include <linux/irq.h>
28 #include <linux/interrupt.h>
29 #include <linux/usb/sl811.h>
30 #include <linux/spi/mmc_spi.h>
31 #include <linux/leds.h>
32 #include <linux/input.h>
34 #include <asm/bfin5xx_spi.h>
35 #include <asm/reboot.h>
36 #include <asm/portmux.h>
40 * Name the Board for the /proc/cpuinfo
42 const char bfin_board_name
[] = "ADI BF537-STAMP";
45 * Driver needs to know address, irq and flag pin.
48 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
49 #include <linux/usb/isp1760.h>
50 static struct resource bfin_isp1760_resources
[] = {
53 .end
= 0x203C0000 + 0x000fffff,
54 .flags
= IORESOURCE_MEM
,
59 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
63 static struct isp1760_platform_data isp1760_priv
= {
68 .dack_polarity_high
= 0,
69 .dreq_polarity_high
= 0,
72 static struct platform_device bfin_isp1760_device
= {
76 .platform_data
= &isp1760_priv
,
78 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
79 .resource
= bfin_isp1760_resources
,
83 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
84 #include <linux/gpio_keys.h>
86 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
87 {BTN_0
, GPIO_PF2
, 1, "gpio-keys: BTN0"},
88 {BTN_1
, GPIO_PF3
, 1, "gpio-keys: BTN1"},
89 {BTN_2
, GPIO_PF4
, 1, "gpio-keys: BTN2"},
90 {BTN_3
, GPIO_PF5
, 1, "gpio-keys: BTN3"},
93 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
94 .buttons
= bfin_gpio_keys_table
,
95 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
98 static struct platform_device bfin_device_gpiokeys
= {
101 .platform_data
= &bfin_gpio_keys_data
,
106 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
107 static struct resource bfin_pcmcia_cf_resources
[] = {
109 .start
= 0x20310000, /* IO PORT */
111 .flags
= IORESOURCE_MEM
,
113 .start
= 0x20311000, /* Attribute Memory */
115 .flags
= IORESOURCE_MEM
,
119 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
121 .start
= 6, /* Card Detect PF6 */
123 .flags
= IORESOURCE_IRQ
,
127 static struct platform_device bfin_pcmcia_cf_device
= {
128 .name
= "bfin_cf_pcmcia",
130 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
131 .resource
= bfin_pcmcia_cf_resources
,
135 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
136 static struct platform_device rtc_device
= {
142 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
143 #include <linux/smc91x.h>
145 static struct smc91x_platdata smc91x_info
= {
146 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
147 .leda
= RPC_LED_100_10
,
148 .ledb
= RPC_LED_TX_RX
,
151 static struct resource smc91x_resources
[] = {
153 .name
= "smc91x-regs",
155 .end
= 0x20300300 + 16,
156 .flags
= IORESOURCE_MEM
,
161 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
164 static struct platform_device smc91x_device
= {
167 .num_resources
= ARRAY_SIZE(smc91x_resources
),
168 .resource
= smc91x_resources
,
170 .platform_data
= &smc91x_info
,
175 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
176 static struct resource dm9000_resources
[] = {
179 .end
= 0x203FB800 + 1,
180 .flags
= IORESOURCE_MEM
,
184 .end
= 0x203FB804 + 1,
185 .flags
= IORESOURCE_MEM
,
190 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
194 static struct platform_device dm9000_device
= {
197 .num_resources
= ARRAY_SIZE(dm9000_resources
),
198 .resource
= dm9000_resources
,
202 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
203 static struct resource sl811_hcd_resources
[] = {
207 .flags
= IORESOURCE_MEM
,
211 .flags
= IORESOURCE_MEM
,
215 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
219 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
220 void sl811_port_power(struct device
*dev
, int is_on
)
222 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
223 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
227 static struct sl811_platform_data sl811_priv
= {
229 .power
= 250, /* == 500mA */
230 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
231 .port_power
= &sl811_port_power
,
235 static struct platform_device sl811_hcd_device
= {
239 .platform_data
= &sl811_priv
,
241 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
242 .resource
= sl811_hcd_resources
,
246 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
247 static struct resource isp1362_hcd_resources
[] = {
251 .flags
= IORESOURCE_MEM
,
255 .flags
= IORESOURCE_MEM
,
259 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
263 static struct isp1362_platform_data isp1362_priv
= {
268 .int_edge_triggered
= 0,
269 .remote_wakeup_connected
= 0,
270 .no_power_switching
= 1,
271 .power_switching_mode
= 0,
274 static struct platform_device isp1362_hcd_device
= {
275 .name
= "isp1362-hcd",
278 .platform_data
= &isp1362_priv
,
280 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
281 .resource
= isp1362_hcd_resources
,
285 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
286 unsigned short bfin_can_peripherals
[] = {
287 P_CAN0_RX
, P_CAN0_TX
, 0
290 static struct resource bfin_can_resources
[] = {
294 .flags
= IORESOURCE_MEM
,
299 .flags
= IORESOURCE_IRQ
,
304 .flags
= IORESOURCE_IRQ
,
307 .start
= IRQ_CAN_ERROR
,
308 .end
= IRQ_CAN_ERROR
,
309 .flags
= IORESOURCE_IRQ
,
313 static struct platform_device bfin_can_device
= {
315 .num_resources
= ARRAY_SIZE(bfin_can_resources
),
316 .resource
= bfin_can_resources
,
318 .platform_data
= &bfin_can_peripherals
, /* Passed to driver */
323 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
324 static struct platform_device bfin_mii_bus
= {
325 .name
= "bfin_mii_bus",
328 static struct platform_device bfin_mac_device
= {
330 .dev
.platform_data
= &bfin_mii_bus
,
334 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
335 static struct resource net2272_bfin_resources
[] = {
338 .end
= 0x20300000 + 0x100,
339 .flags
= IORESOURCE_MEM
,
343 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
347 static struct platform_device net2272_bfin_device
= {
350 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
351 .resource
= net2272_bfin_resources
,
355 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
356 #ifdef CONFIG_MTD_PARTITIONS
357 const char *part_probes
[] = { "cmdlinepart", "RedBoot", NULL
};
359 static struct mtd_partition bfin_plat_nand_partitions
[] = {
361 .name
= "linux kernel(nand)",
365 .name
= "file system(nand)",
366 .size
= MTDPART_SIZ_FULL
,
367 .offset
= MTDPART_OFS_APPEND
,
372 #define BFIN_NAND_PLAT_CLE 2
373 #define BFIN_NAND_PLAT_ALE 1
374 static void bfin_plat_nand_cmd_ctrl(struct mtd_info
*mtd
, int cmd
, unsigned int ctrl
)
376 struct nand_chip
*this = mtd
->priv
;
378 if (cmd
== NAND_CMD_NONE
)
382 writeb(cmd
, this->IO_ADDR_W
+ (1 << BFIN_NAND_PLAT_CLE
));
384 writeb(cmd
, this->IO_ADDR_W
+ (1 << BFIN_NAND_PLAT_ALE
));
387 #define BFIN_NAND_PLAT_READY GPIO_PF3
388 static int bfin_plat_nand_dev_ready(struct mtd_info
*mtd
)
390 return gpio_get_value(BFIN_NAND_PLAT_READY
);
393 static struct platform_nand_data bfin_plat_nand_data
= {
396 #ifdef CONFIG_MTD_PARTITIONS
397 .part_probe_types
= part_probes
,
398 .partitions
= bfin_plat_nand_partitions
,
399 .nr_partitions
= ARRAY_SIZE(bfin_plat_nand_partitions
),
403 .cmd_ctrl
= bfin_plat_nand_cmd_ctrl
,
404 .dev_ready
= bfin_plat_nand_dev_ready
,
408 #define MAX(x, y) (x > y ? x : y)
409 static struct resource bfin_plat_nand_resources
= {
411 .end
= 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE
, BFIN_NAND_PLAT_ALE
)),
412 .flags
= IORESOURCE_IO
,
415 static struct platform_device bfin_async_nand_device
= {
419 .resource
= &bfin_plat_nand_resources
,
421 .platform_data
= &bfin_plat_nand_data
,
425 static void bfin_plat_nand_init(void)
427 gpio_request(BFIN_NAND_PLAT_READY
, "bfin_nand_plat");
430 static void bfin_plat_nand_init(void) {}
433 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
434 static struct mtd_partition stamp_partitions
[] = {
436 .name
= "bootloader(nor)",
440 .name
= "linux kernel(nor)",
442 .offset
= MTDPART_OFS_APPEND
,
444 .name
= "file system(nor)",
445 .size
= 0x400000 - 0x40000 - 0x180000 - 0x10000,
446 .offset
= MTDPART_OFS_APPEND
,
448 .name
= "MAC Address(nor)",
449 .size
= MTDPART_SIZ_FULL
,
451 .mask_flags
= MTD_WRITEABLE
,
455 static struct physmap_flash_data stamp_flash_data
= {
457 .parts
= stamp_partitions
,
458 .nr_parts
= ARRAY_SIZE(stamp_partitions
),
459 #ifdef CONFIG_ROMKERNEL
460 .probe_type
= "map_rom",
464 static struct resource stamp_flash_resource
= {
467 .flags
= IORESOURCE_MEM
,
470 static struct platform_device stamp_flash_device
= {
471 .name
= "physmap-flash",
474 .platform_data
= &stamp_flash_data
,
477 .resource
= &stamp_flash_resource
,
481 #if defined(CONFIG_MTD_M25P80) \
482 || defined(CONFIG_MTD_M25P80_MODULE)
483 static struct mtd_partition bfin_spi_flash_partitions
[] = {
485 .name
= "bootloader(spi)",
488 .mask_flags
= MTD_CAP_ROM
490 .name
= "linux kernel(spi)",
492 .offset
= MTDPART_OFS_APPEND
,
494 .name
= "file system(spi)",
495 .size
= MTDPART_SIZ_FULL
,
496 .offset
= MTDPART_OFS_APPEND
,
500 static struct flash_platform_data bfin_spi_flash_data
= {
502 .parts
= bfin_spi_flash_partitions
,
503 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
504 /* .type = "m25p64", */
507 /* SPI flash chip (m25p64) */
508 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
509 .enable_dma
= 0, /* use dma transfer with this chip*/
514 #if defined(CONFIG_BFIN_SPI_ADC) \
515 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
517 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
518 .enable_dma
= 1, /* use dma transfer with this chip*/
523 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
524 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
525 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
531 #if defined(CONFIG_SND_BF5XX_SOC_AD1938) \
532 || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
533 static struct bfin5xx_spi_chip ad1938_spi_chip_info
= {
539 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
540 #include <linux/input/ad714x.h>
541 static struct bfin5xx_spi_chip ad7147_spi_chip_info
= {
546 static struct ad714x_slider_plat ad7147_spi_slider_plat
[] = {
554 static struct ad714x_button_plat ad7147_spi_button_plat
[] = {
556 .keycode
= BTN_FORWARD
,
566 .keycode
= BTN_MIDDLE
,
571 .keycode
= BTN_RIGHT
,
581 static struct ad714x_platform_data ad7147_spi_platform_data
= {
584 .slider
= ad7147_spi_slider_plat
,
585 .button
= ad7147_spi_button_plat
,
587 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
588 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
589 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
590 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
591 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
592 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
593 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
594 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
595 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
596 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
597 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
598 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
600 .sys_cfg_reg
= {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
604 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
605 #include <linux/input/ad714x.h>
606 static struct ad714x_button_plat ad7142_i2c_button_plat
[] = {
628 static struct ad714x_platform_data ad7142_i2c_platform_data
= {
630 .button
= ad7142_i2c_button_plat
,
632 /* fixme: figure out right setting for all comoponent according
633 * to hardware feature of EVAL-AD7142EB board */
634 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
635 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
636 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
637 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
638 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
639 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
640 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
641 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
642 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
643 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
644 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
645 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
647 .sys_cfg_reg
= {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
651 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
652 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
654 static int bfin_mmc_spi_init(struct device
*dev
,
655 irqreturn_t (*detect_int
)(int, void *), void *data
)
657 return request_irq(MMC_SPI_CARD_DETECT_INT
, detect_int
,
658 IRQF_TRIGGER_FALLING
, "mmc-spi-detect", data
);
661 static void bfin_mmc_spi_exit(struct device
*dev
, void *data
)
663 free_irq(MMC_SPI_CARD_DETECT_INT
, data
);
666 static struct mmc_spi_platform_data bfin_mmc_spi_pdata
= {
667 .init
= bfin_mmc_spi_init
,
668 .exit
= bfin_mmc_spi_exit
,
669 .detect_delay
= 100, /* msecs */
672 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
679 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
680 #include <linux/spi/ad7877.h>
681 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
686 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
688 .vref_delay_usecs
= 50, /* internal, no capacitor */
691 .pressure_max
= 1000,
693 .stopacq_polarity
= 1,
694 .first_conversion_delay
= 3,
695 .acquisition_time
= 1,
697 .pen_down_acc_interval
= 1,
701 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
702 #include <linux/spi/ad7879.h>
703 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
704 .model
= 7879, /* Model = AD7879 */
705 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
706 .pressure_max
= 10000,
708 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
709 .acquisition_time
= 1, /* 4us acquisition time per sample */
710 .median
= 2, /* do 8 measurements */
711 .averaging
= 1, /* take the average of 4 middle samples */
712 .pen_down_acc_interval
= 255, /* 9.4 ms */
713 .gpio_export
= 1, /* Export GPIO to gpiolib */
714 .gpio_base
= -1, /* Dynamic allocation */
718 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
719 #include <linux/input/adxl34x.h>
720 static const struct adxl34x_platform_data adxl34x_info
= {
724 .tap_threshold
= 0x31,
725 .tap_duration
= 0x10,
728 .tap_axis_control
= ADXL_TAP_X_EN
| ADXL_TAP_Y_EN
| ADXL_TAP_Z_EN
,
729 .act_axis_control
= 0xFF,
730 .activity_threshold
= 5,
731 .inactivity_threshold
= 3,
732 .inactivity_time
= 4,
733 .free_fall_threshold
= 0x7,
734 .free_fall_time
= 0x20,
736 .data_range
= ADXL_FULL_RES
,
739 .ev_code_x
= ABS_X
, /* EV_REL */
740 .ev_code_y
= ABS_Y
, /* EV_REL */
741 .ev_code_z
= ABS_Z
, /* EV_REL */
743 .ev_code_tap
= {BTN_TOUCH
, BTN_TOUCH
, BTN_TOUCH
}, /* EV_KEY x,y,z */
745 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
746 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
747 .power_mode
= ADXL_AUTO_SLEEP
| ADXL_LINK
,
748 .fifo_mode
= ADXL_FIFO_STREAM
,
752 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
753 static struct bfin5xx_spi_chip spi_ad7879_chip_info
= {
759 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
760 static struct bfin5xx_spi_chip spidev_chip_info
= {
766 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
767 static struct bfin5xx_spi_chip lq035q1_spi_chip_info
= {
773 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
774 static struct bfin5xx_spi_chip enc28j60_spi_chip_info
= {
777 .cs_gpio
= GPIO_PF10
,
781 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
782 static struct bfin5xx_spi_chip adf7021_spi_chip_info
= {
784 .cs_gpio
= GPIO_PF10
,
787 #include <linux/spi/adf702x.h>
788 #define TXREG 0x0160A470
789 static const u32 adf7021_regs
[] = {
808 static struct adf702x_platform_data adf7021_platform_data
= {
809 .regs_base
= (void *)SPORT1_TCR1
,
810 .dma_ch_rx
= CH_SPORT1_RX
,
811 .dma_ch_tx
= CH_SPORT1_TX
,
812 .irq_sport_err
= IRQ_SPORT1_ERROR
,
813 .gpio_int_rfs
= GPIO_PF8
,
814 .pin_req
= {P_SPORT1_DTPRI
, P_SPORT1_RFS
, P_SPORT1_DRPRI
,
815 P_SPORT1_RSCLK
, P_SPORT1_TSCLK
, 0},
816 .adf702x_model
= MODEL_ADF7021
,
817 .adf702x_regs
= adf7021_regs
,
820 static inline void adf702x_mac_init(void)
822 random_ether_addr(adf7021_platform_data
.mac_addr
);
825 static inline void adf702x_mac_init(void) {}
828 #if defined(CONFIG_MTD_DATAFLASH) \
829 || defined(CONFIG_MTD_DATAFLASH_MODULE)
831 static struct mtd_partition bfin_spi_dataflash_partitions
[] = {
833 .name
= "bootloader(spi)",
836 .mask_flags
= MTD_CAP_ROM
838 .name
= "linux kernel(spi)",
840 .offset
= MTDPART_OFS_APPEND
,
842 .name
= "file system(spi)",
843 .size
= MTDPART_SIZ_FULL
,
844 .offset
= MTDPART_OFS_APPEND
,
848 static struct flash_platform_data bfin_spi_dataflash_data
= {
849 .name
= "SPI Dataflash",
850 .parts
= bfin_spi_dataflash_partitions
,
851 .nr_parts
= ARRAY_SIZE(bfin_spi_dataflash_partitions
),
855 static struct bfin5xx_spi_chip data_flash_chip_info
= {
856 .enable_dma
= 0, /* use dma transfer with this chip*/
861 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
862 static struct bfin5xx_spi_chip spi_adxl34x_chip_info
= {
863 .enable_dma
= 0, /* use dma transfer with this chip*/
868 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
869 #if defined(CONFIG_MTD_M25P80) \
870 || defined(CONFIG_MTD_M25P80_MODULE)
872 /* the modalias must be the same as spi device driver name */
873 .modalias
= "m25p80", /* Name of spi_driver for this device */
874 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
875 .bus_num
= 0, /* Framework bus number */
876 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
877 .platform_data
= &bfin_spi_flash_data
,
878 .controller_data
= &spi_flash_chip_info
,
882 #if defined(CONFIG_MTD_DATAFLASH) \
883 || defined(CONFIG_MTD_DATAFLASH_MODULE)
884 { /* DataFlash chip */
885 .modalias
= "mtd_dataflash",
886 .max_speed_hz
= 33250000, /* max spi clock (SCK) speed in HZ */
887 .bus_num
= 0, /* Framework bus number */
888 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
889 .platform_data
= &bfin_spi_dataflash_data
,
890 .controller_data
= &data_flash_chip_info
,
894 #if defined(CONFIG_BFIN_SPI_ADC) \
895 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
897 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
898 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
899 .bus_num
= 0, /* Framework bus number */
900 .chip_select
= 1, /* Framework chip select. */
901 .platform_data
= NULL
, /* No spi_driver specific config */
902 .controller_data
= &spi_adc_chip_info
,
906 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
907 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
909 .modalias
= "ad1836",
910 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
912 .chip_select
= 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
913 .controller_data
= &ad1836_spi_chip_info
,
918 #if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
920 .modalias
= "ad1938",
921 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
924 .controller_data
= &ad1938_spi_chip_info
,
929 #if defined(CONFIG_INPUT_AD714X_SPI) || defined(CONFIG_INPUT_AD714X_SPI_MODULE)
931 .modalias
= "ad714x_captouch",
932 .max_speed_hz
= 1000000, /* max spi clock (SCK) speed in HZ */
937 .platform_data
= &ad7147_spi_platform_data
,
938 .controller_data
= &ad7147_spi_chip_info
,
942 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
944 .modalias
= "mmc_spi",
945 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
948 .platform_data
= &bfin_mmc_spi_pdata
,
949 .controller_data
= &mmc_spi_chip_info
,
953 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
955 .modalias
= "ad7877",
956 .platform_data
= &bfin_ad7877_ts_info
,
958 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
961 .controller_data
= &spi_ad7877_chip_info
,
964 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
966 .modalias
= "ad7879",
967 .platform_data
= &bfin_ad7879_ts_info
,
969 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
972 .controller_data
= &spi_ad7879_chip_info
,
973 .mode
= SPI_CPHA
| SPI_CPOL
,
976 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
978 .modalias
= "spidev",
979 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
982 .controller_data
= &spidev_chip_info
,
985 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
987 .modalias
= "bfin-lq035q1-spi",
988 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
991 .controller_data
= &lq035q1_spi_chip_info
,
992 .mode
= SPI_CPHA
| SPI_CPOL
,
995 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
997 .modalias
= "enc28j60",
998 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
1001 .chip_select
= 0, /* GPIO controlled SSEL */
1002 .controller_data
= &enc28j60_spi_chip_info
,
1006 #if defined(CONFIG_INPUT_ADXL34X_SPI) || defined(CONFIG_INPUT_ADXL34X_SPI_MODULE)
1008 .modalias
= "adxl34x",
1009 .platform_data
= &adxl34x_info
,
1011 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
1014 .controller_data
= &spi_adxl34x_chip_info
,
1018 #if defined(CONFIG_ADF702X) || defined(CONFIG_ADF702X_MODULE)
1020 .modalias
= "adf702x",
1021 .max_speed_hz
= 16000000, /* max spi clock (SCK) speed in HZ */
1023 .chip_select
= 0, /* GPIO controlled SSEL */
1024 .controller_data
= &adf7021_spi_chip_info
,
1025 .platform_data
= &adf7021_platform_data
,
1032 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1033 /* SPI controller data */
1034 static struct bfin5xx_spi_master bfin_spi0_info
= {
1035 .num_chipselect
= 8,
1036 .enable_dma
= 1, /* master has the ability to do dma transfer */
1037 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
1041 static struct resource bfin_spi0_resource
[] = {
1043 .start
= SPI0_REGBASE
,
1044 .end
= SPI0_REGBASE
+ 0xFF,
1045 .flags
= IORESOURCE_MEM
,
1050 .flags
= IORESOURCE_DMA
,
1055 .flags
= IORESOURCE_IRQ
,
1059 static struct platform_device bfin_spi0_device
= {
1061 .id
= 0, /* Bus number */
1062 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
1063 .resource
= bfin_spi0_resource
,
1065 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
1068 #endif /* spi master and devices */
1070 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1072 /* SPORT SPI controller data */
1073 static struct bfin5xx_spi_master bfin_sport_spi0_info
= {
1074 .num_chipselect
= 1, /* master only supports one device */
1075 .enable_dma
= 0, /* master don't support DMA */
1076 .pin_req
= {P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_DRPRI
,
1077 P_SPORT0_RSCLK
, P_SPORT0_TFS
, P_SPORT0_RFS
, 0},
1080 static struct resource bfin_sport_spi0_resource
[] = {
1082 .start
= SPORT0_TCR1
,
1083 .end
= SPORT0_TCR1
+ 0xFF,
1084 .flags
= IORESOURCE_MEM
,
1087 .start
= IRQ_SPORT0_ERROR
,
1088 .end
= IRQ_SPORT0_ERROR
,
1089 .flags
= IORESOURCE_IRQ
,
1093 static struct platform_device bfin_sport_spi0_device
= {
1094 .name
= "bfin-sport-spi",
1095 .id
= 1, /* Bus number */
1096 .num_resources
= ARRAY_SIZE(bfin_sport_spi0_resource
),
1097 .resource
= bfin_sport_spi0_resource
,
1099 .platform_data
= &bfin_sport_spi0_info
, /* Passed to driver */
1103 static struct bfin5xx_spi_master bfin_sport_spi1_info
= {
1104 .num_chipselect
= 1, /* master only supports one device */
1105 .enable_dma
= 0, /* master don't support DMA */
1106 .pin_req
= {P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_DRPRI
,
1107 P_SPORT1_RSCLK
, P_SPORT1_TFS
, P_SPORT1_RFS
, 0},
1110 static struct resource bfin_sport_spi1_resource
[] = {
1112 .start
= SPORT1_TCR1
,
1113 .end
= SPORT1_TCR1
+ 0xFF,
1114 .flags
= IORESOURCE_MEM
,
1117 .start
= IRQ_SPORT1_ERROR
,
1118 .end
= IRQ_SPORT1_ERROR
,
1119 .flags
= IORESOURCE_IRQ
,
1123 static struct platform_device bfin_sport_spi1_device
= {
1124 .name
= "bfin-sport-spi",
1125 .id
= 2, /* Bus number */
1126 .num_resources
= ARRAY_SIZE(bfin_sport_spi1_resource
),
1127 .resource
= bfin_sport_spi1_resource
,
1129 .platform_data
= &bfin_sport_spi1_info
, /* Passed to driver */
1133 #endif /* sport spi master and devices */
1135 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1136 static struct platform_device bfin_fb_device
= {
1137 .name
= "bf537-lq035",
1141 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1142 #include <asm/bfin-lq035q1.h>
1144 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data
= {
1145 .mode
= LQ035_NORM
| LQ035_RGB
| LQ035_RL
| LQ035_TB
,
1146 .ppi_mode
= USE_RGB565_16_BIT_PPI
,
1147 .use_bl
= 0, /* let something else control the LCD Blacklight */
1148 .gpio_bl
= GPIO_PF7
,
1151 static struct resource bfin_lq035q1_resources
[] = {
1153 .start
= IRQ_PPI_ERROR
,
1154 .end
= IRQ_PPI_ERROR
,
1155 .flags
= IORESOURCE_IRQ
,
1159 static struct platform_device bfin_lq035q1_device
= {
1160 .name
= "bfin-lq035q1",
1162 .num_resources
= ARRAY_SIZE(bfin_lq035q1_resources
),
1163 .resource
= bfin_lq035q1_resources
,
1165 .platform_data
= &bfin_lq035q1_data
,
1170 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1171 #ifdef CONFIG_SERIAL_BFIN_UART0
1172 static struct resource bfin_uart0_resources
[] = {
1175 .end
= UART0_GCTL
+2,
1176 .flags
= IORESOURCE_MEM
,
1179 .start
= IRQ_UART0_RX
,
1180 .end
= IRQ_UART0_RX
+1,
1181 .flags
= IORESOURCE_IRQ
,
1184 .start
= IRQ_UART0_ERROR
,
1185 .end
= IRQ_UART0_ERROR
,
1186 .flags
= IORESOURCE_IRQ
,
1189 .start
= CH_UART0_TX
,
1191 .flags
= IORESOURCE_DMA
,
1194 .start
= CH_UART0_RX
,
1196 .flags
= IORESOURCE_DMA
,
1198 #ifdef CONFIG_BFIN_UART0_CTSRTS
1202 .flags
= IORESOURCE_IO
,
1207 .flags
= IORESOURCE_IO
,
1212 unsigned short bfin_uart0_peripherals
[] = {
1213 P_UART0_TX
, P_UART0_RX
, 0
1216 static struct platform_device bfin_uart0_device
= {
1217 .name
= "bfin-uart",
1219 .num_resources
= ARRAY_SIZE(bfin_uart0_resources
),
1220 .resource
= bfin_uart0_resources
,
1222 .platform_data
= &bfin_uart0_peripherals
, /* Passed to driver */
1226 #ifdef CONFIG_SERIAL_BFIN_UART1
1227 static struct resource bfin_uart1_resources
[] = {
1230 .end
= UART1_GCTL
+2,
1231 .flags
= IORESOURCE_MEM
,
1234 .start
= IRQ_UART1_RX
,
1235 .end
= IRQ_UART1_RX
+1,
1236 .flags
= IORESOURCE_IRQ
,
1239 .start
= IRQ_UART1_ERROR
,
1240 .end
= IRQ_UART1_ERROR
,
1241 .flags
= IORESOURCE_IRQ
,
1244 .start
= CH_UART1_TX
,
1246 .flags
= IORESOURCE_DMA
,
1249 .start
= CH_UART1_RX
,
1251 .flags
= IORESOURCE_DMA
,
1255 unsigned short bfin_uart1_peripherals
[] = {
1256 P_UART1_TX
, P_UART1_RX
, 0
1259 static struct platform_device bfin_uart1_device
= {
1260 .name
= "bfin-uart",
1262 .num_resources
= ARRAY_SIZE(bfin_uart1_resources
),
1263 .resource
= bfin_uart1_resources
,
1265 .platform_data
= &bfin_uart1_peripherals
, /* Passed to driver */
1271 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1272 #ifdef CONFIG_BFIN_SIR0
1273 static struct resource bfin_sir0_resources
[] = {
1275 .start
= 0xFFC00400,
1277 .flags
= IORESOURCE_MEM
,
1280 .start
= IRQ_UART0_RX
,
1281 .end
= IRQ_UART0_RX
+1,
1282 .flags
= IORESOURCE_IRQ
,
1285 .start
= CH_UART0_RX
,
1286 .end
= CH_UART0_RX
+1,
1287 .flags
= IORESOURCE_DMA
,
1291 static struct platform_device bfin_sir0_device
= {
1294 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
1295 .resource
= bfin_sir0_resources
,
1298 #ifdef CONFIG_BFIN_SIR1
1299 static struct resource bfin_sir1_resources
[] = {
1301 .start
= 0xFFC02000,
1303 .flags
= IORESOURCE_MEM
,
1306 .start
= IRQ_UART1_RX
,
1307 .end
= IRQ_UART1_RX
+1,
1308 .flags
= IORESOURCE_IRQ
,
1311 .start
= CH_UART1_RX
,
1312 .end
= CH_UART1_RX
+1,
1313 .flags
= IORESOURCE_DMA
,
1317 static struct platform_device bfin_sir1_device
= {
1320 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
1321 .resource
= bfin_sir1_resources
,
1326 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1327 static struct resource bfin_twi0_resource
[] = {
1329 .start
= TWI0_REGBASE
,
1330 .end
= TWI0_REGBASE
,
1331 .flags
= IORESOURCE_MEM
,
1336 .flags
= IORESOURCE_IRQ
,
1340 static struct platform_device i2c_bfin_twi_device
= {
1341 .name
= "i2c-bfin-twi",
1343 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
1344 .resource
= bfin_twi0_resource
,
1348 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1349 static const unsigned short adp5588_keymap
[ADP5588_KEYMAPSIZE
] = {
1363 [13] = KEY_BACKSLASH
,
1375 [26] = KEY_LEFTBRACE
,
1376 [27] = KEY_RIGHTBRACE
,
1389 [41] = KEY_SEMICOLON
,
1390 [42] = KEY_APOSTROPHE
,
1391 [43] = KEY_BACKSLASH
,
1411 [65] = KEY_BACKSPACE
,
1424 static struct adp5588_kpad_platform_data adp5588_kpad_data
= {
1427 .keymap
= adp5588_keymap
,
1428 .keymapsize
= ARRAY_SIZE(adp5588_keymap
),
1433 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1434 #include <linux/mfd/adp5520.h>
1437 * ADP5520/5501 Backlight Data
1440 static struct adp5520_backlight_platform_data adp5520_backlight_data
= {
1441 .fade_in
= ADP5520_FADE_T_1200ms
,
1442 .fade_out
= ADP5520_FADE_T_1200ms
,
1443 .fade_led_law
= ADP5520_BL_LAW_LINEAR
,
1445 .abml_filt
= ADP5520_BL_AMBL_FILT_640ms
,
1446 .l1_daylight_max
= ADP5520_BL_CUR_mA(15),
1447 .l1_daylight_dim
= ADP5520_BL_CUR_mA(0),
1448 .l2_office_max
= ADP5520_BL_CUR_mA(7),
1449 .l2_office_dim
= ADP5520_BL_CUR_mA(0),
1450 .l3_dark_max
= ADP5520_BL_CUR_mA(3),
1451 .l3_dark_dim
= ADP5520_BL_CUR_mA(0),
1452 .l2_trip
= ADP5520_L2_COMP_CURR_uA(700),
1453 .l2_hyst
= ADP5520_L2_COMP_CURR_uA(50),
1454 .l3_trip
= ADP5520_L3_COMP_CURR_uA(80),
1455 .l3_hyst
= ADP5520_L3_COMP_CURR_uA(20),
1459 * ADP5520/5501 LEDs Data
1462 static struct led_info adp5520_leds
[] = {
1464 .name
= "adp5520-led1",
1465 .default_trigger
= "none",
1466 .flags
= FLAG_ID_ADP5520_LED1_ADP5501_LED0
| ADP5520_LED_OFFT_600ms
,
1468 #ifdef ADP5520_EN_ALL_LEDS
1470 .name
= "adp5520-led2",
1471 .default_trigger
= "none",
1472 .flags
= FLAG_ID_ADP5520_LED2_ADP5501_LED1
,
1475 .name
= "adp5520-led3",
1476 .default_trigger
= "none",
1477 .flags
= FLAG_ID_ADP5520_LED3_ADP5501_LED2
,
1482 static struct adp5520_leds_platform_data adp5520_leds_data
= {
1483 .num_leds
= ARRAY_SIZE(adp5520_leds
),
1484 .leds
= adp5520_leds
,
1485 .fade_in
= ADP5520_FADE_T_600ms
,
1486 .fade_out
= ADP5520_FADE_T_600ms
,
1487 .led_on_time
= ADP5520_LED_ONT_600ms
,
1494 static struct adp5520_gpio_platform_data adp5520_gpio_data
= {
1496 .gpio_en_mask
= ADP5520_GPIO_C1
| ADP5520_GPIO_C2
| ADP5520_GPIO_R2
,
1497 .gpio_pullup_mask
= ADP5520_GPIO_C1
| ADP5520_GPIO_C2
| ADP5520_GPIO_R2
,
1501 * ADP5520 Keypad Data
1504 static const unsigned short adp5520_keymap
[ADP5520_KEYMAPSIZE
] = {
1505 [ADP5520_KEY(0, 0)] = KEY_GRAVE
,
1506 [ADP5520_KEY(0, 1)] = KEY_1
,
1507 [ADP5520_KEY(0, 2)] = KEY_2
,
1508 [ADP5520_KEY(0, 3)] = KEY_3
,
1509 [ADP5520_KEY(1, 0)] = KEY_4
,
1510 [ADP5520_KEY(1, 1)] = KEY_5
,
1511 [ADP5520_KEY(1, 2)] = KEY_6
,
1512 [ADP5520_KEY(1, 3)] = KEY_7
,
1513 [ADP5520_KEY(2, 0)] = KEY_8
,
1514 [ADP5520_KEY(2, 1)] = KEY_9
,
1515 [ADP5520_KEY(2, 2)] = KEY_0
,
1516 [ADP5520_KEY(2, 3)] = KEY_MINUS
,
1517 [ADP5520_KEY(3, 0)] = KEY_EQUAL
,
1518 [ADP5520_KEY(3, 1)] = KEY_BACKSLASH
,
1519 [ADP5520_KEY(3, 2)] = KEY_BACKSPACE
,
1520 [ADP5520_KEY(3, 3)] = KEY_ENTER
,
1523 static struct adp5520_keys_platform_data adp5520_keys_data
= {
1524 .rows_en_mask
= ADP5520_ROW_R3
| ADP5520_ROW_R2
| ADP5520_ROW_R1
| ADP5520_ROW_R0
,
1525 .cols_en_mask
= ADP5520_COL_C3
| ADP5520_COL_C2
| ADP5520_COL_C1
| ADP5520_COL_C0
,
1526 .keymap
= adp5520_keymap
,
1527 .keymapsize
= ARRAY_SIZE(adp5520_keymap
),
1532 * ADP5520/5501 Multifuction Device Init Data
1535 static struct adp5520_platform_data adp5520_pdev_data
= {
1536 .backlight
= &adp5520_backlight_data
,
1537 .leds
= &adp5520_leds_data
,
1538 .gpio
= &adp5520_gpio_data
,
1539 .keys
= &adp5520_keys_data
,
1544 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1545 static struct adp5588_gpio_platform_data adp5588_gpio_data
= {
1547 .pullup_dis_mask
= 0,
1551 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1552 #include <linux/i2c/adp8870.h>
1553 static struct led_info adp8870_leds
[] = {
1555 .name
= "adp8870-led7",
1556 .default_trigger
= "none",
1557 .flags
= ADP8870_LED_D7
| ADP8870_LED_OFFT_600ms
,
1562 static struct adp8870_backlight_platform_data adp8870_pdata
= {
1563 .bl_led_assign
= ADP8870_BL_D1
| ADP8870_BL_D2
| ADP8870_BL_D3
|
1564 ADP8870_BL_D4
| ADP8870_BL_D5
| ADP8870_BL_D6
, /* 1 = Backlight 0 = Individual LED */
1565 .pwm_assign
= 0, /* 1 = Enables PWM mode */
1567 .bl_fade_in
= ADP8870_FADE_T_1200ms
, /* Backlight Fade-In Timer */
1568 .bl_fade_out
= ADP8870_FADE_T_1200ms
, /* Backlight Fade-Out Timer */
1569 .bl_fade_law
= ADP8870_FADE_LAW_CUBIC1
, /* fade-on/fade-off transfer characteristic */
1571 .en_ambl_sens
= 1, /* 1 = enable ambient light sensor */
1572 .abml_filt
= ADP8870_BL_AMBL_FILT_320ms
, /* Light sensor filter time */
1574 .l1_daylight_max
= ADP8870_BL_CUR_mA(20), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1575 .l1_daylight_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1576 .l2_bright_max
= ADP8870_BL_CUR_mA(14), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1577 .l2_bright_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1578 .l3_office_max
= ADP8870_BL_CUR_mA(6), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1579 .l3_office_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1580 .l4_indoor_max
= ADP8870_BL_CUR_mA(3), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1581 .l4_indor_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1582 .l5_dark_max
= ADP8870_BL_CUR_mA(2), /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
1583 .l5_dark_dim
= ADP8870_BL_CUR_mA(0), /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
1585 .l2_trip
= ADP8870_L2_COMP_CURR_uA(710), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1586 .l2_hyst
= ADP8870_L2_COMP_CURR_uA(73), /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
1587 .l3_trip
= ADP8870_L3_COMP_CURR_uA(389), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1588 .l3_hyst
= ADP8870_L3_COMP_CURR_uA(54), /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
1589 .l4_trip
= ADP8870_L4_COMP_CURR_uA(167), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1590 .l4_hyst
= ADP8870_L4_COMP_CURR_uA(16), /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
1591 .l5_trip
= ADP8870_L5_COMP_CURR_uA(43), /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1592 .l5_hyst
= ADP8870_L5_COMP_CURR_uA(11), /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
1594 .leds
= adp8870_leds
,
1595 .num_leds
= ARRAY_SIZE(adp8870_leds
),
1596 .led_fade_law
= ADP8870_FADE_LAW_SQUARE
, /* fade-on/fade-off transfer characteristic */
1597 .led_fade_in
= ADP8870_FADE_T_600ms
,
1598 .led_fade_out
= ADP8870_FADE_T_600ms
,
1599 .led_on_time
= ADP8870_LED_ONT_200ms
,
1603 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
1604 #if defined(CONFIG_INPUT_AD714X_I2C) || defined(CONFIG_INPUT_AD714X_I2C_MODULE)
1606 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
1608 .platform_data
= (void *)&ad7142_i2c_platform_data
,
1611 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1613 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1616 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1618 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1622 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1624 I2C_BOARD_INFO("ad7879", 0x2F),
1626 .platform_data
= (void *)&bfin_ad7879_ts_info
,
1629 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1631 I2C_BOARD_INFO("adp5588-keys", 0x34),
1633 .platform_data
= (void *)&adp5588_kpad_data
,
1636 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1638 I2C_BOARD_INFO("pmic-adp5520", 0x32),
1640 .platform_data
= (void *)&adp5520_pdev_data
,
1643 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1645 I2C_BOARD_INFO("adxl34x", 0x53),
1647 .platform_data
= (void *)&adxl34x_info
,
1650 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1652 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1653 .platform_data
= (void *)&adp5588_gpio_data
,
1656 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1658 I2C_BOARD_INFO("bfin-adv7393", 0x2B),
1661 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1663 I2C_BOARD_INFO("bf537-lq035-ad5280", 0x2C),
1666 #if defined(CONFIG_BACKLIGHT_ADP8870) || defined(CONFIG_BACKLIGHT_ADP8870_MODULE)
1668 I2C_BOARD_INFO("adp8870", 0x2B),
1669 .platform_data
= (void *)&adp8870_pdata
,
1672 #if defined(CONFIG_SND_SOC_ADAU1371) || defined(CONFIG_SND_SOC_ADAU1371_MODULE)
1674 I2C_BOARD_INFO("adau1371", 0x1A),
1677 #if defined(CONFIG_SND_SOC_ADAU1761) || defined(CONFIG_SND_SOC_ADAU1761_MODULE)
1679 I2C_BOARD_INFO("adau1761", 0x38),
1682 #if defined(CONFIG_AD525X_DPOT) || defined(CONFIG_AD525X_DPOT_MODULE)
1684 I2C_BOARD_INFO("ad5258", 0x18),
1687 #if defined(CONFIG_SND_SOC_SSM2602) || defined(CONFIG_SND_SOC_SSM2602_MODULE)
1689 I2C_BOARD_INFO("ssm2602", 0x1b),
1694 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1695 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1696 static struct resource bfin_sport0_uart_resources
[] = {
1698 .start
= SPORT0_TCR1
,
1699 .end
= SPORT0_MRCS3
+4,
1700 .flags
= IORESOURCE_MEM
,
1703 .start
= IRQ_SPORT0_RX
,
1704 .end
= IRQ_SPORT0_RX
+1,
1705 .flags
= IORESOURCE_IRQ
,
1708 .start
= IRQ_SPORT0_ERROR
,
1709 .end
= IRQ_SPORT0_ERROR
,
1710 .flags
= IORESOURCE_IRQ
,
1714 unsigned short bfin_sport0_peripherals
[] = {
1715 P_SPORT0_TFS
, P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_RFS
,
1716 P_SPORT0_DRPRI
, P_SPORT0_RSCLK
, P_SPORT0_DRSEC
, P_SPORT0_DTSEC
, 0
1719 static struct platform_device bfin_sport0_uart_device
= {
1720 .name
= "bfin-sport-uart",
1722 .num_resources
= ARRAY_SIZE(bfin_sport0_uart_resources
),
1723 .resource
= bfin_sport0_uart_resources
,
1725 .platform_data
= &bfin_sport0_peripherals
, /* Passed to driver */
1729 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1730 static struct resource bfin_sport1_uart_resources
[] = {
1732 .start
= SPORT1_TCR1
,
1733 .end
= SPORT1_MRCS3
+4,
1734 .flags
= IORESOURCE_MEM
,
1737 .start
= IRQ_SPORT1_RX
,
1738 .end
= IRQ_SPORT1_RX
+1,
1739 .flags
= IORESOURCE_IRQ
,
1742 .start
= IRQ_SPORT1_ERROR
,
1743 .end
= IRQ_SPORT1_ERROR
,
1744 .flags
= IORESOURCE_IRQ
,
1748 unsigned short bfin_sport1_peripherals
[] = {
1749 P_SPORT1_TFS
, P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_RFS
,
1750 P_SPORT1_DRPRI
, P_SPORT1_RSCLK
, P_SPORT1_DRSEC
, P_SPORT1_DTSEC
, 0
1753 static struct platform_device bfin_sport1_uart_device
= {
1754 .name
= "bfin-sport-uart",
1756 .num_resources
= ARRAY_SIZE(bfin_sport1_uart_resources
),
1757 .resource
= bfin_sport1_uart_resources
,
1759 .platform_data
= &bfin_sport1_peripherals
, /* Passed to driver */
1765 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1766 #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1767 /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
1769 #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1770 #define PATA_INT IRQ_PF5
1771 static struct pata_platform_info bfin_pata_platform_data
= {
1773 .irq_flags
= IRQF_TRIGGER_HIGH
| IRQF_DISABLED
,
1776 static struct resource bfin_pata_resources
[] = {
1778 .start
= 0x20314020,
1780 .flags
= IORESOURCE_MEM
,
1783 .start
= 0x2031401C,
1785 .flags
= IORESOURCE_MEM
,
1790 .flags
= IORESOURCE_IRQ
,
1793 #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
1794 static struct pata_platform_info bfin_pata_platform_data
= {
1797 /* CompactFlash Storage Card Memory Mapped Adressing
1800 static struct resource bfin_pata_resources
[] = {
1802 .start
= 0x20211800,
1804 .flags
= IORESOURCE_MEM
,
1807 .start
= 0x2021180E, /* Device Ctl */
1809 .flags
= IORESOURCE_MEM
,
1814 static struct platform_device bfin_pata_device
= {
1815 .name
= "pata_platform",
1817 .num_resources
= ARRAY_SIZE(bfin_pata_resources
),
1818 .resource
= bfin_pata_resources
,
1820 .platform_data
= &bfin_pata_platform_data
,
1825 static const unsigned int cclk_vlev_datasheet
[] =
1827 VRPAIR(VLEV_085
, 250000000),
1828 VRPAIR(VLEV_090
, 376000000),
1829 VRPAIR(VLEV_095
, 426000000),
1830 VRPAIR(VLEV_100
, 426000000),
1831 VRPAIR(VLEV_105
, 476000000),
1832 VRPAIR(VLEV_110
, 476000000),
1833 VRPAIR(VLEV_115
, 476000000),
1834 VRPAIR(VLEV_120
, 500000000),
1835 VRPAIR(VLEV_125
, 533000000),
1836 VRPAIR(VLEV_130
, 600000000),
1839 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
1840 .tuple_tab
= cclk_vlev_datasheet
,
1841 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
1842 .vr_settling_time
= 25 /* us */,
1845 static struct platform_device bfin_dpmc
= {
1846 .name
= "bfin dpmc",
1848 .platform_data
= &bfin_dmpc_vreg_data
,
1852 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1853 static struct platform_device bfin_tdm
= {
1855 /* TODO: add platform data here */
1859 static struct platform_device
*stamp_devices
[] __initdata
= {
1863 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
1864 &bfin_pcmcia_cf_device
,
1867 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1871 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
1875 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
1876 &isp1362_hcd_device
,
1879 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1880 &bfin_isp1760_device
,
1883 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1887 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
1891 #if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
1895 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
1900 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
1901 &net2272_bfin_device
,
1904 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1908 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1909 &bfin_sport_spi0_device
,
1910 &bfin_sport_spi1_device
,
1913 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1917 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1918 &bfin_lq035q1_device
,
1921 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1922 #ifdef CONFIG_SERIAL_BFIN_UART0
1925 #ifdef CONFIG_SERIAL_BFIN_UART1
1930 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1931 #ifdef CONFIG_BFIN_SIR0
1934 #ifdef CONFIG_BFIN_SIR1
1939 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1940 &i2c_bfin_twi_device
,
1943 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1944 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1945 &bfin_sport0_uart_device
,
1947 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1948 &bfin_sport1_uart_device
,
1952 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1956 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1957 &bfin_device_gpiokeys
,
1960 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
1961 &bfin_async_nand_device
,
1964 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1965 &stamp_flash_device
,
1968 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1973 static int __init
stamp_init(void)
1975 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
1976 bfin_plat_nand_init();
1978 platform_add_devices(stamp_devices
, ARRAY_SIZE(stamp_devices
));
1979 i2c_register_board_info(0, bfin_i2c_board_info
,
1980 ARRAY_SIZE(bfin_i2c_board_info
));
1981 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
1986 arch_initcall(stamp_init
);
1989 static struct platform_device
*stamp_early_devices
[] __initdata
= {
1990 #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1991 #ifdef CONFIG_SERIAL_BFIN_UART0
1994 #ifdef CONFIG_SERIAL_BFIN_UART1
1999 #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
2000 #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
2001 &bfin_sport0_uart_device
,
2003 #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
2004 &bfin_sport1_uart_device
,
2009 void __init
native_machine_early_platform_add_devices(void)
2011 printk(KERN_INFO
"register early platform devices\n");
2012 early_platform_add_devices(stamp_early_devices
,
2013 ARRAY_SIZE(stamp_early_devices
));
2016 void native_machine_restart(char *cmd
)
2018 /* workaround reboot hang when booting from SPI */
2019 if ((bfin_read_SYSCR() & 0x7) == 0x3)
2020 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
2024 * Currently the MAC address is saved in Flash by U-Boot
2026 #define FLASH_MAC 0x203f0000
2027 void bfin_get_ether_addr(char *addr
)
2029 *(u32
*)(&(addr
[0])) = bfin_read32(FLASH_MAC
);
2030 *(u16
*)(&(addr
[4])) = bfin_read16(FLASH_MAC
+ 4);
2032 EXPORT_SYMBOL(bfin_get_ether_addr
);