2 * File: arch/blackfin/mach-bf537/boards/stamp.c
3 * Based on: arch/blackfin/mach-bf533/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2006 Analog Devices Inc.
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <linux/device.h>
32 #include <linux/kernel.h>
33 #include <linux/platform_device.h>
34 #include <linux/mtd/mtd.h>
35 #include <linux/mtd/nand.h>
36 #include <linux/mtd/partitions.h>
37 #include <linux/mtd/plat-ram.h>
38 #include <linux/mtd/physmap.h>
39 #include <linux/spi/spi.h>
40 #include <linux/spi/flash.h>
41 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
42 #include <linux/usb/isp1362.h>
44 #include <linux/ata_platform.h>
45 #include <linux/irq.h>
46 #include <linux/interrupt.h>
47 #include <linux/i2c.h>
48 #include <linux/usb/sl811.h>
49 #include <linux/spi/mmc_spi.h>
51 #include <asm/bfin5xx_spi.h>
52 #include <asm/reboot.h>
53 #include <asm/portmux.h>
57 * Name the Board for the /proc/cpuinfo
59 const char bfin_board_name
[] = "ADI BF537-STAMP";
62 * Driver needs to know address, irq and flag pin.
65 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
66 #include <linux/usb/isp1760.h>
67 static struct resource bfin_isp1760_resources
[] = {
70 .end
= 0x203C0000 + 0x000fffff,
71 .flags
= IORESOURCE_MEM
,
76 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
80 static struct isp1760_platform_data isp1760_priv
= {
85 .dack_polarity_high
= 0,
86 .dreq_polarity_high
= 0,
89 static struct platform_device bfin_isp1760_device
= {
90 .name
= "isp1760-hcd",
93 .platform_data
= &isp1760_priv
,
95 .num_resources
= ARRAY_SIZE(bfin_isp1760_resources
),
96 .resource
= bfin_isp1760_resources
,
100 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
101 #include <linux/input.h>
102 #include <linux/gpio_keys.h>
104 static struct gpio_keys_button bfin_gpio_keys_table
[] = {
105 {BTN_0
, GPIO_PF2
, 1, "gpio-keys: BTN0"},
106 {BTN_1
, GPIO_PF3
, 1, "gpio-keys: BTN1"},
107 {BTN_2
, GPIO_PF4
, 1, "gpio-keys: BTN2"},
108 {BTN_3
, GPIO_PF5
, 1, "gpio-keys: BTN3"},
111 static struct gpio_keys_platform_data bfin_gpio_keys_data
= {
112 .buttons
= bfin_gpio_keys_table
,
113 .nbuttons
= ARRAY_SIZE(bfin_gpio_keys_table
),
116 static struct platform_device bfin_device_gpiokeys
= {
119 .platform_data
= &bfin_gpio_keys_data
,
124 static struct resource bfin_gpios_resources
= {
126 .end
= MAX_BLACKFIN_GPIOS
- 1,
127 .flags
= IORESOURCE_IRQ
,
130 static struct platform_device bfin_gpios_device
= {
131 .name
= "simple-gpio",
134 .resource
= &bfin_gpios_resources
,
137 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
138 static struct resource bfin_pcmcia_cf_resources
[] = {
140 .start
= 0x20310000, /* IO PORT */
142 .flags
= IORESOURCE_MEM
,
144 .start
= 0x20311000, /* Attribute Memory */
146 .flags
= IORESOURCE_MEM
,
150 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
,
152 .start
= 6, /* Card Detect PF6 */
154 .flags
= IORESOURCE_IRQ
,
158 static struct platform_device bfin_pcmcia_cf_device
= {
159 .name
= "bfin_cf_pcmcia",
161 .num_resources
= ARRAY_SIZE(bfin_pcmcia_cf_resources
),
162 .resource
= bfin_pcmcia_cf_resources
,
166 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
167 static struct platform_device rtc_device
= {
173 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
174 #include <linux/smc91x.h>
176 static struct smc91x_platdata smc91x_info
= {
177 .flags
= SMC91X_USE_16BIT
| SMC91X_NOWAIT
,
178 .leda
= RPC_LED_100_10
,
179 .ledb
= RPC_LED_TX_RX
,
182 static struct resource smc91x_resources
[] = {
184 .name
= "smc91x-regs",
186 .end
= 0x20300300 + 16,
187 .flags
= IORESOURCE_MEM
,
192 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
195 static struct platform_device smc91x_device
= {
198 .num_resources
= ARRAY_SIZE(smc91x_resources
),
199 .resource
= smc91x_resources
,
201 .platform_data
= &smc91x_info
,
206 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
207 static struct resource dm9000_resources
[] = {
210 .end
= 0x203FB800 + 1,
211 .flags
= IORESOURCE_MEM
,
215 .end
= 0x203FB804 + 1,
216 .flags
= IORESOURCE_MEM
,
221 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHEDGE
),
225 static struct platform_device dm9000_device
= {
228 .num_resources
= ARRAY_SIZE(dm9000_resources
),
229 .resource
= dm9000_resources
,
233 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
234 static struct resource ax88180_resources
[] = {
237 .end
= 0x20300000 + 0x8000,
238 .flags
= IORESOURCE_MEM
,
243 .flags
= (IORESOURCE_IRQ
| IORESOURCE_IRQ_LOWLEVEL
),
247 static struct platform_device ax88180_device
= {
250 .num_resources
= ARRAY_SIZE(ax88180_resources
),
251 .resource
= ax88180_resources
,
255 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
256 static struct resource sl811_hcd_resources
[] = {
260 .flags
= IORESOURCE_MEM
,
264 .flags
= IORESOURCE_MEM
,
266 .start
= CONFIG_USB_SL811_BFIN_IRQ
,
267 .end
= CONFIG_USB_SL811_BFIN_IRQ
,
268 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
272 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
273 void sl811_port_power(struct device
*dev
, int is_on
)
275 gpio_request(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, "usb:SL811_VBUS");
276 gpio_direction_output(CONFIG_USB_SL811_BFIN_GPIO_VBUS
, is_on
);
280 static struct sl811_platform_data sl811_priv
= {
282 .power
= 250, /* == 500mA */
283 #if defined(CONFIG_USB_SL811_BFIN_USE_VBUS)
284 .port_power
= &sl811_port_power
,
288 static struct platform_device sl811_hcd_device
= {
292 .platform_data
= &sl811_priv
,
294 .num_resources
= ARRAY_SIZE(sl811_hcd_resources
),
295 .resource
= sl811_hcd_resources
,
299 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
300 static struct resource isp1362_hcd_resources
[] = {
304 .flags
= IORESOURCE_MEM
,
308 .flags
= IORESOURCE_MEM
,
310 .start
= CONFIG_USB_ISP1362_BFIN_GPIO_IRQ
,
311 .end
= CONFIG_USB_ISP1362_BFIN_GPIO_IRQ
,
312 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
316 static struct isp1362_platform_data isp1362_priv
= {
321 .int_edge_triggered
= 0,
322 .remote_wakeup_connected
= 0,
323 .no_power_switching
= 1,
324 .power_switching_mode
= 0,
327 static struct platform_device isp1362_hcd_device
= {
328 .name
= "isp1362-hcd",
331 .platform_data
= &isp1362_priv
,
333 .num_resources
= ARRAY_SIZE(isp1362_hcd_resources
),
334 .resource
= isp1362_hcd_resources
,
338 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
339 static struct platform_device bfin_mii_bus
= {
340 .name
= "bfin_mii_bus",
343 static struct platform_device bfin_mac_device
= {
345 .dev
.platform_data
= &bfin_mii_bus
,
349 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
350 static struct resource net2272_bfin_resources
[] = {
353 .end
= 0x20300000 + 0x100,
354 .flags
= IORESOURCE_MEM
,
358 .flags
= IORESOURCE_IRQ
| IORESOURCE_IRQ_HIGHLEVEL
,
362 static struct platform_device net2272_bfin_device
= {
365 .num_resources
= ARRAY_SIZE(net2272_bfin_resources
),
366 .resource
= net2272_bfin_resources
,
370 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
371 #ifdef CONFIG_MTD_PARTITIONS
372 const char *part_probes
[] = { "cmdlinepart", "RedBoot", NULL
};
374 static struct mtd_partition bfin_plat_nand_partitions
[] = {
376 .name
= "linux kernel(nand)",
380 .name
= "file system(nand)",
381 .size
= MTDPART_SIZ_FULL
,
382 .offset
= MTDPART_OFS_APPEND
,
387 #define BFIN_NAND_PLAT_CLE 2
388 #define BFIN_NAND_PLAT_ALE 1
389 static void bfin_plat_nand_cmd_ctrl(struct mtd_info
*mtd
, int cmd
, unsigned int ctrl
)
391 struct nand_chip
*this = mtd
->priv
;
393 if (cmd
== NAND_CMD_NONE
)
397 writeb(cmd
, this->IO_ADDR_W
+ (1 << BFIN_NAND_PLAT_CLE
));
399 writeb(cmd
, this->IO_ADDR_W
+ (1 << BFIN_NAND_PLAT_ALE
));
402 #define BFIN_NAND_PLAT_READY GPIO_PF3
403 static int bfin_plat_nand_dev_ready(struct mtd_info
*mtd
)
405 return gpio_get_value(BFIN_NAND_PLAT_READY
);
408 static struct platform_nand_data bfin_plat_nand_data
= {
411 #ifdef CONFIG_MTD_PARTITIONS
412 .part_probe_types
= part_probes
,
413 .partitions
= bfin_plat_nand_partitions
,
414 .nr_partitions
= ARRAY_SIZE(bfin_plat_nand_partitions
),
418 .cmd_ctrl
= bfin_plat_nand_cmd_ctrl
,
419 .dev_ready
= bfin_plat_nand_dev_ready
,
423 #define MAX(x, y) (x > y ? x : y)
424 static struct resource bfin_plat_nand_resources
= {
426 .end
= 0x20212000 + (1 << MAX(BFIN_NAND_PLAT_CLE
, BFIN_NAND_PLAT_ALE
)),
427 .flags
= IORESOURCE_IO
,
430 static struct platform_device bfin_async_nand_device
= {
434 .resource
= &bfin_plat_nand_resources
,
436 .platform_data
= &bfin_plat_nand_data
,
440 static void bfin_plat_nand_init(void)
442 gpio_request(BFIN_NAND_PLAT_READY
, "bfin_nand_plat");
445 static void bfin_plat_nand_init(void) {}
448 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
449 static struct mtd_partition stamp_partitions
[] = {
451 .name
= "bootloader(nor)",
455 .name
= "linux kernel(nor)",
457 .offset
= MTDPART_OFS_APPEND
,
459 .name
= "file system(nor)",
460 .size
= 0x400000 - 0x40000 - 0x180000 - 0x10000,
461 .offset
= MTDPART_OFS_APPEND
,
463 .name
= "MAC Address(nor)",
464 .size
= MTDPART_SIZ_FULL
,
466 .mask_flags
= MTD_WRITEABLE
,
470 static struct physmap_flash_data stamp_flash_data
= {
472 .parts
= stamp_partitions
,
473 .nr_parts
= ARRAY_SIZE(stamp_partitions
),
476 static struct resource stamp_flash_resource
= {
479 .flags
= IORESOURCE_MEM
,
482 static struct platform_device stamp_flash_device
= {
483 .name
= "physmap-flash",
486 .platform_data
= &stamp_flash_data
,
489 .resource
= &stamp_flash_resource
,
493 #if defined(CONFIG_MTD_M25P80) \
494 || defined(CONFIG_MTD_M25P80_MODULE)
495 static struct mtd_partition bfin_spi_flash_partitions
[] = {
497 .name
= "bootloader(spi)",
500 .mask_flags
= MTD_CAP_ROM
502 .name
= "linux kernel(spi)",
504 .offset
= MTDPART_OFS_APPEND
,
506 .name
= "file system(spi)",
507 .size
= MTDPART_SIZ_FULL
,
508 .offset
= MTDPART_OFS_APPEND
,
512 static struct flash_platform_data bfin_spi_flash_data
= {
514 .parts
= bfin_spi_flash_partitions
,
515 .nr_parts
= ARRAY_SIZE(bfin_spi_flash_partitions
),
516 /* .type = "m25p64", */
519 /* SPI flash chip (m25p64) */
520 static struct bfin5xx_spi_chip spi_flash_chip_info
= {
521 .enable_dma
= 0, /* use dma transfer with this chip*/
526 #if defined(CONFIG_BFIN_SPI_ADC) \
527 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
529 static struct bfin5xx_spi_chip spi_adc_chip_info
= {
530 .enable_dma
= 1, /* use dma transfer with this chip*/
535 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
536 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
537 static struct bfin5xx_spi_chip ad1836_spi_chip_info
= {
543 #if defined(CONFIG_SND_BF5XX_SOC_AD1938) \
544 || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
545 static struct bfin5xx_spi_chip ad1938_spi_chip_info
= {
552 #if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
553 #include <linux/input.h>
554 #include <linux/input/ad714x.h>
555 static struct bfin5xx_spi_chip ad7147_spi_chip_info
= {
560 static struct ad714x_slider_plat slider_plat
[] = {
568 static struct ad714x_button_plat button_plat
[] = {
570 .keycode
= BTN_FORWARD
,
580 .keycode
= BTN_MIDDLE
,
585 .keycode
= BTN_RIGHT
,
595 static struct ad714x_platform_data ad7147_platfrom_data
= {
598 .slider
= slider_plat
,
599 .button
= button_plat
,
601 {0xFBFF, 0x1FFF, 0, 0x2626, 1600, 1600, 1600, 1600},
602 {0xEFFF, 0x1FFF, 0, 0x2626, 1650, 1650, 1650, 1650},
603 {0xFFFF, 0x1FFE, 0, 0x2626, 1650, 1650, 1650, 1650},
604 {0xFFFF, 0x1FFB, 0, 0x2626, 1650, 1650, 1650, 1650},
605 {0xFFFF, 0x1FEF, 0, 0x2626, 1650, 1650, 1650, 1650},
606 {0xFFFF, 0x1FBF, 0, 0x2626, 1650, 1650, 1650, 1650},
607 {0xFFFF, 0x1EFF, 0, 0x2626, 1650, 1650, 1650, 1650},
608 {0xFFFF, 0x1BFF, 0, 0x2626, 1600, 1600, 1600, 1600},
609 {0xFF7B, 0x3FFF, 0x506, 0x2626, 1100, 1100, 1150, 1150},
610 {0xFDFE, 0x3FFF, 0x606, 0x2626, 1100, 1100, 1150, 1150},
611 {0xFEBA, 0x1FFF, 0x1400, 0x2626, 1200, 1200, 1300, 1300},
612 {0xFFEF, 0x1FFF, 0x0, 0x2626, 1100, 1100, 1150, 1150},
614 .sys_cfg_reg
= {0x2B2, 0x0, 0x3233, 0x819, 0x832, 0xCFF, 0xCFF, 0x0},
618 #if defined(CONFIG_INPUT_EVAL_AD7142EB)
619 #include <linux/input.h>
620 #include <linux/input/ad714x.h>
621 static struct ad714x_button_plat button_plat
[] = {
643 static struct ad714x_platform_data ad7142_platfrom_data
= {
645 .button
= button_plat
,
647 /* fixme: figure out right setting for all comoponent according
648 * to hardware feature of EVAL-AD7142EB board */
649 {0xE7FF, 0x3FFF, 0x0005, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
650 {0xFDBF, 0x3FFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
651 {0xFFFF, 0x2DFF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
652 {0xFFFF, 0x37BF, 0x0001, 0x2626, 0x01F4, 0x01F4, 0x028A, 0x028A},
653 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
654 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
655 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
656 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
657 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
658 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
659 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
660 {0xFFFF, 0x3FFF, 0x0000, 0x0606, 0x01F4, 0x01F4, 0x0320, 0x0320},
662 .sys_cfg_reg
= {0x0B2, 0x0, 0x690, 0x664, 0x290F, 0xF, 0xF, 0x0},
666 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
667 #define MMC_SPI_CARD_DETECT_INT IRQ_PF5
669 static int bfin_mmc_spi_init(struct device
*dev
,
670 irqreturn_t (*detect_int
)(int, void *), void *data
)
672 return request_irq(MMC_SPI_CARD_DETECT_INT
, detect_int
,
673 IRQF_TRIGGER_FALLING
, "mmc-spi-detect", data
);
676 static void bfin_mmc_spi_exit(struct device
*dev
, void *data
)
678 free_irq(MMC_SPI_CARD_DETECT_INT
, data
);
681 static struct mmc_spi_platform_data bfin_mmc_spi_pdata
= {
682 .init
= bfin_mmc_spi_init
,
683 .exit
= bfin_mmc_spi_exit
,
684 .detect_delay
= 100, /* msecs */
687 static struct bfin5xx_spi_chip mmc_spi_chip_info
= {
694 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
695 #include <linux/spi/ad7877.h>
696 static struct bfin5xx_spi_chip spi_ad7877_chip_info
= {
701 static const struct ad7877_platform_data bfin_ad7877_ts_info
= {
703 .vref_delay_usecs
= 50, /* internal, no capacitor */
706 .pressure_max
= 1000,
708 .stopacq_polarity
= 1,
709 .first_conversion_delay
= 3,
710 .acquisition_time
= 1,
712 .pen_down_acc_interval
= 1,
716 #if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
717 #include <linux/spi/ad7879.h>
718 static const struct ad7879_platform_data bfin_ad7879_ts_info
= {
719 .model
= 7879, /* Model = AD7879 */
720 .x_plate_ohms
= 620, /* 620 Ohm from the touch datasheet */
721 .pressure_max
= 10000,
723 .first_conversion_delay
= 3, /* wait 512us before do a first conversion */
724 .acquisition_time
= 1, /* 4us acquisition time per sample */
725 .median
= 2, /* do 8 measurements */
726 .averaging
= 1, /* take the average of 4 middle samples */
727 .pen_down_acc_interval
= 255, /* 9.4 ms */
728 .gpio_output
= 1, /* configure AUX/VBAT/GPIO as GPIO output */
729 .gpio_default
= 1, /* During initialization set GPIO = HIGH */
733 #if defined(CONFIG_INPUT_ADXL34X) || defined(CONFIG_INPUT_ADXL34X_MODULE)
734 #include <linux/input.h>
735 #include <linux/spi/adxl34x.h>
736 static const struct adxl34x_platform_data adxl34x_info
= {
740 .tap_threshold
= 0x31,
741 .tap_duration
= 0x10,
744 .tap_axis_control
= ADXL_TAP_X_EN
| ADXL_TAP_Y_EN
| ADXL_TAP_Z_EN
,
745 .act_axis_control
= 0xFF,
746 .activity_threshold
= 5,
747 .inactivity_threshold
= 3,
748 .inactivity_time
= 4,
749 .free_fall_threshold
= 0x7,
750 .free_fall_time
= 0x20,
752 .data_range
= ADXL_FULL_RES
,
755 .ev_code_x
= ABS_X
, /* EV_REL */
756 .ev_code_y
= ABS_Y
, /* EV_REL */
757 .ev_code_z
= ABS_Z
, /* EV_REL */
759 .ev_code_tap_x
= BTN_TOUCH
, /* EV_KEY */
760 .ev_code_tap_y
= BTN_TOUCH
, /* EV_KEY */
761 .ev_code_tap_z
= BTN_TOUCH
, /* EV_KEY */
763 /* .ev_code_ff = KEY_F,*/ /* EV_KEY */
764 /* .ev_code_act_inactivity = KEY_A,*/ /* EV_KEY */
765 .power_mode
= ADXL_AUTO_SLEEP
| ADXL_LINK
,
766 .fifo_mode
= ADXL_FIFO_STREAM
,
770 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
771 static struct bfin5xx_spi_chip spi_ad7879_chip_info
= {
777 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
778 static struct bfin5xx_spi_chip spidev_chip_info
= {
784 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
785 static struct bfin5xx_spi_chip lq035q1_spi_chip_info
= {
791 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
792 static struct bfin5xx_spi_chip enc28j60_spi_chip_info
= {
795 .cs_gpio
= GPIO_PF10
,
799 #if defined(CONFIG_MTD_DATAFLASH) \
800 || defined(CONFIG_MTD_DATAFLASH_MODULE)
802 static struct mtd_partition bfin_spi_dataflash_partitions
[] = {
804 .name
= "bootloader(spi)",
807 .mask_flags
= MTD_CAP_ROM
809 .name
= "linux kernel(spi)",
811 .offset
= MTDPART_OFS_APPEND
,
813 .name
= "file system(spi)",
814 .size
= MTDPART_SIZ_FULL
,
815 .offset
= MTDPART_OFS_APPEND
,
819 static struct flash_platform_data bfin_spi_dataflash_data
= {
820 .name
= "SPI Dataflash",
821 .parts
= bfin_spi_dataflash_partitions
,
822 .nr_parts
= ARRAY_SIZE(bfin_spi_dataflash_partitions
),
826 static struct bfin5xx_spi_chip data_flash_chip_info
= {
827 .enable_dma
= 0, /* use dma transfer with this chip*/
832 static struct spi_board_info bfin_spi_board_info
[] __initdata
= {
833 #if defined(CONFIG_MTD_M25P80) \
834 || defined(CONFIG_MTD_M25P80_MODULE)
836 /* the modalias must be the same as spi device driver name */
837 .modalias
= "m25p80", /* Name of spi_driver for this device */
838 .max_speed_hz
= 25000000, /* max spi clock (SCK) speed in HZ */
839 .bus_num
= 0, /* Framework bus number */
840 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
841 .platform_data
= &bfin_spi_flash_data
,
842 .controller_data
= &spi_flash_chip_info
,
846 #if defined(CONFIG_MTD_DATAFLASH) \
847 || defined(CONFIG_MTD_DATAFLASH_MODULE)
848 { /* DataFlash chip */
849 .modalias
= "mtd_dataflash",
850 .max_speed_hz
= 33250000, /* max spi clock (SCK) speed in HZ */
851 .bus_num
= 0, /* Framework bus number */
852 .chip_select
= 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
853 .platform_data
= &bfin_spi_dataflash_data
,
854 .controller_data
= &data_flash_chip_info
,
858 #if defined(CONFIG_BFIN_SPI_ADC) \
859 || defined(CONFIG_BFIN_SPI_ADC_MODULE)
861 .modalias
= "bfin_spi_adc", /* Name of spi_driver for this device */
862 .max_speed_hz
= 6250000, /* max spi clock (SCK) speed in HZ */
863 .bus_num
= 0, /* Framework bus number */
864 .chip_select
= 1, /* Framework chip select. */
865 .platform_data
= NULL
, /* No spi_driver specific config */
866 .controller_data
= &spi_adc_chip_info
,
870 #if defined(CONFIG_SND_BF5XX_SOC_AD1836) \
871 || defined(CONFIG_SND_BF5XX_SOC_AD1836_MODULE)
873 .modalias
= "ad1836",
874 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
876 .chip_select
= 4,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
877 .controller_data
= &ad1836_spi_chip_info
,
882 #if defined(CONFIG_SND_BF5XX_SOC_AD1938) || defined(CONFIG_SND_BF5XX_SOC_AD1938_MODULE)
884 .modalias
= "ad1938",
885 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
887 .chip_select
= 0,/* CONFIG_SND_BLACKFIN_SPI_PFBIT */
888 .controller_data
= &ad1938_spi_chip_info
,
893 #if defined(CONFIG_INPUT_EVAL_AD7147EBZ)
895 .modalias
= "ad714x_captouch",
896 .max_speed_hz
= 1000000, /* max spi clock (SCK) speed in HZ */
901 .platform_data
= &ad7147_platfrom_data
,
902 .controller_data
= &ad7147_spi_chip_info
,
906 #if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
908 .modalias
= "mmc_spi",
909 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
912 .platform_data
= &bfin_mmc_spi_pdata
,
913 .controller_data
= &mmc_spi_chip_info
,
917 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
919 .modalias
= "ad7877",
920 .platform_data
= &bfin_ad7877_ts_info
,
922 .max_speed_hz
= 12500000, /* max spi clock (SCK) speed in HZ */
925 .controller_data
= &spi_ad7877_chip_info
,
928 #if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
930 .modalias
= "ad7879",
931 .platform_data
= &bfin_ad7879_ts_info
,
933 .max_speed_hz
= 5000000, /* max spi clock (SCK) speed in HZ */
936 .controller_data
= &spi_ad7879_chip_info
,
937 .mode
= SPI_CPHA
| SPI_CPOL
,
940 #if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
942 .modalias
= "spidev",
943 .max_speed_hz
= 3125000, /* max spi clock (SCK) speed in HZ */
946 .controller_data
= &spidev_chip_info
,
949 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
951 .modalias
= "bfin-lq035q1-spi",
952 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
955 .controller_data
= &lq035q1_spi_chip_info
,
956 .mode
= SPI_CPHA
| SPI_CPOL
,
959 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
961 .modalias
= "enc28j60",
962 .max_speed_hz
= 20000000, /* max spi clock (SCK) speed in HZ */
965 .chip_select
= 0, /* GPIO controlled SSEL */
966 .controller_data
= &enc28j60_spi_chip_info
,
972 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
973 /* SPI controller data */
974 static struct bfin5xx_spi_master bfin_spi0_info
= {
976 .enable_dma
= 1, /* master has the ability to do dma transfer */
977 .pin_req
= {P_SPI0_SCK
, P_SPI0_MISO
, P_SPI0_MOSI
, 0},
981 static struct resource bfin_spi0_resource
[] = {
983 .start
= SPI0_REGBASE
,
984 .end
= SPI0_REGBASE
+ 0xFF,
985 .flags
= IORESOURCE_MEM
,
990 .flags
= IORESOURCE_DMA
,
995 .flags
= IORESOURCE_IRQ
,
999 static struct platform_device bfin_spi0_device
= {
1001 .id
= 0, /* Bus number */
1002 .num_resources
= ARRAY_SIZE(bfin_spi0_resource
),
1003 .resource
= bfin_spi0_resource
,
1005 .platform_data
= &bfin_spi0_info
, /* Passed to driver */
1008 #endif /* spi master and devices */
1010 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1012 /* SPORT SPI controller data */
1013 static struct bfin5xx_spi_master bfin_sport_spi0_info
= {
1014 .num_chipselect
= 1, /* master only supports one device */
1015 .enable_dma
= 0, /* master don't support DMA */
1016 .pin_req
= {P_SPORT0_DTPRI
, P_SPORT0_TSCLK
, P_SPORT0_DRPRI
,
1017 P_SPORT0_RSCLK
, P_SPORT0_TFS
, P_SPORT0_RFS
, 0},
1020 static struct resource bfin_sport_spi0_resource
[] = {
1022 .start
= SPORT0_TCR1
,
1023 .end
= SPORT0_TCR1
+ 0xFF,
1024 .flags
= IORESOURCE_MEM
,
1027 .start
= IRQ_SPORT0_ERROR
,
1028 .end
= IRQ_SPORT0_ERROR
,
1029 .flags
= IORESOURCE_IRQ
,
1033 static struct platform_device bfin_sport_spi0_device
= {
1034 .name
= "bfin-sport-spi",
1035 .id
= 1, /* Bus number */
1036 .num_resources
= ARRAY_SIZE(bfin_sport_spi0_resource
),
1037 .resource
= bfin_sport_spi0_resource
,
1039 .platform_data
= &bfin_sport_spi0_info
, /* Passed to driver */
1043 static struct bfin5xx_spi_master bfin_sport_spi1_info
= {
1044 .num_chipselect
= 1, /* master only supports one device */
1045 .enable_dma
= 0, /* master don't support DMA */
1046 .pin_req
= {P_SPORT1_DTPRI
, P_SPORT1_TSCLK
, P_SPORT1_DRPRI
,
1047 P_SPORT1_RSCLK
, P_SPORT1_TFS
, P_SPORT1_RFS
, 0},
1050 static struct resource bfin_sport_spi1_resource
[] = {
1052 .start
= SPORT1_TCR1
,
1053 .end
= SPORT1_TCR1
+ 0xFF,
1054 .flags
= IORESOURCE_MEM
,
1057 .start
= IRQ_SPORT1_ERROR
,
1058 .end
= IRQ_SPORT1_ERROR
,
1059 .flags
= IORESOURCE_IRQ
,
1063 static struct platform_device bfin_sport_spi1_device
= {
1064 .name
= "bfin-sport-spi",
1065 .id
= 2, /* Bus number */
1066 .num_resources
= ARRAY_SIZE(bfin_sport_spi1_resource
),
1067 .resource
= bfin_sport_spi1_resource
,
1069 .platform_data
= &bfin_sport_spi1_info
, /* Passed to driver */
1073 #endif /* sport spi master and devices */
1075 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1076 static struct platform_device bfin_fb_device
= {
1077 .name
= "bf537-lq035",
1081 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1082 static struct platform_device bfin_fb_adv7393_device
= {
1083 .name
= "bfin-adv7393",
1087 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1088 #include <asm/bfin-lq035q1.h>
1090 static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data
= {
1091 .mode
= LQ035_NORM
| LQ035_RGB
| LQ035_RL
| LQ035_TB
,
1092 .use_bl
= 0, /* let something else control the LCD Blacklight */
1093 .gpio_bl
= GPIO_PF7
,
1096 static struct resource bfin_lq035q1_resources
[] = {
1098 .start
= IRQ_PPI_ERROR
,
1099 .end
= IRQ_PPI_ERROR
,
1100 .flags
= IORESOURCE_IRQ
,
1104 static struct platform_device bfin_lq035q1_device
= {
1105 .name
= "bfin-lq035q1",
1107 .num_resources
= ARRAY_SIZE(bfin_lq035q1_resources
),
1108 .resource
= bfin_lq035q1_resources
,
1110 .platform_data
= &bfin_lq035q1_data
,
1115 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1116 static struct resource bfin_uart_resources
[] = {
1117 #ifdef CONFIG_SERIAL_BFIN_UART0
1119 .start
= 0xFFC00400,
1121 .flags
= IORESOURCE_MEM
,
1124 #ifdef CONFIG_SERIAL_BFIN_UART1
1126 .start
= 0xFFC02000,
1128 .flags
= IORESOURCE_MEM
,
1133 static struct platform_device bfin_uart_device
= {
1134 .name
= "bfin-uart",
1136 .num_resources
= ARRAY_SIZE(bfin_uart_resources
),
1137 .resource
= bfin_uart_resources
,
1141 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1142 #ifdef CONFIG_BFIN_SIR0
1143 static struct resource bfin_sir0_resources
[] = {
1145 .start
= 0xFFC00400,
1147 .flags
= IORESOURCE_MEM
,
1150 .start
= IRQ_UART0_RX
,
1151 .end
= IRQ_UART0_RX
+1,
1152 .flags
= IORESOURCE_IRQ
,
1155 .start
= CH_UART0_RX
,
1156 .end
= CH_UART0_RX
+1,
1157 .flags
= IORESOURCE_DMA
,
1161 static struct platform_device bfin_sir0_device
= {
1164 .num_resources
= ARRAY_SIZE(bfin_sir0_resources
),
1165 .resource
= bfin_sir0_resources
,
1168 #ifdef CONFIG_BFIN_SIR1
1169 static struct resource bfin_sir1_resources
[] = {
1171 .start
= 0xFFC02000,
1173 .flags
= IORESOURCE_MEM
,
1176 .start
= IRQ_UART1_RX
,
1177 .end
= IRQ_UART1_RX
+1,
1178 .flags
= IORESOURCE_IRQ
,
1181 .start
= CH_UART1_RX
,
1182 .end
= CH_UART1_RX
+1,
1183 .flags
= IORESOURCE_DMA
,
1187 static struct platform_device bfin_sir1_device
= {
1190 .num_resources
= ARRAY_SIZE(bfin_sir1_resources
),
1191 .resource
= bfin_sir1_resources
,
1196 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1197 static struct resource bfin_twi0_resource
[] = {
1199 .start
= TWI0_REGBASE
,
1200 .end
= TWI0_REGBASE
,
1201 .flags
= IORESOURCE_MEM
,
1206 .flags
= IORESOURCE_IRQ
,
1210 static struct platform_device i2c_bfin_twi_device
= {
1211 .name
= "i2c-bfin-twi",
1213 .num_resources
= ARRAY_SIZE(bfin_twi0_resource
),
1214 .resource
= bfin_twi0_resource
,
1218 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1219 #include <linux/input.h>
1220 #include <linux/i2c/adp5588.h>
1221 static const unsigned short adp5588_keymap
[ADP5588_KEYMAPSIZE
] = {
1235 [13] = KEY_BACKSLASH
,
1247 [26] = KEY_LEFTBRACE
,
1248 [27] = KEY_RIGHTBRACE
,
1261 [41] = KEY_SEMICOLON
,
1262 [42] = KEY_APOSTROPHE
,
1263 [43] = KEY_BACKSLASH
,
1283 [65] = KEY_BACKSPACE
,
1296 static struct adp5588_kpad_platform_data adp5588_kpad_data
= {
1299 .keymap
= adp5588_keymap
,
1300 .keymapsize
= ARRAY_SIZE(adp5588_keymap
),
1305 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1306 #include <linux/mfd/adp5520.h>
1309 * ADP5520/5501 Backlight Data
1312 static struct adp5520_backlight_platfrom_data adp5520_backlight_data
= {
1313 .fade_in
= FADE_T_1200ms
,
1314 .fade_out
= FADE_T_1200ms
,
1315 .fade_led_law
= BL_LAW_LINEAR
,
1317 .abml_filt
= BL_AMBL_FILT_640ms
,
1318 .l1_daylight_max
= BL_CUR_mA(15),
1319 .l1_daylight_dim
= BL_CUR_mA(0),
1320 .l2_office_max
= BL_CUR_mA(7),
1321 .l2_office_dim
= BL_CUR_mA(0),
1322 .l3_dark_max
= BL_CUR_mA(3),
1323 .l3_dark_dim
= BL_CUR_mA(0),
1324 .l2_trip
= L2_COMP_CURR_uA(700),
1325 .l2_hyst
= L2_COMP_CURR_uA(50),
1326 .l3_trip
= L3_COMP_CURR_uA(80),
1327 .l3_hyst
= L3_COMP_CURR_uA(20),
1331 * ADP5520/5501 LEDs Data
1334 #include <linux/leds.h>
1336 static struct led_info adp5520_leds
[] = {
1338 .name
= "adp5520-led1",
1339 .default_trigger
= "none",
1340 .flags
= FLAG_ID_ADP5520_LED1_ADP5501_LED0
| LED_OFFT_600ms
,
1342 #ifdef ADP5520_EN_ALL_LEDS
1344 .name
= "adp5520-led2",
1345 .default_trigger
= "none",
1346 .flags
= FLAG_ID_ADP5520_LED2_ADP5501_LED1
,
1349 .name
= "adp5520-led3",
1350 .default_trigger
= "none",
1351 .flags
= FLAG_ID_ADP5520_LED3_ADP5501_LED2
,
1356 static struct adp5520_leds_platfrom_data adp5520_leds_data
= {
1357 .num_leds
= ARRAY_SIZE(adp5520_leds
),
1358 .leds
= adp5520_leds
,
1359 .fade_in
= FADE_T_600ms
,
1360 .fade_out
= FADE_T_600ms
,
1361 .led_on_time
= LED_ONT_600ms
,
1368 static struct adp5520_gpio_platfrom_data adp5520_gpio_data
= {
1370 .gpio_en_mask
= GPIO_C1
| GPIO_C2
| GPIO_R2
,
1371 .gpio_pullup_mask
= GPIO_C1
| GPIO_C2
| GPIO_R2
,
1375 * ADP5520 Keypad Data
1378 #include <linux/input.h>
1379 static const unsigned short adp5520_keymap
[ADP5520_KEYMAPSIZE
] = {
1380 [KEY(0, 0)] = KEY_GRAVE
,
1381 [KEY(0, 1)] = KEY_1
,
1382 [KEY(0, 2)] = KEY_2
,
1383 [KEY(0, 3)] = KEY_3
,
1384 [KEY(1, 0)] = KEY_4
,
1385 [KEY(1, 1)] = KEY_5
,
1386 [KEY(1, 2)] = KEY_6
,
1387 [KEY(1, 3)] = KEY_7
,
1388 [KEY(2, 0)] = KEY_8
,
1389 [KEY(2, 1)] = KEY_9
,
1390 [KEY(2, 2)] = KEY_0
,
1391 [KEY(2, 3)] = KEY_MINUS
,
1392 [KEY(3, 0)] = KEY_EQUAL
,
1393 [KEY(3, 1)] = KEY_BACKSLASH
,
1394 [KEY(3, 2)] = KEY_BACKSPACE
,
1395 [KEY(3, 3)] = KEY_ENTER
,
1398 static struct adp5520_keys_platfrom_data adp5520_keys_data
= {
1399 .rows_en_mask
= ROW_R3
| ROW_R2
| ROW_R1
| ROW_R0
,
1400 .cols_en_mask
= COL_C3
| COL_C2
| COL_C1
| COL_C0
,
1401 .keymap
= adp5520_keymap
,
1402 .keymapsize
= ARRAY_SIZE(adp5520_keymap
),
1407 * ADP5520/5501 Multifuction Device Init Data
1410 static struct adp5520_subdev_info adp5520_subdevs
[] = {
1412 .name
= "adp5520-backlight",
1414 .platform_data
= &adp5520_backlight_data
,
1417 .name
= "adp5520-led",
1419 .platform_data
= &adp5520_leds_data
,
1422 .name
= "adp5520-gpio",
1424 .platform_data
= &adp5520_gpio_data
,
1427 .name
= "adp5520-keys",
1429 .platform_data
= &adp5520_keys_data
,
1433 static struct adp5520_platform_data adp5520_pdev_data
= {
1434 .num_subdevs
= ARRAY_SIZE(adp5520_subdevs
),
1435 .subdevs
= adp5520_subdevs
,
1440 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1441 #include <linux/i2c/adp5588.h>
1442 static struct adp5588_gpio_platfrom_data adp5588_gpio_data
= {
1444 .pullup_dis_mask
= 0,
1448 static struct i2c_board_info __initdata bfin_i2c_board_info
[] = {
1449 #if defined(CONFIG_INPUT_EVAL_AD7142EB)
1451 I2C_BOARD_INFO("ad7142_captouch", 0x2C),
1453 .platform_data
= (void *)&ad7142_platfrom_data
,
1456 #if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
1458 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
1461 #if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
1463 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
1467 #if defined(CONFIG_TOUCHSCREEN_AD7879_I2C) || defined(CONFIG_TOUCHSCREEN_AD7879_I2C_MODULE)
1469 I2C_BOARD_INFO("ad7879", 0x2F),
1471 .platform_data
= (void *)&bfin_ad7879_ts_info
,
1474 #if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1476 I2C_BOARD_INFO("adp5588-keys", 0x34),
1478 .platform_data
= (void *)&adp5588_kpad_data
,
1481 #if defined(CONFIG_PMIC_ADP5520) || defined(CONFIG_PMIC_ADP5520_MODULE)
1483 I2C_BOARD_INFO("pmic-adp5520", 0x32),
1485 .platform_data
= (void *)&adp5520_pdev_data
,
1488 #if defined(CONFIG_INPUT_ADXL34X_I2C) || defined(CONFIG_INPUT_ADXL34X_I2C_MODULE)
1490 I2C_BOARD_INFO("adxl34x", 0x53),
1492 .platform_data
= (void *)&adxl34x_info
,
1495 #if defined(CONFIG_GPIO_ADP5588) || defined(CONFIG_GPIO_ADP5588_MODULE)
1497 I2C_BOARD_INFO("adp5588-gpio", 0x34),
1498 .platform_data
= (void *)&adp5588_gpio_data
,
1503 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1504 static struct platform_device bfin_sport0_uart_device
= {
1505 .name
= "bfin-sport-uart",
1509 static struct platform_device bfin_sport1_uart_device
= {
1510 .name
= "bfin-sport-uart",
1515 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1516 #define CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1517 /* #define CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE */
1519 #ifdef CF_IDE_NAND_CARD_USE_HDD_INTERFACE
1520 #define PATA_INT IRQ_PF5
1521 static struct pata_platform_info bfin_pata_platform_data
= {
1523 .irq_flags
= IRQF_TRIGGER_HIGH
| IRQF_DISABLED
,
1526 static struct resource bfin_pata_resources
[] = {
1528 .start
= 0x20314020,
1530 .flags
= IORESOURCE_MEM
,
1533 .start
= 0x2031401C,
1535 .flags
= IORESOURCE_MEM
,
1540 .flags
= IORESOURCE_IRQ
,
1543 #elif defined(CF_IDE_NAND_CARD_USE_CF_IN_COMMON_MEMORY_MODE)
1544 static struct pata_platform_info bfin_pata_platform_data
= {
1547 /* CompactFlash Storage Card Memory Mapped Adressing
1550 static struct resource bfin_pata_resources
[] = {
1552 .start
= 0x20211800,
1554 .flags
= IORESOURCE_MEM
,
1557 .start
= 0x2021180E, /* Device Ctl */
1559 .flags
= IORESOURCE_MEM
,
1564 static struct platform_device bfin_pata_device
= {
1565 .name
= "pata_platform",
1567 .num_resources
= ARRAY_SIZE(bfin_pata_resources
),
1568 .resource
= bfin_pata_resources
,
1570 .platform_data
= &bfin_pata_platform_data
,
1575 static const unsigned int cclk_vlev_datasheet
[] =
1577 VRPAIR(VLEV_085
, 250000000),
1578 VRPAIR(VLEV_090
, 376000000),
1579 VRPAIR(VLEV_095
, 426000000),
1580 VRPAIR(VLEV_100
, 426000000),
1581 VRPAIR(VLEV_105
, 476000000),
1582 VRPAIR(VLEV_110
, 476000000),
1583 VRPAIR(VLEV_115
, 476000000),
1584 VRPAIR(VLEV_120
, 500000000),
1585 VRPAIR(VLEV_125
, 533000000),
1586 VRPAIR(VLEV_130
, 600000000),
1589 static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data
= {
1590 .tuple_tab
= cclk_vlev_datasheet
,
1591 .tabsize
= ARRAY_SIZE(cclk_vlev_datasheet
),
1592 .vr_settling_time
= 25 /* us */,
1595 static struct platform_device bfin_dpmc
= {
1596 .name
= "bfin dpmc",
1598 .platform_data
= &bfin_dmpc_vreg_data
,
1602 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1603 static struct platform_device bfin_tdm
= {
1605 /* TODO: add platform data here */
1609 static struct platform_device
*stamp_devices
[] __initdata
= {
1613 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
1614 &bfin_pcmcia_cf_device
,
1617 #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
1621 #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
1625 #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
1626 &isp1362_hcd_device
,
1629 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1630 &bfin_isp1760_device
,
1633 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1637 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
1641 #if defined(CONFIG_AX88180) || defined(CONFIG_AX88180_MODULE)
1645 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
1650 #if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
1651 &net2272_bfin_device
,
1654 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
1658 #if defined(CONFIG_SPI_BFIN_SPORT) || defined(CONFIG_SPI_BFIN_SPORT_MODULE)
1659 &bfin_sport_spi0_device
,
1660 &bfin_sport_spi1_device
,
1663 #if defined(CONFIG_FB_BF537_LQ035) || defined(CONFIG_FB_BF537_LQ035_MODULE)
1667 #if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
1668 &bfin_lq035q1_device
,
1671 #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
1672 &bfin_fb_adv7393_device
,
1675 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
1679 #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1680 #ifdef CONFIG_BFIN_SIR0
1683 #ifdef CONFIG_BFIN_SIR1
1688 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
1689 &i2c_bfin_twi_device
,
1692 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
1693 &bfin_sport0_uart_device
,
1694 &bfin_sport1_uart_device
,
1697 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
1701 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
1702 &bfin_device_gpiokeys
,
1707 #if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
1708 &bfin_async_nand_device
,
1711 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
1712 &stamp_flash_device
,
1715 #if defined(CONFIG_SND_BF5XX_TDM) || defined(CONFIG_SND_BF5XX_TDM_MODULE)
1720 static int __init
stamp_init(void)
1722 printk(KERN_INFO
"%s(): registering device resources\n", __func__
);
1723 i2c_register_board_info(0, bfin_i2c_board_info
,
1724 ARRAY_SIZE(bfin_i2c_board_info
));
1725 bfin_plat_nand_init();
1726 platform_add_devices(stamp_devices
, ARRAY_SIZE(stamp_devices
));
1727 spi_register_board_info(bfin_spi_board_info
, ARRAY_SIZE(bfin_spi_board_info
));
1732 arch_initcall(stamp_init
);
1734 void native_machine_restart(char *cmd
)
1736 /* workaround reboot hang when booting from SPI */
1737 if ((bfin_read_SYSCR() & 0x7) == 0x3)
1738 bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS
);
1742 * Currently the MAC address is saved in Flash by U-Boot
1744 #define FLASH_MAC 0x203f0000
1745 void bfin_get_ether_addr(char *addr
)
1747 *(u32
*)(&(addr
[0])) = bfin_read32(FLASH_MAC
);
1748 *(u16
*)(&(addr
[4])) = bfin_read16(FLASH_MAC
+ 4);
1750 EXPORT_SYMBOL(bfin_get_ether_addr
);