Page MenuHomeFreeBSD

[spibus] begin conversion of SPI transactions to spibus acquire/release semantics
Needs ReviewPublic

Authored by adrian on May 27 2016, 1:50 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This implements:

  • spibus acquire/release semantics, so SPI bus transactions can be atomic
  • sleep/wakeup in the bus acquire/release methods, so controllers don't have to implement their own serialisation (eg what bcm2835_spi does)
  • convert all the spi devices I can find over to the new semantics
  • convert some of the (simple!) spi controllers over to the new semantics

However, it doesn't yet implement all controllers, as it's not entirely
clear how to hold CS asserted for the whole transaction set.

It's quite possible that a follow up commit will be to let the controller
specify whether CS can be held across transactions or not, so potential
consumers (eg mmcspi) can decide whether the work or not.

Test Plan
  • Testing on AR9331 SoC, ned to test on others

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 3986
Build 4029: arc lint + arc unit

Event Timeline

adrian retitled this revision from to [spibus] begin conversion of SPI transactions to spibus acquire/release semantics.
adrian updated this object.
adrian edited the test plan for this revision. (Show Details)

Make the exynos5_ec spi access mirror the same behaviour as before.

I'm not sure if we can handle CS in acquire/release bus. With MMCSPI, for example, we must be able to issue some clock pulses with CS de-asserted.

interesting. pkelsey and loos apparently had mmcspi going with CS asserted during bus acquire/release, right?

I'm okay committing the acquire/release without moving the CS assertion bits in?