Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-06-11 Thread Hemanth V


- Original Message - 
From: Hemanth V heman...@ti.com

To: Tony Lindgren t...@atomide.com
Cc: linux-omap@vger.kernel.org
Sent: Friday, June 05, 2009 3:28 PM
Subject: Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support


- Original Message - 
From: Tony Lindgren t...@atomide.com

To: Hemanth V heman...@ti.com
Cc: linux-omap@vger.kernel.org
Sent: Tuesday, June 02, 2009 11:36 PM
Subject: Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support



Hi,

Sorry for the delay in replying, few comments below.

* Hemanth V heman...@ti.com [090519 22:57]:

This patch adds support for McSPI slave and FIFO. DMA and FIFO
could be enabled together for better throughput. Platform config
parameters have been added to enable these features on any particular
McSPI controller.

FIFO can be enabled by defining fifo_depth parameter. fifo_depth needs
to be a multiple of buffer size that is used for read/write.

These features are useful when you have high throughput devices
like WLAN or Modem connected over SPI.

Signed-off-by: Hemanth V heman...@ti.com
 arch/arm/mach-omap2/devices.c   |5
 arch/arm/plat-omap/include/mach/mcspi.h |   16 +
 drivers/spi/omap2_mcspi.c   |  343 


 3 files changed, 325 insertions(+), 39 deletions(-)


As this is mostly drivers/spi/omap2_mcspi.c, this patch should get
merged via:

$ grep -A7 SPI SUBSYSTEM MAINTAINERS
SPI SUBSYSTEM
P:  David Brownell
M:  dbrown...@users.sourceforge.net
L:  spi-devel-gene...@lists.sourceforge.net
S:  Maintained
F:  Documentation/spi/
F:  drivers/spi/
F:  include/linux/spi/

Please keep linux-omap list Cc'd too so everybody can follow
the progress.


Tony, is this list active. The archives seem to be flooded with spam
mails

http://sourceforge.net/mailarchive/forum.php?forum_name=spi-devel-general





Kevin, Can u suggest what is to be done in this situation. spi-devel list 
doesnot seem
to be active and Tony is not willing to merge this patch. Should I send this 
to LKML


Thanks
Hemanth




---
Index: linux-omap-2.6/arch/arm/mach-omap2/devices.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/devices.c 2009-05-19
17:00:21.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/devices.c 2009-05-20 
11:02:41.0

+0530
@@ -259,6 +259,7 @@

 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
 .num_cs = 4,
+ .force_cs_mode = 1,
 };

 static struct resource omap2_mcspi1_resources[] = {
@@ -281,6 +282,10 @@

 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
 .num_cs = 2,
+ .mode = OMAP2_MCSPI_MASTER,
+ .dma_mode = 1,
+ .force_cs_mode = 0,
+ .fifo_depth = 0,
 };

 static struct resource omap2_mcspi2_resources[] = {
Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h
===
--- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mcspi.h 
2009-05-19

17:00:21.0 +0530
+++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h 2009-05-20
11:02:41.0 +0530
@@ -1,8 +1,24 @@
 #ifndef _OMAP2_MCSPI_H
 #define _OMAP2_MCSPI_H

+#define OMAP2_MCSPI_MASTER 0
+#define OMAP2_MCSPI_SLAVE 1
+
 struct omap2_mcspi_platform_config {
 unsigned short num_cs;
+
+ /* SPI is master or slave */
+ unsigned short mode;
+
+ /* Use only DMA for data transfers */
+ unsigned short dma_mode;
+
+ /* Force chip select mode */
+ unsigned short force_cs_mode;
+
+ /* FIFO depth in bytes, max value 64 */
+ unsigned short fifo_depth;
+
 };

 struct omap2_mcspi_device_config {
Index: linux-omap-2.6/drivers/spi/omap2_mcspi.c
===
--- linux-omap-2.6.orig/drivers/spi/omap2_mcspi.c 2009-05-19 
17:00:21.0

+0530
+++ linux-omap-2.6/drivers/spi/omap2_mcspi.c 2009-05-20 
11:02:41.0 +0530

@@ -37,9 +37,11 @@

 #include mach/dma.h
 #include mach/clock.h
+#include mach/mcspi.h


 #define OMAP2_MCSPI_MAX_FREQ 4800
+#define OMAP2_MCSPI_MAX_FIFODEPTH 64

 #define OMAP2_MCSPI_REVISION 0x00
 #define OMAP2_MCSPI_SYSCONFIG 0x10
@@ -49,6 +51,7 @@
 #define OMAP2_MCSPI_WAKEUPENABLE 0x20
 #define OMAP2_MCSPI_SYST 0x24
 #define OMAP2_MCSPI_MODULCTRL 0x28
+#define OMAP2_MCSPI_XFERLEVEL 0x7c

 /* per-channel banks, 0x14 bytes each, first is: */
 #define OMAP2_MCSPI_CHCONF0 0x2c
@@ -85,6 +88,9 @@
 #define OMAP2_MCSPI_CHCONF_IS BIT(18)
 #define OMAP2_MCSPI_CHCONF_TURBO BIT(19)
 #define OMAP2_MCSPI_CHCONF_FORCE BIT(20)
+#define OMAP2_MCSPI_CHCONF_FFER BIT(28)
+#define OMAP2_MCSPI_CHCONF_FFET BIT(27)
+

 #define OMAP2_MCSPI_CHSTAT_RXS BIT(0)
 #define OMAP2_MCSPI_CHSTAT_TXS BIT(1)
@@ -93,6 +99,7 @@


Please swap BIT(27) to be before BIT(28) to keep them sorted above.




 #define OMAP2_MCSPI_CHCTRL_EN BIT(0)

 #define OMAP2_MCSPI_WAKEUPENABLE_WKEN BIT(0)
+#define OMAP2_MCSPI_IRQ_EOW BIT(17)

 /* We have 2 DMA channels per CS, one for RX and one for TX */
 struct omap2_mcspi_dma

Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-06-11 Thread Hemanth V


- Original Message - 
From: Kevin Hilman khil...@deeprootsystems.com

To: Hemanth V heman...@ti.com
Cc: linux-omap@vger.kernel.org; Tony Lindgren t...@atomide.com; David 
Brownell davi...@pacbell.net

Sent: Thursday, June 11, 2009 8:17 PM
Subject: Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support



Hemanth V heman...@ti.com writes:

- Original Message - 
From: Hemanth V heman...@ti.com

To: Tony Lindgren t...@atomide.com
Cc: linux-omap@vger.kernel.org
Sent: Friday, June 05, 2009 3:28 PM
Subject: Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support


- Original Message - 
From: Tony Lindgren t...@atomide.com

To: Hemanth V heman...@ti.com
Cc: linux-omap@vger.kernel.org
Sent: Tuesday, June 02, 2009 11:36 PM
Subject: Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support



Hi,

Sorry for the delay in replying, few comments below.

* Hemanth V heman...@ti.com [090519 22:57]:

This patch adds support for McSPI slave and FIFO. DMA and FIFO
could be enabled together for better throughput. Platform config
parameters have been added to enable these features on any particular
McSPI controller.

FIFO can be enabled by defining fifo_depth parameter. fifo_depth needs
to be a multiple of buffer size that is used for read/write.

These features are useful when you have high throughput devices
like WLAN or Modem connected over SPI.

Signed-off-by: Hemanth V heman...@ti.com
 arch/arm/mach-omap2/devices.c   |5
 arch/arm/plat-omap/include/mach/mcspi.h |   16 +
 drivers/spi/omap2_mcspi.c   |  343

 3 files changed, 325 insertions(+), 39 deletions(-)


As this is mostly drivers/spi/omap2_mcspi.c, this patch should get
merged via:

$ grep -A7 SPI SUBSYSTEM MAINTAINERS
SPI SUBSYSTEM
P:  David Brownell
M:  dbrown...@users.sourceforge.net
L:  spi-devel-gene...@lists.sourceforge.net
S:  Maintained
F:  Documentation/spi/
F:  drivers/spi/
F:  include/linux/spi/

Please keep linux-omap list Cc'd too so everybody can follow
the progress.


Tony, is this list active. The archives seem to be flooded with spam
mails

http://sourceforge.net/mailarchive/forum.php?forum_name=spi-devel-general





Kevin, Can u suggest what is to be done in this situation. spi-devel
list doesnot seem
to be active and Tony is not willing to merge this patch. Should I
send this to LKML


First, you haven't addressed any of the comments made on the list
about your series.

Tony isn't merging this patch because most of it should go via the SPI
subsystem.

A Santosh suggested, you need to break this up into parts that are
OMAP specific (arch/arm/*) and parts that go via the SPI subsystem
(drivers/spi/*.)  If doing this breaks your series, then fix it


But then that would cause a problem, we will not be able to
use arch/arm/plat-omap/include/mach/mcspi.h and will need to redefine those
variables in omap2_mcspi.c which obviously is not the preferred way.



because if it breaks compile this way, then upstream maintainers will
surely hit the same errors and complain.

David Brownell is the SPI maintainer.  I suggest you send to him,
CC'ing linux-omap.

Kevin




--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-06-05 Thread Hemanth V
- Original Message - 
From: Tony Lindgren t...@atomide.com

To: Hemanth V heman...@ti.com
Cc: linux-omap@vger.kernel.org
Sent: Tuesday, June 02, 2009 11:36 PM
Subject: Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support



Hi,

Sorry for the delay in replying, few comments below.

* Hemanth V heman...@ti.com [090519 22:57]:

This patch adds support for McSPI slave and FIFO. DMA and FIFO
could be enabled together for better throughput. Platform config
parameters have been added to enable these features on any particular
McSPI controller.

FIFO can be enabled by defining fifo_depth parameter. fifo_depth needs
to be a multiple of buffer size that is used for read/write.

These features are useful when you have high throughput devices
like WLAN or Modem connected over SPI.

Signed-off-by: Hemanth V heman...@ti.com
 arch/arm/mach-omap2/devices.c   |5
 arch/arm/plat-omap/include/mach/mcspi.h |   16 +
 drivers/spi/omap2_mcspi.c   |  343 


 3 files changed, 325 insertions(+), 39 deletions(-)


As this is mostly drivers/spi/omap2_mcspi.c, this patch should get
merged via:

$ grep -A7 SPI SUBSYSTEM MAINTAINERS
SPI SUBSYSTEM
P:  David Brownell
M:  dbrown...@users.sourceforge.net
L:  spi-devel-gene...@lists.sourceforge.net
S:  Maintained
F:  Documentation/spi/
F:  drivers/spi/
F:  include/linux/spi/

Please keep linux-omap list Cc'd too so everybody can follow
the progress.


Tony, is this list active. The archives seem to be flooded with spam
mails

http://sourceforge.net/mailarchive/forum.php?forum_name=spi-devel-general





---
Index: linux-omap-2.6/arch/arm/mach-omap2/devices.c
===
--- linux-omap-2.6.orig/arch/arm/mach-omap2/devices.c 2009-05-19
17:00:21.0 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/devices.c 2009-05-20 
11:02:41.0

+0530
@@ -259,6 +259,7 @@

 static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
 .num_cs = 4,
+ .force_cs_mode = 1,
 };

 static struct resource omap2_mcspi1_resources[] = {
@@ -281,6 +282,10 @@

 static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
 .num_cs = 2,
+ .mode = OMAP2_MCSPI_MASTER,
+ .dma_mode = 1,
+ .force_cs_mode = 0,
+ .fifo_depth = 0,
 };

 static struct resource omap2_mcspi2_resources[] = {
Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h
===
--- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mcspi.h 
2009-05-19

17:00:21.0 +0530
+++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h 2009-05-20
11:02:41.0 +0530
@@ -1,8 +1,24 @@
 #ifndef _OMAP2_MCSPI_H
 #define _OMAP2_MCSPI_H

+#define OMAP2_MCSPI_MASTER 0
+#define OMAP2_MCSPI_SLAVE 1
+
 struct omap2_mcspi_platform_config {
 unsigned short num_cs;
+
+ /* SPI is master or slave */
+ unsigned short mode;
+
+ /* Use only DMA for data transfers */
+ unsigned short dma_mode;
+
+ /* Force chip select mode */
+ unsigned short force_cs_mode;
+
+ /* FIFO depth in bytes, max value 64 */
+ unsigned short fifo_depth;
+
 };

 struct omap2_mcspi_device_config {
Index: linux-omap-2.6/drivers/spi/omap2_mcspi.c
===
--- linux-omap-2.6.orig/drivers/spi/omap2_mcspi.c 2009-05-19 
17:00:21.0

+0530
+++ linux-omap-2.6/drivers/spi/omap2_mcspi.c 2009-05-20 
11:02:41.0 +0530

@@ -37,9 +37,11 @@

 #include mach/dma.h
 #include mach/clock.h
+#include mach/mcspi.h


 #define OMAP2_MCSPI_MAX_FREQ 4800
+#define OMAP2_MCSPI_MAX_FIFODEPTH 64

 #define OMAP2_MCSPI_REVISION 0x00
 #define OMAP2_MCSPI_SYSCONFIG 0x10
@@ -49,6 +51,7 @@
 #define OMAP2_MCSPI_WAKEUPENABLE 0x20
 #define OMAP2_MCSPI_SYST 0x24
 #define OMAP2_MCSPI_MODULCTRL 0x28
+#define OMAP2_MCSPI_XFERLEVEL 0x7c

 /* per-channel banks, 0x14 bytes each, first is: */
 #define OMAP2_MCSPI_CHCONF0 0x2c
@@ -85,6 +88,9 @@
 #define OMAP2_MCSPI_CHCONF_IS BIT(18)
 #define OMAP2_MCSPI_CHCONF_TURBO BIT(19)
 #define OMAP2_MCSPI_CHCONF_FORCE BIT(20)
+#define OMAP2_MCSPI_CHCONF_FFER BIT(28)
+#define OMAP2_MCSPI_CHCONF_FFET BIT(27)
+

 #define OMAP2_MCSPI_CHSTAT_RXS BIT(0)
 #define OMAP2_MCSPI_CHSTAT_TXS BIT(1)
@@ -93,6 +99,7 @@


Please swap BIT(27) to be before BIT(28) to keep them sorted above.




 #define OMAP2_MCSPI_CHCTRL_EN BIT(0)

 #define OMAP2_MCSPI_WAKEUPENABLE_WKEN BIT(0)
+#define OMAP2_MCSPI_IRQ_EOW BIT(17)

 /* We have 2 DMA channels per CS, one for RX and one for TX */
 struct omap2_mcspi_dma {
@@ -125,6 +132,10 @@
 unsigned long phys;
 /* SPI1 has 4 channels, while SPI2 has 2 */
 struct omap2_mcspi_dma *dma_channels;
+ unsigned short mcspi_mode;
+ unsigned short dma_mode;
+ unsigned short force_cs_mode;
+ unsigned short fifo_depth;
 };

 struct omap2_mcspi_cs {
@@ -133,6 +144,37 @@
 int word_len;
 };

+#ifdef CONFIG_SPI_DEBUG
+struct reg_type {
+ char name[40];
+ int offset;
+};
+
+static struct reg_type reg_map

Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-06-02 Thread Tony Lindgren
Hi,

Sorry for the delay in replying, few comments below.

* Hemanth V heman...@ti.com [090519 22:57]:
 This patch adds support for McSPI slave and FIFO. DMA and FIFO
 could be enabled together for better throughput. Platform config
 parameters have been added to enable these features on any particular
 McSPI controller.
 
 FIFO can be enabled by defining fifo_depth parameter. fifo_depth needs
 to be a multiple of buffer size that is used for read/write.
 
 These features are useful when you have high throughput devices
 like WLAN or Modem connected over SPI.
 
 Signed-off-by: Hemanth V heman...@ti.com
  arch/arm/mach-omap2/devices.c   |5
  arch/arm/plat-omap/include/mach/mcspi.h |   16 +
  drivers/spi/omap2_mcspi.c   |  343 
 
  3 files changed, 325 insertions(+), 39 deletions(-)

As this is mostly drivers/spi/omap2_mcspi.c, this patch should get
merged via:

$ grep -A7 SPI SUBSYSTEM MAINTAINERS 
SPI SUBSYSTEM
P:  David Brownell
M:  dbrown...@users.sourceforge.net
L:  spi-devel-gene...@lists.sourceforge.net
S:  Maintained
F:  Documentation/spi/
F:  drivers/spi/
F:  include/linux/spi/

Please keep linux-omap list Cc'd too so everybody can follow
the progress.

 
 ---
 Index: linux-omap-2.6/arch/arm/mach-omap2/devices.c
 ===
 --- linux-omap-2.6.orig/arch/arm/mach-omap2/devices.c 2009-05-19
 17:00:21.0 +0530
 +++ linux-omap-2.6/arch/arm/mach-omap2/devices.c  2009-05-20 
 11:02:41.0
 +0530
 @@ -259,6 +259,7 @@
 
  static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
   .num_cs = 4,
 + .force_cs_mode  = 1,
  };
 
  static struct resource omap2_mcspi1_resources[] = {
 @@ -281,6 +282,10 @@
 
  static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
   .num_cs = 2,
 + .mode   = OMAP2_MCSPI_MASTER,
 + .dma_mode   = 1,
 + .force_cs_mode  = 0,
 + .fifo_depth = 0,
  };
 
  static struct resource omap2_mcspi2_resources[] = {
 Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h
 ===
 --- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mcspi.h   
 2009-05-19
 17:00:21.0 +0530
 +++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h2009-05-20
 11:02:41.0 +0530
 @@ -1,8 +1,24 @@
  #ifndef _OMAP2_MCSPI_H
  #define _OMAP2_MCSPI_H
 
 +#define OMAP2_MCSPI_MASTER   0
 +#define OMAP2_MCSPI_SLAVE1
 +
  struct omap2_mcspi_platform_config {
   unsigned short  num_cs;
 +
 + /* SPI is master or slave */
 + unsigned short  mode;
 +
 + /* Use only DMA for data transfers */
 + unsigned short  dma_mode;
 +
 + /* Force chip select mode */
 + unsigned short  force_cs_mode;
 +
 + /* FIFO depth in bytes, max value 64 */
 + unsigned short fifo_depth;
 +
  };
 
  struct omap2_mcspi_device_config {
 Index: linux-omap-2.6/drivers/spi/omap2_mcspi.c
 ===
 --- linux-omap-2.6.orig/drivers/spi/omap2_mcspi.c 2009-05-19 
 17:00:21.0
 +0530
 +++ linux-omap-2.6/drivers/spi/omap2_mcspi.c  2009-05-20 11:02:41.0 
 +0530
 @@ -37,9 +37,11 @@
 
  #include mach/dma.h
  #include mach/clock.h
 +#include mach/mcspi.h
 
 
  #define OMAP2_MCSPI_MAX_FREQ 4800
 +#define OMAP2_MCSPI_MAX_FIFODEPTH64
 
  #define OMAP2_MCSPI_REVISION 0x00
  #define OMAP2_MCSPI_SYSCONFIG0x10
 @@ -49,6 +51,7 @@
  #define OMAP2_MCSPI_WAKEUPENABLE 0x20
  #define OMAP2_MCSPI_SYST 0x24
  #define OMAP2_MCSPI_MODULCTRL0x28
 +#define OMAP2_MCSPI_XFERLEVEL0x7c
 
  /* per-channel banks, 0x14 bytes each, first is: */
  #define OMAP2_MCSPI_CHCONF0  0x2c
 @@ -85,6 +88,9 @@
  #define OMAP2_MCSPI_CHCONF_ISBIT(18)
  #define OMAP2_MCSPI_CHCONF_TURBO BIT(19)
  #define OMAP2_MCSPI_CHCONF_FORCE BIT(20)
 +#define OMAP2_MCSPI_CHCONF_FFER  BIT(28)
 +#define OMAP2_MCSPI_CHCONF_FFET  BIT(27)
 +
 
  #define OMAP2_MCSPI_CHSTAT_RXS   BIT(0)
  #define OMAP2_MCSPI_CHSTAT_TXS   BIT(1)
 @@ -93,6 +99,7 @@

Please swap BIT(27) to be before BIT(28) to keep them sorted above.



  #define OMAP2_MCSPI_CHCTRL_ENBIT(0)
 
  #define OMAP2_MCSPI_WAKEUPENABLE_WKENBIT(0)
 +#define OMAP2_MCSPI_IRQ_EOW  BIT(17)
 
  /* We have 2 DMA channels per CS, one for RX and one for TX */
  struct omap2_mcspi_dma {
 @@ -125,6 +132,10 @@
   unsigned long   phys;
   /* SPI1 has 4 channels, while SPI2 has 2 */
   struct omap2_mcspi_dma  *dma_channels;
 + unsigned short  mcspi_mode;
 + unsigned short  dma_mode;
 + unsigned short  force_cs_mode;
 + unsigned short  fifo_depth;
  };
 
  struct omap2_mcspi_cs {
 @@ 

Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-05-26 Thread Hemanth V
Tony, Any update on this patch.

Thanks
Hemanth

 This patch adds support for McSPI slave and FIFO. DMA and FIFO
 could be enabled together for better throughput. Platform config
 parameters have been added to enable these features on any particular
 McSPI controller.

 FIFO can be enabled by defining fifo_depth parameter. fifo_depth needs
 to be a multiple of buffer size that is used for read/write.

 These features are useful when you have high throughput devices
 like WLAN or Modem connected over SPI.

 Signed-off-by: Hemanth V heman...@ti.com
  arch/arm/mach-omap2/devices.c   |5
  arch/arm/plat-omap/include/mach/mcspi.h |   16 +
  drivers/spi/omap2_mcspi.c   |  343
 
  3 files changed, 325 insertions(+), 39 deletions(-)

 ---
 Index: linux-omap-2.6/arch/arm/mach-omap2/devices.c
 ===
 --- linux-omap-2.6.orig/arch/arm/mach-omap2/devices.c 2009-05-19
 17:00:21.0 +0530
 +++ linux-omap-2.6/arch/arm/mach-omap2/devices.c  2009-05-20 
 11:02:41.0
 +0530
 @@ -259,6 +259,7 @@

  static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
   .num_cs = 4,
 + .force_cs_mode  = 1,
  };

  static struct resource omap2_mcspi1_resources[] = {
 @@ -281,6 +282,10 @@

  static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
   .num_cs = 2,
 + .mode   = OMAP2_MCSPI_MASTER,
 + .dma_mode   = 1,
 + .force_cs_mode  = 0,
 + .fifo_depth = 0,
  };

  static struct resource omap2_mcspi2_resources[] = {
 Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h
 ===
 --- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mcspi.h   
 2009-05-19
 17:00:21.0 +0530
 +++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mcspi.h2009-05-20
 11:02:41.0 +0530
 @@ -1,8 +1,24 @@
  #ifndef _OMAP2_MCSPI_H
  #define _OMAP2_MCSPI_H

 +#define OMAP2_MCSPI_MASTER   0
 +#define OMAP2_MCSPI_SLAVE1
 +
  struct omap2_mcspi_platform_config {
   unsigned short  num_cs;
 +
 + /* SPI is master or slave */
 + unsigned short  mode;
 +
 + /* Use only DMA for data transfers */
 + unsigned short  dma_mode;
 +
 + /* Force chip select mode */
 + unsigned short  force_cs_mode;
 +
 + /* FIFO depth in bytes, max value 64 */
 + unsigned short fifo_depth;
 +
  };

  struct omap2_mcspi_device_config {
 Index: linux-omap-2.6/drivers/spi/omap2_mcspi.c
 ===
 --- linux-omap-2.6.orig/drivers/spi/omap2_mcspi.c 2009-05-19 
 17:00:21.0
 +0530
 +++ linux-omap-2.6/drivers/spi/omap2_mcspi.c  2009-05-20 11:02:41.0
 +0530
 @@ -37,9 +37,11 @@

  #include mach/dma.h
  #include mach/clock.h
 +#include mach/mcspi.h


  #define OMAP2_MCSPI_MAX_FREQ 4800
 +#define OMAP2_MCSPI_MAX_FIFODEPTH64

  #define OMAP2_MCSPI_REVISION 0x00
  #define OMAP2_MCSPI_SYSCONFIG0x10
 @@ -49,6 +51,7 @@
  #define OMAP2_MCSPI_WAKEUPENABLE 0x20
  #define OMAP2_MCSPI_SYST 0x24
  #define OMAP2_MCSPI_MODULCTRL0x28
 +#define OMAP2_MCSPI_XFERLEVEL0x7c

  /* per-channel banks, 0x14 bytes each, first is: */
  #define OMAP2_MCSPI_CHCONF0  0x2c
 @@ -85,6 +88,9 @@
  #define OMAP2_MCSPI_CHCONF_ISBIT(18)
  #define OMAP2_MCSPI_CHCONF_TURBO BIT(19)
  #define OMAP2_MCSPI_CHCONF_FORCE BIT(20)
 +#define OMAP2_MCSPI_CHCONF_FFER  BIT(28)
 +#define OMAP2_MCSPI_CHCONF_FFET  BIT(27)
 +

  #define OMAP2_MCSPI_CHSTAT_RXS   BIT(0)
  #define OMAP2_MCSPI_CHSTAT_TXS   BIT(1)
 @@ -93,6 +99,7 @@
  #define OMAP2_MCSPI_CHCTRL_ENBIT(0)

  #define OMAP2_MCSPI_WAKEUPENABLE_WKENBIT(0)
 +#define OMAP2_MCSPI_IRQ_EOW  BIT(17)

  /* We have 2 DMA channels per CS, one for RX and one for TX */
  struct omap2_mcspi_dma {
 @@ -125,6 +132,10 @@
   unsigned long   phys;
   /* SPI1 has 4 channels, while SPI2 has 2 */
   struct omap2_mcspi_dma  *dma_channels;
 + unsigned short  mcspi_mode;
 + unsigned short  dma_mode;
 + unsigned short  force_cs_mode;
 + unsigned short  fifo_depth;
  };

  struct omap2_mcspi_cs {
 @@ -133,6 +144,37 @@
   int word_len;
  };

 +#ifdef CONFIG_SPI_DEBUG
 +struct reg_type {
 + char name[40];
 + int offset;
 +};
 +
 +static struct reg_type reg_map[] = {
 + {MCSPI_REV, 0x0},
 + {MCSPI_SYSCONFIG, 0x10},
 + {MCSPI_SYSSTATUS, 0x14},
 + {MCSPI_IRQSTATUS, 0x18},
 + {MCSPI_IRQENABLE, 0x1C},
 + {MCSPI_WAKEUPENABLE, 0x20},
 + {MCSPI_SYST, 0x24},
 + {MCSPI_MODULCTRL, 0x28},
 + {MCSPI_XFERLEVEL, 0x7c},
 + {CH0, 0x2C},
 + {CH1, 0x40},
 + {CH2, 0x54},
 + {CH3, 0x68}
 +};
 +
 

RE: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-05-20 Thread Shilimkar, Santosh

Hemanth,

 Signed-off-by: Hemanth V heman...@ti.com
  arch/arm/mach-omap2/devices.c   |5
  arch/arm/plat-omap/include/mach/mcspi.h |   16 +
  drivers/spi/omap2_mcspi.c   |  343 
 

drivers/spi/omap2_mcspi.c This should be separate patch since this has 
touching drivers directory.

How about arranging this series
[1/2]: OMAP platform specific changes ( arch/arm/plat-omap, arch/arm/mach-omap)
[2/2]: Drivers specific (drivers/spi)


Regards,
Santosh
 

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] McSPI Slave and DMA,FIFO support

2009-05-20 Thread Hemanth V

Santosh,

- Original Message - 
From: Shilimkar, Santosh santosh.shilim...@ti.com

To: V, Hemanth heman...@ti.com; linux-omap@vger.kernel.org
Sent: Wednesday, May 20, 2009 11:34 AM
Subject: RE: [PATCH 1/2] McSPI Slave and DMA,FIFO support



Hemanth,


Signed-off-by: Hemanth V heman...@ti.com
 arch/arm/mach-omap2/devices.c   |5
 arch/arm/plat-omap/include/mach/mcspi.h |   16 +
 drivers/spi/omap2_mcspi.c   |  343



drivers/spi/omap2_mcspi.c This should be separate patch since 
this has touching drivers directory.


It would break compililation of the patch




--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html