Skip to contentSkip to conversation

mmc: msm_sdcc: Use SPS BAM as DMA engine

RFC In review Subhash Jadavani 4 participants 7 messages Mar 18, 2011 – Mar 29, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

On recent MSMs, ADM (Data Mover) HW is not present which means existing SDCC driver can perform data transfer in PIO (peripheral IO) mode only. But PIO mode requires lot of CPU attention which would mean consuming extra CPU MIPS.

As a replacement on these recent MSMs, there is a new DMA HW engine named SPS-BAM (as part of Smart Peripheral System of MSM) is added for data movement between SDCC core and system memory.

This patch has done changes in existing MSM SDCC
driver for using SPS-BAM as DMA engine.

This patch is just for early review.

This patch is dependent on following 2 patches:
https://patchwork.kernel.org/patch/586271/
http://www.spinics.net/lists/arm-kernel/msg118467.html

Subhash Jadavani (1):
mmc: msm_sdcc: Use SPS BAM as DMA engine

 drivers/mmc/host/Kconfig        |   10 +
 drivers/mmc/host/Makefile       |    1 +
 drivers/mmc/host/msm_sdcc.c     |  929 +++++++++++++++++++++++++++++++++++++--
 drivers/mmc/host/msm_sdcc.h     |   47 ++
 drivers/mmc/host/msm_sdcc_dml.c |  303 +++++++++++++
 drivers/mmc/host/msm_sdcc_dml.h |  120 +++++
 6 files changed, 1374 insertions(+), 36 deletions(-)
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.c
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.h

--
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

#1 lore raw

RFC 1/1 mmc: msm_sdcc: Use SPS BAM as DMA engine

On recent MSMs, ADM (Data Mover) HW is not present which means existing SDCC driver can perform data transfer in PIO (peripheral IO) mode only. But PIO mode requires lot of CPU attention which would mean consuming extra CPU MIPS.

As a replacement on these recent MSMs, there is a new DMA HW engine named SPS-BAM (as part of Smart Peripheral System of MSM) is added for data movement between SDCC core and system memory.

This patch has done changes in existing MSM SDCC
driver for using SPS-BAM as DMA engine.

---
 drivers/mmc/host/Kconfig        |   10 +
 drivers/mmc/host/Makefile       |    1 +
 drivers/mmc/host/msm_sdcc.c     |  929 +++++++++++++++++++++++++++++++++++++--
 drivers/mmc/host/msm_sdcc.h     |   47 ++
 drivers/mmc/host/msm_sdcc_dml.c |  303 +++++++++++++
 drivers/mmc/host/msm_sdcc_dml.h |  120 +++++
 6 files changed, 1374 insertions(+), 36 deletions(-)
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.c
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.h
drivers/mmc/host/Kconfig +10 -0
index afe8c6f..8be85a3 100644
@@ -430,6 +430,16 @@ config MMC_SDRICOH_CS
 	  To compile this driver as a module, choose M here: the
 	  module will be called sdricoh_cs.
 
+config MMC_MSM_SPS_SUPPORT
+	bool "Use SPS BAM HW as DMA engine"
+	depends on MMC_MSM && SPS
+	default n
+	help
+	  Select Y to use SPS BAM as DMA engine on Qualcomm's MSM. This
+	  config should be set when ADM HW is not available.
+
+	  If unsure, say N.
+
 config MMC_TMIO
 	tristate "Toshiba Mobile IO Controller (TMIO) MMC/SD function support"
 	depends on MFD_TMIO || MFD_ASIC3 || MFD_SH_MOBILE_SDHI
drivers/mmc/host/Makefile +1 -0
index e834fb2..f19cec2 100644
@@ -19,6 +19,7 @@ obj-$(CONFIG_MMC_AT91)		+= at91_mci.o
 obj-$(CONFIG_MMC_ATMELMCI)	+= atmel-mci.o
 obj-$(CONFIG_MMC_TIFM_SD)	+= tifm_sd.o
 obj-$(CONFIG_MMC_MSM)		+= msm_sdcc.o
+obj-$(CONFIG_MMC_MSM_SPS_SUPPORT) += msm_sdcc_dml.o
 obj-$(CONFIG_MMC_MVSDIO)	+= mvsdio.o
 obj-$(CONFIG_MMC_DAVINCI)       += davinci_mmc.o
 obj-$(CONFIG_MMC_SPI)		+= mmc_spi.o
drivers/mmc/host/msm_sdcc.c +893 -36

1,134 lines not on this page · raw message

drivers/mmc/host/msm_sdcc.h +47 -0

79 lines not on this page · raw message

drivers/mmc/host/msm_sdcc_dml.c new file +303 -0

303 lines not on this page · raw message

drivers/mmc/host/msm_sdcc_dml.h new file +120 -0

120 lines not on this page · raw message

Signature · 5 lines
1.7.1.1

--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#2 lore raw
Quoted 6 lines · Subhash Jadavani

On recent MSMs, ADM (Data Mover) HW is not present which means existing SDCC driver can perform data transfer in PIO (peripheral IO) mode only. But PIO mode requires lot of CPU attention which would mean consuming extra CPU MIPS.

Quoted 7 lines

As a replacement on these recent MSMs, there is a new DMA HW engine named SPS-BAM (as part of Smart Peripheral System of MSM) is added for data movement between SDCC core and system memory.

This patch has done changes in existing MSM SDCC driver for using SPS-BAM as DMA engine.

1300+ lines of code might warrant more of a description .. In the subject you say "DMA engine" but does this use drivers/dma/dmaengine.c ?

Quoted 11 lines
---
 drivers/mmc/host/Kconfig        |   10 +
 drivers/mmc/host/Makefile       |    1 +
 drivers/mmc/host/msm_sdcc.c     |  929 +++++++++++++++++++++++++++++++++++++--
 drivers/mmc/host/msm_sdcc.h     |   47 ++
 drivers/mmc/host/msm_sdcc_dml.c |  303 +++++++++++++
 drivers/mmc/host/msm_sdcc_dml.h |  120 +++++
 6 files changed, 1374 insertions(+), 36 deletions(-)
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.c
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.h

I'd do at least two patches. One that adds msm_sdcc_dml.[ch] and one that modifies msm_sdcc.[ch] and the Kconfig and Makefile.

Daniel

#3 lore raw
Quoted 24 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Daniel Walker
Sent: Wednesday, March 23, 2011 6:36 PM
To: Subhash Jadavani
Cc: [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [RFC] mmc: msm_sdcc: Use SPS BAM as DMA engine

Quoted 11 lines · Subhash Jadavani

On recent MSMs, ADM (Data Mover) HW is not present which means existing SDCC driver can perform data transfer in PIO (peripheral IO) mode only. But PIO mode requires lot of CPU attention which would mean consuming extra CPU MIPS.

As a replacement on these recent MSMs, there is a new DMA HW engine named SPS-BAM (as part of Smart Peripheral System of MSM) is added for data movement between SDCC core and system memory.

Quoted 6 lines
Quoted 2 lines

This patch has done changes in existing MSM SDCC driver for using SPS-BAM as DMA engine.

1300+ lines of code might warrant more of a description .. In the subject you say "DMA engine" but does this use drivers/dma/dmaengine.c ?

Here "DMA engine" means we are using SPS BAM as DMA HW.
No, we are not using the "drivers/dma/dmaengine.c" because MSM SPS driver is not exporting the dma compliant APIs to client. We are using the MSM SPS driver's exported APIs directly from our driver. Not sure what extra description we can put it in commit text. Any suggestion?

This is where MSM SPS driver patch is available: https://patchwork.kernel.org/patch/586271/

Quoted 23 lines
Quoted 6 lines
---
 drivers/mmc/host/Kconfig        |   10 +
 drivers/mmc/host/Makefile       |    1 +
 drivers/mmc/host/msm_sdcc.c     |  929

+++++++++++++++++++++++++++++++++++++--

Quoted 6 lines
 drivers/mmc/host/msm_sdcc.h     |   47 ++
 drivers/mmc/host/msm_sdcc_dml.c |  303 +++++++++++++
 drivers/mmc/host/msm_sdcc_dml.h |  120 +++++
 6 files changed, 1374 insertions(+), 36 deletions(-)
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.c
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.h

I'd do at least two patches. One that adds msm_sdcc_dml.[ch] and one that modifies msm_sdcc.[ch] and the Kconfig and Makefile.

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 6 lines · Subhash Jadavani

Here "DMA engine" means we are using SPS BAM as DMA HW.

No, we are not using the "drivers/dma/dmaengine.c" because MSM SPS driver is not exporting the dma compliant APIs to client. We are using the MSM SPS driver's exported APIs directly from our driver. Not sure what extra description we can put it in commit text. Any suggestion?

I think the commit text should explain why this driver doesn't just use the DMA engine API. People are going to want to know that later on as well. I know you did an analysis for this driver, and it would be good to include that information in the commit text. Email me privately if you want some help with that.

Currently none of the MSM DMA hardware uses the DMA engine API, and I think we need to figure out if we want to move to that at some point. I realize that the hardware (especially SPS BAM) does a lot more than regular DMA, this may involve extending DMA engine, which may or may not be appropriate.

Thanks,
David

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#5 lore raw
Quoted 6 lines · David Brown

Currently none of the MSM DMA hardware uses the DMA engine API, and I think we need to figure out if we want to move to that at some point. I realize that the hardware (especially SPS BAM) does a lot more than regular DMA, this may involve extending DMA engine, which may or may not be appropriate.

If its looks sane extension, I am okay with it :)
Can you point out _exactly_ why the MSM DMA H/W can't use DMA engine at this point of time?

Signature · 1 line
~Vinod
#6 lore raw
In reply to Daniel Walker
Quoted 44 lines

-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Daniel Walker
Sent: Wednesday, March 23, 2011 6:36 PM
To: Subhash Jadavani
Cc: [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [RFC] mmc: msm_sdcc: Use SPS BAM as DMA engine

Quoted 6 lines · Subhash Jadavani

On recent MSMs, ADM (Data Mover) HW is not present which means existing SDCC driver can perform data transfer in PIO (peripheral IO) mode only. But PIO mode requires lot of CPU attention which would mean consuming extra CPU MIPS.

Quoted 7 lines

As a replacement on these recent MSMs, there is a new DMA HW engine named SPS-BAM (as part of Smart Peripheral System of MSM) is added for data movement between SDCC core and system memory.

This patch has done changes in existing MSM SDCC driver for using SPS-BAM as DMA engine.

1300+ lines of code might warrant more of a description .. In the subject you say "DMA engine" but does this use drivers/dma/dmaengine.c ?

Quoted 5 lines
---
 drivers/mmc/host/Kconfig        |   10 +
 drivers/mmc/host/Makefile       |    1 +
 drivers/mmc/host/msm_sdcc.c     |  929

+++++++++++++++++++++++++++++++++++++--

Quoted 6 lines
 drivers/mmc/host/msm_sdcc.h     |   47 ++
 drivers/mmc/host/msm_sdcc_dml.c |  303 +++++++++++++
 drivers/mmc/host/msm_sdcc_dml.h |  120 +++++
 6 files changed, 1374 insertions(+), 36 deletions(-)
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.c
 create mode 100644 drivers/mmc/host/msm_sdcc_dml.h
Quoted 2 lines

I'd do at least two patches. One that adds msm_sdcc_dml.[ch] and one that modifies msm_sdcc.[ch] and the Kconfig and Makefile.

Yes, I can do that. Will make sure to separate it in 2 patches when I upload v2.

Thanks,
Subhash

Quoted 7 lines

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html