Page MenuHomeFreeBSD

ofw_spibus Parse spi-cpol, spi-cpha and spi-cs-high
ClosedPublic

Authored by manu on Nov 22 2016, 5:34 PM.
Tags
Referenced Files
F106680048: D8614.diff
Fri, Jan 3, 6:56 PM
F106653780: D8614.diff
Fri, Jan 3, 10:49 AM
Unknown Object (File)
Thu, Jan 2, 7:05 AM
Unknown Object (File)
Tue, Dec 31, 9:00 AM
Unknown Object (File)
Thu, Dec 12, 7:53 AM
Unknown Object (File)
Sat, Dec 7, 8:49 AM
Unknown Object (File)
Nov 26 2024, 4:28 AM
Unknown Object (File)
Nov 26 2024, 4:28 AM
Subscribers

Details

Summary

Parse OFW property for the SPI mode and CS polarity.
As cs is stored in a uint32_t, use the last bit to store the active high flag as it's unlikely that we will have that much CS.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu retitled this revision from to ofw_spibus Parse spi-cpol, spi-cpha and spi-cs-high.
manu updated this object.
manu edited the test plan for this revision. (Show Details)
manu added a reviewer: ARM.
manu set the repository for this revision to rS FreeBSD src repository - subversion.
manu added a project: ARM.
manu added a subscriber: ARM.
manu removed rS FreeBSD src repository - subversion as the repository for this revision.

Use correct define ...

It looks good to me, but I guess we need to sweep existing code to mask the result of get_spibus_cs() now ?

In D8614#179408, @loos wrote:

It looks good to me, but I guess we need to sweep existing code to mask the result of get_spibus_cs() now ?

True, I'll make a pass and add this to this review.

Mask out CS_HIGH bit from cs.

sys/arm/at91/at91_spi.c
304 ↗(On Diff #22853)

Is the parentheses necessary here ?

sys/dev/spibus/spibusvar.h
49 ↗(On Diff #22853)

I think you have to use (1U << 31) here to stay on safe side.

Remove uneeded parenthesis and specify 1U

loos added a reviewer: loos.

Thank you!

This revision is now accepted and ready to land.Dec 17 2016, 5:45 PM
This revision was automatically updated to reflect the committed changes.