Page MenuHomeFreeBSD

Add support for spi flash on SiFive Unmatched.
ClosedPublic

Authored by skibo on Aug 16 2021, 4:25 PM.
Tags
None
Referenced Files
F103042589: D31562.diff
Wed, Nov 20, 4:39 AM
Unknown Object (File)
Tue, Oct 29, 8:56 PM
Unknown Object (File)
Oct 8 2024, 4:41 PM
Unknown Object (File)
Sep 22 2024, 10:19 PM
Unknown Object (File)
Sep 10 2024, 12:56 AM
Unknown Object (File)
Sep 8 2024, 8:56 AM
Unknown Object (File)
Sep 5 2024, 10:58 AM
Unknown Object (File)
Sep 3 2024, 11:20 PM

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41106
Build 37995: arc lint + arc unit

Event Timeline

skibo requested review of this revision.Aug 16 2021, 4:25 PM
  • Enable 4-byte addressing for is25wp256 flash.
sys/riscv/conf/GENERIC
156 ↗(On Diff #93762)

I'm thinking maybe this should not be in GENERIC and we can use a module.

sys/dev/flash/mx25l.c
157

Maybe belongs in a separate commit? Not overly fussed though.

sys/riscv/conf/GENERIC
156 ↗(On Diff #93762)

Yeah, and with proper PNP info for mx25l you could even autoload it, though it might be better to *not* do that and force people to load it when they want to use it, safer against people accidentally trashing their flash... definitely doesn't need to be in GENERIC though.

sys/riscv/sifive/sifive_spi.c
234

Ah is this missing case why kldload mx25l was giving 0xff for everything? I tried it and put it on the backburner behind getting the existing patches upstreamed when I saw that, didn't dig any further.

235

Return EINVAL?

sys/riscv/conf/GENERIC
156 ↗(On Diff #93762)

I'm not sure why it doesn't autoload but I'm happy to just manually load it or put a line loader.conf when I need it.

sys/riscv/sifive/sifive_spi.c
234

Yes. I was getting ff ffff for the device ID. It's dumb luck that I figured it out. I printf'ed everything and the uninitialized value of sckmode happened to be 2 which is a valid value for the mode register. Only later did I notice that mode was 0.

  • Address revision feedback.

EDIT: Backed out mx25l from GENERIC kernel. Return EINVAL for invalid values of mode.

This revision is now accepted and ready to land.Aug 24 2021, 2:07 PM

Please elaborate on "Fix a bug in sifive_spi.c." when committing, and please mark for MFC (I have yet to do the big batch of MFCs for the other commits to stable/13 but will get round to it soon).

Please elaborate on "Fix a bug in sifive_spi.c." when committing, and please mark for MFC (I have yet to do the big batch of MFCs for the other commits to stable/13 but will get round to it soon).

How about "Add missing case for SPIBUS_MODE_NONE to sifive_spi.c" and "Add support for IS25WP256D flash memory to mx25l.c" in separate commits if you wish? I am not a committer so I can't do it. Thanks.