Merge tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6
Linus Torvalds [Sat, 31 Mar 2012 00:31:56 +0000 (17:31 -0700)]
Pull MTD changes from David Woodhouse:
 - Artem's cleanup of the MTD API continues apace.
 - Fixes and improvements for ST FSMC and SuperH FLCTL NAND, amongst
   others.
 - More work on DiskOnChip G3, new driver for DiskOnChip G4.
 - Clean up debug/warning printks in JFFS2 to use pr_<level>.

Fix up various trivial conflicts, largely due to changes in calling
conventions for things like dmaengine_prep_slave_sg() (new inline
wrapper to hide new parameter, clashing with rewrite of previously last
parameter that used to be an 'append' flag, and is now a bitmap of
'unsigned long flags').

(Also some header file fallout - like so many merges this merge window -
and silly conflicts with sparse fixes)

* tag 'for-linus-3.4' of git://git.infradead.org/mtd-2.6: (120 commits)
  mtd: docg3 add protection against concurrency
  mtd: docg3 refactor cascade floors structure
  mtd: docg3 increase write/erase timeout
  mtd: docg3 fix inbound calculations
  mtd: nand: gpmi: fix function annotations
  mtd: phram: fix section mismatch for phram_setup
  mtd: unify initialization of erase_info->fail_addr
  mtd: support ONFI multi lun NAND
  mtd: sm_ftl: fix typo in major number.
  mtd: add device-tree support to spear_smi
  mtd: spear_smi: Remove default partition information from driver
  mtd: Add device-tree support to fsmc_nand
  mtd: fix section mismatch for doc_probe_device
  mtd: nand/fsmc: Remove sparse warnings and errors
  mtd: nand/fsmc: Add DMA support
  mtd: nand/fsmc: Access the NAND device word by word whenever possible
  mtd: nand/fsmc: Use dev_err to report error scenario
  mtd: nand/fsmc: Use devm routines
  mtd: nand/fsmc: Modify fsmc driver to accept nand timing parameters via platform
  mtd: fsmc_nand: add pm callbacks to support hibernation
  ...

24 files changed:
1  2 
arch/arm/mach-omap1/flash.c
arch/arm/mach-s3c24xx/simtec-nor.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/clock-sh7372.c
arch/arm/mach-u300/core.c
arch/arm/mach-u300/include/mach/u300-regs.h
drivers/dma/mxs-dma.c
drivers/mmc/host/mxs-mmc.c
drivers/mtd/Kconfig
drivers/mtd/chips/cfi_cmdset_0001.c
drivers/mtd/devices/Kconfig
drivers/mtd/devices/pmc551.c
drivers/mtd/devices/slram.c
drivers/mtd/maps/pcmciamtd.c
drivers/mtd/mtdchar.c
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Makefile
drivers/mtd/nand/atmel_nand.c
drivers/mtd/nand/bcm_umi_nand.c
drivers/mtd/nand/gpmi-nand/gpmi-lib.c
drivers/net/ethernet/sfc/mtd.c
fs/jffs2/fs.c
sound/soc/mxs/mxs-pcm.c
sound/soc/mxs/mxs-saif.c

  #include <plat/tc.h>
  #include <plat/flash.h>
  
 +#include <mach/hardware.h>
 +
  void omap1_set_vpp(struct platform_device *pdev, int enable)
  {
-       static int count;
        u32 l;
  
-       if (enable) {
-               if (count++ == 0) {
-                       l = omap_readl(EMIFS_CONFIG);
-                       l |= OMAP_EMIFS_CONFIG_WP;
-                       omap_writel(l, EMIFS_CONFIG);
-               }
-       } else {
-               if (count && (--count == 0)) {
-                       l = omap_readl(EMIFS_CONFIG);
-                       l &= ~OMAP_EMIFS_CONFIG_WP;
-                       omap_writel(l, EMIFS_CONFIG);
-               }
-       }
+       l = omap_readl(EMIFS_CONFIG);
+       if (enable)
+               l |= OMAP_EMIFS_CONFIG_WP;
+       else
+               l &= ~OMAP_EMIFS_CONFIG_WP;
+       omap_writel(l, EMIFS_CONFIG);
  }
index 2119ca6,0000000..b9d6d4f
mode 100644,000000..100644
--- /dev/null
@@@ -1,87 -1,0 +1,84 @@@
 +/* linux/arch/arm/mach-s3c2410/nor-simtec.c
 + *
 + * Copyright (c) 2008 Simtec Electronics
 + *    http://armlinux.simtec.co.uk/
 + *    Ben Dooks <ben@simtec.co.uk>
 + *
 + * Simtec NOR mapping
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 +*/
 +
 +#include <linux/module.h>
 +#include <linux/types.h>
 +#include <linux/init.h>
 +#include <linux/kernel.h>
 +#include <linux/platform_device.h>
 +
 +#include <linux/mtd/mtd.h>
 +#include <linux/mtd/map.h>
 +#include <linux/mtd/physmap.h>
 +#include <linux/mtd/partitions.h>
 +
 +#include <asm/mach/arch.h>
 +#include <asm/mach/map.h>
 +#include <asm/mach/irq.h>
 +
 +#include <mach/map.h>
 +#include <mach/bast-map.h>
 +#include <mach/bast-cpld.h>
 +
 +#include "simtec.h"
 +
 +static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
 +{
 +      unsigned int val;
-       unsigned long flags;
 +
-       local_irq_save(flags);
 +      val = __raw_readb(BAST_VA_CTRL3);
 +
 +      printk(KERN_DEBUG "%s(%d)\n", __func__, vpp);
 +
 +      if (vpp)
 +              val |= BAST_CPLD_CTRL3_ROMWEN;
 +      else
 +              val &= ~BAST_CPLD_CTRL3_ROMWEN;
 +
 +      __raw_writeb(val, BAST_VA_CTRL3);
-       local_irq_restore(flags);
 +}
 +
 +static struct physmap_flash_data simtec_nor_pdata = {
 +      .width          = 2,
 +      .set_vpp        = simtec_nor_vpp,
 +      .nr_parts       = 0,
 +};
 +
 +static struct resource simtec_nor_resource[] = {
 +      [0] = {
 +              .start = S3C2410_CS1 + 0x4000000,
 +              .end   = S3C2410_CS1 + 0x4000000 + SZ_8M - 1,
 +              .flags = IORESOURCE_MEM,
 +      }
 +};
 +
 +static struct platform_device simtec_device_nor = {
 +      .name           = "physmap-flash",
 +      .id             = -1,
 +      .num_resources  = ARRAY_SIZE(simtec_nor_resource),
 +      .resource       = simtec_nor_resource,
 +      .dev            = {
 +              .platform_data = &simtec_nor_pdata,
 +      },
 +};
 +
 +void __init nor_simtec_init(void)
 +{
 +      int ret;
 +
 +      ret = platform_device_register(&simtec_device_nor);
 +      if (ret < 0)
 +              printk(KERN_ERR "failed to register physmap-flash device\n");
 +      else
 +              simtec_nor_vpp(NULL, 1);
 +}
Simple merge
Simple merge
  
  #include <asm/irq.h>
  #include <mach/mxs.h>
- #include <mach/dma.h>
  #include <mach/common.h>
  
 +#include "dmaengine.h"
 +
  /*
   * NOTE: The term "PIO" throughout the mxs-dma implementation means
   * PIO mode of mxs apbh-dma and apbx-dma.  With this working mode,
@@@ -340,7 -374,7 +362,7 @@@ static void mxs_dma_free_chan_resources
  static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
                struct dma_chan *chan, struct scatterlist *sgl,
                unsigned int sg_len, enum dma_transfer_direction direction,
-               unsigned long append, void *context)
 -              unsigned long flags)
++              unsigned long flags, void *context)
  {
        struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
        struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@@ -324,8 -324,8 +324,8 @@@ static struct dma_async_tx_descriptor *
                sg_len = SSP_PIO_NUM;
        }
  
 -      desc = host->dmach->device->device_prep_slave_sg(host->dmach,
 +      desc = dmaengine_prep_slave_sg(host->dmach,
-                               sgl, sg_len, host->slave_dirn, append);
+                               sgl, sg_len, host->slave_dirn, flags);
        if (desc) {
                desc->callback = mxs_mmc_dma_irq_callback;
                desc->callback_param = host;
Simple merge
Simple merge
Simple merge
  #include <linux/fs.h>
  #include <linux/ioctl.h>
  #include <asm/io.h>
 -#include <asm/system.h>
  #include <linux/pci.h>
  #include <linux/mtd/mtd.h>
- #include <linux/mtd/pmc551.h>
+ #define PMC551_VERSION \
+       "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n"
+ #define PCI_VENDOR_ID_V3_SEMI 0x11b0
+ #define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200
+ #define PMC551_PCI_MEM_MAP0 0x50
+ #define PMC551_PCI_MEM_MAP1 0x54
+ #define PMC551_PCI_MEM_MAP_MAP_ADDR_MASK 0x3ff00000
+ #define PMC551_PCI_MEM_MAP_APERTURE_MASK 0x000000f0
+ #define PMC551_PCI_MEM_MAP_REG_EN 0x00000002
+ #define PMC551_PCI_MEM_MAP_ENABLE 0x00000001
+ #define PMC551_SDRAM_MA  0x60
+ #define PMC551_SDRAM_CMD 0x62
+ #define PMC551_DRAM_CFG  0x64
+ #define PMC551_SYS_CTRL_REG 0x78
+ #define PMC551_DRAM_BLK0 0x68
+ #define PMC551_DRAM_BLK1 0x6c
+ #define PMC551_DRAM_BLK2 0x70
+ #define PMC551_DRAM_BLK3 0x74
+ #define PMC551_DRAM_BLK_GET_SIZE(x) (524288 << ((x >> 4) & 0x0f))
+ #define PMC551_DRAM_BLK_SET_COL_MUX(x, v) (((x) & ~0x00007000) | (((v) & 0x7) << 12))
+ #define PMC551_DRAM_BLK_SET_ROW_MUX(x, v) (((x) & ~0x00000f00) | (((v) & 0xf) << 8))
+ struct mypriv {
+       struct pci_dev *dev;
+       u_char *start;
+       u32 base_map0;
+       u32 curr_map0;
+       u32 asize;
+       struct mtd_info *nextpmc551;
+ };
  
  static struct mtd_info *pmc551list;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -848,7 -848,10 +848,10 @@@ int gpmi_send_command(struct gpmi_nand_
  
        sg_init_one(sgl, this->cmd_buffer, this->command_length);
        dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE);
-       desc = dmaengine_prep_slave_sg(channel, sgl, 1, DMA_MEM_TO_DEV, 1);
 -      desc = channel->device->device_prep_slave_sg(channel,
++      desc = dmaengine_prep_slave_sg(channel,
+                               sgl, 1, DMA_MEM_TO_DEV,
+                               DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 2 error\n");
                return -1;
@@@ -888,8 -892,9 +891,9 @@@ int gpmi_send_data(struct gpmi_nand_dat
  
        /* [2] send DMA request */
        prepare_data_dma(this, DMA_TO_DEVICE);
 -      desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl,
 +      desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
-                                               1, DMA_MEM_TO_DEV, 1);
+                                       1, DMA_MEM_TO_DEV,
+                                       DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 2 error\n");
                return -1;
@@@ -924,8 -929,9 +928,9 @@@ int gpmi_read_data(struct gpmi_nand_dat
  
        /* [2] : send DMA request */
        prepare_data_dma(this, DMA_FROM_DEVICE);
 -      desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl,
 +      desc = dmaengine_prep_slave_sg(channel, &this->data_sgl,
-                                       1, DMA_DEV_TO_MEM, 1);
+                                       1, DMA_DEV_TO_MEM,
+                                       DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 2 error\n");
                return -1;
@@@ -970,8 -976,10 +975,10 @@@ int gpmi_send_page(struct gpmi_nand_dat
        pio[4] = payload;
        pio[5] = auxiliary;
  
-       desc = dmaengine_prep_slave_sg(channel, (struct scatterlist *)pio,
-                                       ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
 -      desc = channel->device->device_prep_slave_sg(channel,
++      desc = dmaengine_prep_slave_sg(channel,
+                                       (struct scatterlist *)pio,
+                                       ARRAY_SIZE(pio), DMA_TRANS_NONE,
+                                       DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 2 error\n");
                return -1;
@@@ -1033,9 -1041,10 +1040,10 @@@ int gpmi_read_page(struct gpmi_nand_dat
        pio[3] = geo->page_size;
        pio[4] = payload;
        pio[5] = auxiliary;
 -      desc = channel->device->device_prep_slave_sg(channel,
 +      desc = dmaengine_prep_slave_sg(channel,
                                        (struct scatterlist *)pio,
-                                       ARRAY_SIZE(pio), DMA_TRANS_NONE, 1);
+                                       ARRAY_SIZE(pio), DMA_TRANS_NONE,
+                                       DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 2 error\n");
                return -1;
                | BF_GPMI_CTRL0_ADDRESS(address)
                | BF_GPMI_CTRL0_XFER_COUNT(geo->page_size);
        pio[1] = 0;
+       pio[2] = 0; /* clear GPMI_HW_GPMI_ECCCTRL, disable the BCH. */
 -      desc = channel->device->device_prep_slave_sg(channel,
 +      desc = dmaengine_prep_slave_sg(channel,
-                               (struct scatterlist *)pio, 2,
-                               DMA_TRANS_NONE, 1);
+                               (struct scatterlist *)pio, 3,
+                               DMA_TRANS_NONE,
+                               DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 3 error\n");
                return -1;
Simple merge
diff --cc fs/jffs2/fs.c
@@@ -560,10 -572,10 +572,10 @@@ int jffs2_do_fill_super(struct super_bl
  
        ret = -ENOMEM;
  
-       D1(printk(KERN_DEBUG "jffs2_do_fill_super(): d_alloc_root()\n"));
 -      jffs2_dbg(1, "%s(): d_alloc_root()\n", __func__);
 -      sb->s_root = d_alloc_root(root_i);
++      jffs2_dbg(1, "%s(): d_make_root()\n", __func__);
 +      sb->s_root = d_make_root(root_i);
        if (!sb->s_root)
 -              goto out_root_i;
 +              goto out_root;
  
        sb->s_maxbytes = 0xFFFFFFFF;
        sb->s_blocksize = PAGE_CACHE_SIZE;
  #include <sound/pcm.h>
  #include <sound/pcm_params.h>
  #include <sound/soc.h>
 +#include <sound/dmaengine_pcm.h>
  
- #include <mach/dma.h>
  #include "mxs-pcm.h"
  
 +struct mxs_pcm_dma_data {
 +      struct mxs_dma_data dma_data;
 +      struct mxs_pcm_dma_params *dma_params;
 +};
 +
  static struct snd_pcm_hardware snd_mxs_hardware = {
        .info                   = SNDRV_PCM_INFO_MMAP |
                                  SNDRV_PCM_INFO_MMAP_VALID |
Simple merge