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
Unknown Object (File)
Sun, Apr 28, 3:14 PM
Unknown Object (File)
Sun, Apr 28, 3:13 PM
Unknown Object (File)
Sat, Apr 27, 1:16 PM
Unknown Object (File)
Sat, Apr 27, 1:16 PM
Unknown Object (File)
Sat, Apr 27, 1:15 PM
Unknown Object (File)
Sat, Apr 27, 1:15 PM
Unknown Object (File)
Mar 16 2024, 3:45 AM
Unknown Object (File)
Mar 8 2024, 9:58 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.