Page MenuHomeFreeBSD

Update OpenCores i2c driver for SiFive Unmatched.
ClosedPublic

Authored by skibo on Oct 29 2021, 5:44 PM.
Tags
None
Referenced Files
F132253504: D32737.id97784.diff
Wed, Oct 15, 5:33 AM
F132253502: D32737.id97679.diff
Wed, Oct 15, 5:33 AM
F132253501: D32737.id.diff
Wed, Oct 15, 5:33 AM
F132253493: D32737.id97754.diff
Wed, Oct 15, 5:33 AM
Unknown Object (File)
Tue, Oct 14, 7:52 PM
Unknown Object (File)
Mon, Oct 13, 1:18 AM
Unknown Object (File)
Sat, Sep 20, 3:07 PM
Unknown Object (File)
Sep 11 2025, 6:49 AM

Details

Summary
  • Add compatibility strings for Unmatched.
  • Add support for building driver as a module.
  • Fix repeated start.
Test Plan

Testing on a SiFive Unmatched.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

skibo requested review of this revision.Oct 29 2021, 5:44 PM
jrtc27 added inline comments.
sys/dev/iicbus/iicoc.c
152 ↗(On Diff #97679)

Use bool

sys/dev/iicbus/iicoc_fdt.c
59

sifive,i2c0? Until devmatch is able to see secondary compatible strings in the device tree, the SoC-specific compats need to be here if you want the module to be auto-loaded (though maybe this will want to just be compiled into the GENERIC kernel?), but we should still have the generic one too.

sys/modules/i2c/controllers/Makefile
8 ↗(On Diff #97679)

Does this need to be limited to RISC-V? The IP isn't tied to a specific core, unlike imcsmb which is Intel's.

sys/modules/i2c/controllers/iicoc/Makefile
1 ↗(On Diff #97679)

I don't think we're adding this for new files?

  • Address review feed-back on iicoc driver.
skibo added inline comments.
sys/dev/iicbus/iicoc_fdt.c
59

I was on the fence between putting this in GENERIC or creating a module. But now I'm leaning towards putting it in GENERIC. I would also be inclined to drop the module if we did that. What do you think?

sys/modules/i2c/controllers/Makefile
8 ↗(On Diff #97679)

The core is definitely not riscv specific but I thought it would save resources to only build it for riscv. If it shows up in other architectures, we can change it later.

philip added a subscriber: philip.

Looks good to me. Thanks!

I think this is fine in GENERIC. I would prefer this to a module.

This revision is now accepted and ready to land.Oct 31 2021, 10:51 AM