Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 5 Jan 2009 09:50:33 +0000 (10:50 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 5 Jan 2009 09:50:33 +0000 (10:50 +0100)
Conflicts:
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/spitz.c

1  2 
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/spitz.c
drivers/mtd/maps/ixp2000.c
drivers/mtd/maps/ixp4xx.c
drivers/mtd/onenand/omap2.c
drivers/mtd/ubi/build.c

index b65be8e7792a4b914918688f6f24539a4d00656c,c5e28a46b2929cc92133073608eaf84606971ca6..a8d91b6c136b8daba787e724a16d725fb8553157
@@@ -19,6 -19,7 +19,7 @@@
  #include <linux/fs.h>
  #include <linux/interrupt.h>
  #include <linux/mmc/host.h>
+ #include <linux/mtd/physmap.h>
  #include <linux/pm.h>
  #include <linux/gpio.h>
  #include <linux/backlight.h>
@@@ -26,7 -27,6 +27,7 @@@
  #include <linux/spi/spi.h>
  #include <linux/spi/ads7846.h>
  #include <linux/spi/corgi_lcd.h>
 +#include <linux/mtd/sharpsl.h>
  #include <video/w100fb.h>
  
  #include <asm/setup.h>
@@@ -542,61 -542,42 +543,92 @@@ err_free_1
  static inline void corgi_init_spi(void) {}
  #endif
  
 +static struct mtd_partition sharpsl_nand_partitions[] = {
 +      {
 +              .name = "System Area",
 +              .offset = 0,
 +              .size = 7 * 1024 * 1024,
 +      },
 +      {
 +              .name = "Root Filesystem",
 +              .offset = 7 * 1024 * 1024,
 +              .size = 25 * 1024 * 1024,
 +      },
 +      {
 +              .name = "Home Filesystem",
 +              .offset = MTDPART_OFS_APPEND,
 +              .size = MTDPART_SIZ_FULL,
 +      },
 +};
 +
 +static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
 +
 +static struct nand_bbt_descr sharpsl_bbt = {
 +      .options = 0,
 +      .offs = 4,
 +      .len = 2,
 +      .pattern = scan_ff_pattern
 +};
 +
 +static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
 +      .badblock_pattern       = &sharpsl_bbt,
 +      .partitions             = sharpsl_nand_partitions,
 +      .nr_partitions          = ARRAY_SIZE(sharpsl_nand_partitions),
 +};
 +
 +static struct resource sharpsl_nand_resources[] = {
 +      {
 +              .start  = 0x0C000000,
 +              .end    = 0x0C000FFF,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device sharpsl_nand_device = {
 +      .name           = "sharpsl-nand",
 +      .id             = -1,
 +      .resource       = sharpsl_nand_resources,
 +      .num_resources  = ARRAY_SIZE(sharpsl_nand_resources),
 +      .dev.platform_data      = &sharpsl_nand_platform_data,
 +};
 +
+ static struct mtd_partition sharpsl_rom_parts[] = {
+       {
+               .name   ="Boot PROM Filesystem",
+               .offset = 0x00120000,
+               .size   = MTDPART_SIZ_FULL,
+       },
+ };
+ static struct physmap_flash_data sharpsl_rom_data = {
+       .width          = 2,
+       .nr_parts       = ARRAY_SIZE(sharpsl_rom_parts),
+       .parts          = sharpsl_rom_parts,
+ };
+ static struct resource sharpsl_rom_resources[] = {
+       {
+               .start  = 0x00000000,
+               .end    = 0x007fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+ };
+ static struct platform_device sharpsl_rom_device = {
+       .name   = "physmap-flash",
+       .id     = -1,
+       .resource = sharpsl_rom_resources,
+       .num_resources = ARRAY_SIZE(sharpsl_rom_resources),
+       .dev.platform_data = &sharpsl_rom_data,
+ };
  static struct platform_device *devices[] __initdata = {
        &corgiscoop_device,
        &corgifb_device,
        &corgikbd_device,
        &corgiled_device,
 +      &sharpsl_nand_device,
+       &sharpsl_rom_device,
  };
  
  static void corgi_poweroff(void)
@@@ -636,9 -617,6 +668,9 @@@ static void __init corgi_init(void
  
        platform_scoop_config = &corgi_pcmcia_config;
  
 +      if (machine_is_husky())
 +              sharpsl_nand_partitions[1].size = 53 * 1024 * 1024;
 +
        platform_add_devices(devices, ARRAY_SIZE(devices));
  }
  
index a45afdf252028a25dc8528fe6a09fe471f6ab501,ae88855bf97461b1851b78b0a1c64786740880f1..f9093beba752295a52cac1559b49243da7283d14
  #include <linux/fb.h>
  #include <linux/pm.h>
  #include <linux/delay.h>
+ #include <linux/mtd/physmap.h>
  #include <linux/gpio.h>
  #include <linux/spi/spi.h>
  #include <linux/spi/ads7846.h>
 +#include <linux/mtd/sharpsl.h>
  
  #include <mach/hardware.h>
  #include <asm/mach-types.h>
@@@ -414,59 -414,40 +415,90 @@@ static struct pxafb_mach_info poodle_fb
        .lcd_conn       = LCD_COLOR_TFT_16BPP,
  };
  
 +static struct mtd_partition sharpsl_nand_partitions[] = {
 +      {
 +              .name = "System Area",
 +              .offset = 0,
 +              .size = 7 * 1024 * 1024,
 +      },
 +      {
 +              .name = "Root Filesystem",
 +              .offset = 7 * 1024 * 1024,
 +              .size = 22 * 1024 * 1024,
 +      },
 +      {
 +              .name = "Home Filesystem",
 +              .offset = MTDPART_OFS_APPEND,
 +              .size = MTDPART_SIZ_FULL,
 +      },
 +};
 +
 +static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
 +
 +static struct nand_bbt_descr sharpsl_bbt = {
 +      .options = 0,
 +      .offs = 4,
 +      .len = 2,
 +      .pattern = scan_ff_pattern
 +};
 +
 +static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
 +      .badblock_pattern       = &sharpsl_bbt,
 +      .partitions             = sharpsl_nand_partitions,
 +      .nr_partitions          = ARRAY_SIZE(sharpsl_nand_partitions),
 +};
 +
 +static struct resource sharpsl_nand_resources[] = {
 +      {
 +              .start  = 0x0C000000,
 +              .end    = 0x0C000FFF,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device sharpsl_nand_device = {
 +      .name           = "sharpsl-nand",
 +      .id             = -1,
 +      .resource       = sharpsl_nand_resources,
 +      .num_resources  = ARRAY_SIZE(sharpsl_nand_resources),
 +      .dev.platform_data      = &sharpsl_nand_platform_data,
 +};
 +
+ static struct mtd_partition sharpsl_rom_parts[] = {
+       {
+               .name   ="Boot PROM Filesystem",
+               .offset = 0x00120000,
+               .size   = MTDPART_SIZ_FULL,
+       },
+ };
+ static struct physmap_flash_data sharpsl_rom_data = {
+       .width          = 2,
+       .nr_parts       = ARRAY_SIZE(sharpsl_rom_parts),
+       .parts          = sharpsl_rom_parts,
+ };
+ static struct resource sharpsl_rom_resources[] = {
+       {
+               .start  = 0x00000000,
+               .end    = 0x007fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+ };
+ static struct platform_device sharpsl_rom_device = {
+       .name   = "physmap-flash",
+       .id     = -1,
+       .resource = sharpsl_rom_resources,
+       .num_resources = ARRAY_SIZE(sharpsl_rom_resources),
+       .dev.platform_data = &sharpsl_rom_data,
+ };
  static struct platform_device *devices[] __initdata = {
        &poodle_locomo_device,
        &poodle_scoop_device,
 +      &sharpsl_nand_device,
+       &sharpsl_rom_device,
  };
  
  static void poodle_poweroff(void)
index 7672b09c31b9f38074704b42d517777c5c905049,7299d87a1cb31f9b33d0ae9deadc2d9e30eab9a3..6d447c9ce8abfcadb2743f11330a48ab93d7d125
@@@ -22,6 -22,7 +22,7 @@@
  #include <linux/gpio.h>
  #include <linux/leds.h>
  #include <linux/mmc/host.h>
+ #include <linux/mtd/physmap.h>
  #include <linux/pm.h>
  #include <linux/backlight.h>
  #include <linux/io.h>
@@@ -30,7 -31,6 +31,7 @@@
  #include <linux/spi/spi.h>
  #include <linux/spi/ads7846.h>
  #include <linux/spi/corgi_lcd.h>
 +#include <linux/mtd/sharpsl.h>
  
  #include <asm/setup.h>
  #include <asm/memory.h>
@@@ -123,6 -123,10 +124,10 @@@ static unsigned long spitz_pin_config[
        GPIO105_GPIO,   /* SPITZ_GPIO_CF_IRQ */
        GPIO106_GPIO,   /* SPITZ_GPIO_CF2_IRQ */
  
+       /* I2C */
+       GPIO117_I2C_SCL,
+       GPIO118_I2C_SDA,
        GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
  };
  
@@@ -609,60 -613,42 +614,91 @@@ static struct pxafb_mach_info spitz_pxa
        .lcd_conn       = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING,
  };
  
 +static struct mtd_partition sharpsl_nand_partitions[] = {
 +      {
 +              .name = "System Area",
 +              .offset = 0,
 +              .size = 7 * 1024 * 1024,
 +      },
 +      {
 +              .name = "Root Filesystem",
 +              .offset = 7 * 1024 * 1024,
 +      },
 +      {
 +              .name = "Home Filesystem",
 +              .offset = MTDPART_OFS_APPEND,
 +              .size = MTDPART_SIZ_FULL,
 +      },
 +};
 +
 +static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
 +
 +static struct nand_bbt_descr sharpsl_bbt = {
 +      .options = 0,
 +      .offs = 4,
 +      .len = 2,
 +      .pattern = scan_ff_pattern
 +};
 +
 +static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
 +      .badblock_pattern       = &sharpsl_bbt,
 +      .partitions             = sharpsl_nand_partitions,
 +      .nr_partitions          = ARRAY_SIZE(sharpsl_nand_partitions),
 +};
 +
 +static struct resource sharpsl_nand_resources[] = {
 +      {
 +              .start  = 0x0C000000,
 +              .end    = 0x0C000FFF,
 +              .flags  = IORESOURCE_MEM,
 +      },
 +};
 +
 +static struct platform_device sharpsl_nand_device = {
 +      .name           = "sharpsl-nand",
 +      .id             = -1,
 +      .resource       = sharpsl_nand_resources,
 +      .num_resources  = ARRAY_SIZE(sharpsl_nand_resources),
 +      .dev.platform_data      = &sharpsl_nand_platform_data,
 +};
 +
  
+ static struct mtd_partition sharpsl_rom_parts[] = {
+       {
+               .name   ="Boot PROM Filesystem",
+               .offset = 0x00140000,
+               .size   = MTDPART_SIZ_FULL,
+       },
+ };
+ static struct physmap_flash_data sharpsl_rom_data = {
+       .width          = 2,
+       .nr_parts       = ARRAY_SIZE(sharpsl_rom_parts),
+       .parts          = sharpsl_rom_parts,
+ };
+ static struct resource sharpsl_rom_resources[] = {
+       {
+               .start  = 0x00000000,
+               .end    = 0x007fffff,
+               .flags  = IORESOURCE_MEM,
+       },
+ };
+ static struct platform_device sharpsl_rom_device = {
+       .name   = "physmap-flash",
+       .id     = -1,
+       .resource = sharpsl_rom_resources,
+       .num_resources = ARRAY_SIZE(sharpsl_rom_resources),
+       .dev.platform_data = &sharpsl_rom_data,
+ };
  static struct platform_device *devices[] __initdata = {
        &spitzscoop_device,
        &spitzkbd_device,
        &spitzled_device,
 +      &sharpsl_nand_device,
+       &sharpsl_rom_device,
  };
  
  static void spitz_poweroff(void)
@@@ -685,14 -671,6 +721,14 @@@ static void __init common_init(void
        pm_power_off = spitz_poweroff;
        arm_pm_restart = spitz_restart;
  
 +      if (machine_is_spitz()) {
 +              sharpsl_nand_partitions[1].size = 5 * 1024 * 1024;
 +      } else if (machine_is_akita()) {
 +              sharpsl_nand_partitions[1].size = 58 * 1024 * 1024;
 +      } else if (machine_is_borzoi()) {
 +              sharpsl_nand_partitions[1].size = 32 * 1024 * 1024;
 +      }
 +
        PMCR = 0x00;
  
        /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
@@@ -737,29 -715,10 +773,29 @@@ static struct i2c_board_info akita_i2c_
        },
  };
  
 +static struct nand_bbt_descr sharpsl_akita_bbt = {
 +      .options = 0,
 +      .offs = 4,
 +      .len = 1,
 +      .pattern = scan_ff_pattern
 +};
 +
 +static struct nand_ecclayout akita_oobinfo = {
 +      .eccbytes = 24,
 +      .eccpos = {
 +                 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
 +                 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
 +                 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
 +      .oobfree = {{0x08, 0x09}}
 +};
 +
  static void __init akita_init(void)
  {
        spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode;
  
 +      sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
 +      sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
 +
        /* We just pretend the second element of the array doesn't exist */
        spitz_pcmcia_config.num_devs = 1;
        platform_scoop_config = &spitz_pcmcia_config;
index d76880d91bdbbc1317d215962595f082bd80caa2,3ea1de9be7203aedb92ae1014db058eba4d3620e..d4fb9a3ab4dfd88bd4c7a9d456f25d7613b449cc
@@@ -170,7 -170,7 +170,7 @@@ static int ixp2000_flash_probe(struct p
                err = -ENOMEM;
                goto Error;
        }
-       memzero(info, sizeof(struct ixp2000_flash_info));
+       memset(info, 0, sizeof(struct ixp2000_flash_info));
  
        platform_set_drvdata(dev, info);
  
         */
        info->map.map_priv_2 = (unsigned long) ixp_data->bank_setup;
  
 -      info->map.name = dev->dev.bus_id;
 +      info->map.name = dev_name(&dev->dev);
        info->map.read = ixp2000_flash_read8;
        info->map.write = ixp2000_flash_write8;
        info->map.copy_from = ixp2000_flash_copy_from;
  
        info->res = request_mem_region(dev->resource->start,
                        dev->resource->end - dev->resource->start + 1,
 -                      dev->dev.bus_id);
 +                      dev_name(&dev->dev));
        if (!info->res) {
                dev_err(&dev->dev, "Could not reserve memory region\n");
                err = -ENOMEM;
index 4d0be2f1503f3a3134fb187cf595b65d9ec9e180,16555cbeaea4572e383189ea88f3f153338431b8..7214b876febaea91e339e5964a0d6c1cb463899f
@@@ -201,7 -201,7 +201,7 @@@ static int ixp4xx_flash_probe(struct pl
                err = -ENOMEM;
                goto Error;
        }
-       memzero(info, sizeof(struct ixp4xx_flash_info));
+       memset(info, 0, sizeof(struct ixp4xx_flash_info));
  
        platform_set_drvdata(dev, info);
  
         * handle that.
         */
        info->map.bankwidth = 2;
 -      info->map.name = dev->dev.bus_id;
 +      info->map.name = dev_name(&dev->dev);
        info->map.read = ixp4xx_read16,
        info->map.write = ixp4xx_probe_write16,
        info->map.copy_from = ixp4xx_copy_from,
index 710edee790b5868ae2b7542658dd25b1fe4fa8d2,d1e0b8e7224bfa32a87aa8d5dabb37c657b8ae34..96ecc1766fa80346ebf825b42ad8f5cff1cb13be
@@@ -149,7 -149,7 +149,7 @@@ static int omap2_onenand_wait(struct mt
  
                INIT_COMPLETION(c->irq_done);
                if (c->gpio_irq) {
-                       result = omap_get_gpio_datain(c->gpio_irq);
+                       result = gpio_get_value(c->gpio_irq);
                        if (result == -1) {
                                ctrl = read_reg(c, ONENAND_REG_CTRL_STATUS);
                                intr = read_reg(c, ONENAND_REG_INTERRUPT);
@@@ -634,9 -634,9 +634,9 @@@ static int __devinit omap2_onenand_prob
                                "OneNAND\n", c->gpio_irq);
                        goto err_iounmap;
        }
-       omap_set_gpio_direction(c->gpio_irq, 1);
+       gpio_direction_input(c->gpio_irq);
  
-       if ((r = request_irq(OMAP_GPIO_IRQ(c->gpio_irq),
+       if ((r = request_irq(gpio_to_irq(c->gpio_irq),
                             omap2_onenand_interrupt, IRQF_TRIGGER_RISING,
                             pdev->dev.driver->name, c)) < 0)
                goto err_release_gpio;
                 c->onenand.base);
  
        c->pdev = pdev;
 -      c->mtd.name = pdev->dev.bus_id;
 +      c->mtd.name = dev_name(&pdev->dev);
        c->mtd.priv = &c->onenand;
        c->mtd.owner = THIS_MODULE;
  
@@@ -723,7 -723,7 +723,7 @@@ err_release_dma
        if (c->dma_channel != -1)
                omap_free_dma(c->dma_channel);
        if (c->gpio_irq)
-               free_irq(OMAP_GPIO_IRQ(c->gpio_irq), c);
+               free_irq(gpio_to_irq(c->gpio_irq), c);
  err_release_gpio:
        if (c->gpio_irq)
                omap_free_gpio(c->gpio_irq);
@@@ -760,7 -760,7 +760,7 @@@ static int __devexit omap2_onenand_remo
        omap2_onenand_shutdown(pdev);
        platform_set_drvdata(pdev, NULL);
        if (c->gpio_irq) {
-               free_irq(OMAP_GPIO_IRQ(c->gpio_irq), c);
+               free_irq(gpio_to_irq(c->gpio_irq), c);
                omap_free_gpio(c->gpio_irq);
        }
        iounmap(c->onenand.base);
diff --combined drivers/mtd/ubi/build.c
index 84a134ead7cc89634c61717f6f988b1e5eeebcc1,ba0bd3d5775be9933a0e3da5e15cf8caf366bf6d..9082768cc6c3850df4c9290e5f7487e795bc4e88
@@@ -280,7 -280,7 +280,7 @@@ static int ubi_sysfs_init(struct ubi_de
        ubi->dev.release = dev_release;
        ubi->dev.devt = ubi->cdev.dev;
        ubi->dev.class = ubi_class;
 -      sprintf(&ubi->dev.bus_id[0], UBI_NAME_STR"%d", ubi->ubi_num);
 +      dev_set_name(&ubi->dev, UBI_NAME_STR"%d", ubi->ubi_num);
        err = device_register(&ubi->dev);
        if (err)
                return err;
@@@ -561,7 -561,7 +561,7 @@@ static int io_init(struct ubi_device *u
         */
  
        ubi->peb_size   = ubi->mtd->erasesize;
 -      ubi->peb_count  = ubi->mtd->size / ubi->mtd->erasesize;
 +      ubi->peb_count  = mtd_div_by_eb(ubi->mtd->size, ubi->mtd);
        ubi->flash_size = ubi->mtd->size;
  
        if (ubi->mtd->block_isbad && ubi->mtd->block_markbad)
@@@ -815,19 -815,20 +815,20 @@@ int ubi_attach_mtd_dev(struct mtd_info 
        if (err)
                goto out_free;
  
+       err = -ENOMEM;
        ubi->peb_buf1 = vmalloc(ubi->peb_size);
        if (!ubi->peb_buf1)
                goto out_free;
  
        ubi->peb_buf2 = vmalloc(ubi->peb_size);
        if (!ubi->peb_buf2)
-                goto out_free;
+               goto out_free;
  
  #ifdef CONFIG_MTD_UBI_DEBUG
        mutex_init(&ubi->dbg_buf_mutex);
        ubi->dbg_peb_buf = vmalloc(ubi->peb_size);
        if (!ubi->dbg_peb_buf)
-                goto out_free;
+               goto out_free;
  #endif
  
        err = attach_by_scanning(ubi);