Skip to content

SPI API cleanup and update #5921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 52 commits into from
Apr 4, 2018

Conversation

tbursztyka
Copy link
Collaborator

@tbursztyka tbursztyka commented Jan 31, 2018

Please review

The patch-set disables the legacy api by default, applies the feedback and then move most of the code using legacy API to the new API.

Some other patch might come still, (esp ethernet stuff for instance) but it's worth reviewing the patches already.

@tbursztyka tbursztyka requested a review from jukkar as a code owner January 31, 2018 11:03
@carlescufi carlescufi requested a review from anangl January 31, 2018 11:16
@carlescufi
Copy link
Member

Sorry @tbursztyka I assigned before I read :) @anangl please don't review yet

@codecov-io
Copy link

codecov-io commented Jan 31, 2018

Codecov Report

Merging #5921 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5921   +/-   ##
=======================================
  Coverage   54.99%   54.99%           
=======================================
  Files         456      456           
  Lines       43842    43842           
  Branches     8225     8225           
=======================================
  Hits        24112    24112           
  Misses      16386    16386           
  Partials     3344     3344

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efa3a13...f104fad. Read the comment docs.

@tbursztyka
Copy link
Collaborator Author

@carlescufi no problem, a lot more commits are coming, so reviewer list will be long then.

@locomuco
Copy link
Contributor

@tbursztyka this one might be related, just in case...
#662

@tbursztyka
Copy link
Collaborator Author

@locomuco yes, good point, I'll backport it

@vanwinkeljan
Copy link
Member

@tbursztyka fyi (rfc) pull request #5670 takes care of moving nrf52 master spi to new API

@tbursztyka tbursztyka force-pushed the spi_api_rework branch 6 times, most recently from c1ff5c0 to 11a1368 Compare February 1, 2018 10:24
Tomasz Bursztyka and others added 22 commits April 4, 2018 16:49
As QMSI driver does not support new SPI API.

Signed-off-by: Tomasz Bursztyka <[email protected]>
As QMSI driver does not support new SPI API.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Native DW driver is relevantly used instead.

Signed-off-by: Tomasz Bursztyka <[email protected]>
These now support the new API through SPI DW native driver.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Ditch any legacy API support altogether.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Adds support for the new spi api to the mcux dspi shim driver. Does not
remove support for the legacy spi api since there are still consumers of
that api, particularly the mcr20a 802.15.4 driver.

Signed-off-by: Maureen Helm <[email protected]>
Adds a board-specific configuration for the frdm_k64f to the
spi_loopback test.

Signed-off-by: Maureen Helm <[email protected]>
And adding support for GPIO CS as well.
It looks like the driver could benefit from centralizing all SPI access
into a unique function, the protocol does not seem too convoluted to do
so, like CC2520 or CC1200.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Now that MCR20A supports the new API, legacy support from mcux dspi
driver can be safely removed.

Signed-off-by: Tomasz Bursztyka <[email protected]>
This adds a translation layer to make the nrfx driver for the legacy
(i.e. without EasyDMA) nRF SPI peripheral accessible via the updated
Zephyr's API of the SPI driver.
Configuration files are already prepared for adding support for SPIM
(Master with EasyDMA) and SPIS (Slave with EasyDMA) peripherals.

Signed-off-by: Andrzej Głąbek <[email protected]>
This adds to the spi_loopback test board-specific configurations
for the following boards:
- nrf51_pca10028
- nrf52_pca10040
- nrf52840_pca10056

Signed-off-by: Andrzej Głąbek <[email protected]>
It involves a minor change on which register is configured.
Most of the change is with threshold handling.
Handling the Kconfig based supported mode per-port.

Signed-off-by: Tomasz Bursztyka <[email protected]>
This port is a slave SPI port only.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Quark SE provides a slave SPI.

Signed-off-by: Tomasz Bursztyka <[email protected]>
No need to test it twice then in completed().

Signed-off-by: Tomasz Bursztyka <[email protected]>
No need to check on busy bit from hardware.

Signed-off-by: Tomasz Bursztyka <[email protected]>
SPI API is reentrant.

Signed-off-by: Tomasz Bursztyka <[email protected]>
SPI API is reentrant.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Removing old API usage.

Signed-off-by: Tomasz Bursztyka <[email protected]>
As legacy SPI API is being removed.

Signed-off-by: Tomasz Bursztyka <[email protected]>
No drivers nor samples are using it anymore.

Signed-off-by: Tomasz Bursztyka <[email protected]>
Unlike master mode which will always return 0 on success.

Signed-off-by: Tomasz Bursztyka <[email protected]>
@carlescufi carlescufi merged commit f1ae940 into zephyrproject-rtos:master Apr 4, 2018
@tbursztyka tbursztyka mentioned this pull request Apr 5, 2018
@tbursztyka tbursztyka deleted the spi_api_rework branch May 4, 2018 11:23
carlescufi pushed a commit that referenced this pull request Jun 22, 2022
The value of CONFIG_SYS_CLOCK_TICKS_PER_SEC has side-effects that
are not expected with tickless kernel mode. In bug #46378, application
code is shown to run slower with higher sys clock tick value. In SOF
bug #5921, audio quality issues were root-caused to k_timer inaccuracy
with 50000 sys clock tick.

Set the the value to 15000 for all SOF applications. All existing
test cases pass with this value.

BugLink: #46378
BugLink: thesofproject/sof#5921
Signed-off-by: Kai Vehmanen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: SPI SPI bus
Projects
None yet
Development

Successfully merging this pull request may close these issues.