Blackfin: clean up isp1362 board resources
[safe/jmp/linux-2.6] / arch / blackfin / mach-bf527 / boards / cm_bf527.c
index 856c097..40b9934 100644 (file)
@@ -1,31 +1,10 @@
 /*
- * File:         arch/blackfin/mach-bf527/boards/cm-bf527.c
- * Based on:     arch/blackfin/mach-bf537/boards/stamp.c
- * Author:       Aidan Williams <aidan@nicta.com.au>
+ * Copyright 2004-2009 Analog Devices Inc.
+ *           2008-2009 Bluetechnix
+ *                2005 National ICT Australia (NICTA)
+ *                      Aidan Williams <aidan@nicta.com.au>
  *
- * Created:
- * Description:
- *
- * Modified:
- *               Copyright 2005 National ICT Australia (NICTA)
- *               Copyright 2004-2008 Analog Devices Inc.
- *
- * Bugs:         Enter bugs at http://blackfin.uclinux.org/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see the file COPYING, or write
- * to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * Licensed under the GPL-2 or later.
  */
 
 #include <linux/device.h>
@@ -36,9 +15,6 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
 #include <linux/etherdevice.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/irq.h>
 #include <linux/interrupt.h>
@@ -78,7 +54,6 @@ static struct resource bfin_isp1760_resources[] = {
 
 static struct isp1760_platform_data isp1760_priv = {
        .is_isp1761 = 0,
-       .port1_disable = 0,
        .bus_width_16 = 1,
        .port1_otg = 0,
        .analog_oc = 0,
@@ -152,46 +127,6 @@ static struct platform_device musb_device = {
 };
 #endif
 
-#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
-static struct mtd_partition ezkit_partitions[] = {
-       {
-               .name       = "bootloader(nor)",
-               .size       = 0x40000,
-               .offset     = 0,
-       }, {
-               .name       = "linux kernel(nor)",
-               .size       = 0x1C0000,
-               .offset     = MTDPART_OFS_APPEND,
-       }, {
-               .name       = "file system(nor)",
-               .size       = MTDPART_SIZ_FULL,
-               .offset     = MTDPART_OFS_APPEND,
-       }
-};
-
-static struct physmap_flash_data ezkit_flash_data = {
-       .width      = 2,
-       .parts      = ezkit_partitions,
-       .nr_parts   = ARRAY_SIZE(ezkit_partitions),
-};
-
-static struct resource ezkit_flash_resource = {
-       .start = 0x20000000,
-       .end   = 0x201fffff,
-       .flags = IORESOURCE_MEM,
-};
-
-static struct platform_device ezkit_flash_device = {
-       .name          = "physmap-flash",
-       .id            = 0,
-       .dev = {
-               .platform_data = &ezkit_flash_data,
-       },
-       .num_resources = 1,
-       .resource      = &ezkit_flash_resource,
-};
-#endif
-
 #if defined(CONFIG_MTD_NAND_BF5XX) || defined(CONFIG_MTD_NAND_BF5XX_MODULE)
 static struct mtd_partition partition_info[] = {
        {
@@ -276,6 +211,14 @@ static struct platform_device rtc_device = {
 #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",
@@ -294,6 +237,9 @@ static struct platform_device smc91x_device = {
        .id = 0,
        .num_resources = ARRAY_SIZE(smc91x_resources),
        .resource = smc91x_resources,
+       .dev    = {
+               .platform_data  = &smc91x_info,
+       },
 };
 #endif
 
@@ -301,10 +247,15 @@ static struct platform_device smc91x_device = {
 static struct resource dm9000_resources[] = {
        [0] = {
                .start  = 0x203FB800,
-               .end    = 0x203FB800 + 8,
+               .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),
@@ -363,45 +314,6 @@ static struct platform_device sl811_hcd_device = {
 };
 #endif
 
-#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-static struct resource isp1362_hcd_resources[] = {
-       {
-               .start = 0x20360000,
-               .end = 0x20360000,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = 0x20360004,
-               .end = 0x20360004,
-               .flags = IORESOURCE_MEM,
-       }, {
-               .start = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
-               .end = CONFIG_USB_ISP1362_BFIN_GPIO_IRQ,
-               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
-       },
-};
-
-static struct isp1362_platform_data isp1362_priv = {
-       .sel15Kres = 1,
-       .clknotstop = 0,
-       .oc_enable = 0,
-       .int_act_high = 0,
-       .int_edge_triggered = 0,
-       .remote_wakeup_connected = 0,
-       .no_power_switching = 1,
-       .power_switching_mode = 0,
-};
-
-static struct platform_device isp1362_hcd_device = {
-       .name = "isp1362-hcd",
-       .id = 0,
-       .dev = {
-               .platform_data = &isp1362_priv,
-       },
-       .num_resources = ARRAY_SIZE(isp1362_hcd_resources),
-       .resource = isp1362_hcd_resources,
-};
-#endif
-
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
 static struct platform_device bfin_mii_bus = {
        .name = "bfin_mii_bus",
@@ -463,8 +375,8 @@ static struct bfin5xx_spi_chip spi_flash_chip_info = {
 };
 #endif
 
-#if defined(CONFIG_SPI_ADC_BF533) \
-       || defined(CONFIG_SPI_ADC_BF533_MODULE)
+#if defined(CONFIG_BFIN_SPI_ADC) \
+       || defined(CONFIG_BFIN_SPI_ADC_MODULE)
 /* SPI ADC chip */
 static struct bfin5xx_spi_chip spi_adc_chip_info = {
        .enable_dma = 1,         /* use dma transfer with this chip*/
@@ -480,29 +392,13 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
 };
 #endif
 
-#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
-static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
+#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
+static struct bfin5xx_spi_chip  mmc_spi_chip_info = {
        .enable_dma = 0,
-       .bits_per_word = 16,
-};
-#endif
-
-#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
-static struct bfin5xx_spi_chip spi_mmc_chip_info = {
-       .enable_dma = 1,
        .bits_per_word = 8,
 };
 #endif
 
-#if defined(CONFIG_PBX)
-static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
-       .ctl_reg        = 0x4, /* send zero */
-       .enable_dma     = 0,
-       .bits_per_word  = 8,
-       .cs_change_per_word = 1,
-};
-#endif
-
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
        .enable_dma = 0,
@@ -554,8 +450,8 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
        },
 #endif
 
-#if defined(CONFIG_SPI_ADC_BF533) \
-       || defined(CONFIG_SPI_ADC_BF533_MODULE)
+#if defined(CONFIG_BFIN_SPI_ADC) \
+       || defined(CONFIG_BFIN_SPI_ADC_MODULE)
        {
                .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
                .max_speed_hz = 6250000,     /* max spi clock (SCK) speed in HZ */
@@ -569,57 +465,20 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
        || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
        {
-               .modalias = "ad1836-spi",
+               .modalias = "ad1836",
                .max_speed_hz = 3125000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
                .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
                .controller_data = &ad1836_spi_chip_info,
        },
 #endif
-#if defined(CONFIG_AD9960) || defined(CONFIG_AD9960_MODULE)
-       {
-               .modalias = "ad9960-spi",
-               .max_speed_hz = 10000000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num = 0,
-               .chip_select = 1,
-               .controller_data = &ad9960_spi_chip_info,
-       },
-#endif
-#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
-       {
-               .modalias = "spi_mmc_dummy",
-               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num = 0,
-               .chip_select = 0,
-               .platform_data = NULL,
-               .controller_data = &spi_mmc_chip_info,
-               .mode = SPI_MODE_3,
-       },
-       {
-               .modalias = "spi_mmc",
-               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num = 0,
-               .chip_select = CONFIG_SPI_MMC_CS_CHAN,
-               .platform_data = NULL,
-               .controller_data = &spi_mmc_chip_info,
-               .mode = SPI_MODE_3,
-       },
-#endif
-#if defined(CONFIG_PBX)
-       {
-               .modalias = "fxs-spi",
-               .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num = 0,
-               .chip_select = 8 - CONFIG_J11_JUMPER,
-               .controller_data = &spi_si3xxx_chip_info,
-               .mode = SPI_MODE_3,
-       },
+#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
        {
-               .modalias = "fxo-spi",
-               .max_speed_hz = 12500000,     /* max spi clock (SCK) speed in HZ */
+               .modalias = "mmc_spi",
+               .max_speed_hz = 20000000,     /* max spi clock (SCK) speed in HZ */
                .bus_num = 0,
-               .chip_select = 8 - CONFIG_J19_JUMPER,
-               .controller_data = &spi_si3xxx_chip_info,
+               .chip_select = 5,
+               .controller_data = &mmc_spi_chip_info,
                .mode = SPI_MODE_3,
        },
 #endif
@@ -674,6 +533,11 @@ static struct resource bfin_spi0_resource[] = {
        [1] = {
                .start = CH_SPI,
                .end   = CH_SPI,
+               .flags = IORESOURCE_DMA,
+       },
+       [2] = {
+               .start = IRQ_SPI,
+               .end   = IRQ_SPI,
                .flags = IORESOURCE_IRQ,
        },
 };
@@ -689,9 +553,52 @@ static struct platform_device bfin_spi0_device = {
 };
 #endif  /* spi master and devices */
 
-#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
-static struct platform_device bfin_fb_adv7393_device = {
-       .name = "bfin-adv7393",
+#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
+static struct mtd_partition cm_partitions[] = {
+       {
+               .name   = "bootloader(nor)",
+               .size   = 0x40000,
+               .offset = 0,
+       }, {
+               .name   = "linux kernel(nor)",
+               .size   = 0x100000,
+               .offset = MTDPART_OFS_APPEND,
+       }, {
+               .name   = "file system(nor)",
+               .size   = MTDPART_SIZ_FULL,
+               .offset = MTDPART_OFS_APPEND,
+       }
+};
+
+static struct physmap_flash_data cm_flash_data = {
+       .width    = 2,
+       .parts    = cm_partitions,
+       .nr_parts = ARRAY_SIZE(cm_partitions),
+};
+
+static unsigned cm_flash_gpios[] = { GPIO_PH9, GPIO_PG11 };
+
+static struct resource cm_flash_resource[] = {
+       {
+               .name  = "cfi_probe",
+               .start = 0x20000000,
+               .end   = 0x201fffff,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = (unsigned long)cm_flash_gpios,
+               .end   = ARRAY_SIZE(cm_flash_gpios),
+               .flags = IORESOURCE_IRQ,
+       }
+};
+
+static struct platform_device cm_flash_device = {
+       .name          = "gpio-addr-flash",
+       .id            = 0,
+       .dev = {
+               .platform_data = &cm_flash_data,
+       },
+       .num_resources = ARRAY_SIZE(cm_flash_resource),
+       .resource      = cm_flash_resource,
 };
 #endif
 
@@ -799,19 +706,22 @@ static struct platform_device i2c_bfin_twi_device = {
 #endif
 
 static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
-#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
+#if defined(CONFIG_BFIN_TWI_LCD) || defined(CONFIG_BFIN_TWI_LCD_MODULE)
        {
                I2C_BOARD_INFO("pcf8574_lcd", 0x22),
-               .type = "pcf8574_lcd",
        },
 #endif
-#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
+#if defined(CONFIG_INPUT_PCF8574) || defined(CONFIG_INPUT_PCF8574_MODULE)
        {
                I2C_BOARD_INFO("pcf8574_keypad", 0x27),
-               .type = "pcf8574_keypad",
                .irq = IRQ_PF8,
        },
 #endif
+#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
+       {
+               I2C_BOARD_INFO("bfin-adv7393", 0x2B),
+       },
+#endif
 };
 
 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
@@ -847,19 +757,6 @@ static struct platform_device bfin_device_gpiokeys = {
 };
 #endif
 
-static struct resource bfin_gpios_resources = {
-       .start = 0,
-       .end   = MAX_BLACKFIN_GPIOS - 1,
-       .flags = IORESOURCE_IRQ,
-};
-
-static struct platform_device bfin_gpios_device = {
-       .name = "simple-gpio",
-       .id = -1,
-       .num_resources = 1,
-       .resource = &bfin_gpios_resources,
-};
-
 static const unsigned int cclk_vlev_datasheet[] =
 {
        VRPAIR(VLEV_100, 400000000),
@@ -882,7 +779,7 @@ static struct platform_device bfin_dpmc = {
        },
 };
 
-static struct platform_device *stamp_devices[] __initdata = {
+static struct platform_device *cmbf527_devices[] __initdata = {
 
        &bfin_dpmc,
 
@@ -902,10 +799,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &sl811_hcd_device,
 #endif
 
-#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
-       &isp1362_hcd_device,
-#endif
-
 #if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
        &bfin_isp1760_device,
 #endif
@@ -935,10 +828,6 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_spi0_device,
 #endif
 
-#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
-       &bfin_fb_adv7393_device,
-#endif
-
 #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
        &bfin_uart_device,
 #endif
@@ -965,11 +854,9 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_device_gpiokeys,
 #endif
 
-#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
-       &ezkit_flash_device,
+#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
+       &cm_flash_device,
 #endif
-
-       &bfin_gpios_device,
 };
 
 static int __init cm_init(void)
@@ -977,7 +864,7 @@ static int __init cm_init(void)
        printk(KERN_INFO "%s(): registering device resources\n", __func__);
        i2c_register_board_info(0, bfin_i2c_board_info,
                                ARRAY_SIZE(bfin_i2c_board_info));
-       platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
+       platform_add_devices(cmbf527_devices, ARRAY_SIZE(cmbf527_devices));
        spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
        return 0;
 }