Page MenuHomeFreeBSD

riscv: Add driver for the cvitek reset controller
ClosedPublic

Authored by bnovkov on Jan 20 2025, 6:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 17, 2:08 AM
Unknown Object (File)
Sun, Oct 12, 6:26 PM
Unknown Object (File)
Thu, Oct 9, 9:13 PM
Unknown Object (File)
Mon, Oct 6, 8:23 AM
Unknown Object (File)
Fri, Oct 3, 6:49 PM
Unknown Object (File)
Fri, Oct 3, 6:48 AM
Unknown Object (File)
Fri, Oct 3, 1:55 AM
Unknown Object (File)
Wed, Oct 1, 12:38 AM
Subscribers

Details

Summary

This patch adds support for the cvitek reset controller.
This controller is present on the Milk-V riscv SoCs. The controller is
currently used by the if_dwc driver.

Diff Detail

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

Event Timeline

imp added inline comments.
sys/riscv/cvitek/cvitek_reset.c
65

If we use a table, then we can make this a module that's automatically loaded by the loader when it finds it in the FDT.
Though if it's not a module, this is fine for now.

This revision is now accepted and ready to land.Jan 20 2025, 6:34 PM
jrtc27 added inline comments.
sys/riscv/cvitek/cvitek_reset.c
83

Uh, who knows what this is going to pick up... surely there's a phandle reference? That's how this normally works... that or it's a child of the syscon.

104–105

By definition these are both just 32? Don't see what benefit the calculation gives when it's already hard-coded in the type name.

bnovkov marked 2 inline comments as done.

Address @jrtc27 's comments.

This revision now requires review to proceed.Jan 21 2025, 7:09 PM
sys/riscv/cvitek/cvitek_reset.c
65

It is not a module for now, but I'll bear this in mind, thanks!

83

yeah, this was an issue in other places as well, I've rearranged the dts to include a syscon phandle and updated the code accordingly.

104–105

Right, unnecessary, replaced it with a constant.

This revision is now accepted and ready to land.Jan 30 2025, 8:35 AM