Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-18 Thread Eddie Huang
On Wed, 2015-06-17 at 17:35 +0100, Mark Brown wrote: > On Wed, Jun 17, 2015 at 10:10:51PM +0800, Eddie Huang wrote: > > > Our hardware limitation is: we don't have separate dma tx, rx channel > > with transfer finish interrupt, only have spi trigger operation.So the > > mediatek SPI dma full duple

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-17 Thread Mark Brown
On Wed, Jun 17, 2015 at 10:10:51PM +0800, Eddie Huang wrote: > Our hardware limitation is: we don't have separate dma tx, rx channel > with transfer finish interrupt, only have spi trigger operation.So the > mediatek SPI dma full duplex operation steps are: > 1. Set TX DMA address. > 2. Set RX DMA

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-17 Thread Eddie Huang
On Wed, 2015-06-17 at 13:47 +0100, Mark Brown wrote: > On Wed, Jun 17, 2015 at 05:08:03PM +0800, Eddie Huang wrote: > > > Here comes the problem, although total length of tx, rx is the same, > > each entry in rx and tx scatterlist may not be the same (in the case > > data buffer allocate from vmal

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-17 Thread Mark Brown
On Wed, Jun 17, 2015 at 05:08:03PM +0800, Eddie Huang wrote: > Here comes the problem, although total length of tx, rx is the same, > each entry in rx and tx scatterlist may not be the same (in the case > data buffer allocate from vmalloc). Other vendor have dmaengine driver > to send entry-by-ent

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-17 Thread Eddie Huang
Hi Mark, On Wed, 2015-06-10 at 16:06 +0800, Eddie Huang wrote: > On Tue, 2015-06-09 at 11:39 +0100, Mark Brown wrote: > > On Tue, Jun 09, 2015 at 06:05:21PM +0800, Eddie Huang wrote: > > > > > --- a/drivers/spi/spi.c > > > +++ b/drivers/spi/spi.c > > > @@ -539,8 +539,8 @@ static int __spi_map_msg

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-10 Thread Eddie Huang
Hi Mark, On Tue, 2015-06-09 at 11:39 +0100, Mark Brown wrote: > On Tue, Jun 09, 2015 at 06:05:21PM +0800, Eddie Huang wrote: > > > --- a/drivers/spi/spi.c > > +++ b/drivers/spi/spi.c > > @@ -539,8 +539,8 @@ static int __spi_map_msg(struct spi_master *master, > > struct spi_message *msg) > >

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-09 Thread Mark Brown
On Tue, Jun 09, 2015 at 06:05:21PM +0800, Eddie Huang wrote: > --- a/drivers/spi/spi.c > +++ b/drivers/spi/spi.c > @@ -539,8 +539,8 @@ static int __spi_map_msg(struct spi_master *master, > struct spi_message *msg) > if (!master->can_dma) > return 0; > - tx_dev = mast

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-09 Thread Eddie Huang
Hi Mark, On Mon, 2015-06-08 at 18:59 +0100, Mark Brown wrote: > On Mon, Jun 08, 2015 at 06:15:46PM +0800, Eddie Huang wrote: > > On Fri, 2015-05-15 at 17:25 +0800, Mark Brown wrote: > > > > That's how a very large proportion of devices that work with DMA are > > > done - why would this be complic

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-08 Thread Mark Brown
On Mon, Jun 08, 2015 at 06:15:46PM +0800, Eddie Huang wrote: > On Fri, 2015-05-15 at 17:25 +0800, Mark Brown wrote: > > That's how a very large proportion of devices that work with DMA are > > done - why would this be complicated? All can_dma() does is report if > > DMA is possible. > In include

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-06-08 Thread Eddie Huang
Hi Mark, On Fri, 2015-05-15 at 17:25 +0800, Mark Brown wrote: > On Fri, May 15, 2015 at 03:38:42PM +0800, leilk liu wrote: > > On Tue, 2015-05-12 at 17:05 +0100, Mark Brown wrote: > > > > Implement can_dma() - look for drivers providing that for examples. > > > MTK spi hardware uses the dmaengin

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-15 Thread Mark Brown
On Fri, May 15, 2015 at 03:38:42PM +0800, leilk liu wrote: > On Tue, 2015-05-12 at 17:05 +0100, Mark Brown wrote: > > Implement can_dma() - look for drivers providing that for examples. > MTK spi hardware uses the dmaengine in spi controller. According to > datasheet, spi driver just need to enab

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-15 Thread leilk liu
Dear Mark, Thanks for your reply. On Tue, 2015-05-12 at 17:05 +0100, Mark Brown wrote: > On Tue, May 12, 2015 at 08:39:16PM +0800, leilk liu wrote: > > On Fri, 2015-05-08 at 18:53 +0100, Mark Brown wrote: > > > On Fri, May 08, 2015 at 04:55:42PM +0800, leilk@mediatek.com wrote: > > > Could y

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-13 Thread Yingjoe Chen
On Wed, 2015-05-13 at 12:10 +0100, Mark Brown wrote: > On Wed, May 13, 2015 at 05:26:06PM +0800, Yingjoe Chen wrote: > > On Tue, 2015-05-12 at 17:05 +0100, Mark Brown wrote: > > > > > > There were three compatible strings listed in the DT binding but only > > > > > two here. > > > > > And I test

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-13 Thread Mark Brown
On Wed, May 13, 2015 at 05:26:06PM +0800, Yingjoe Chen wrote: > On Tue, 2015-05-12 at 17:05 +0100, Mark Brown wrote: > > > > There were three compatible strings listed in the DT binding but only > > > > two here. > > > And I test it's ok on MT8135 platform. So I add struct of_device_id > > > mtk_

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-13 Thread Yingjoe Chen
On Tue, 2015-05-12 at 17:05 +0100, Mark Brown wrote: > On Tue, May 12, 2015 at 08:39:16PM +0800, leilk liu wrote: <...> > > > > +static const struct of_device_id mtk_spi_of_match[] = { > > > > + { .compatible = "mediatek,mt6589-spi", .data = (void > > > > *)COMPAT_MT6589}, > > > > + {

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-12 Thread Mark Brown
On Tue, May 12, 2015 at 08:39:16PM +0800, leilk liu wrote: > On Fri, 2015-05-08 at 18:53 +0100, Mark Brown wrote: > > On Fri, May 08, 2015 at 04:55:42PM +0800, leilk@mediatek.com wrote: > Could you tell me more details about "You should also be using the core > helpers for DMA mapping"? Imple

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-12 Thread leilk liu
Thanks for your review. On Fri, 2015-05-08 at 18:53 +0100, Mark Brown wrote: > On Fri, May 08, 2015 at 04:55:42PM +0800, leilk@mediatek.com wrote: > > From: Leilk Liu > > > > This patch adds basic spi bus for MT8173. > > Please try to only CC relevant people on patches, you've got a very >

Re: [PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-08 Thread Mark Brown
On Fri, May 08, 2015 at 04:55:42PM +0800, leilk@mediatek.com wrote: > From: Leilk Liu > > This patch adds basic spi bus for MT8173. Please try to only CC relevant people on patches, you've got a very broad CC list here and I'm not sure I understand why everyone is on it. Sending people irrel

[PATCH 2/3] spi: mediatek: Add spi bus for Mediatek MT8173

2015-05-08 Thread leilk.liu
From: Leilk Liu This patch adds basic spi bus for MT8173. Signed-off-by: Leilk Liu --- drivers/spi/Kconfig | 10 + drivers/spi/Makefile | 1 + drivers/spi/spi-mt65xx.c | 622 +++ 3 files changed, 633 insertions(+) create mode 100644 driv