]> err.no Git - linux-2.6/blobdiff - arch/blackfin/mach-bf537/boards/stamp.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / arch / blackfin / mach-bf537 / boards / stamp.c
index 9e2277e0d25cde2c628abc69e3a85665beee33d6..d3727b7c2d7d94da933ec76834c2a2378764b407 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/ata_platform.h>
 #include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/i2c.h>
 #include <linux/usb/sl811.h>
 #include <asm/dma.h>
 #include <asm/bfin5xx_spi.h>
@@ -90,7 +91,7 @@ int __init bfin_isp1761_init(void)
 {
        unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
 
-       printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
+       printk(KERN_INFO "%s(): registering device resources\n", __func__);
        set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
 
        return platform_add_devices(bfin_isp1761_devices, num_devices);
@@ -128,6 +129,19 @@ 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,
+};
+
 #if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
 static struct resource bfin_pcmcia_cf_resources[] = {
        {
@@ -340,10 +354,11 @@ static struct platform_device net2272_bfin_device = {
 };
 #endif
 
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition stamp_partitions[] = {
        {
                .name       = "Bootloader",
-               .size       = 0x20000,
+               .size       = 0x40000,
                .offset     = 0,
        }, {
                .name       = "Kernel",
@@ -351,7 +366,7 @@ static struct mtd_partition stamp_partitions[] = {
                .offset     = MTDPART_OFS_APPEND,
        }, {
                .name       = "RootFS",
-               .size       = 0x400000 - 0x20000 - 0xE0000 - 0x10000,
+               .size       = 0x400000 - 0x40000 - 0xE0000 - 0x10000,
                .offset     = MTDPART_OFS_APPEND,
        }, {
                .name       = "MAC Address",
@@ -382,6 +397,7 @@ static struct platform_device stamp_flash_device = {
        .num_resources = 1,
        .resource      = &stamp_flash_resource,
 };
+#endif
 
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
 /* all SPI peripherals info goes here */
@@ -391,17 +407,17 @@ static struct platform_device stamp_flash_device = {
 static struct mtd_partition bfin_spi_flash_partitions[] = {
        {
                .name = "bootloader",
-               .size = 0x00020000,
+               .size = 0x00040000,
                .offset = 0,
                .mask_flags = MTD_CAP_ROM
        }, {
                .name = "kernel",
                .size = 0xe0000,
-               .offset = 0x20000
+               .offset = MTDPART_OFS_APPEND,
        }, {
                .name = "file system",
-               .size = 0x700000,
-               .offset = 0x00100000,
+               .size = MTDPART_SIZ_FULL,
+               .offset = MTDPART_OFS_APPEND,
        }
 };
 
@@ -459,13 +475,6 @@ static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
 };
 #endif
 
-#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
-static struct bfin5xx_spi_chip ad5304_chip_info = {
-       .enable_dma = 0,
-       .bits_per_word = 16,
-};
-#endif
-
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
 static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
        .enable_dma = 0,
@@ -494,6 +503,15 @@ static struct bfin5xx_spi_chip spidev_chip_info = {
 };
 #endif
 
+#if defined(CONFIG_MTD_DATAFLASH) \
+       || defined(CONFIG_MTD_DATAFLASH_MODULE)
+/* DataFlash chip */
+static struct bfin5xx_spi_chip data_flash_chip_info = {
+       .enable_dma = 0,         /* use dma transfer with this chip*/
+       .bits_per_word = 8,
+};
+#endif
+
 static struct spi_board_info bfin_spi_board_info[] __initdata = {
 #if defined(CONFIG_MTD_M25P80) \
        || defined(CONFIG_MTD_M25P80_MODULE)
@@ -508,7 +526,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .mode = SPI_MODE_3,
        },
 #endif
-
+#if defined(CONFIG_MTD_DATAFLASH) \
+       || defined(CONFIG_MTD_DATAFLASH_MODULE)
+       {       /* DataFlash chip */
+               .modalias = "mtd_dataflash",
+               .max_speed_hz = 25000000,     /* max spi clock (SCK) speed in HZ */
+               .bus_num = 0, /* Framework bus number */
+               .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
+               .controller_data = &data_flash_chip_info,
+               .mode = SPI_MODE_3,
+       },
+#endif
 #if defined(CONFIG_SPI_ADC_BF533) \
        || defined(CONFIG_SPI_ADC_BF533_MODULE)
        {
@@ -578,17 +606,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
                .mode = SPI_MODE_3,
        },
 #endif
-#if defined(CONFIG_AD5304) || defined(CONFIG_AD5304_MODULE)
-       {
-               .modalias = "ad5304_spi",
-               .max_speed_hz = 1250000,     /* max spi clock (SCK) speed in HZ */
-               .bus_num = 0,
-               .chip_select = 2,
-               .platform_data = NULL,
-               .controller_data = &ad5304_chip_info,
-               .mode = SPI_MODE_2,
-       },
-#endif
 #if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
        {
                .modalias               = "ad7877",
@@ -681,6 +698,32 @@ static struct platform_device bfin_uart_device = {
 };
 #endif
 
+#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
+static struct resource bfin_sir_resources[] = {
+#ifdef CONFIG_BFIN_SIR0
+       {
+               .start = 0xFFC00400,
+               .end = 0xFFC004FF,
+               .flags = IORESOURCE_MEM,
+       },
+#endif
+#ifdef CONFIG_BFIN_SIR1
+       {
+               .start = 0xFFC02000,
+               .end = 0xFFC020FF,
+               .flags = IORESOURCE_MEM,
+       },
+#endif
+};
+
+static struct platform_device bfin_sir_device = {
+       .name = "bfin_sir",
+       .id = 0,
+       .num_resources = ARRAY_SIZE(bfin_sir_resources),
+       .resource = bfin_sir_resources,
+};
+#endif
+
 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
 static struct resource bfin_twi0_resource[] = {
        [0] = {
@@ -703,6 +746,28 @@ static struct platform_device i2c_bfin_twi_device = {
 };
 #endif
 
+#ifdef CONFIG_I2C_BOARDINFO
+static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
+#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
+       {
+               I2C_BOARD_INFO("ad7142_joystick", 0x2C),
+               .irq = 55,
+       },
+#endif
+#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
+       {
+               I2C_BOARD_INFO("pcf8574_lcd", 0x22),
+       },
+#endif
+#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
+       {
+               I2C_BOARD_INFO("pcf8574_keypad", 0x27),
+               .irq = 72,
+       },
+#endif
+};
+#endif
+
 #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
 static struct platform_device bfin_sport0_uart_device = {
        .name = "bfin-sport-uart",
@@ -805,6 +870,10 @@ static struct platform_device *stamp_devices[] __initdata = {
        &bfin_uart_device,
 #endif
 
+#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
+       &bfin_sir_device,
+#endif
+
 #if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
        &i2c_bfin_twi_device,
 #endif
@@ -821,12 +890,23 @@ static struct platform_device *stamp_devices[] __initdata = {
 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
        &bfin_device_gpiokeys,
 #endif
+
+       &bfin_gpios_device,
+
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
        &stamp_flash_device,
+#endif
 };
 
 static int __init stamp_init(void)
 {
-       printk(KERN_INFO "%s(): registering device resources\n", __FUNCTION__);
+       printk(KERN_INFO "%s(): registering device resources\n", __func__);
+
+#ifdef CONFIG_I2C_BOARDINFO
+       i2c_register_board_info(0, bfin_i2c_board_info,
+                               ARRAY_SIZE(bfin_i2c_board_info));
+#endif
+
        platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
 #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
        spi_register_board_info(bfin_spi_board_info,
@@ -836,6 +916,7 @@ static int __init stamp_init(void)
 #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
        irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
 #endif
+
        return 0;
 }