[PATCH] staging: octeon-usb: use correct function for hcd cleanup

2017-05-08 Thread Anton Bondarenko
Use usb_put_hdc to release hdc allocated by usb_create_hcd. This is needed to handle sub-allocations and HCD sharing correctly. Signed-off-by: Anton Bondarenko --- drivers/staging/octeon-usb/octeon-hcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging

[PATCH v6 3/8] spi: imx: return error from dma channel request

2015-12-07 Thread Anton Bondarenko
On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko --- drivers/spi/spi

[PATCH v6 1/8] spi: imx: fix loopback mode setup after controller reset

2015-12-07 Thread Anton Bondarenko
If controller hold in reset it's not possible to write any register except CTRL. So all other registers must be updated only after controller bring out from reset. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --

[PATCH v6 4/8] spi: imx: defer spi initialization, if DMA engine is

2015-12-07 Thread Anton Bondarenko
If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 3

[PATCH v6 5/8] spi: imx: allow only WML aligned transfers to use DMA

2015-12-07 Thread Anton Bondarenko
8 58 dc 3d 3d a4 6a 6a 3a 52 52 7a 36 RX0080: 06 20 a7 93 1b 34 dd 4c f5 ec Zeros at offset 33 and 34 caused by reading empty RX FIFO which not possible if DMA RX read was triggered by RX event. This mean DMA was triggered by RX TAIL event. Signed-off-by: Anton Bondarenko --- drivers/spi/spi

[PATCH v6 8/8] spi: imx: add support for all SPI word width for DMA

2015-12-07 Thread Anton Bondarenko
DMA transfer for SPI was limited to up to 8 bits word size until now. Sync in SPI burst size and DMA bus width is necessary to correctly support 16 and 32 BPW. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 121 +++--- 1 file changed, 95

[PATCH v6 0/8] Improvements for SPI IMX driver for Freescale ECSPI controller, continuation

2015-12-07 Thread Anton Bondarenko
This series is to complement commits already applied to topic/imx branch Changes since V5: * Fix for commit "spi: imx: Add loopback mode support" * Addressed some comments from Sascha Hauer for DMA initialization error report * Fixed 32 bytes transaction. It will be DMA now. Anton

[PATCH v6 7/8] spi: imx: replace fixed timeout with calculated

2015-12-07 Thread Anton Bondarenko
. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 08492d6..d74d809 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -56,7

[PATCH v6 2/8] spi: imx: enable loopback only for ECSPI controller family

2015-12-07 Thread Anton Bondarenko
Limit SPI_LOOP mode to ECSPI controller (iMX.51, iMX53 and i.MX6) only since there is no support in other families specific code for now. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi

[PATCH v6 6/8] spi: imx: remove dead RX DMA tail handling code

2015-12-07 Thread Anton Bondarenko
transfer->len % wml for DMA capable transactions will always be 0 due to recent change in can_dma checks. So it's safe to remove dead code in processing DMA. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 13 - 1 file changed, 13 deletions(-) diff --git a/dri

Re: [PATCH v5 08/11] spi: imx: allow only WML aligned transfers to use DMA

2015-12-07 Thread Anton Bondarenko
On 2015-12-07 10:42, Sascha Hauer wrote: On Sat, Dec 05, 2015 at 05:57:06PM +0100, Anton Bondarenko wrote: RX DMA tail data handling doesn't work correctly in many cases with current implementation. It happens because SPI core was setup to generates both RX and RX TAIL events. And RX

Re: [PATCH v5 06/11] spi: imx: return error from dma channel request

2015-12-07 Thread Anton Bondarenko
On 2015-12-07 10:32, Sascha Hauer wrote: On Sat, Dec 05, 2015 at 05:57:04PM +0100, Anton Bondarenko wrote: On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is

Re: [PATCH v5 05/11] spi: imx: Add support for loopback for ECSPI controllers

2015-12-07 Thread Anton Bondarenko
On 2015-12-07 10:27, Sascha Hauer wrote: On Sat, Dec 05, 2015 at 05:57:03PM +0100, Anton Bondarenko wrote: Support for ECSPI loopback for IMX51, IMX53 and IMX6Q using TEST register. Signed-off-by: Mohsin Kazmi Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 19

[PATCH v5 01/11] spi: imx: terminate RX DMA transaction in case of TX DMA timeout

2015-12-05 Thread Anton Bondarenko
Not only TX DMA should be terminated, but RX DMA also. It's required to avoid accidential DMA memory writes from RX DMA channel and properly terminate transaction. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-

[PATCH v5 00/11] Improvements for SPI IMX driver for Freescale IMX51, IMX53 and IMX6

2015-12-05 Thread Anton Bondarenko
: * Split [PATCH v4 01] into several smaller commits * Change [PATCH v4 01] into workaround to disable DMA for transfer which len mod WML not equal 0 * Rework some patches to isolate changes in one place Anton Bondarenko (11): spi: imx: terminate RX DMA transaction in case of TX DMA timeout

[PATCH v5 03/11] spi: imx: replace multiple watermarks with single for RX, TX and RXT

2015-12-05 Thread Anton Bondarenko
There is no need to have different watermarks levels since they are the same. Merge them into one WML parameter. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 29 + 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/spi/spi-imx.c b

[PATCH v5 07/11] spi: imx: defer spi initialization, if DMA engine is

2015-12-05 Thread Anton Bondarenko
If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 3

[PATCH v5 05/11] spi: imx: Add support for loopback for ECSPI controllers

2015-12-05 Thread Anton Bondarenko
Support for ECSPI loopback for IMX51, IMX53 and IMX6Q using TEST register. Signed-off-by: Mohsin Kazmi Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi

[PATCH v5 10/11] spi: imx: replace fixed timeout with calculated

2015-12-05 Thread Anton Bondarenko
. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index adfa9cf..f7ee288 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c

[PATCH v5 02/11] spi: imx: reorder HW operations enable order to avoid possible RX data loss

2015-12-05 Thread Anton Bondarenko
actual data transfer. The risk rise in case of heavy system load and high SPI clock. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index fb3bcc4..17e8f9e 100644

[PATCH v5 08/11] spi: imx: allow only WML aligned transfers to use DMA

2015-12-05 Thread Anton Bondarenko
3d a4 6a 6a 3a 52 52 7a 36 RX0080: 06 20 a7 93 1b 34 dd 4c f5 ec Zeros at offset 33 and 34 caused by reading empty RX FIFO which not possible if DMA RX read was triggered by RX event. This mean DMA was triggered by RX TAIL event. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 4 ++

[PATCH v5 06/11] spi: imx: return error from dma channel request

2015-12-05 Thread Anton Bondarenko
On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko --- drivers/spi/spi

[PATCH v5 09/11] spi: imx: remove dead RX DMA tail handling code

2015-12-05 Thread Anton Bondarenko
transfer->len % wml for DMA capable transactions will always be 0 due to recent change in can_dma checks. So it's safe to remove dead code in processing DMA. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 13 - 1 file changed, 13 deletions(-) diff --git a/dri

[PATCH v5 11/11] spi: imx: add support for all SPI word width for DMA

2015-12-05 Thread Anton Bondarenko
DMA transfer for SPI was limited to up to 8 bits word size until now. Sync in SPI burst size and DMA bus width is necessary to correctly support 16 and 32 BPW. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 121 +++--- 1 file changed, 95

[PATCH v5 04/11] spi: imx: add function to check for IMX51 family controller

2015-12-05 Thread Anton Bondarenko
Similar to other controller type checks add check function for IMX51. It includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index f811f68

Re: [PATCH v4 1/7] spi: imx: Fix DMA transfer

2015-11-30 Thread Anton Bondarenko
On 2015-11-30 09:29, Sascha Hauer wrote: On Sat, Nov 28, 2015 at 12:15:59AM +0100, Anton Bondarenko wrote: New implementation change handling of RX data tail. DMA is used to process all TX data and only full chunks of RX data with size aligned to FIFO/2. Driver is waiting until both TX and RX

[PATCH v4 1/7] spi: imx: Fix DMA transfer

2015-11-27 Thread Anton Bondarenko
using PIO. Transfer triggering changed to avoid RX data loss. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 115 +- 1 file changed, 76 insertions(+), 39 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 0e

[PATCH v4 3/7] spi: imx: add support for all SPI word width for DMA transfer

2015-11-27 Thread Anton Bondarenko
DMA transfer for SPI was limited to up to 8 bits word size until now. Sync in SPI burst size and DMA bus width is necessary to correctly support other BPW supported by HW. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 133 ++ 1 file

[PATCH v4 0/7] Improvements for SPI IMX driver for Freescale IMX51, IMX53 and IMX6

2015-11-27 Thread Anton Bondarenko
: Addressed comments from V3 review, simplified timeout calculation Anton Bondarenko (7): spi: imx: Fix DMA transfer spi: imx: replace fixed timeout with calculated one spi: imx: add support for all SPI word width for DMA transfer spi: imx: add function to check for IMX51 family controller

[PATCH v4 4/7] spi: imx: add function to check for IMX51 family controller

2015-11-27 Thread Anton Bondarenko
Similar to other controller type checks add check function for IMX51. This also includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index

[PATCH v4 2/7] spi: imx: replace fixed timeout with calculated one

2015-11-27 Thread Anton Bondarenko
-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 36 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index bd7b721..4770d81 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -57,7

[PATCH v4 7/7] spi: imx: defer spi initialization, if DMA engine is pending

2015-11-27 Thread Anton Bondarenko
If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko

[PATCH v4 6/7] spi: imx: return error from dma channel request

2015-11-27 Thread Anton Bondarenko
On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko --- drivers/spi/spi

[PATCH v4 5/7] spi: imx: Add support for loopback for ECSPI controllers

2015-11-27 Thread Anton Bondarenko
Support for ECSPI loopback for IMX51,IMX53 and IMX6Q using TEST register. Signed-off-by: Mohsin Kazmi Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c

Re: [PATCH 3/8] Documentation/spi/spidev_test.c: accept input from a file

2015-11-17 Thread Anton Bondarenko
On 17.11.2015 16:24, Joshua Clayton wrote: Add input file support to facilitate testing larger data. Signed-off-by: Joshua Clayton --- Documentation/spi/spidev_test.c | 42 - 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Documentation/s

Re: [PATCH v3 3/7] spi: imx: add support for all SPI word width for DMA transfer

2015-11-14 Thread Anton Bondarenko
On 01.11.2015 15:41, Anton Bondarenko wrote: From: Anton Bondarenko DMA transfer for SPI was limited to up to 8 bits word size until now. Sync in SPI burst size and DMA bus width is necessary to correctly support other BPW supported by HW. Signed-off-by: Anton Bondarenko --- drivers/spi

Re: [PATCH v3 5/7] spi: imx: Add support for loopback for ECSPI controllers

2015-11-14 Thread Anton Bondarenko
On 01.11.2015 15:41, Anton Bondarenko wrote: From: Anton Bondarenko Support for ECSPI loopback for IMX51,IMX53 and IMX6Q using TEST register. Signed-off-by: Mohsin Kazmi Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 19 --- 1 file changed, 16 insertions

Re: [PATCH v3 4/7] spi: imx: add function to check for IMX51 family controller

2015-11-14 Thread Anton Bondarenko
On 01.11.2015 15:41, Anton Bondarenko wrote: From: Anton Bondarenko Similar to other controller type checks add check function for IMX51. This also includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 9 +++-- 1 file changed, 7 insertions(+), 2

Re: [PATCH v3 6/7] spi: imx: return error from dma channel request

2015-11-14 Thread Anton Bondarenko
On 05.11.2015 17:00, Anton Bondarenko wrote: On 05.11.2015 09:56, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:40PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it

Re: [PATCH v3 6/7] spi: imx: return error from dma channel request

2015-11-14 Thread Anton Bondarenko
On 05.11.2015 17:00, Anton Bondarenko wrote: On 05.11.2015 09:56, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:40PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it

Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer

2015-11-14 Thread Anton Bondarenko
On 05.11.2015 17:51, Anton Bondarenko wrote: On 05.11.2015 09:34, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:35PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko RX DMA tail data handling doesn't work correctly in many cases with current implementation. It happens becaus

Re: [PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine is pending

2015-11-14 Thread Anton Bondarenko
On 05.11.2015 17:18, Anton Bondarenko wrote: On 05.11.2015 09:59, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:41PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding

Re: [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated one

2015-11-14 Thread Anton Bondarenko
On 11.11.2015 09:12, Sascha Hauer wrote: On Tue, Nov 10, 2015 at 09:20:06PM +0100, Anton Bondarenko wrote: On 05.11.2015 09:47, Sascha Hauer wrote: @@ -890,12 +891,40 @@ static void spi_imx_dma_tx_callback(void *cookie) complete(&spi_imx->dma_tx_completion); } +sta

Re: [PATCH v3 2/7] spi: imx: replace fixed timeout with calculated one

2015-11-10 Thread Anton Bondarenko
On 05.11.2015 09:47, Sascha Hauer wrote: @@ -890,12 +891,40 @@ static void spi_imx_dma_tx_callback(void *cookie) complete(&spi_imx->dma_tx_completion); } +static int spi_imx_calculate_timeout(struct spi_imx_data *spi_imx, int size) +{ + unsigned long coef1 = 1; + unsigned

Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer

2015-11-05 Thread Anton Bondarenko
On 05.11.2015 09:34, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:35PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko RX DMA tail data handling doesn't work correctly in many cases with current implementation. It happens because SPI core was setup to generates both RX wate

Re: [PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine is pending

2015-11-05 Thread Anton Bondarenko
On 05.11.2015 09:59, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:41PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize

Re: [PATCH v3 6/7] spi: imx: return error from dma channel request

2015-11-05 Thread Anton Bondarenko
On 05.11.2015 09:56, Sascha Hauer wrote: On Sun, Nov 01, 2015 at 03:41:40PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA

Re: [PATCH v3 1/7] spi: imx: Fix DMA transfer

2015-11-04 Thread Anton Bondarenko
On 03.11.2015 08:08, Robin Gong wrote: On Sun, Nov 01, 2015 at 03:41:35PM +0100, Anton Bondarenko wrote: From: Anton Bondarenko RX DMA tail data handling doesn't work correctly in many cases with current implementation. It happens because SPI core was setup to generates both RX wate

[PATCH v3 5/7] spi: imx: Add support for loopback for ECSPI controllers

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko Support for ECSPI loopback for IMX51,IMX53 and IMX6Q using TEST register. Signed-off-by: Mohsin Kazmi Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi

[PATCH v3 2/7] spi: imx: replace fixed timeout with calculated one

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko Fixed timeout value can fire while transaction is ongoing. This may happen because there are no strict requirements on SPI transaction duration. Dynamic timeout value is generated based on SCLK and transaction size. There is also 4 * SCLK delay between TX bursts related

[PATCH v3 6/7] spi: imx: return error from dma channel request

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko

[PATCH v3 4/7] spi: imx: add function to check for IMX51 family controller

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko Similar to other controller type checks add check function for IMX51. This also includes IMX53 and IMX6. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-imx.c b

[PATCH v3 7/7] spi: imx: defer spi initialization, if DMA engine is pending

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Vladimir Zapolskiy Signed

[PATCH v3 1/7] spi: imx: Fix DMA transfer

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko RX DMA tail data handling doesn't work correctly in many cases with current implementation. It happens because SPI core was setup to generates both RX watermark level and RX DATA TAIL events incorrectly. SPI transfer triggering for DMA also done in wrong way. SPI c

[PATCH v3 3/7] spi: imx: add support for all SPI word width for DMA transfer

2015-11-01 Thread Anton Bondarenko
From: Anton Bondarenko DMA transfer for SPI was limited to up to 8 bits word size until now. Sync in SPI burst size and DMA bus width is necessary to correctly support other BPW supported by HW. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 133

[PATCH v3 0/7] Improvements for SPI IMX driver for Freescale IMX51, IMX53 and IMX6

2015-11-01 Thread Anton Bondarenko
: Removed patch V2 8/8 since it's not ready due to quality problems Simlified patch 4/7 since V2 8/8 removed Addressed all comments from reviewers and build bot failure Anton Bondarenko (7): spi: imx: Fix DMA transfer spi: imx: replace fixed timeout with calculated one spi: imx: add suppor

Re: [PATCH v2 3/8] spi: imx: add support for all SPI word width for DMA transfer

2015-10-20 Thread Anton Bondarenko
On 08.10.2015 11:51, Robin Gong wrote: On Thu, Oct 01, 2015 at 12:34:54AM +, Bondarenko, Anton wrote: On 30.09.2015 10:35, Robin Gong wrote: On Fri, Sep 25, 2015 at 07:57:10PM +0200, Anton Bondarenko wrote: @@ -91,11 +91,15 @@ struct spi_imx_data { struct completion xfer_done

Re: [PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI controllers

2015-10-20 Thread Anton Bondarenko
On 08.10.2015 11:28, Robin Gong wrote: On Thu, Oct 01, 2015 at 12:16:49AM +, Bondarenko, Anton wrote: On 30.09.2015 10:42, Robin Gong wrote: On Fri, Sep 25, 2015 at 07:57:12PM +0200, Anton Bondarenko wrote: @@ -370,8 +374,12 @@ static int __maybe_unused mx51_ecspi_config(struct

Re: [PATCH v2 1/8] spi: imx: Fix DMA transfer

2015-10-20 Thread Anton Bondarenko
On 08.10.2015 11:19, Robin Gong wrote: On Thu, Oct 01, 2015 at 12:02:41AM +, Bondarenko, Anton wrote: @@ -201,9 +202,8 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi, { struct spi_imx_data *spi_imx = spi_master_get_devdata(master); - if (sp

[PATCH v2 2/8] spi: imx: replace fixed timeout with calculated one

2015-09-25 Thread Anton Bondarenko
-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 49 + 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 165bc2c..6c98eda 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c

[PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI controllers

2015-09-25 Thread Anton Bondarenko
Support for ECSPI loopback for IMX51,IMX53 and IMX6Q using TEST register. Signed-off-by: Mohsin Kazmi Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi

[PATCH v2 4/8] spi: imx: add selection for iMX53 and iMX6 controller type

2015-09-25 Thread Anton Bondarenko
ECSPI contorller for iMX53 and iMX6 has few hardware issues in slave mode and (32*n+1) SPI word size handling comparing to iMX51. The change add possibility to detect the SPI controller is use and apply workarounds/limitations. Documentation for device tree bindings updated Signed-off-by: Anton

[PATCH v2 7/8] spi: imx: defer spi initialization, if DMA engine is pending

2015-09-25 Thread Anton Bondarenko
If SPI device supports DMA mode, but DMA controller is not yet available due to e.g. a delay in the corresponding kernel module initialization, retry to initialize SPI driver later on instead of falling back into PIO only mode. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko

[PATCH v2 8/8] spi: imx: Add support for SPI Slave mode for imx53 and imx6 chips

2015-09-25 Thread Anton Bondarenko
mum 2^12 bits. Signed-off-by: Jiada Wang Signed-off-by: Muzaffar Mahmood Signed-off-by: Anton Bondarenko --- .../devicetree/bindings/spi/fsl-imx-cspi.txt | 1 + drivers/spi/spi-imx.c | 169 ++--- 2 files changed, 146 insertions(+), 24

[PATCH v2 6/8] spi: imx: return error from dma channel request

2015-09-25 Thread Anton Bondarenko
On SDMA initialization return exactly the same error, which is reported by dma_request_slave_channel_reason(), it is a preceding change to defer SPI DMA initialization, if SDMA module is not yet available. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Anton Bondarenko --- drivers/spi/spi

[PATCH v2 1/8] spi: imx: Fix DMA transfer

2015-09-25 Thread Anton Bondarenko
using PIO. Transfer triggering changed to avoid RX data loss. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 105 +++--- 1 file changed, 66 insertions(+), 39 deletions(-) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index f9

[PATCH v2 3/8] spi: imx: add support for all SPI word width for DMA transfer

2015-09-25 Thread Anton Bondarenko
DMA transfer for SPI was limited to up to 8 bits word size until now. Sync in SPI burst size and DMA bus width is necessary to correctly support other BPW supported by HW. Signed-off-by: Anton Bondarenko --- drivers/spi/spi-imx.c | 121 -- 1 file

[PATCH v2 0/8] Improvements for SPI IMX driver for Freescale IMX53 and IMX6 families

2015-09-25 Thread Anton Bondarenko
A number of patches to impove or add the implementation for the spi-imx driver related to Freescale IMX53 and IMX6. It would also possible some of patches can be applied for other Freescale controllers using spi-imx driver but could not be tested due to lack of hardware. Anton Bondarenko (8