123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- /*
- * Copyright 2004-2009 Analog Devices Inc.
- * 2005 National ICT Australia (NICTA)
- * Aidan Williams <aidan@nicta.com.au>
- *
- * Licensed under the GPL-2 or later.
- */
- #include <linux/device.h>
- #include <linux/export.h>
- #include <linux/kernel.h>
- #include <linux/platform_device.h>
- #include <linux/io.h>
- #include <linux/mtd/mtd.h>
- #include <linux/mtd/nand.h>
- #include <linux/mtd/partitions.h>
- #include <linux/mtd/plat-ram.h>
- #include <linux/mtd/physmap.h>
- #include <linux/spi/spi.h>
- #include <linux/spi/flash.h>
- #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
- #include <linux/usb/isp1362.h>
- #endif
- #include <linux/i2c.h>
- #include <linux/i2c/adp5588.h>
- #include <linux/etherdevice.h>
- #include <linux/ata_platform.h>
- #include <linux/irq.h>
- #include <linux/interrupt.h>
- #include <linux/usb/sl811.h>
- #include <linux/spi/mmc_spi.h>
- #include <linux/leds.h>
- #include <linux/input.h>
- #include <asm/dma.h>
- #include <asm/bfin5xx_spi.h>
- #include <asm/reboot.h>
- #include <asm/portmux.h>
- #include <asm/dpmc.h>
- #include <asm/bfin_sport.h>
- #ifdef CONFIG_REGULATOR_FIXED_VOLTAGE
- #include <linux/regulator/fixed.h>
- #endif
- #include <linux/regulator/machine.h>
- #include <linux/regulator/consumer.h>
- #include <linux/regulator/userspace-consumer.h>
- /*
- * Name the Board for the /proc/cpuinfo
- */
- const char bfin_board_name[] = "ADI BF537-STAMP";
- /*
- * Driver needs to know address, irq and flag pin.
- */
- #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
- #include <linux/usb/isp1760.h>
- static struct resource bfin_isp1760_resources[] = {
- [0] = {
- .start = 0x203C0000,
- .end = 0x203C0000 + 0x000fffff,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ_PF7,
- .end = IRQ_PF7,
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
- },
- };
- static struct isp1760_platform_data isp1760_priv = {
- .is_isp1761 = 0,
- .bus_width_16 = 1,
- .port1_otg = 0,
- .analog_oc = 0,
- .dack_polarity_high = 0,
- .dreq_polarity_high = 0,
- };
- static struct platform_device bfin_isp1760_device = {
- .name = "isp1760",
- .id = 0,
- .dev = {
- .platform_data = &isp1760_priv,
- },
- .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
- .resource = bfin_isp1760_resources,
- };
- #endif
- #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
- #include <linux/gpio_keys.h>
- static struct gpio_keys_button bfin_gpio_keys_table[] = {
- {BTN_0, GPIO_PF2, 1, "gpio-keys: BTN0"},
- {BTN_1, GPIO_PF3, 1, "gpio-keys: BTN1"},
- {BTN_2, GPIO_PF4, 1, "gpio-keys: BTN2"},
- {BTN_3, GPIO_PF5, 1, "gpio-keys: BTN3"},
- };
- static struct gpio_keys_platform_data bfin_gpio_keys_data = {
- .buttons = bfin_gpio_keys_table,
- .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
- };
- static struct platform_device bfin_device_gpiokeys = {
- .name = "gpio-keys",
- .dev = {
- .platform_data = &bfin_gpio_keys_data,
- },
- };
- #endif
- #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
- static struct resource bfin_pcmcia_cf_resources[] = {
- {
- .start = 0x20310000, /* IO PORT */
- .end = 0x20312000,
- .flags = IORESOURCE_MEM,
- }, {
- .start = 0x20311000, /* Attribute Memory */
- .end = 0x20311FFF,
- .flags = IORESOURCE_MEM,
- }, {
- .start = IRQ_PF4,
- .end = IRQ_PF4,
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
- }, {
- .start = 6, /* Card Detect PF6 */
- .end = 6,
- .flags = IORESOURCE_IRQ,
- },
- };
- static struct platform_device bfin_pcmcia_cf_device = {
- .name = "bfin_cf_pcmcia",
- .id = -1,
- .num_resources = ARRAY_SIZE(bfin_pcmcia_cf_resources),
- .resource = bfin_pcmcia_cf_resources,
- };
- #endif
- #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
- static struct platform_device rtc_device = {
- .name = "rtc-bfin",
- .id = -1,
- };
- #endif
- #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
- #include <linux/smc91x.h>
- static struct smc91x_platdata smc91x_info = {
- .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT,
- .leda = RPC_LED_100_10,
- .ledb = RPC_LED_TX_RX,
- };
- static struct resource smc91x_resources[] = {
- {
- .name = "smc91x-regs",
- .start = 0x20300300,
- .end = 0x20300300 + 16,
- .flags = IORESOURCE_MEM,
- }, {
- .start = IRQ_PF7,
- .end = IRQ_PF7,
- .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
- },
- };
- static struct platform_device smc91x_device = {
- .name = "smc91x",
- .id = 0,
- .num_resources = ARRAY_SIZE(smc91x_resources),
- .resource = smc91x_resources,
- .dev = {
- .platform_data = &smc91x_info,
- },
- };
- #endif
- #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
- static struct resource dm9000_resources[] = {
- [0] = {
- .start = 0x203FB800,
- .end = 0x203FB800 + 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0x203FB804,
- .end = 0x203FB804 + 1,
- .flags = IORESOURCE_MEM,
- },
- [2] = {
- .start = IRQ_PF9,
- .end = IRQ_PF9,
- .flags = (IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE),
- },
- };
- static struct platform_device dm9000_device = {
- .name = "dm9000",
- .id = -1,
- .num_resources = ARRAY_SIZE(dm9000_resources),
- .resource = dm9000_resources,
- };
- #endif
- #if defined(CONFIG_USB_SL811_HCD) || defined(CONFIG_USB_SL811_HCD_MODULE)
- static struct resource sl811_hcd_resources[] = {
- {
|