#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);
  }
 
  
  #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,
  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;
 
                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;
 
  #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;
  
 
  
        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;
  
        /* [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;
  
        /* [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;
        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;
        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;
 -      desc = channel->device->device_prep_slave_sg(channel,
+       pio[2] = 0; /* clear GPMI_HW_GPMI_ECCCTRL, disable the BCH. */
-                               (struct scatterlist *)pio, 2,
-                               DMA_TRANS_NONE, 1);
 +      desc = dmaengine_prep_slave_sg(channel,
+                               (struct scatterlist *)pio, 3,
+                               DMA_TRANS_NONE,
+                               DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
        if (!desc) {
                pr_err("step 3 error\n");
                return -1;
 
  
        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 |