[PATCH v3 3/7] dt-bindings: watchdog: dw-wdt: Add watchdog TOPs array property

2020-05-26 Thread Serge Semin
In case if DW Watchdog IP core is built with WDT_USE_FIX_TOP == false, a custom timeout periods are used to preset the timer counter. In this case that periods should be specified in a new "snps,watchdog-tops" property of the DW watchdog dts node. Signed-off-by: Serge Semin Review

[PATCH v3 1/7] dt-bindings: watchdog: Convert DW WDT binding to DT schema

2020-05-26 Thread Serge Semin
references clock source, optional reset line and pre-timeout interrupt. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: linux-m...@vger.kernel.org --- Changelog v2: - Rearrange SoBs. - Discard BE copyright header. - Replace

[PATCH v3 4/7] watchdog: dw_wdt: Support devices with non-fixed TOP values

2020-05-26 Thread Serge Semin
rt the new timeouts data structure. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Rearrange SoBs. - Add "ms" suffix to the methods return

[PATCH v3 0/7] watchdog: dw_wdt: Take Baikal-T1 DW WDT peculiarities into account

2020-05-26 Thread Serge Semin
...@baikalelectronics.ru/ Changelog v3: - Add Rob's Reviewed-by tag to the DT-related patches. - Remove items from the "snps,watchdog-tops" property and move the minItems and maxItems constraints to the root level of it. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurki

[PATCH v3 2/7] dt-bindings: watchdog: dw-wdt: Support devices with asynch clocks

2020-05-26 Thread Serge Semin
the optional APB3 bus clock specified along with the mandatory watchdog timer reference clock. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: linux-m...@vger.kernel.org --- Changelog v2: - It's a new patch unpinned from

[PATCH v4 0/3] serial: 8250_dw: Fix ref clock usage

2020-05-26 Thread Serge Semin
y-next branch. - Use EXPORT_SYMBOL_GPL() for the serial8250_update_uartclk() method. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Alexey Kolotnikov Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Arnd Bergmann Cc:

[PATCH v4 3/3] serial: 8250_dw: Fix common clocks usage race condition

2020-05-26 Thread Serge Semin
a functionality of the ref clock events handler for the current UART port, since uartclk update will be done a bit further in the generic serial8250_do_set_termios() function. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Maxime

[PATCH v4 1/3] serial: 8250: Add 8250 port clock update method

2020-05-26 Thread Serge Semin
All of these things is done in a coherent way by calling the serial8250_update_uartclk() method provided in this patch. Though note that it isn't supposed to be called from within the UART port callbacks because the locks using to the protect the UART port data are already taken in there. Signed-off-by: Se

[PATCH v4 2/3] serial: 8250_dw: Simplify the ref clock rate setting procedure

2020-05-26 Thread Serge Semin
-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Maxime Ripard Cc: Will Deacon Cc: Russell King Cc: linux-m...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org --- Changelog v3: - This is a new patch. --- drivers/tty/serial/8250

Re: [PATCH v3 3/6] dt-bindings: memory: Add Baikal-T1 L2-cache Control Block binding

2020-05-26 Thread Serge Semin
On Tue, May 26, 2020 at 10:09:15AM -0600, Rob Herring wrote: > On Tue, 26 May 2020 15:59:25 +0300, Serge Semin wrote: > > There is a single register provided by the SoC system controller, > > which can be used to tune the L2-cache RAM up. It only provides a way > > to cha

Re: [PATCH v4 3/3] serial: 8250_dw: Fix common clocks usage race condition

2020-05-26 Thread Serge Semin
On Tue, May 26, 2020 at 07:57:01PM +0300, Andy Shevchenko wrote: > On Tue, May 26, 2020 at 07:03:16PM +0300, Serge Semin wrote: > > The race condition may happen if the UART reference clock is shared with > > some other device (on Baikal-T1 SoC it's another DW UART port). I

[PATCH v5 3/3] serial: 8250_dw: Fix common clocks usage race condition

2020-05-26 Thread Serge Semin
a functionality of the ref clock events handler for the current UART port, since uartclk update will be done a bit further in the generic serial8250_do_set_termios() function. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Maxime

[PATCH v5 2/3] serial: 8250_dw: Simplify the ref clock rate setting procedure

2020-05-26 Thread Serge Semin
-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Maxime Ripard Cc: Will Deacon Cc: Russell King Cc: linux-m...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org --- Changelog v3: - This is a new patch. --- drivers/tty/serial/8250

[PATCH v5 0/3] serial: 8250_dw: Fix ref clock usage

2020-05-26 Thread Serge Semin
in the same procedure at the set_termios() function being invoked by the serial_core anyway. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Alexey Kolotnikov Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Arnd Bergma

[PATCH v5 1/3] serial: 8250: Add 8250 port clock update method

2020-05-26 Thread Serge Semin
All of these things is done in a coherent way by calling the serial8250_update_uartclk() method provided in this patch. Though note that it isn't supposed to be called from within the UART port callbacks because the locks using to the protect the UART port data are already taken in there. Signed-off-by: Se

Re: [PATCH v2 07/12] i2c: designware: Move Baytrail sem config to the platform if-clause

2020-05-26 Thread Serge Semin
On Mon, May 25, 2020 at 04:01:26PM +0300, Jarkko Nikula wrote: > On 5/21/20 5:22 AM, Serge Semin wrote: > > On Wed, May 20, 2020 at 03:16:14PM +0300, Jarkko Nikula wrote: > > > On 5/10/20 12:50 PM, Serge Semin wrote: > > > > Currently Intel Baytrail I2C semaphore

Re: [PATCH v2 08/12] i2c: designware: Introduce platform drivers glue layer interface

2020-05-26 Thread Serge Semin
On Mon, May 25, 2020 at 04:16:05PM +0300, Jarkko Nikula wrote: > Hi > > On 5/21/20 5:37 AM, Serge Semin wrote: > > On Wed, May 20, 2020 at 03:46:11PM +0300, Jarkko Nikula wrote: > > > Hi > > > > > > On 5/10/20 12:50 PM, Serge Semin wrote: > >

[PATCH v3 04/12] dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller

2020-05-26 Thread Serge Semin
Add the "baikal,bt1-sys-i2c" compatible string to the DW I2C binding. Even though the corresponding node is supposed to be a child of the Baikal-T1 System Controller, its reg property is left required for compatibility. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogend

[PATCH v3 10/12] i2c: designware: Retrieve quirk flags as early as possible

2020-05-26 Thread Serge Semin
let's retrieve the model flags right after the DW I2C private data is created. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new patch, which has been created

[PATCH v3 12/12] i2c: designware: Add Baikal-T1 System I2C support

2020-05-26 Thread Serge Semin
-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new patch, which has been created due to declining the glue-layer approach. --- drivers/i2c/busses/Kconfig | 3

[PATCH v3 09/12] i2c: designware: Convert driver to using regmap API

2020-05-26 Thread Serge Semin
stage. The rest of the code won't do this because basically we have MMIO-based regmap so non of the read/write methods can fail (this also won't be needed for the Baikal-T1-specific I2C controller). Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Tested-by: Jarkko Nikula Acked

[PATCH v3 07/12] i2c: designware: Add Baytrail sem config DW I2C platform dependency

2020-05-26 Thread Serge Semin
it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the config menu will display the feature right below the DW I2C platform driver item and will indent it to the right so signifying its belonging. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer

[PATCH v3 11/12] i2c: designware: Move reg-space remapping into a dedicated function

2020-05-26 Thread Serge Semin
devm_platform_get_and_ioremap_resource(). Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new patch, which has been created due to declining the glue-layer approach. --- drivers/i2c/busses/i2c

[PATCH v3 06/12] i2c: designware: slave: Set DW I2C core module dependency

2020-05-26 Thread Serge Semin
if the I2C_DESIGNWARE_CORE config is enabled. Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Andy Shevchenko Cc: Mika Westerberg Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- drivers/i2c/busses/Kconfig | 2 +- 1 file

[PATCH v3 01/12] scripts/dtc: check: Add 10bit/slave i2c reg flags support

2020-05-26 Thread Serge Semin
-bit address is expected in the "reg"-property. If I2C_TEN_BIT_ADDRESS is set, then the 10-bit address check will be performed. The I2C_OWN_SLAVE_ADDRESS flag will be just ignored. [1] Documentation/i2c/slave-interface.rst [2] include/dt-bindings/i2c/i2c.h Signed-off-by: Serge Semin Cc: Alexey Malahov C

[PATCH v3 05/12] i2c: designware: Use `-y` to build multi-object modules

2020-05-26 Thread Serge Semin
we can discard the ifeq construction in favor to the more natural and less bulky `-$(CONFIG_X) += x.o` Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Andy Shevchenko Cc: Mika Westerberg Cc: Rob Herring Cc: linux-m...@vger.kernel.o

[PATCH v3 03/12] dt-bindings: i2c: Discard i2c-slave flag from the DW I2C example

2020-05-26 Thread Serge Semin
2/i2c@112/eeprom@64:reg: I2C address must be less than 10-bits, got "0x4064" In order to silence dtc up let's discard the flag from the DW I2C DT binding example for now. Just revert this commit when dtc is fixed. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bog

[PATCH v3 02/12] dt-bindings: i2c: Convert DW I2C binding to DT schema

2020-05-26 Thread Serge Semin
I2C controller or with Microsemi Ocelot SoC I2C one, to have registers, interrupts and clocks properties. In addition the node may have clock-frequency, i2c-sda-hold-time-ns, i2c-scl-falling-time-ns and i2c-sda-falling-time-ns optional properties. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc

[PATCH v3 08/12] i2c: designware: Discard Cherry Trail model flag

2020-05-26 Thread Serge Semin
A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C bus pm_disabled workaround"), but the flag most likely by mistake has been left in the Dw I2C drivers. Lets remove it. Signed-off-by: S

[PATCH v3 00/12] i2c: designeware: Add Baikal-T1 System I2C support

2020-05-26 Thread Serge Semin
in the System Controller registers space. - Replace if-endif clause around the I2C_DESIGNWARE_BAYTRAIL config with "depends on" operator. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov

[PATCH v3 2/4] dt-bindings: clk: Add Baikal-T1 CCU Dividers binding

2020-05-26 Thread Serge Semin
and System Devices CCU DT nodes to be also reset-providers. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: linux-m...@vger.kernel.org --- Changelog v2: - Rearrange the SoBs. - Combine AXI-bus and System Devices CCU bindings into a single file. - Discard comments

[PATCH v3 3/4] clk: Add Baikal-T1 CCU PLLs driver

2020-05-26 Thread Serge Semin
the implemented rate-PLLs-dividers calculation algorithm is correct. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Rearrange the SoBs. - Don't enable the CCU clock drivers

[PATCH v3 4/4] clk: Add Baikal-T1 CCU Dividers driver

2020-05-26 Thread Serge Semin
-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Rearrange the SoBs. - Alter the commit message, since CCU isn't considered as MFD anymore. - Enable the CCU Divider clock driver by default only

[PATCH v3 0/4] clk: Add Baikal-T1 SoC Clock Control Unit support

2020-05-26 Thread Serge Semin
perty back to the DT bindings even though the driver is using the parental syscon regmap. - The DT schema will live separately from the system controller, but the corresponding sub-node of the later DT schema will $ref this one. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc:

[PATCH v3 1/4] dt-bindings: clk: Add Baikal-T1 CCU PLLs binding

2020-05-26 Thread Serge Semin
. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Arnd Bergmann Cc: linux-m...@vger.kernel.org --- Changelog v2: - Rearrange the SoBs. - Discard comments in the bindings file header. - Add dual GPL/BSD license. - Add spaces around the ASCII-graphics in the binding description. - Remove reference

[PATCH v3 07/10] dmaengine: dw: Set DMA device max segment size parameter

2020-05-26 Thread Serge Semin
will cause less dw_desc allocations, less LLP reinitializations, better DMA device performance. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2

[PATCH v3 05/10] dmaengine: Introduce DMA-device device_caps callback

2020-05-26 Thread Serge Semin
if provided it gets called from the dma_get_slave_caps() method and is able to override the generic DMA-device capabilities. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet

[PATCH v3 08/10] dmaengine: dw: Add dummy device_caps callback

2020-05-26 Thread Serge Semin
overrides in the next commits. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new patch created as a result of the discussion with Vinud and Andy

[PATCH v3 09/10] dmaengine: dw: Introduce max burst length hw config

2020-05-26 Thread Serge Semin
capability we make sure a DMA consumer will get the channel-specific max burst length. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Rearrange SoBs. - Discard

[PATCH v3 10/10] dmaengine: dw: Initialize max_sg_nents with nollp flag

2020-05-26 Thread Serge Semin
consumer would be ready to somehow workaround errors caused by such mode being utilized. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new

[PATCH v3 00/10] dmaengine: dw: Take Baikal-T1 SoC DW DMAC peculiarities into account

2020-05-26 Thread Serge Semin
with nollp flag". This is required to fix the DW APB SSI issue of the Tx and Rx DMA channels de-synchronization. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc:

[PATCH v3 02/10] dt-bindings: dma: dw: Add max burst transaction length property

2020-05-26 Thread Serge Semin
This array property is used to indicate the maximum burst transaction length supported by each DMA channel. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: linux-m...@vger.kernel.org --- Changelog v2: - Rearrange SoBs. - Move

[PATCH v3 03/10] dmaengine: Introduce min burst length capability

2020-05-26 Thread Serge Semin
Some hardware aside from default 0/1 may have greater minimum burst transactions length constraints. Here we introduce the DMA device and slave capability, which if required can be initialized by the DMA engine driver with the device-specific value. Signed-off-by: Serge Semin Cc: Alexey Malahov

[PATCH v3 06/10] dmaengine: dw: Take HC_LLP flag into account for noLLP auto-config

2020-05-26 Thread Serge Semin
then the LLP register is hardcoded to zero, so the blocks chaining based on the LLPs is unsupported. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org

[PATCH v3 01/10] dt-bindings: dma: dw: Convert DW DMAC to DT binding

2020-05-26 Thread Serge Semin
" and "interrupts", which will be used by the driver to correctly find the controller memory region and handle its events. The rest of the properties are optional, since in case if either "dma-channels" or "dma-masters" isn't specified, the driver will attempt to auto-d

[PATCH v3 04/10] dmaengine: Introduce max SG list entries capability

2020-05-26 Thread Serge Semin
with 0 if there is no limitation for the number of SG entries atomically executed and with non-zero value if there is such constraints, so the upper limit is determined by the number set to the property. Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas

[PATCH RESEND v2] mtd: physmap: Add Baikal-T1 physically mapped ROMs support

2020-05-26 Thread Serge Semin
must be enabled by means of a dedicated flag in the Baikal-T1 System SPI register flag. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Maxim Kaurkin Cc: Pavel Parkhomenko Cc: Ramil Zaripov Cc: Ekaterina Skachko Cc: Vadim Vlasov Cc: Alexey Kolotnikov Cc: Thomas Bogendoerfer Cc: Arnd

Re: [PATCH v3 01/12] scripts/dtc: check: Add 10bit/slave i2c reg flags support

2020-05-27 Thread Serge Semin
On Tue, May 26, 2020 at 07:17:04PM -0600, Rob Herring wrote: > On Wed, May 27, 2020 at 12:55:17AM +0300, Serge Semin wrote: > > Recently the I2C-controllers slave interface support was added to the > > kernel I2C subsystem. In this case Linux can be used as, for example, > >

Re: [PATCH v3 11/12] i2c: designware: Move reg-space remapping into a dedicated function

2020-05-27 Thread Serge Semin
On Wed, May 27, 2020 at 12:26:09PM +0300, Andy Shevchenko wrote: > On Wed, May 27, 2020 at 4:03 AM Serge Semin > wrote: > > > > This is a preparation patch before adding a quirk with custom registers > > map creation required for the Baikal-T1 System I2C support. Since we'

Re: [PATCH v3 01/12] scripts/dtc: check: Add 10bit/slave i2c reg flags support

2020-05-27 Thread Serge Semin
On Tue, May 26, 2020 at 07:17:04PM -0600, Rob Herring wrote: > On Wed, May 27, 2020 at 12:55:17AM +0300, Serge Semin wrote: > > Recently the I2C-controllers slave interface support was added to the > > kernel I2C subsystem. In this case Linux can be used as, for example, > >

[PATCH v4 05/11] i2c: designware: slave: Set DW I2C core module dependency

2020-05-27 Thread Serge Semin
I versions of the IP core, but it still depends on the DW I2C core functionality and must be available only if the last one is enabled. So make sure the DW APB I2C slave config is only available if the I2C_DESIGNWARE_CORE config is enabled. Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Cc: Alex

Re: [PATCH v3 03/12] dt-bindings: i2c: Discard i2c-slave flag from the DW I2C example

2020-05-27 Thread Serge Semin
On Wed, May 27, 2020 at 12:30:04PM +0300, Andy Shevchenko wrote: > On Wed, May 27, 2020 at 1:00 AM Serge Semin > wrote: > > > > dtc currently doesn't support I2C_OWN_SLAVE_ADDRESS flag set in the > > i2c "reg" property. If it is the compiler will print a warni

[PATCH v4 04/11] i2c: designware: Use `-y` to build multi-object modules

2020-05-27 Thread Serge Semin
we can discard the ifeq construction in favor to the more natural and less bulky `-$(CONFIG_X) += x.o` Signed-off-by: Serge Semin Acked-by: Jarkko Nikula Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Andy Shevchenko Cc: Mika Westerberg Cc: Rob Herring Cc: linux-m...@vger.kernel.o

[PATCH v4 11/11] i2c: designware: Add Baikal-T1 System I2C support

2020-05-27 Thread Serge Semin
-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new patch, which has been created due to declining the glue-layer approach. Changelog v4: - Use PTR_ERR_OR_ZERO() helper

[PATCH v4 07/11] i2c: designware: Discard Cherry Trail model flag

2020-05-27 Thread Serge Semin
A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C bus pm_disabled workaround"), but the flag most likely by mistake has been left in the Dw I2C drivers. Let's remove it. Signed-off-by: S

[PATCH v4 09/11] i2c: designware: Retrieve quirk flags as early as possible

2020-05-27 Thread Serge Semin
let's retrieve the model flags right after the DW I2C private data is created. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - This is a new patch, which has been created

[PATCH v4 10/11] i2c: designware: Move reg-space remapping into a dedicated function

2020-05-27 Thread Serge Semin
This is a preparation patch before adding a quirk with custom registers map creation required for the Baikal-T1 System I2C support. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org

[PATCH v4 06/11] i2c: designware: Add Baytrail sem config DW I2C platform dependency

2020-05-27 Thread Serge Semin
it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the config menu will display the feature right below the DW I2C platform driver item and will indent it to the right so signifying its belonging. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogendoerfer

[PATCH v4 01/11] dt-bindings: i2c: Convert DW I2C binding to DT schema

2020-05-27 Thread Serge Semin
I2C controller or with Microsemi Ocelot SoC I2C one, to have registers, interrupts and clocks properties. In addition the node may have clock-frequency, i2c-sda-hold-time-ns, i2c-scl-falling-time-ns and i2c-sda-falling-time-ns optional properties. Signed-off-by: Serge Semin Reviewed-by: Rob Herring

[PATCH v4 08/11] i2c: designware: Convert driver to using regmap API

2020-05-27 Thread Serge Semin
stage. The rest of the code won't do this because basically we have MMIO-based regmap so non of the read/write methods can fail (this also won't be needed for the Baikal-T1-specific I2C controller). Suggested-by: Andy Shevchenko Signed-off-by: Serge Semin Tested-by: Jarkko Nikula Acked

[PATCH v4 00/11] i2c: designeware: Add Baikal-T1 System I2C support

2020-05-27 Thread Serge Semin
ext branch. - Use PTR_ERR_OR_ZERO() helper in the bt1_i2c_request_regs() and in the dw_i2c_plat_request_regs() methods. - Discard devm_platform_get_and_ioremap_resource() utilization. - Discard patch "scripts/dtc: check: Add 10bit/slave i2c reg flags support" since it must be merged in to

[PATCH v4 02/11] dt-bindings: i2c: Discard i2c-slave flag from the DW I2C example

2020-05-27 Thread Serge Semin
2/i2c@112/eeprom@64:reg: I2C address must be less than 10-bits, got "0x4064" In order to silence dtc up let's discard the flag from the DW I2C DT binding example for now. Just revert this commit when dtc is fixed. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bog

[PATCH v4 03/11] dt-bindings: i2c: dw: Add Baikal-T1 SoC I2C controller

2020-05-27 Thread Serge Semin
Add the "baikal,bt1-sys-i2c" compatible string to the DW I2C binding. Even though the corresponding node is supposed to be a child of the Baikal-T1 System Controller, its reg property is left required for compatibility. Signed-off-by: Serge Semin Cc: Alexey Malahov Cc: Thomas Bogend

[PATCH] check: Add 10bit/slave i2c reg flags support

2020-05-27 Thread Serge Semin
-bit address is expected in the "reg"-property. If I2C_TEN_BIT_ADDRESS is set, then the 10-bit address check will be performed. The I2C_OWN_SLAVE_ADDRESS flag will be just ignored. [1] kernel/Documentation/i2c/slave-interface.rst [2] kernel/include/dt-bindings/i2c/i2c.h Signed-off-by: Serge Semin Cc: Alexe

[PATCH v5 01/16] spi: dw: Set xfer effective_speed_hz

2020-05-28 Thread Serge Semin
. By doing so the core will be able to execute the xfer-related delays with better accuracy. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-m

[PATCH v5 02/16] spi: dw: Return any value retrieved from the dma_transfer callback

2020-05-28 Thread Serge Semin
transactions are finished, but there is still data left in the SPI Tx/Rx buffers. But for now make dma_transfer to return 1 as the normal dw_spi_transfer_one() method. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy

[PATCH v5 11/16] spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI

2020-05-28 Thread Serge Semin
. Especially seeing that we don't use anything DW DMAC specific in the new driver. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas

[PATCH v5 09/16] spi: dw: Add core suffix to the DW APB SSI core source file

2020-05-28 Thread Serge Semin
Generic DMA support is going to be part of the DW APB SSI core object. In order to preserve the kernel loadable module name as spi-dw.ko, let's add the "-core" suffix to the object with generic DW APB SSI code and build it into the target spi-dw.ko driver. Signed-off-by: Serge Semin

[PATCH v5 04/16] spi: dw: Add SPI Tx-done wait method to DMA-based transfer

2020-05-28 Thread Serge Semin
pport") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.

[PATCH v5 06/16] spi: dw: Parameterize the DMA Rx/Tx burst length

2020-05-28 Thread Serge Semin
-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - Discard the dws->fifo_len utilizat

[PATCH v5 00/16] spi: dw: Add generic DW DMA controller support

2020-05-28 Thread Serge Semin
e effective_speed_hz initialized. - Rx-wait for a delay correlated with the APB/SSI synchronous clock rate instead of using the SPI bus clock rate. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin

[PATCH v5 12/16] spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core

2020-05-28 Thread Serge Semin
Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- drivers/spi/Kconfig | 9 ++--- 1 file changed

[PATCH v5 03/16] spi: dw: Locally wait for the DMA transactions completion

2020-05-28 Thread Serge Semin
these callbacks might be executed in the tasklet context (and they will be in case of the DW DMA). In case of slow SPI bus it can cause significant system performance drop. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc

[PATCH v5 15/16] spi: dw: Use regset32 DebugFS method to create regdump file

2020-05-28 Thread Serge Semin
DebugFS kernel interface provides a dedicated method to create the registers dump file. Use it instead of creating a generic DebugFS file with manually written read callback function. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey

[PATCH v5 13/16] spi: dw: Cleanup generic DW DMA code namings

2020-05-28 Thread Serge Semin
Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Leave the DMA setup method suffixes

[PATCH v5 08/16] spi: dw: Fix Rx-only DMA transfers

2020-05-28 Thread Serge Semin
the SPI_CONTROLLER_MUST_TX flag for DMA-capable platform. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org

[PATCH v5 07/16] spi: dw: Use DMA max burst to set the request thresholds

2020-05-28 Thread Serge Semin
level to be of FIFO depth minus the maximum burst transactions length. To prevent the Rx buffer underflow the DMA Rx level should be set to the maximum burst transactions length. This commit setups the DMA channels and the DW SPI DMA Tx/Rx levels in accordance with these rules. Signed-off-by: Serge

[PATCH v5 14/16] spi: dw: Add DMA support to the DW SPI MMIO driver

2020-05-28 Thread Serge Semin
for generic "snps,dw-apb-ssi" and "snps,dwc-ssi-1.01a" devices. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfe

[PATCH v5 10/16] spi: dw: Move Non-DMA code to the DW PCIe-SPI driver

2020-05-28 Thread Serge Semin
Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Compile the DW SPI DMA module into the DW APB SSI core

[PATCH v5 16/16] dt-bindings: spi: Convert DW SPI binding to DT schema

2020-05-28 Thread Serge Semin
, DMA and slave device sub-nodes are optional. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Feng Tang Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: linux-m...@vger.kernel.org --- .../bindings/spi/snps,dw-apb

[PATCH v5 05/16] spi: dw: Add SPI Rx-done wait method to DMA-based transfer

2020-05-28 Thread Serge Semin
of doing their duties. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: R

Re: [PATCH v5 03/16] spi: dw: Locally wait for the DMA transactions completion

2020-05-29 Thread Serge Semin
On Fri, May 29, 2020 at 10:55:32AM +0300, Andy Shevchenko wrote: > On Fri, May 29, 2020 at 7:02 AM Serge Semin > wrote: > > > > Even if DMA transactions are finished it doesn't mean that the SPI > > transfers are also completed. It's specifically concerns the Tx-only

Re: [PATCH v5 01/16] spi: dw: Set xfer effective_speed_hz

2020-05-29 Thread Serge Semin
On Fri, May 29, 2020 at 11:49:12AM +0300, Sergei Shtylyov wrote: > Hello! > > On 29.05.2020 6:58, Serge Semin wrote: > > > Seeing DW APB SSI controller doesn't support setting the exactly > > requested SPI bus frequency, but only a rounded frequency determined > >

Re: [PATCH v5 03/16] spi: dw: Locally wait for the DMA transactions completion

2020-05-29 Thread Serge Semin
On Fri, May 29, 2020 at 12:26:10PM +0300, Andy Shevchenko wrote: > On Fri, May 29, 2020 at 11:12:04AM +0300, Serge Semin wrote: > > On Fri, May 29, 2020 at 10:55:32AM +0300, Andy Shevchenko wrote: > > > On Fri, May 29, 2020 at 7:02 AM Serge Semin > > > wrote:

Re: [PATCH v5 05/16] spi: dw: Add SPI Rx-done wait method to DMA-based transfer

2020-05-29 Thread Serge Semin
On Fri, May 29, 2020 at 12:46:48PM +0300, Andy Shevchenko wrote: > On Fri, May 29, 2020 at 06:59:03AM +0300, Serge Semin wrote: > > Having any data left in the Rx FIFO after the DMA engine claimed it has > > finished all DMA transactions is an abnormal situation, since the DW SPI

Re: [PATCH v4 09/11] dmaengine: dw: Initialize min_burst capability

2020-05-29 Thread Serge Semin
On Fri, May 29, 2020 at 01:29:02PM +0300, Andy Shevchenko wrote: > On Fri, May 29, 2020 at 01:25:15PM +0300, Andy Shevchenko wrote: > > On Fri, May 29, 2020 at 01:23:59AM +0300, Serge Semin wrote: > > > According to the DW APB DMAC data book the minimum burst transaction > >

Re: [PATCH v4 09/11] dmaengine: dw: Initialize min_burst capability

2020-05-29 Thread Serge Semin
On Fri, May 29, 2020 at 01:50:09PM +0300, Andy Shevchenko wrote: > On Fri, May 29, 2020 at 01:41:19PM +0300, Serge Semin wrote: > > On Fri, May 29, 2020 at 01:29:02PM +0300, Andy Shevchenko wrote: > > > On Fri, May 29, 2020 at 01:25:15PM +0300, Andy Shevchenko wrote: > >

[PATCH v6 07/16] spi: dw: Use DMA max burst to set the request thresholds

2020-05-29 Thread Serge Semin
level to be of FIFO depth minus the maximum burst transactions length. To prevent the Rx buffer underflow the DMA Rx level should be set to the maximum burst transactions length. This commit setups the DMA channels and the DW SPI DMA Tx/Rx levels in accordance with these rules. Signed-off-by: Serge

[PATCH v6 03/16] spi: dw: Locally wait for the DMA transfers completion

2020-05-29 Thread Serge Semin
with zero returned signalling to the SPI core that the SPI transfer is finished. This implementation is fully equivalent to the currently used DMA-execution-SPI-core-wait algorithm. The SPI-bus transmission/reception wait methods will be added in the follow-up commits. Signed-off-by: Serge Semin Cc

[PATCH v6 09/16] spi: dw: Add core suffix to the DW APB SSI core source file

2020-05-29 Thread Serge Semin
Generic DMA support is going to be part of the DW APB SSI core object. In order to preserve the kernel loadable module name as spi-dw.ko, let's add the "-core" suffix to the object with generic DW APB SSI code and build it into the target spi-dw.ko driver. Signed-off-by: Serge Semin

[PATCH v6 01/16] spi: dw: Set xfer effective_speed_hz

2020-05-29 Thread Serge Semin
. By doing so the core will be able to execute the xfer-related delays with better accuracy. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Andy Shevchenko Cc: Rob Herring Cc: linux-m

[PATCH v6 05/16] spi: dw: Add SPI Rx-done wait method to DMA-based transfer

2020-05-29 Thread Serge Semin
at some point of doing their duties. Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Fen

[PATCH v6 10/16] spi: dw: Move Non-DMA code to the DW PCIe-SPI driver

2020-05-29 Thread Serge Semin
Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Compile the DW SPI DMA module into the DW APB SSI core

[PATCH v6 14/16] spi: dw: Add DMA support to the DW SPI MMIO driver

2020-05-29 Thread Serge Semin
for generic "snps,dw-apb-ssi" and "snps,dwc-ssi-1.01a" devices. Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Co-developed-by: Ramil Zaripov Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfe

[PATCH v6 12/16] spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core

2020-05-29 Thread Serge Semin
Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- drivers/spi/Kconfig | 9 ++--- 1 file changed

[PATCH v6 04/16] spi: dw: Add SPI Tx-done wait method to DMA-based transfer

2020-05-29 Thread Serge Semin
pport") Co-developed-by: Georgy Vlasov Signed-off-by: Georgy Vlasov Signed-off-by: Serge Semin Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Andy Shevchenko Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.

[PATCH v6 02/16] spi: dw: Return any value retrieved from the dma_transfer callback

2020-05-29 Thread Serge Semin
procedure. This will be needed to fix the problem when DMA transactions are finished, but there is still data left in the SPI Tx/Rx FIFOs being sent/received. But for now make dma_transfer to return 1 as the normal dw_spi_transfer_one() method. Signed-off-by: Serge Semin Cc: Georgy Vlasov Cc: Ramil

[PATCH v6 16/16] dt-bindings: spi: Convert DW SPI binding to DT schema

2020-05-29 Thread Serge Semin
, DMA and slave device sub-nodes are optional. Signed-off-by: Serge Semin Reviewed-by: Rob Herring Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Feng Tang Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: linux-m...@vger.kernel.org --- .../bindings/spi/snps,dw-apb

[PATCH v6 06/16] spi: dw: Parameterize the DMA Rx/Tx burst length

2020-05-29 Thread Serge Semin
-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v3: - Discard the dws->fifo_len utilizat

[PATCH v6 13/16] spi: dw: Cleanup generic DW DMA code namings

2020-05-29 Thread Serge Semin
Signed-off-by: Ramil Zaripov Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-m...@vger.kernel.org Cc: devicet...@vger.kernel.org --- Changelog v2: - Leave the DMA setup method suffixes

<    7   8   9   10   11   12   13   14   15   16   >