linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] patch set about the MXS-DMA
@ 2012-01-19  6:15 Huang Shijie
  2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
                   ` (10 more replies)
  0 siblings, 11 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:15 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

This patch set does two things about the MXS-DMA:
[1] patch 1 ~ patch 5: move the mxs dma header to a more common place.
	Beside the mx23/mx28, the APBH-DMA is also used by MX50 and MX6Q.
	So move the mxs dma header file to a more common place, and rename
	it to mxs-dma.h

[2] patch 6 ~ patch 10: rewrite the last parameter of mxs_dma_prep_slave_sg().
	In the new GPMI version, some hardware behavior changes.
	The WAIT4END bit should be set in the middle one of the ECC READ page DMA chain.
	The DMA chain should be set like this:

          +-----+               +-----+                      +-----+
          | cmd | ------------> | cmd | ------------------>  | cmd |
          +-----+               +-----+                      +-----+
                                   ^                            ^
                                   |                            |
                                   |                            |
                              set WAIT4END here too        set WAIT4END here

         Please read the comment in patch "MXS-DMA : add more flags for MXS-DMA".

Huang Shijie (10):
  MXS-DMA : move the mxs-dma.h to a more common place
  MXS-DMA : change the header
  MXS-MMC : change the DMA header file
  MTD/GPMI : change the DMA header file
  ASoc : change the DMA header file
  MXS-DMA : add more flags for MXS-DMA
  MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg()
  MXS-MMC : use the new DMA flags
  MTD/GPMI : add a new field `gpmi_version`
  MTD/GPMI : change the code for new DMA interface

 arch/arm/mach-mxs/include/mach/dma.h   |   28 ----------------
 drivers/dma/mxs-dma.c                  |   12 ++++---
 drivers/mmc/host/mxs-mmc.c             |   12 +++---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c  |   23 ++++++++++---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.h |    6 +++-
 drivers/mtd/nand/gpmi-nand/gpmi-regs.h |    2 +
 include/linux/mxs-dma.h                |   54 ++++++++++++++++++++++++++++++++
 sound/soc/mxs/mxs-pcm.c                |    2 +-
 sound/soc/mxs/mxs-pcm.h                |    2 +-
 sound/soc/mxs/mxs-saif.c               |    2 +-
 10 files changed, 94 insertions(+), 49 deletions(-)
 delete mode 100644 arch/arm/mach-mxs/include/mach/dma.h
 create mode 100644 include/linux/mxs-dma.h



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
@ 2012-01-19  6:15 ` Huang Shijie
  2012-01-19  8:58   ` Wolfram Sang
  2012-01-19 13:04   ` Shawn Guo
  2012-01-19  6:15 ` [PATCH 02/10] MXS-DMA : change the header Huang Shijie
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:15 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

Move the header to a more common place.
The DMA engine is not only used in mx23/mx28, but also used
in mx50/mx6q.
It will also be used in the future chips.

Rename it to mxs-dma.h

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 arch/arm/mach-mxs/include/mach/dma.h |   28 ----------------------------
 include/linux/mxs-dma.h              |   28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 28 deletions(-)
 delete mode 100644 arch/arm/mach-mxs/include/mach/dma.h
 create mode 100644 include/linux/mxs-dma.h

diff --git a/arch/arm/mach-mxs/include/mach/dma.h b/arch/arm/mach-mxs/include/mach/dma.h
deleted file mode 100644
index 203d7c4..0000000
--- a/arch/arm/mach-mxs/include/mach/dma.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * 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.
- */
-
-#ifndef __MACH_MXS_DMA_H__
-#define __MACH_MXS_DMA_H__
-
-#include <linux/dmaengine.h>
-
-struct mxs_dma_data {
-	int chan_irq;
-};
-
-static inline int mxs_dma_is_apbh(struct dma_chan *chan)
-{
-	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
-}
-
-static inline int mxs_dma_is_apbx(struct dma_chan *chan)
-{
-	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
-}
-
-#endif /* __MACH_MXS_DMA_H__ */
diff --git a/include/linux/mxs-dma.h b/include/linux/mxs-dma.h
new file mode 100644
index 0000000..203d7c4
--- /dev/null
+++ b/include/linux/mxs-dma.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * 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.
+ */
+
+#ifndef __MACH_MXS_DMA_H__
+#define __MACH_MXS_DMA_H__
+
+#include <linux/dmaengine.h>
+
+struct mxs_dma_data {
+	int chan_irq;
+};
+
+static inline int mxs_dma_is_apbh(struct dma_chan *chan)
+{
+	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
+}
+
+static inline int mxs_dma_is_apbx(struct dma_chan *chan)
+{
+	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
+}
+
+#endif /* __MACH_MXS_DMA_H__ */
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 02/10] MXS-DMA : change the header
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
  2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
@ 2012-01-19  6:15 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 03/10] MXS-MMC : change the DMA header file Huang Shijie
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:15 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

change the header for MXS-DMA driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/dma/mxs-dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index b06cd4c..c80fbed 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -22,10 +22,10 @@
 #include <linux/platform_device.h>
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
+#include <linux/mxs-dma.h>
 
 #include <asm/irq.h>
 #include <mach/mxs.h>
-#include <mach/dma.h>
 #include <mach/common.h>
 
 /*
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 03/10] MXS-MMC : change the DMA header file
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
  2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
  2012-01-19  6:15 ` [PATCH 02/10] MXS-DMA : change the header Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 04/10] MTD/GPMI " Huang Shijie
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

use the new MXS-DMA header for mxs-mmc driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mmc/host/mxs-mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 382c835..1e18970 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -38,10 +38,10 @@
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
 #include <linux/module.h>
+#include <linux/mxs-dma.h>
 
 #include <mach/mxs.h>
 #include <mach/common.h>
-#include <mach/dma.h>
 #include <mach/mmc.h>
 
 #define DRIVER_NAME	"mxs-mmc"
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 04/10] MTD/GPMI : change the DMA header file
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (2 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 03/10] MXS-MMC : change the DMA header file Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 05/10] ASoc " Huang Shijie
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

change the DMA header file for GPMI NAND driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
index e023bcc..1c7fdbb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
@@ -20,7 +20,7 @@
 #include <linux/mtd/nand.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
-#include <mach/dma.h>
+#include <linux/mxs-dma.h>
 
 struct resources {
 	void          *gpmi_regs;
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 05/10] ASoc : change the DMA header file
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (3 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 04/10] MTD/GPMI " Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA Huang Shijie
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

change these files to use the new DMA header file.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 sound/soc/mxs/mxs-pcm.c  |    2 +-
 sound/soc/mxs/mxs-pcm.h  |    2 +-
 sound/soc/mxs/mxs-saif.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c
index 105f42a..7eb186f 100644
--- a/sound/soc/mxs/mxs-pcm.c
+++ b/sound/soc/mxs/mxs-pcm.c
@@ -28,6 +28,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/dmaengine.h>
+#include <linux/mxs-dma.h>
 
 #include <sound/core.h>
 #include <sound/initval.h>
@@ -35,7 +36,6 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 
-#include <mach/dma.h>
 #include "mxs-pcm.h"
 
 static struct snd_pcm_hardware snd_mxs_hardware = {
diff --git a/sound/soc/mxs/mxs-pcm.h b/sound/soc/mxs/mxs-pcm.h
index f55ac4f..3ac9956 100644
--- a/sound/soc/mxs/mxs-pcm.h
+++ b/sound/soc/mxs/mxs-pcm.h
@@ -19,7 +19,7 @@
 #ifndef _MXS_PCM_H
 #define _MXS_PCM_H
 
-#include <mach/dma.h>
+#include <linux/mxs-dma.h>
 
 struct mxs_pcm_dma_params {
 	int chan_irq;
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index dccfb37..ada6344 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -24,12 +24,12 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/time.h>
+#include <linux/mxs-dma.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #include <sound/saif.h>
-#include <mach/dma.h>
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <mach/mxs.h>
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (4 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 05/10] ASoc " Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  9:02   ` Russell King - ARM Linux
  2012-01-19  6:16 ` [PATCH 07/10] MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg() Huang Shijie
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

[1] Background :
    The GPMI does ECC read page operation with a DMA chain consist of three DMA
    Command Structures. The middle one of the chain is used to enable the BCH,
    and read out the NAND page.

    The WAIT4END(wait for command end) is a comunication signal between
    the GPMI and MXS-DMA.

[2] The current DMA code sets the WAIT4END bit at the last one, such as:

    +-----+               +-----+                      +-----+
    | cmd | ------------> | cmd | ------------------>  | cmd |
    +-----+               +-----+                      +-----+
                                                          ^
                                                          |
                                                          |
                                                     set WAIT4END here

    This chain works fine in the mx23/mx28.

[3] But in the new GPMI version (used in MX50/MX60), the WAIT4END bit should
    be set not only at the last DMA Command Structure,
    but also at the middle one, such as:

    +-----+               +-----+                      +-----+
    | cmd | ------------> | cmd | ------------------>  | cmd |
    +-----+               +-----+                      +-----+
                             ^                            ^
                             |                            |
                             |                            |
                        set WAIT4END here too        set WAIT4END here

   If we do not set WAIT4END, the BCH maybe stall in "ECC reading page" state.
   In the next ECC write page operation, a DMA-timeout occurs.
   This has been catched in the MX6Q board.

In order to fix the bug, we should let the driver to
set the proper DMA flags in the DMA command structrues.

So add the new flags for MXS-DMA.
The driver can use these flags to control the DMA in a more flexible way.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 include/linux/mxs-dma.h |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/include/linux/mxs-dma.h b/include/linux/mxs-dma.h
index 203d7c4..3ef73b8 100644
--- a/include/linux/mxs-dma.h
+++ b/include/linux/mxs-dma.h
@@ -11,6 +11,32 @@
 
 #include <linux/dmaengine.h>
 
+/*
+ * The drivers use these flags for ->device_prep_slave_sg() :
+ *    [1] If there is only one DMA command in the DMA chain, the code should be:
+ *            ......
+ *            ->device_prep_slave_sg(MXS_DMA_F_WAIT4END);
+ *            ......
+ *    [2] If there are two DMA commands in the DMA chain, the code should be
+ *            ......
+ *            ->device_prep_slave_sg(0);
+ *            ......
+ *            ->device_prep_slave_sg(MXS_DMA_F_LASTONE);
+ *            ......
+ *    [3] If there are more than two DMA commands in the DMA chain, the code
+ *        should be:
+ *            ......
+ *            ->device_prep_slave_sg(0);                 // First
+ *            ......
+ *            ->device_prep_slave_sg(MXS_DMA_F_APPEND [| MXS_DMA_F_WAIT4END]);
+ *            ......
+ *            ->device_prep_slave_sg(MXS_DMA_F_LASTONE); // Last
+ */
+#define MXS_DMA_F_APPEND	(1 << 0)
+#define MXS_DMA_F_WAIT4END	(1 << 1)
+
+#define MXS_DMA_F_LASTONE	(MXS_DMA_F_APPEND | MXS_DMA_F_WAIT4END)
+
 struct mxs_dma_data {
 	int chan_irq;
 };
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 07/10] MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg()
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (5 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 08/10] MXS-MMC : use the new DMA flags Huang Shijie
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

Rewrite the last parameter of mxs_dma_prep_slave_sg().
Add some more flags to let the driver sets the flags as it needs,
such as WAIT4END bit.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/dma/mxs-dma.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index c80fbed..cfcb8d8 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -352,7 +352,7 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)
 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)
+		unsigned long flags)
 {
 	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@ -360,6 +360,7 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 	struct scatterlist *sg;
 	int i, j;
 	u32 *pio;
+	bool append = flags & MXS_DMA_F_APPEND;
 	int idx = append ? mxs_chan->desc_count : 0;
 
 	if (mxs_chan->status == DMA_IN_PROGRESS && !append)
@@ -386,7 +387,6 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 		ccw->bits |= CCW_CHAIN;
 		ccw->bits &= ~CCW_IRQ;
 		ccw->bits &= ~CCW_DEC_SEM;
-		ccw->bits &= ~CCW_WAIT4END;
 	} else {
 		idx = 0;
 	}
@@ -401,7 +401,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 		ccw->bits = 0;
 		ccw->bits |= CCW_IRQ;
 		ccw->bits |= CCW_DEC_SEM;
-		ccw->bits |= CCW_WAIT4END;
+		if (flags & MXS_DMA_F_WAIT4END)
+			ccw->bits |= CCW_WAIT4END;
 		ccw->bits |= CCW_HALT_ON_TERM;
 		ccw->bits |= CCW_TERM_FLUSH;
 		ccw->bits |= BF_CCW(sg_len, PIO_NUM);
@@ -432,7 +433,8 @@ static struct dma_async_tx_descriptor *mxs_dma_prep_slave_sg(
 				ccw->bits &= ~CCW_CHAIN;
 				ccw->bits |= CCW_IRQ;
 				ccw->bits |= CCW_DEC_SEM;
-				ccw->bits |= CCW_WAIT4END;
+				if (flags & MXS_DMA_F_WAIT4END)
+					ccw->bits |= CCW_WAIT4END;
 			}
 		}
 	}
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 08/10] MXS-MMC : use the new DMA flags
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (6 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 07/10] MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg() Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 09/10] MTD/GPMI : add a new field `gpmi_version` Huang Shijie
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

Use the new DMA flags while do not change any logic.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mmc/host/mxs-mmc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 1e18970..be8fbbc 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -305,7 +305,7 @@ static irqreturn_t mxs_mmc_irq_handler(int irq, void *dev_id)
 }
 
 static struct dma_async_tx_descriptor *mxs_mmc_prep_dma(
-	struct mxs_mmc_host *host, unsigned int append)
+	struct mxs_mmc_host *host, unsigned long flags)
 {
 	struct dma_async_tx_descriptor *desc;
 	struct mmc_data *data = host->data;
@@ -325,7 +325,7 @@ static struct dma_async_tx_descriptor *mxs_mmc_prep_dma(
 	}
 
 	desc = host->dmach->device->device_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;
@@ -358,7 +358,7 @@ static void mxs_mmc_bc(struct mxs_mmc_host *host)
 	host->ssp_pio_words[2] = cmd1;
 	host->dma_dir = DMA_NONE;
 	host->slave_dirn = DMA_TRANS_NONE;
-	desc = mxs_mmc_prep_dma(host, 0);
+	desc = mxs_mmc_prep_dma(host, MXS_DMA_F_WAIT4END);
 	if (!desc)
 		goto out;
 
@@ -398,7 +398,7 @@ static void mxs_mmc_ac(struct mxs_mmc_host *host)
 	host->ssp_pio_words[2] = cmd1;
 	host->dma_dir = DMA_NONE;
 	host->slave_dirn = DMA_TRANS_NONE;
-	desc = mxs_mmc_prep_dma(host, 0);
+	desc = mxs_mmc_prep_dma(host, MXS_DMA_F_WAIT4END);
 	if (!desc)
 		goto out;
 
@@ -526,7 +526,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 	host->data = data;
 	host->dma_dir = dma_data_dir;
 	host->slave_dirn = slave_dirn;
-	desc = mxs_mmc_prep_dma(host, 1);
+	desc = mxs_mmc_prep_dma(host, MXS_DMA_F_LASTONE);
 	if (!desc)
 		goto out;
 
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 09/10] MTD/GPMI : add a new field `gpmi_version`
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (7 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 08/10] MXS-MMC : use the new DMA flags Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  6:16 ` [PATCH 10/10] MTD/GPMI : change the code for new DMA interface Huang Shijie
  2012-01-19  9:10 ` [PATCH 00/10] patch set about the MXS-DMA Shawn Guo
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

add this field to store the GPMI verison.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c  |    3 +++
 drivers/mtd/nand/gpmi-nand/gpmi-nand.h |    4 ++++
 drivers/mtd/nand/gpmi-nand/gpmi-regs.h |    2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 7f68042..5b73ae5 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -133,6 +133,9 @@ int gpmi_init(struct gpmi_nand_data *this)
 	if (ret)
 		goto err_out;
 
+	/* Read out the GPMI version */
+	this->gpmi_version = readl(r->gpmi_regs + HW_GPMI_VERSION);
+
 	/* Choose NAND mode. */
 	writel(BM_GPMI_CTRL1_GPMI_MODE, r->gpmi_regs + HW_GPMI_CTRL1_CLR);
 
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
index 1c7fdbb..5c277e3 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.h
@@ -132,6 +132,10 @@ struct gpmi_nand_data {
 	/* Flash Hardware */
 	struct nand_timing	timing;
 
+	/* GPMI hardware version */
+#define GPMI_VERSION_0501	(0x05010000)
+	u32			gpmi_version;
+
 	/* BCH */
 	struct bch_geometry	bch_geometry;
 	struct completion	bch_done;
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-regs.h b/drivers/mtd/nand/gpmi-nand/gpmi-regs.h
index 8343124..f005b24 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-regs.h
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-regs.h
@@ -169,4 +169,6 @@
 #define HW_GPMI_DEBUG					0x000000c0
 #define MX23_BP_GPMI_DEBUG_READY0			28
 #define MX23_BM_GPMI_DEBUG_READY0	(1 << MX23_BP_GPMI_DEBUG_READY0)
+
+#define HW_GPMI_VERSION					0x000000d0
 #endif
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 10/10] MTD/GPMI : change the code for new DMA interface
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (8 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 09/10] MTD/GPMI : add a new field `gpmi_version` Huang Shijie
@ 2012-01-19  6:16 ` Huang Shijie
  2012-01-19  9:10 ` [PATCH 00/10] patch set about the MXS-DMA Shawn Guo
  10 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  6:16 UTC (permalink / raw)
  To: vinod.koul
  Cc: shawn.guo, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396, Huang Shijie

Please read more comment in the mxs-dma.h.

In the new GPMI version(0x05010000 used by MX6Q/MX50), we should
set the WAIT4END bit in the middle one of this chain,
which enables the BCH module and reads out the NAND page.
If we do not do this, a DMA timeout occurs. This bug has been
catched in the MX6Q board.

We have changed the DMA interface to fix the bug, now use the new
interface.

Signed-off-by: Huang Shijie <b32955@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 5b73ae5..84abd49 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -842,7 +842,7 @@ int gpmi_send_command(struct gpmi_nand_data *this)
 	sg_init_one(sgl, this->cmd_buffer, this->command_length);
 	dma_map_sg(this->dev, sgl, 1, DMA_TO_DEVICE);
 	desc = channel->device->device_prep_slave_sg(channel,
-					sgl, 1, DMA_MEM_TO_DEV, 1);
+				sgl, 1, DMA_MEM_TO_DEV, MXS_DMA_F_LASTONE);
 	if (!desc) {
 		pr_err("step 2 error\n");
 		return -1;
@@ -884,7 +884,7 @@ int gpmi_send_data(struct gpmi_nand_data *this)
 	/* [2] send DMA request */
 	prepare_data_dma(this, DMA_TO_DEVICE);
 	desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl,
-						1, DMA_MEM_TO_DEV, 1);
+					1, DMA_MEM_TO_DEV, MXS_DMA_F_LASTONE);
 	if (!desc) {
 		pr_err("step 2 error\n");
 		return -1;
@@ -920,7 +920,7 @@ int gpmi_read_data(struct gpmi_nand_data *this)
 	/* [2] : send DMA request */
 	prepare_data_dma(this, DMA_FROM_DEVICE);
 	desc = channel->device->device_prep_slave_sg(channel, &this->data_sgl,
-						1, DMA_DEV_TO_MEM, 1);
+					1, DMA_DEV_TO_MEM, MXS_DMA_F_LASTONE);
 	if (!desc) {
 		pr_err("step 2 error\n");
 		return -1;
@@ -967,7 +967,8 @@ int gpmi_send_page(struct gpmi_nand_data *this,
 
 	desc = channel->device->device_prep_slave_sg(channel,
 					(struct scatterlist *)pio,
-					ARRAY_SIZE(pio), DMA_TRANS_NONE, 0);
+					ARRAY_SIZE(pio), DMA_TRANS_NONE,
+					MXS_DMA_F_WAIT4END);
 	if (!desc) {
 		pr_err("step 2 error\n");
 		return -1;
@@ -987,6 +988,7 @@ int gpmi_read_page(struct gpmi_nand_data *this,
 	struct dma_async_tx_descriptor *desc;
 	struct dma_chan *channel = get_dma_chan(this);
 	int chip = this->current_chip;
+	unsigned long flags;
 	u32 pio[6];
 
 	/* [1] Wait for the chip to report ready. */
@@ -1029,9 +1031,14 @@ int gpmi_read_page(struct gpmi_nand_data *this,
 	pio[3] = geo->page_size;
 	pio[4] = payload;
 	pio[5] = auxiliary;
+
+	/* If the GPMI is new version, set MXS_DMA_F_WAIT4END here. */
+	flags = MXS_DMA_F_APPEND;
+	if (this->gpmi_version == GPMI_VERSION_0501)
+		flags |= MXS_DMA_F_WAIT4END;
 	desc = channel->device->device_prep_slave_sg(channel,
 					(struct scatterlist *)pio,
-					ARRAY_SIZE(pio), DMA_TRANS_NONE, 1);
+					ARRAY_SIZE(pio), DMA_TRANS_NONE, flags);
 	if (!desc) {
 		pr_err("step 2 error\n");
 		return -1;
@@ -1048,9 +1055,10 @@ int gpmi_read_page(struct gpmi_nand_data *this,
 		| BF_GPMI_CTRL0_ADDRESS(address)
 		| BF_GPMI_CTRL0_XFER_COUNT(geo->page_size);
 	pio[1] = 0;
+	pio[2] = 0;
 	desc = channel->device->device_prep_slave_sg(channel,
 				(struct scatterlist *)pio, 2,
-				DMA_TRANS_NONE, 1);
+				DMA_TRANS_NONE, MXS_DMA_F_LASTONE);
 	if (!desc) {
 		pr_err("step 3 error\n");
 		return -1;
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place
  2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
@ 2012-01-19  8:58   ` Wolfram Sang
  2012-01-19 11:20     ` Mark Brown
  2012-01-19 13:04   ` Shawn Guo
  1 sibling, 1 reply; 19+ messages in thread
From: Wolfram Sang @ 2012-01-19  8:58 UTC (permalink / raw)
  To: Huang Shijie
  Cc: vinod.koul, shawn.guo, artem.bityutskiy, shijie8,
	linux-arm-kernel, linux-mtd, linux-mmc, linux-kernel, LW,
	alsa-devel, b29396

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

On Thu, Jan 19, 2012 at 02:15:58PM +0800, Huang Shijie wrote:
> Move the header to a more common place.
> The DMA engine is not only used in mx23/mx28, but also used
> in mx50/mx6q.
> It will also be used in the future chips.
> 
> Rename it to mxs-dma.h
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
>  arch/arm/mach-mxs/include/mach/dma.h |   28 ----------------------------
>  include/linux/mxs-dma.h              |   28 ++++++++++++++++++++++++++++
>  2 files changed, 28 insertions(+), 28 deletions(-)
>  delete mode 100644 arch/arm/mach-mxs/include/mach/dma.h
>  create mode 100644 include/linux/mxs-dma.h

Please use -M with git format-patch, so we can better see that it is a
pure rename.

I'd also suggest to squash patches up to 05/10 into this one,
(collecting all the proper acks from maintainers) since the changes are
trivial and it will reduce dependencies and temporary build-failures.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA
  2012-01-19  6:16 ` [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA Huang Shijie
@ 2012-01-19  9:02   ` Russell King - ARM Linux
  2012-01-19  9:31     ` Huang Shijie
  0 siblings, 1 reply; 19+ messages in thread
From: Russell King - ARM Linux @ 2012-01-19  9:02 UTC (permalink / raw)
  To: Huang Shijie
  Cc: vinod.koul, alsa-devel, artem.bityutskiy, b29396, linux-mmc,
	linux-kernel, w.sang, linux-mtd, shawn.guo, shijie8,
	linux-arm-kernel, LW

On Thu, Jan 19, 2012 at 02:16:03PM +0800, Huang Shijie wrote:
> [1] Background :
>     The GPMI does ECC read page operation with a DMA chain consist of three DMA
>     Command Structures. The middle one of the chain is used to enable the BCH,
>     and read out the NAND page.
> 
>     The WAIT4END(wait for command end) is a comunication signal between
>     the GPMI and MXS-DMA.
> 
> [2] The current DMA code sets the WAIT4END bit at the last one, such as:
> 
>     +-----+               +-----+                      +-----+
>     | cmd | ------------> | cmd | ------------------>  | cmd |
>     +-----+               +-----+                      +-----+
>                                                           ^
>                                                           |
>                                                           |
>                                                      set WAIT4END here
> 
>     This chain works fine in the mx23/mx28.
> 
> [3] But in the new GPMI version (used in MX50/MX60), the WAIT4END bit should
>     be set not only at the last DMA Command Structure,
>     but also at the middle one, such as:
> 
>     +-----+               +-----+                      +-----+
>     | cmd | ------------> | cmd | ------------------>  | cmd |
>     +-----+               +-----+                      +-----+
>                              ^                            ^
>                              |                            |
>                              |                            |
>                         set WAIT4END here too        set WAIT4END here
> 
>    If we do not set WAIT4END, the BCH maybe stall in "ECC reading page" state.
>    In the next ECC write page operation, a DMA-timeout occurs.
>    This has been catched in the MX6Q board.
> 
> In order to fix the bug, we should let the driver to
> set the proper DMA flags in the DMA command structrues.
> 
> So add the new flags for MXS-DMA.
> The driver can use these flags to control the DMA in a more flexible way.
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
>  include/linux/mxs-dma.h |   26 ++++++++++++++++++++++++++
>  1 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/mxs-dma.h b/include/linux/mxs-dma.h
> index 203d7c4..3ef73b8 100644
> --- a/include/linux/mxs-dma.h
> +++ b/include/linux/mxs-dma.h
> @@ -11,6 +11,32 @@
>  
>  #include <linux/dmaengine.h>
>  
> +/*
> + * The drivers use these flags for ->device_prep_slave_sg() :
> + *    [1] If there is only one DMA command in the DMA chain, the code should be:
> + *            ......
> + *            ->device_prep_slave_sg(MXS_DMA_F_WAIT4END);
> + *            ......
> + *    [2] If there are two DMA commands in the DMA chain, the code should be
> + *            ......
> + *            ->device_prep_slave_sg(0);
> + *            ......
> + *            ->device_prep_slave_sg(MXS_DMA_F_LASTONE);
> + *            ......
> + *    [3] If there are more than two DMA commands in the DMA chain, the code
> + *        should be:
> + *            ......
> + *            ->device_prep_slave_sg(0);                 // First
> + *            ......
> + *            ->device_prep_slave_sg(MXS_DMA_F_APPEND [| MXS_DMA_F_WAIT4END]);
> + *            ......
> + *            ->device_prep_slave_sg(MXS_DMA_F_LASTONE); // Last
> + */
> +#define MXS_DMA_F_APPEND	(1 << 0)
> +#define MXS_DMA_F_WAIT4END	(1 << 1)
> +
> +#define MXS_DMA_F_LASTONE	(MXS_DMA_F_APPEND | MXS_DMA_F_WAIT4END)

Err, the 'flags' argument to device_prep_slave_sg() is supposed to be
from the set of enum dma_ctrl_flags.  What this means is that your
MXS_DMA_F_APPEND is equivalent to DMA_PREP_INTERRUPT, and
MXS_DMA_F_WAIT4END is equivalent to DMA_CTRL_ACK.

What this does is make your drivers completely dependent on your DMA
engine implementation.  That's not a good idea when devices get
reused in different SoCs.

If you need to supply extra flags which aren't in the dma_ctrl_flags,
at least make sure that they're using different bits.  For bonus points,
also have your driver _check_ the DMA engine it's connected to before
it passes these flags.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 00/10] patch set about the MXS-DMA
  2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
                   ` (9 preceding siblings ...)
  2012-01-19  6:16 ` [PATCH 10/10] MTD/GPMI : change the code for new DMA interface Huang Shijie
@ 2012-01-19  9:10 ` Shawn Guo
  2012-01-19  9:45   ` Wolfram Sang
  10 siblings, 1 reply; 19+ messages in thread
From: Shawn Guo @ 2012-01-19  9:10 UTC (permalink / raw)
  To: Huang Shijie
  Cc: vinod.koul, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396

On Thu, Jan 19, 2012 at 02:15:57PM +0800, Huang Shijie wrote:
> This patch set does two things about the MXS-DMA:
> [1] patch 1 ~ patch 5: move the mxs dma header to a more common place.
> 	Beside the mx23/mx28, the APBH-DMA is also used by MX50 and MX6Q.
> 	So move the mxs dma header file to a more common place, and rename
> 	it to mxs-dma.h
> 
For the sake of bitsec, these 5 patches need to be one.

> [2] patch 6 ~ patch 10: rewrite the last parameter of mxs_dma_prep_slave_sg().

For the sake of bitsec, at least patches #7 and #8 need to be one patch.
That said, if I apply the series and then check out the commit at patch
#7, you need to all mxs-dma client drivers, mxs-mmc, gpmi do not break.

> 	In the new GPMI version, some hardware behavior changes.
> 	The WAIT4END bit should be set in the middle one of the ECC READ page DMA chain.
> 	The DMA chain should be set like this:
> 
>           +-----+               +-----+                      +-----+
>           | cmd | ------------> | cmd | ------------------>  | cmd |
>           +-----+               +-----+                      +-----+
>                                    ^                            ^
>                                    |                            |
>                                    |                            |
>                               set WAIT4END here too        set WAIT4END here
> 
>          Please read the comment in patch "MXS-DMA : add more flags for MXS-DMA".
> 
> Huang Shijie (10):
>   MXS-DMA : move the mxs-dma.h to a more common place
>   MXS-DMA : change the header
>   MXS-MMC : change the DMA header file
>   MTD/GPMI : change the DMA header file
>   ASoc : change the DMA header file
>   MXS-DMA : add more flags for MXS-DMA
>   MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg()
>   MXS-MMC : use the new DMA flags
>   MTD/GPMI : add a new field `gpmi_version`
>   MTD/GPMI : change the code for new DMA interface
> 
Please try to make these subject prefix consistent with the existing
ones in the tree.  You can get them from 'git log' output.  For example
"mxs-dma: ..." is better than "MXS-DMA : ...".

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA
  2012-01-19  9:02   ` Russell King - ARM Linux
@ 2012-01-19  9:31     ` Huang Shijie
  0 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-19  9:31 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: vinod.koul, alsa-devel, artem.bityutskiy, b29396, linux-mmc,
	linux-kernel, w.sang, linux-mtd, shawn.guo, shijie8,
	linux-arm-kernel, LW

hi,
> Err, the 'flags' argument to device_prep_slave_sg() is supposed to be
> from the set of enum dma_ctrl_flags.  What this means is that your
> MXS_DMA_F_APPEND is equivalent to DMA_PREP_INTERRUPT, and
> MXS_DMA_F_WAIT4END is equivalent to DMA_CTRL_ACK.
>
thanks a lot.
I will reuse the dma_ctrl_flags in the next version.
> What this does is make your drivers completely dependent on your DMA
> engine implementation.  That's not a good idea when devices get
> reused in different SoCs.
>
Frankly speaking, the APBH-DMA is more coupled with the GPMI  then any 
other modules.
In the MX6Q, the GPMI is the ONLY user of APBH-DMA.
You even can see the NAND_LOCK bit in the DMA command structure which is 
only used by the GPMI
NAND controller,.


To Shawn & Wolfram:
    thanks very much for your comments.

Best Regards
Huang Shijie

> If you need to supply extra flags which aren't in the dma_ctrl_flags,
> at least make sure that they're using different bits.  For bonus points,
> also have your driver_check_  the DMA engine it's connected to before
> it passes these flags.
>



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 00/10] patch set about the MXS-DMA
  2012-01-19  9:10 ` [PATCH 00/10] patch set about the MXS-DMA Shawn Guo
@ 2012-01-19  9:45   ` Wolfram Sang
  2012-01-20  3:29     ` Huang Shijie
  0 siblings, 1 reply; 19+ messages in thread
From: Wolfram Sang @ 2012-01-19  9:45 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Huang Shijie, vinod.koul, artem.bityutskiy, shijie8,
	linux-arm-kernel, linux-mtd, linux-mmc, linux-kernel, LW,
	alsa-devel, b29396

[-- Attachment #1: Type: text/plain, Size: 687 bytes --]

> > [2] patch 6 ~ patch 10: rewrite the last parameter of mxs_dma_prep_slave_sg().
> 
> For the sake of bitsec, at least patches #7 and #8 need to be one patch.
> That said, if I apply the series and then check out the commit at patch
> #7, you need to all mxs-dma client drivers, mxs-mmc, gpmi do not break.

I'd say patch 6-10 should be squashed, simply. My personal preference is
to change #9 to simply read the register when needed and do not expand
the struct, but this is a minor thing.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place
  2012-01-19  8:58   ` Wolfram Sang
@ 2012-01-19 11:20     ` Mark Brown
  0 siblings, 0 replies; 19+ messages in thread
From: Mark Brown @ 2012-01-19 11:20 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Huang Shijie, alsa-devel, artem.bityutskiy, vinod.koul, b29396,
	linux-mmc, linux-kernel, linux-mtd, shawn.guo, shijie8,
	linux-arm-kernel, LW

On Thu, Jan 19, 2012 at 09:58:56AM +0100, Wolfram Sang wrote:

> (collecting all the proper acks from maintainers) since the changes are

Which is much more likely if you send them the patches.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place
  2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
  2012-01-19  8:58   ` Wolfram Sang
@ 2012-01-19 13:04   ` Shawn Guo
  1 sibling, 0 replies; 19+ messages in thread
From: Shawn Guo @ 2012-01-19 13:04 UTC (permalink / raw)
  To: Huang Shijie
  Cc: vinod.koul, artem.bityutskiy, shijie8, linux-arm-kernel,
	linux-mtd, linux-mmc, linux-kernel, w.sang, LW, alsa-devel,
	b29396

On Thu, Jan 19, 2012 at 02:15:58PM +0800, Huang Shijie wrote:
> Move the header to a more common place.
> The DMA engine is not only used in mx23/mx28, but also used
> in mx50/mx6q.
> It will also be used in the future chips.
> 
> Rename it to mxs-dma.h
> 
> Signed-off-by: Huang Shijie <b32955@freescale.com>
> ---
>  arch/arm/mach-mxs/include/mach/dma.h |   28 ----------------------------
>  include/linux/mxs-dma.h              |   28 ++++++++++++++++++++++++++++
>  2 files changed, 28 insertions(+), 28 deletions(-)
>  delete mode 100644 arch/arm/mach-mxs/include/mach/dma.h
>  create mode 100644 include/linux/mxs-dma.h
> 
I'm wondering if it would be better to create folder include/linux/fsl
for mxs-dma.h accommodation, so that any headers that need to shared
between mxs and imx later can find a place.  Considering that Freescale
has many IPs shared between MPCxxx (PowerPC) and i.MX (ARM) families,
it could also be a good place for any headers that need to be shared
between these two product lines from Freescale.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 00/10] patch set about the MXS-DMA
  2012-01-19  9:45   ` Wolfram Sang
@ 2012-01-20  3:29     ` Huang Shijie
  0 siblings, 0 replies; 19+ messages in thread
From: Huang Shijie @ 2012-01-20  3:29 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Shawn Guo, vinod.koul, artem.bityutskiy, shijie8,
	linux-arm-kernel, linux-mtd, linux-mmc, linux-kernel, LW,
	alsa-devel, b29396


>>> [2] patch 6 ~ patch 10: rewrite the last parameter of mxs_dma_prep_slave_sg().
>> For the sake of bitsec, at least patches #7 and #8 need to be one patch.
>> That said, if I apply the series and then check out the commit at patch
>> #7, you need to all mxs-dma client drivers, mxs-mmc, gpmi do not break.
> I'd say patch 6-10 should be squashed, simply. My personal preference is
> to change #9 to simply read the register when needed and do not expand
It's better to add a new field. i also want to add a new field
`bch_version`, because different
BCH version may support different ECC strength. For example, some
version BCH can support to 24 bit,
while the latest BCH may support to 40 bit. So the BCH version may
limits the computing of ECC strength.

Best Regards
Huang Shijie

> the struct, but this is a minor thing.
>
> Regards,
>
>    Wolfram
>



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-01-20  3:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19  6:15 [PATCH 00/10] patch set about the MXS-DMA Huang Shijie
2012-01-19  6:15 ` [PATCH 01/10] MXS-DMA : move the mxs-dma.h to a more common place Huang Shijie
2012-01-19  8:58   ` Wolfram Sang
2012-01-19 11:20     ` Mark Brown
2012-01-19 13:04   ` Shawn Guo
2012-01-19  6:15 ` [PATCH 02/10] MXS-DMA : change the header Huang Shijie
2012-01-19  6:16 ` [PATCH 03/10] MXS-MMC : change the DMA header file Huang Shijie
2012-01-19  6:16 ` [PATCH 04/10] MTD/GPMI " Huang Shijie
2012-01-19  6:16 ` [PATCH 05/10] ASoc " Huang Shijie
2012-01-19  6:16 ` [PATCH 06/10] MXS-DMA : add more flags for MXS-DMA Huang Shijie
2012-01-19  9:02   ` Russell King - ARM Linux
2012-01-19  9:31     ` Huang Shijie
2012-01-19  6:16 ` [PATCH 07/10] MXS-DMA : change the last parameter of mxs_dma_prep_slave_sg() Huang Shijie
2012-01-19  6:16 ` [PATCH 08/10] MXS-MMC : use the new DMA flags Huang Shijie
2012-01-19  6:16 ` [PATCH 09/10] MTD/GPMI : add a new field `gpmi_version` Huang Shijie
2012-01-19  6:16 ` [PATCH 10/10] MTD/GPMI : change the code for new DMA interface Huang Shijie
2012-01-19  9:10 ` [PATCH 00/10] patch set about the MXS-DMA Shawn Guo
2012-01-19  9:45   ` Wolfram Sang
2012-01-20  3:29     ` Huang Shijie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).