13 Sep, 2016

3 commits


22 Jun, 2016

1 commit

  • SPI core provides DMA mapping with scatterlists. Start using it instead
    of own implementation in spi-pxa2xx. Major difference in addition to
    bunch of removed boilerplate code is that SPI core does
    mapping/unmapping for all transfers in a message before and after the
    message sending where spi-pxa2xx did mapping/unmapping for each
    transfers separately.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Mark Brown

    Jarkko Nikula
     

28 Mar, 2016

3 commits

  • Dummy buffer is used for half duplex transfers that don't have TX or RX
    buffer set. Instead of own dummy buffer management here let the SPI core to
    handle it by setting the SPI_MASTER_MUST_RX and SPI_MASTER_MUST_TX flags.
    Then core makes sure both transfer buffers are set.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Mark Brown

    Jarkko Nikula
     
  • spi-pxa2xx-dma.c DMA engine implementation stopped using PIO for
    unaligned trailing bytes in the commit 111e0a9dc71e ("spi/pxa2xx: Prevent
    DMA from transferring too many bytes"). This means there is no need to
    update tx/rx transfer buffer pointers after DMA completion. These buffer
    pointers will be set to new buffers when handling the next transfer.

    Because this buffer pointer update was only remaining use for rx_map_len
    and tx_map_len members in struct driver_data after removing the legacy PXA
    DMA implementation they can be removed now.

    Signed-off-by: Jarkko Nikula
    Acked-by: Robert Jarzmik
    Signed-off-by: Mark Brown

    Jarkko Nikula
     
  • If by some reason pxa2xx_spi_dma_prepare() fails we have not to ignore its
    error. In such case we abort the transfer and return the error to upper
    level.

    Signed-off-by: Andy Shevchenko
    [Jarkko: Avoid leaking TX descriptors in case RX descriptor allocation
    fails. Noted by Robert Jarzmik .
    Unmap also buffers in case of failure.]
    Signed-off-by: Jarkko Nikula
    Acked-by: Robert Jarzmik
    Signed-off-by: Mark Brown

    Andy Shevchenko
     

04 Mar, 2016

1 commit

  • Commit b36f09c3c441 ("dmaengine: Add transfer termination
    synchronization support") marked dmaengine_terminate_all() as
    deprecated and is being replaced by explicit synchronous and asynchronous
    terminate functions.

    Here DMA termination are done in two cases: FIFO overrun and module
    removal.

    FIFO overrun is handled in interrupt context and converting
    dmaengine_terminate_all() to dmaengine_terminate_async() does the same than
    before.

    Using synchronous termination in module removal however adds a bit more
    robustness as it waits all completion callbacks have finished. Although it
    looks all known DMA engines used with spi-pxa2xx don't implement
    device_synchronize() callback so this too appears to be a no-op in
    practice.

    Signed-off-by: Jarkko Nikula
    Reviewed-by: Mika Westerberg
    Acked-by: Robert Jarzmik
    Signed-off-by: Mark Brown

    Jarkko Nikula
     

02 Oct, 2015

1 commit


23 Dec, 2014

1 commit

  • Currently SSP registers are accessed by having an own read and write macros
    for each register. For instance read_SSSR(iobase) and write_SSSR(iobase).

    In my opinion this hurts readability and requires new macros to be defined
    for each new added register. Let's define and use instead common
    pxa2xx_spi_read() and pxa2xx_spi_write() accessors.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Mark Brown

    Jarkko Nikula
     

18 Sep, 2014

1 commit

  • That field has been deprecated in favour of getting the necessary
    information from ACPI/DT.

    However, we still need to deal systems that are PCI only (no ACPI to back
    up). In order to support such systems, we allow the DMA filter function and
    its corresponding parameter via pxa2xx_spi_master platform data. Then when
    the pxa2xx_spi_dma_setup() doesn't find the channel via ACPI, it falls back
    to use the given filter function.

    Suggested-by: Arnd Bergmann
    Signed-off-by: Mika Westerberg
    Signed-off-by: Andy Shevchenko
    Acked-by: Mark Brown
    Signed-off-by: Vinod Koul

    Mika Westerberg
     

06 Jun, 2014

1 commit

  • This is to fix the SPI DMA transfer failure for speed less than 1M.
    If using current DMA burst size setting (16), the Rx data bytes are
    invalid due to each data byte is multiplied according to the burst
    size setting.

    Let's said supposedly we shall receive the following 18 bytes of data:
    01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18
    Instead, the data bytes received consist of "16 bytes of '01' +
    2 bytes of '02'" :
    01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 02 02

    Signed-off-by: Chew, Chiau Ee
    Acked-by: Mika Westerberg
    Signed-off-by: Mark Brown

    Chew, Chiau Ee
     

13 May, 2014

1 commit

  • In case we are doing DMA transfer and the size of the buffer is not multiple
    of 4 bytes the driver truncates that to 4-byte boundary and tries to handle
    remaining bytes using PIO.

    Or that is what it tried to do. What actually happens is that it calls
    ALIGN() to the buffer size which aligns it to the next 4-byte boundary
    (doesn't truncate). Doing this results 1-3 bytes extra to be transferred.
    Furthermore we handle remaining bytes using PIO which results one extra
    byte to be transferred. In worst case the driver transfers 4 extra bytes.

    While investigating this it turned out that the DMA hardware doesn't even
    have such limitation so we can solve this by dropping the code that tries
    to handle unaligned bytes.

    Reported-by: Chiau Ee Chew
    Reported-by: Hock Leong Kweh
    Signed-off-by: Mika Westerberg
    Signed-off-by: Mark Brown

    Mika Westerberg
     

03 Feb, 2014

1 commit


26 Jun, 2013

1 commit


19 Jun, 2013

1 commit


13 May, 2013

1 commit


08 Feb, 2013

1 commit

  • To be able to use DMA with this driver on non-PXA platforms we implement
    support for the generic DMA engine API. This lets user to use different DMA
    engines with little or no modification to the driver.

    Request lines and channel numbers can be passed to the driver from the
    platform specific data.

    The DMA engine implementation will be selected by default even on PXA
    platform. User can select the legacy DMA API by enabling Kconfig option
    CONFIG_SPI_PXA2XX_PXADMA.

    Signed-off-by: Mika Westerberg
    Acked-by: Linus Walleij
    Tested-by: Lu Cao
    Signed-off-by: Mark Brown

    Mika Westerberg