[PATCH v4 11/21] spi: dw: Unmask IRQs after enabling the chip

2020-10-07 Thread Serge Semin
st in case... Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index e7ffcfff6594..89e5428c8de6 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi

[PATCH v4 01/21] spi: dw: Use an explicit set_cs assignment

2020-10-07 Thread Serge Semin
Simplify the dw_spi_add_host() method a bit by replacing the currently implemented default set_cs callback setting up and later having it overwritten by a custom function with direct if-else-based callback assignment. Signed-off-by: Serge Semin --- Changelog v2: - Replace the ternary operator

[PATCH v4 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-10-07 Thread Serge Semin
of setting it up. By doing so we'll finally make the SPI device chip_data serving as it's supposed to - to preserve the SPI device specific DW SPI configuration. See spi-fsl-dspi.c, spi-pl022.c, spi-pxa2xx.c drivers for example of the way the chip data is utilized. Signed-off-by: Serge Semin

[PATCH v4 13/21] spi: dw: De-assert chip-select on reset

2020-10-07 Thread Serge Semin
in case of an error or having the CS left set by a bootloader or another software. Signed-off-by: Serge Semin --- drivers/spi/spi-dw.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index cfc9f63acde4..eb1d46983319 100644

[PATCH v4 18/21] spi: dw: Introduce max mem-ops SPI bus frequency setting

2020-10-07 Thread Serge Semin
applicable for the memory operations, since the standard SPI core interface is implemented with an assumption that there is no problem with the automatic CS toggling. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +++- drivers/spi/spi-dw.h | 1 + 2 files changed, 4 insertions(+), 1

[PATCH v4 16/21] spi: dw: Add generic DW SSI status-check method

2020-10-07 Thread Serge Semin
of the new method to detect the errors in the IRQ- and DMA-based SPI transfer execution procedures. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 43 +++ drivers/spi/spi-dw-dma.c | 11 ++ drivers/spi/spi-dw.h | 1 + 3 files changed, 37

[PATCH v4 17/21] spi: dw: Add memory operations support

2020-10-07 Thread Serge Semin
controller with fixed automatic CS toggle functionality. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 1 + drivers/spi/spi-dw-core.c | 301 ++ drivers/spi/spi-dw.h | 13 ++ 3 files

[PATCH v4 14/21] spi: dw: Explicitly de-assert CS on SPI transfer completion

2020-10-07 Thread Serge Semin
that. We'll also need a way to explicitly set and clear the corresponding CS bit at a certain moment of the operation. Let's alter the set_cs function then to also de-activate the CS, when it's required. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 2 +- 1 file changed, 1 insertion

[PATCH v4 15/21] spi: dw: Move num-of retries parameter to the header file

2020-10-07 Thread Serge Semin
The parameter will be needed for another wait-done method being added in the framework of the SPI memory operation modification in a further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-dma.c | 5 ++--- drivers/spi/spi-dw.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions

[PATCH v4 10/21] spi: dw: Perform IRQ setup in a dedicated function

2020-10-07 Thread Serge Semin
one. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 41 ++- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 4a45610c85f1..e7ffcfff6594 100644 --- a/drivers/spi/spi-dw-core.c

[PATCH] MAINTAINERS: Add maintainer of DW APB SSI driver

2020-10-02 Thread Serge Semin
Add myself as a maintainer of the Synopsis DesignWare APB SSI driver. Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Link: https://lore.kernel.org/linux-spi/20201001222829.15977-1-sergey.se...@baikalelectronics.ru/ --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 11:08:29PM +0300, Serge Semin wrote: > On Fri, Oct 02, 2020 at 10:46:09PM +0300, Serge Semin wrote: > > On Fri, Oct 02, 2020 at 09:26:07PM +0300, Andy Shevchenko wrote: > > > On Fri, Oct 2, 2020 at 8:18 PM Serge Semin > > > wrote: > > >

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 10:46:09PM +0300, Serge Semin wrote: > On Fri, Oct 02, 2020 at 09:26:07PM +0300, Andy Shevchenko wrote: > > On Fri, Oct 2, 2020 at 8:18 PM Serge Semin > > wrote: > > > > > > On Fri, Oct 02, 2020 at 01:19:29PM +0300, Andy Shevchenko wrote: &

Re: [PATCH v3 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 09:24:55PM +0300, Andy Shevchenko wrote: > On Fri, Oct 2, 2020 at 8:47 PM Serge Semin > wrote: > > On Fri, Oct 02, 2020 at 01:22:46PM +0300, Andy Shevchenko wrote: > > > On Fri, Oct 02, 2020 at 01:28:11AM +0300, Serge Semin wrote: > > > &g

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 09:26:07PM +0300, Andy Shevchenko wrote: > On Fri, Oct 2, 2020 at 8:18 PM Serge Semin > wrote: > > > > On Fri, Oct 02, 2020 at 01:19:29PM +0300, Andy Shevchenko wrote: > > > On Fri, Oct 02, 2020 at 01:28:10AM +0300, Serge Semin wrote: >

Re: [PATCH v3 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 01:22:46PM +0300, Andy Shevchenko wrote: > On Fri, Oct 02, 2020 at 01:28:11AM +0300, Serge Semin wrote: > > Indeed there is no point in detecting the SPI peripheral device parameters > > and initializing the CR0 register fields each time an SPI transfer

Re: [PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-02 Thread Serge Semin
On Fri, Oct 02, 2020 at 01:19:29PM +0300, Andy Shevchenko wrote: > On Fri, Oct 02, 2020 at 01:28:10AM +0300, Serge Semin wrote: > > Currently DWC SSI core is supported by means of setting up the > > core-specific update_cr0() callback. It isn't suitable for multiple > >

[PATCH v3 14/21] spi: dw: Explicitly de-assert CS on SPI transfer completion

2020-10-01 Thread Serge Semin
that. We'll also need a way to explicitly set and clear the corresponding CS bit at a certain moment of the operation. Let's alter the set_cs function then to also de-activate the CS, when it's required. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 2 +- 1 file changed, 1 insertion

[PATCH v3 13/21] spi: dw: De-assert chip-select on reset

2020-10-01 Thread Serge Semin
in case of an error or having the CS left set by a bootloader or another software. Signed-off-by: Serge Semin --- drivers/spi/spi-dw.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index cfc9f63acde4..eb1d46983319 100644

[PATCH v3 07/21] spi: dw: Add DW SPI controller config structure

2020-10-01 Thread Serge Semin
driver, but by the glue layer drivers too. This will be required in a coming further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 29 + drivers/spi/spi-dw.h | 10 ++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git

[PATCH v3 05/21] spi: dw: Simplify the SPI bus speed config procedure

2020-10-01 Thread Serge Semin
procedure by removing the clock-related fields from the peripheral chip data and update the DW SPI clock divider only if it's really changed. The later change is reached by keeping the effective SPI bus speed in the internal DW SPI private data. Signed-off-by: Serge Semin --- drivers/spi/spi-dw

[PATCH v3 09/21] spi: dw: Refactor IRQ-based SPI transfer procedure

2020-10-01 Thread Serge Semin
is sent out, we'll disable the Tx FIFO Empty IRQ. If there is still some data to receive, we'll adjust the Rx FIFO Threshold level, so the next IRQ would be raised at the moment of all incoming data being available in the Rx FIFO. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 33

[PATCH v3 11/21] spi: dw: Unmask IRQs after enabling the chip

2020-10-01 Thread Serge Semin
st in case... Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index db3fec4195f7..58a7c7465c61 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi

[PATCH v3 10/21] spi: dw: Perform IRQ setup in a dedicated function

2020-10-01 Thread Serge Semin
one. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 41 ++- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 74e8f0da2883..db3fec4195f7 100644 --- a/drivers/spi/spi-dw-core.c

[PATCH v3 12/21] spi: dw: Discard chip enabling on DMA setup error

2020-10-01 Thread Serge Semin
returned from the dma_setup callback to be erroneous as it's supposed to be in the kernel. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 58a7c7465c61

[PATCH v3 15/21] spi: dw: Move num-of retries parameter to the header file

2020-10-01 Thread Serge Semin
The parameter will be needed for another wait-done method being added in the framework of the SPI memory operation modification in a further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-dma.c | 5 ++--- drivers/spi/spi-dw.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions

[PATCH v3 06/21] spi: dw: Update Rx sample delay in the config function

2020-10-01 Thread Serge Semin
Rx sample delay can be SPI device specific, and should be synchronously initialized with the rest of the communication and peripheral device related controller setups. So let's move the Rx-sample delay setup into the DW APB SSI configuration update method. Signed-off-by: Serge Semin --- drivers

[PATCH v3 21/21] spi: dw: Add Baikal-T1 SPI Controller glue driver

2020-10-01 Thread Serge Semin
of the DW SPI core module. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 28 drivers/spi/Makefile | 1 + drivers/spi/spi-dw-bt1.c | 339 +++ 3 files changed, 368 insertions

[PATCH v3 16/21] spi: dw: Add generic DW SSI status-check method

2020-10-01 Thread Serge Semin
of the new method to detect the errors in the IRQ- and DMA-based SPI transfer execution procedures. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 43 +++ drivers/spi/spi-dw-dma.c | 11 ++ drivers/spi/spi-dw.h | 1 + 3 files changed, 37

[PATCH v3 00/21] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-10-01 Thread Serge Semin
ATCH 00/04] spi: dw: Clear IRQ status on DW SPI controller reset [PATCH 00/03] spi: dw: Initialize n_bytes before the memory barrier [PATCH 00/01] spi: dw: Discard IRQ threshold macro Changelog v3: - Remove dw_spi_update_cr0() callback assignment from the DW APB SSI PCI glue-driver. Signed-o

[PATCH v3 08/21] spi: dw: Refactor data IO procedure

2020-10-01 Thread Serge Semin
and there in the tx_max(), rx_max(), dw_writer() and dw_reader() methods. Such modification will not only give us the more optimized IO procedures, but will make the data IO methods much more readable than before. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 37

[PATCH v3 04/21] spi: dw: Update SPI bus speed in a config function

2020-10-01 Thread Serge Semin
to have a generic function name not related to CR0. Leave the too long line with the chip->clk_div setting as is for now, since it's going to be changed later anyway. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 28 ++-- 1 file changed, 14 insertions(+),

[PATCH v3 02/21] spi: dw: Add DWC SSI capability

2020-10-01 Thread Serge Semin
controller setup to make the dw_spi_update_cr0() method looking coherent. Signed-off-by: Serge Semin --- Changelog v2: - Get back the in-code comments to the dw_spi_update_cr0() method and it' further derivatives. Changelog v3: - Remove dw_spi_update_cr0() callback assignment from the DW APB SSI PCI

[PATCH v3 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-10-01 Thread Serge Semin
of setting it up. By doing so we'll finally make the SPI device chip_data serving as it's supposed to - to preserve the SPI device specific DW SPI configuration. See spi-fsl-dspi.c, spi-pl022.c, spi-pxa2xx.c drivers for example of the way the chip data is utilized. Signed-off-by: Serge Semin

[PATCH v3 20/21] dt-bindings: spi: dw: Add Baikal-T1 SPI Controllers

2020-10-01 Thread Serge Semin
-off-by: Serge Semin Reviewed-by: Rob Herring --- .../bindings/spi/snps,dw-apb-ssi.yaml | 33 +-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml b/Documentation/devicetree/bindings/spi/snps,dw-apb

[PATCH v3 19/21] spi: dw: Add poll-based SPI transfers support

2020-10-01 Thread Serge Semin
t iteration. Finally the errors status is checked on each iteration. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 40 ++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index cc217b

[PATCH v3 17/21] spi: dw: Add memory operations support

2020-10-01 Thread Serge Semin
controller with fixed automatic CS toggle functionality. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 1 + drivers/spi/spi-dw-core.c | 300 ++ drivers/spi/spi-dw.h | 13 ++ 3 files

[PATCH v3 18/21] spi: dw: Introduce max mem-ops SPI bus frequency setting

2020-10-01 Thread Serge Semin
applicable for the memory operations, since the standard SPI core interface is implemented with an assumption that there is no problem with the automatic CS toggling. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +++- drivers/spi/spi-dw.h | 1 + 2 files changed, 4 insertions(+), 1

[PATCH v3 01/21] spi: dw: Use an explicit set_cs assignment

2020-10-01 Thread Serge Semin
Simplify the dw_spi_add_host() method a bit by replacing the currently implemented default set_cs callback setting up and later having it overwritten by a custom function with direct if-else-based callback assignment. Signed-off-by: Serge Semin --- Changelog v2: - Replace the ternary operator

Re: [PATCH v2 02/21] spi: dw: Add DWC SSI capability

2020-10-01 Thread Serge Semin
On Thu, Oct 01, 2020 at 10:51:05PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 09:55:26PM +0300, Serge Semin wrote: > > Currently DWC SSI core is supported by means of setting up the > > core-specific update_cr0() callback. It isn't suitable for multiple > > reasons

[PATCH v2 09/21] spi: dw: Refactor IRQ-based SPI transfer procedure

2020-09-30 Thread Serge Semin
is sent out, we'll disable the Tx FIFO Empty IRQ. If there is still some data to receive, we'll adjust the Rx FIFO Threshold level, so the next IRQ would be raised at the moment of all incoming data being available in the Rx FIFO. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 33

[PATCH v2 13/21] spi: dw: De-assert chip-select on reset

2020-09-30 Thread Serge Semin
in case of an error or having the CS left set by a bootloader or another software. Signed-off-by: Serge Semin --- drivers/spi/spi-dw.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index cfc9f63acde4..eb1d46983319 100644

[PATCH v2 05/21] spi: dw: Simplify the SPI bus speed config procedure

2020-09-30 Thread Serge Semin
procedure by removing the clock-related fields from the peripheral chip data and update the DW SPI clock divider only if it's really changed. The later change is reached by keeping the effective SPI bus speed in the internal DW SPI private data. Signed-off-by: Serge Semin --- drivers/spi/spi-dw

[PATCH v2 16/21] spi: dw: Add generic DW SSI status-check method

2020-09-30 Thread Serge Semin
of the new method to detect the errors in the IRQ- and DMA-based SPI transfer execution procedures. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 43 +++ drivers/spi/spi-dw-dma.c | 11 ++ drivers/spi/spi-dw.h | 1 + 3 files changed, 37

[PATCH v2 03/21] spi: dw: Detach SPI device specific CR0 config method

2020-09-30 Thread Serge Semin
of setting it up. By doing so we'll finally make the SPI device chip_data serving as it's supposed to - to preserve the SPI device specific DW SPI configuration. See spi-fsl-dspi.c, spi-pl022.c, spi-pxa2xx.c drivers for example of the way the chip data is utilized. Signed-off-by: Serge Semin

[PATCH v2 10/21] spi: dw: Perform IRQ setup in a dedicated function

2020-09-30 Thread Serge Semin
one. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 41 ++- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 74e8f0da2883..db3fec4195f7 100644 --- a/drivers/spi/spi-dw-core.c

[PATCH v2 19/21] spi: dw: Add poll-based SPI transfers support

2020-09-30 Thread Serge Semin
t iteration. Finally the errors status is checked on each iteration. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 40 ++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index cc217b

[PATCH v2 18/21] spi: dw: Introduce max mem-ops SPI bus frequency setting

2020-09-30 Thread Serge Semin
applicable for the memory operations, since the standard SPI core interface is implemented with an assumption that there is no problem with the automatic CS toggling. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +++- drivers/spi/spi-dw.h | 1 + 2 files changed, 4 insertions(+), 1

[PATCH v2 15/21] spi: dw: Move num-of retries parameter to the header file

2020-09-30 Thread Serge Semin
The parameter will be needed for another wait-done method being added in the framework of the SPI memory operation modification in a further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-dma.c | 5 ++--- drivers/spi/spi-dw.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions

[PATCH v2 14/21] spi: dw: Explicitly de-assert CS on SPI transfer completion

2020-09-30 Thread Serge Semin
that. We'll also need a way to explicitly set and clear the corresponding CS bit at a certain moment of the operation. Let's alter the set_cs function then to also de-activate the CS, when it's required. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 21/21] spi: dw: Add Baikal-T1 SPI Controller glue driver

2020-09-30 Thread Serge Semin
of the DW SPI core module. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 28 drivers/spi/Makefile | 1 + drivers/spi/spi-dw-bt1.c | 339 +++ 3 files changed, 368 insertions

[PATCH v2 01/21] spi: dw: Use an explicit set_cs assignment

2020-09-30 Thread Serge Semin
Simplify the dw_spi_add_host() method a bit by replacing the currently implemented default set_cs callback setting up and later having it overwritten by a custom function with direct if-else-based callback assignment. Signed-off-by: Serge Semin --- Changelog v2: - Replace the ternary operator

[PATCH v2 11/21] spi: dw: Unmask IRQs after enabling the chip

2020-09-30 Thread Serge Semin
st in case... Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index db3fec4195f7..58a7c7465c61 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi

[PATCH v2 02/21] spi: dw: Add DWC SSI capability

2020-09-30 Thread Serge Semin
controller setup to make the dw_spi_update_cr0() method looking coherent. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 80 ++- drivers/spi/spi-dw-mmio.c | 20 +- drivers/spi/spi-dw.h | 9 + 3 files changed, 40 insertions(+), 69

[PATCH v2 06/21] spi: dw: Update Rx sample delay in the config function

2020-09-30 Thread Serge Semin
Rx sample delay can be SPI device specific, and should be synchronously initialized with the rest of the communication and peripheral device related controller setups. So let's move the Rx-sample delay setup into the DW APB SSI configuration update method. Signed-off-by: Serge Semin --- drivers

[PATCH v2 12/21] spi: dw: Discard chip enabling on DMA setup error

2020-09-30 Thread Serge Semin
returned from the dma_setup callback to be erroneous as it's supposed to be in the kernel. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 58a7c7465c61

[PATCH v2 00/21] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-09-30 Thread Serge Semin
ATCH 00/04] spi: dw: Clear IRQ status on DW SPI controller reset [PATCH 00/03] spi: dw: Initialize n_bytes before the memory barrier [PATCH 00/01] spi: dw: Discard IRQ threshold macro Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Ramil Zaripov Cc: Pavel Parkhomenko Cc: Andy Shevchenko

[PATCH v2 17/21] spi: dw: Add memory operations support

2020-09-30 Thread Serge Semin
controller with fixed automatic CS toggle functionality. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 1 + drivers/spi/spi-dw-core.c | 300 ++ drivers/spi/spi-dw.h | 13 ++ 3 files

[PATCH v2 20/21] dt-bindings: spi: dw: Add Baikal-T1 SPI Controllers

2020-09-30 Thread Serge Semin
-off-by: Serge Semin Reviewed-by: Rob Herring --- .../bindings/spi/snps,dw-apb-ssi.yaml | 33 +-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml b/Documentation/devicetree/bindings/spi/snps,dw-apb

[PATCH v2 08/21] spi: dw: Refactor data IO procedure

2020-09-30 Thread Serge Semin
and there in the tx_max(), rx_max(), dw_writer() and dw_reader() methods. Such modification will not only give us the more optimized IO procedures, but will make the data IO methods much more readable than before. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 37

[PATCH v2 04/21] spi: dw: Update SPI bus speed in a config function

2020-09-30 Thread Serge Semin
to have a generic function name not related to CR0. Leave the too long line with the chip->clk_div setting as is for now, since it's going to be changed later anyway. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 28 ++-- 1 file changed, 14 insertions(+),

[PATCH v2 07/21] spi: dw: Add DW SPI controller config structure

2020-09-30 Thread Serge Semin
driver, but by the glue layer drivers too. This will be required in a coming further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 29 + drivers/spi/spi-dw.h | 10 ++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git

Re: [PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 04:41:49PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 06:03:12PM +0300, Serge Semin wrote: > > On Wed, Sep 30, 2020 at 01:17:37AM +0300, Serge Semin wrote: > > > > > > - /* > > > > > - * SPI mode (SCPOL|SCPH)

Re: [PATCH 02/30] spi: dw: Use ternary op to init set_cs callback

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 04:01:17PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 05:57:59PM +0300, Serge Semin wrote: > > On Wed, Sep 30, 2020 at 12:55:55AM +0300, Serge Semin wrote: > > > > + if (dws->set_cs) > > > + master->set_cs = dws->set_

Re: [PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-30 Thread Serge Semin
Mark, A concrete question is below of my previous comment. On Wed, Sep 30, 2020 at 01:17:37AM +0300, Serge Semin wrote: > On Tue, Sep 29, 2020 at 02:52:33PM +0100, Mark Brown wrote: > > On Sun, Sep 20, 2020 at 02:28:55PM +0300, Serge Semin wrote: > > > > > - /* > &g

Re: [PATCH 02/30] spi: dw: Use ternary op to init set_cs callback

2020-09-30 Thread Serge Semin
Mark, A concrete question is below the main text.) On Wed, Sep 30, 2020 at 12:55:55AM +0300, Serge Semin wrote: > On Tue, Sep 29, 2020 at 02:11:53PM +0100, Mark Brown wrote: > > On Sun, Sep 20, 2020 at 02:28:46PM +0300, Serge Semin wrote: > > > Simplify the dw_spi_add_h

Re: [PATCH 0/2] mips: Introduce some IO-accessors optimizations

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 12:15:32PM +0200, Thomas Bogendoerfer wrote: > On Wed, Sep 30, 2020 at 12:12:32AM +0300, Serge Semin wrote: > > Thomas, > > Any comment on the series? The changes aren't that comprehensive, so it > > would > > be great to merge it in before the

Re: [PATCH 00/30] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-09-30 Thread Serge Semin
On Wed, Sep 30, 2020 at 12:04:04PM +0100, Mark Brown wrote: > On Wed, Sep 30, 2020 at 01:43:03AM +0300, Serge Semin wrote: > > On Tue, Sep 29, 2020 at 03:43:51PM +0100, Mark Brown wrote: > > > > This is a *huge* patch series which is a bit unweildy to review > > >

Re: [PATCH 00/30] spi: dw: Add full Baikal-T1 SPI Controllers support

2020-09-29 Thread Serge Semin
Hi Mark On Tue, Sep 29, 2020 at 03:43:51PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:44PM +0300, Serge Semin wrote: > > > First two patches are just cleanups to simplify the DW APB SSI device > > initialization a bit. We suggest to discard the IRQ threshold m

Re: [PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:52:33PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:55PM +0300, Serge Semin wrote: > > > - /* > > -* SPI mode (SCPOL|SCPH) > > -* CTRLR0[ 8] Serial Clock Phase > > -* CTRLR0[ 9] Serial Clock Polarity > >

Re: [PATCH 04/30] Revert: spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:28:11PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:48PM +0300, Serge Semin wrote: > > There is no point in having the commit 19b61392c5a8 ("spi: spi-dw: Add > > lock protect dw_spi rx/tx to prevent concurrent calls") applied. T

Re: [PATCH 03/30] spi: dw: Initialize n_bytes before the memory barrier

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:12:25PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:47PM +0300, Serge Semin wrote: > > Since n_bytes field of the DW SPI private data is also utilized by the > > IRQ handler, we need to make sure it' initialization is done before the >

Re: [PATCH 02/30] spi: dw: Use ternary op to init set_cs callback

2020-09-29 Thread Serge Semin
On Tue, Sep 29, 2020 at 02:11:53PM +0100, Mark Brown wrote: > On Sun, Sep 20, 2020 at 02:28:46PM +0300, Serge Semin wrote: > > Simplify the dw_spi_add_host() method a bit by replacing the set_cs > > callback overwrite procedure with direct setting the callback if a custom >

Re: [PATCH 0/2] mips: Introduce some IO-accessors optimizations

2020-09-29 Thread Serge Semin
Thomas, Any comment on the series? The changes aren't that comprehensive, so it would be great to merge it in before the 5.10 merge window is opened. -Sergey On Sun, Sep 20, 2020 at 02:00:08PM +0300, Serge Semin wrote: > It has been discovered that on our MIPS P5600-based CPU the IO access

Re: [PATCH 0/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock

2020-09-29 Thread Serge Semin
Hello, On Sun, Sep 27, 2020 at 05:01:52PM +0200, Hans de Goede wrote: > Hi, > > On 9/23/20 6:19 PM, Serge Semin wrote: > > Hans has discovered that there is a potential deadlock between the ref > > clock change notifier and the port suspension procedures {see the l

Re: [PATCH 1/2] mips: Add strong UC ordering config

2020-09-25 Thread Serge Semin
On Fri, Sep 25, 2020 at 11:54:20AM +0800, Jiaxun Yang wrote: > > > 在 2020/9/20 19:00, Serge Semin 写道: > > In accordance with [1, 2] memory transactions using CCA=2 (Uncached > > Cacheability and Coherency Attribute) are always strongly ordered. This > > means the yo

[PATCH 2/3] serial: 8250: Skip uninitialized TTY port baud rate update

2020-09-23 Thread Serge Semin
Signed-off-by: Serge Semin --- drivers/tty/serial/8250/8250_port.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 1259fb6b66b3..b0af13074cd3 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/

[PATCH 3/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock

2020-09-23 Thread Serge Semin
Hans de Goede Signed-off-by: Serge Semin --- drivers/tty/serial/8250/8250_dw.c | 54 +++ 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 87f450b7c177..9e204f9b799a 100644 --- a/drivers/

[PATCH 1/3] serial: 8250: Discard RTS/DTS setting from clock update method

2020-09-23 Thread Serge Semin
8250: Add 8250 port clock update method") Signed-off-by: Serge Semin --- drivers/tty/serial/8250/8250_port.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index c71d647eb87a..1259fb6b66b3 100644 --- a/drivers/

[PATCH 0/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock

2020-09-23 Thread Serge Semin
ial: 8250_dw: Fix common clocks usage race condition") Fixes: 868f3ee6e452 ("serial: 8250: Add 8250 port clock update method") Reported-by: Hans de Goede Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Pavel Parkhomenko Cc: Andy Shevchenko Cc: Maxime Ripard Cc: Will Deacon Cc:

[PATCH 30/30] spi: dw: Add Baikal-T1 SPI Controller glue driver

2020-09-20 Thread Serge Semin
of the DW SPI core module. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 28 drivers/spi/Makefile | 1 + drivers/spi/spi-dw-bt1.c | 339 +++ 3 files changed, 368 insertions

[PATCH 06/30] spi: dw: Disable all IRQs when controller is unused

2020-09-20 Thread Serge Semin
and when there is no SPI message currently being processed. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 18411f5b9954..be94ed5bb896 100644

[PATCH 25/30] spi: dw: Add generic DW SSI status-check method

2020-09-20 Thread Serge Semin
of the new method to detect the errors in the IRQ- and DMA-based SPI transfer execution procedures. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 43 +++ drivers/spi/spi-dw-dma.c | 11 ++ drivers/spi/spi-dw.h | 1 + 3 files changed, 37

[PATCH 15/30] spi: dw: Update Rx sample delay in the config function

2020-09-20 Thread Serge Semin
Rx sample delay can be SPI device specific, and should be synchronously initialized with the rest of the communication and peripheral device related controller setups. So let's move the Rx-sample delay setup into the DW APB SSI configuration update method. Signed-off-by: Serge Semin --- drivers

[PATCH 21/30] spi: dw: Discard chip enabling on DMA setup error

2020-09-20 Thread Serge Semin
returned from the dma_setup callback to be erroneous as it's supposed to be in the kernel. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 8dbe11c1821c

[PATCH 20/30] spi: dw: Unmask IRQs after enabling the chip

2020-09-20 Thread Serge Semin
st in case... Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 08bc53b9de88..8dbe11c1821c 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi

[PATCH 04/30] Revert: spi: spi-dw: Add lock protect dw_spi rx/tx to prevent concurrent calls

2020-09-20 Thread Serge Semin
by the data transfer algorithm implementation: first we initialize the buffers pointers, then make sure the assignments are visible by the other CPUs by calling the smp_mb(), only after that enable the interrupt, which handler uses the buffers. Signed-off-by: Serge Semin --- Folks. I have also a doubt

[PATCH 11/30] spi: dw: Add DWC SSI capability

2020-09-20 Thread Serge Semin
in mind let's discard the update_cr0() callbacks, define a generic and static dw_spi_update_cr0() method and create the DW_SPI_CAP_DWC_SSI capability, which when enabled would activate the alternative CR0 register layout. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 69

[PATCH 16/30] spi: dw: Add DW SPI controller config structure

2020-09-20 Thread Serge Semin
driver, but by the glue layer drivers too. This will be required in a coming further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 29 + drivers/spi/spi-dw.h | 10 ++ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git

[PATCH 27/30] spi: dw: Introduce max mem-ops SPI bus frequency setting

2020-09-20 Thread Serge Semin
applicable for the memory operations, since the standard SPI core interface is implemented with an assumption that there is no problem with the automatic CS toggling. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 +++- drivers/spi/spi-dw.h | 1 + 2 files changed, 4 insertions(+), 1

[PATCH 18/30] spi: dw: Refactor IRQ-based SPI transfer procedure

2020-09-20 Thread Serge Semin
is sent out, we'll disable the Tx FIFO Empty IRQ. If there is still some data to receive, we'll adjust the Rx FIFO Threshold level, so the next IRQ would be raised at the moment of all incoming data being available in the Rx FIFO. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 33

[PATCH 19/30] spi: dw: Perform IRQ setup in a dedicated function

2020-09-20 Thread Serge Semin
one. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 41 ++- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 682463b2f68b..08bc53b9de88 100644 --- a/drivers/spi/spi-dw-core.c

[PATCH 05/30] spi: dw: Clear IRQ status on DW SPI controller reset

2020-09-20 Thread Serge Semin
in the dedicated controller reset method. Signed-off-by: Serge Semin --- drivers/spi/spi-dw.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index 1ab704d1ebd8..ff77f39047ce 100644 --- a/drivers/spi/spi-dw.h +++ b/drivers/spi

[PATCH 17/30] spi: dw: Refactor data IO procedure

2020-09-20 Thread Serge Semin
and there in the tx_max(), rx_max(), dw_writer() and dw_reader() methods. Such modification will not only give us the more optimized IO procedures, but will make the data IO methods much more readable than before. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 37

[PATCH 22/30] spi: dw: De-assert chip-select on reset

2020-09-20 Thread Serge Semin
in case of an error or having the CS left set by a bootloader or another software. Signed-off-by: Serge Semin --- drivers/spi/spi-dw.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h index cfc9f63acde4..eb1d46983319 100644

[PATCH 13/30] spi: dw: Update SPI bus speed in a config function

2020-09-20 Thread Serge Semin
to have a generic function name not related to CR0. Leave the too long line with the chip->clk_div setting as is for now, since it's going to be changed later anyway. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 28 ++-- 1 file changed, 14 insertions(+),

[PATCH 26/30] spi: dw: Add memory operations support

2020-09-20 Thread Serge Semin
controller with fixed automatic CS toggle functionality. Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin --- drivers/spi/Kconfig | 1 + drivers/spi/spi-dw-core.c | 300 ++ drivers/spi/spi-dw.h | 13 ++ 3 files

[PATCH 24/30] spi: dw: Move num-of retries parameter to the header file

2020-09-20 Thread Serge Semin
The parameter will be needed for another wait-done method being added in the framework of the SPI memory operation modification in a further commit. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-dma.c | 5 ++--- drivers/spi/spi-dw.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions

[PATCH 28/30] spi: dw: Add poll-based SPI transfers support

2020-09-20 Thread Serge Semin
t iteration. Finally the errors status is checked on each iteration. Signed-off-by: Serge Semin --- drivers/spi/spi-dw-core.c | 40 ++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 7b9012

[PATCH 14/30] spi: dw: Simplify the SPI bus speed config procedure

2020-09-20 Thread Serge Semin
procedure by removing the clock-related fields from the peripheral chip data and update the DW SPI clock divider only if it's really changed. The later change is reached by keeping the effective SPI bus speed in the internal DW SPI private data. Signed-off-by: Serge Semin --- drivers/spi/spi-dw

<    1   2   3   4   5   6   7   8   9   10   >