Commit graph

19 commits

Author SHA1 Message Date
Zhiqiang Tu
1bf695251f spi: spi_qsd: add boot marker
Add boot marker for booting KPI measurement

Change-Id: I8ba79f1b0e71e662ad20fcded128d43363e8302f
Signed-off-by: Zhiqiang Tu <ztu@codeaurora.org>
2018-05-31 23:50:03 -07:00
Alok Chauhan
363bbeba93 spi: spi_qsd: Correct SPI slave hw init sequence
While configuring QUP in SPI slave mode, an internal
HW signal needs to propagate from AHB clock domain
to SPI core  clock domain. To make sure a safe and
correct propagation of this signal the software should
perform the SPI HW init sequence in proper order.

Change-Id: Ied621bb5d1ba793ce48c5a6a0f6be3b86b3a6773
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
2018-01-31 11:54:13 +05:30
Dilip Kota
4938bb02a8 spi_qsd: Add sysfs entry for QUP state
QUP state entry exposes the state of the SPI QUP
hardware. It tells whether SPI QUP is in run state,
pause state or reset state.

Change-Id: Idc012a30f78846ff5b4c6da20adcf68a7cd2b4d3
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2018-01-30 14:54:29 +05:30
Dilip Kota
4ac5f8ab03 spi_qsd: Reset SPI core for transaction failure
Reset SPI core for transaction failure.
Remove the code configuring IO_CONTROL register
for SPI slave.

Change-Id: I3819269a9f2b7815ccfaf96713943eb04b36e137
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2018-01-30 14:10:07 +05:30
Dilip Kota
7dd15c2403 spi: spi_qsd: Poll for valid state after software Reset
For SPI slave, software reset performs long pulse
reset. Software should wait for QUP to be in valid
state before doing operations on QUP.

Change-Id: Ifbed295df87a6c5c383cedb431b368b3dffca676
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2017-12-14 20:41:51 +05:30
Dilip Kota
200011cad3 spi: spi_qsd: Add slave support for QUP core
The QUP core can be programmed to operate as an SPI slave. This
change modifies the existing SPI master driver and adds the slave
functionality.

Change-Id: I73189339956e0fd52449391737fb1e616a6e0bb2
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2017-11-23 17:00:38 +05:30
Mukesh Kumar Savaliya
914700383f spi: spi_qsd: Prevent deadlock while runtime pm is disabled
Do not call runtime suspend forcefully while holding the mutex as runtime
suspend also tries to acquire the same mutex. Instead acquire it properly
with the condition of runtime_pm enablement status without mutex.

Change-Id: I2347820e81ded0821e6f56a415af3bed17a951b4
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2017-08-28 14:49:07 +05:30
Mukesh Kumar Savaliya
61b9e193aa spi: spi_qsd: serve set_cs call only for valid device status
when set_cs() is called by framework, first check the device suspend
status and if not suspended then proceed for register access. Let system
suspend call SPI runtime suspend but make sure set_cs doesn't race with
it by holding the mutex.

Change-Id: Id6d05ac37227bf3358438eeedf279ddd1c9aab8b
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2017-06-29 15:50:38 +05:30
Mukesh Kumar Savaliya
bf1e13f6f7 Revert "spi: spi_qsd: Check device state during set_cs call"
This revert commit 67e815c616 ("spi: spi_qsd: Check device
state during set_cs call")

CRs Fixed: 2033878
Change-Id: I34a4564b8164230a6bd8b1ca4271c39a01d0b157
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2017-04-20 13:14:08 +05:30
Mukesh Kumar Savaliya
cbea40b0e1 spi: spi_qsd: Disable packing for unaliged non DMA mode transfers
SPI core has a characterstic that it always sends data in FIFO word size
when we compress the data and fill the FIFO. This helps to improve the
overall througput but sometimes for the data transfers which is not
aligned to FIFO Word [i.e 4] it pads extra bytes and sends out which can
mislead spi slave device.

Do not enable packing if it's a FIFO mode transfer and data size is not
aligned to FIFO word size.

Change-Id: I28f4e3e38db4b882f229c00aa54aabdc72d2c139
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2017-04-06 04:43:05 -07:00
Mukesh Kumar Savaliya
d0aa676fad spi: spi_qsd: Merge back throughput improvements done for small transfers
These changes will merge back the enhancemnts done to improve the medium
side transfers. This was reverted temporarily till the fix identified.

Change-Id: Ib7ac92ecefe7ca3ff9f03716c51dc31b8322ee33
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2017-04-06 11:35:07 +05:30
Girish Mahadevan
67e815c616 spi: spi_qsd: Check device state during set_cs call
If the set_cs() call is made when the device has suspended then don't
try to make the register writes to force cs and return back to the
framework. Also remove the runtime PM calls from set_cs, these should be
done in the prepare/unprepare_transfer_hardware calls from the framework.

Modify the prepare_transfer_hardware_call() to fail if the runtime
framework is not enabled and in addition don't try to call the runtime
suspend callbacks from the system suspend callback as this could race with
an on-going SPI transfer.

Change-Id: Idc714b1024c1f181a4db59d5552d7ab9100c511f
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2017-02-22 16:23:03 -07:00
Linux Build Service Account
4ebfafd8ee Merge "spi: spi_qsd: Set DMA mask for SPI device" 2017-02-15 17:00:59 -08:00
Girish Mahadevan
f61d2a9a02 spi: spi_qsd: Set DMA mask for SPI device
Set the DMA mask for the SPI device appropriately.

This will alleviate usage of bounce buffers by the dma kernel library and
prevent some of the crashes due to the kernel running out of bounce
buffers.

Change-Id: I7b0b123be6e7bb1e30d0755ca8b1b72ea4e2b5f6
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2017-02-14 10:34:47 -07:00
Karthikeyan Ramasubramanian
45c883260a spi: spi_qsd: Use the right device for dma_unmap_single operation
The unmap operation of a dma bounce buffer is performed using an incorrect
device compared to the map operation. This leads to a leaked bounce buffer
dma map.

Fix the device usage during the unmap operation.

CRs-Fixed: 1104864
Change-Id: I7da2484ce1f070a4545b9110e3602b4f39d7afdc
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
2017-02-09 17:00:23 -07:00
Mukesh Kumar Savaliya
1ab10b3000 spi: spi_qsd: Revert latency improvement changes done for small transfers
Reverting the changes provided to improve small transfer rate.

Change-Id: Ifc1ae0ccbd0f991523f4715fbb1ff9951b268986
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2017-01-20 10:59:38 +05:30
Girish Mahadevan
118a4b58d1 spi: spi_qsd: Fix the register peek/poke debug feature
The spi_qsd driver allows peeking/poking registers via debugfs.

Currently a static variable is used as the user data to get to the spi
controller data structure. Unfortunately this means that the last device
to probe is always obtained.

Fix this to use a member of the spi controller data structure instead.

Change-Id: I711354941b4168f3f6ffe2d29185597bdad4da89
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2016-12-26 15:05:03 +05:30
Girish Mahadevan
2012b2e207 spi: spi_qsd: Improve latencies for small transfers
For smaller transfers when DMA mode isn't used improve the transfer
latencies by being more effecient when moving data to the hardware
FIFO especially when using bits_per_word that is less than 32. This
will reduce the number of interrupts being generated in such transfers
helping in overall transaction latency.

Change-Id: I6ddd933d4a43a4d24d7b5310a678a19411a14f2c
Signed-off-by: Mukesh Kumar Savaliya <msavaliy@codeaurora.org>
2016-12-13 17:15:23 +05:30
Girish Mahadevan
5896e48d28 spi: Add snapshot of SPI QSD driver
This change adds a snapshot of SPI QSD driver from the 3.18 branch.
kernel-3.18 baseline: e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1

Change-Id: I6e2a4be429a2681603a12e5ecb6853582cd3ffbe
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
2016-03-22 11:10:29 -07:00