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)
Wed, Jan 14, 1:15 PM
Unknown Object (File)
Wed, Jan 14, 12:39 PM
Unknown Object (File)
Wed, Jan 14, 12:39 PM
Unknown Object (File)
Wed, Jan 14, 11:38 AM
Unknown Object (File)
Mon, Jan 12, 10:55 AM
Unknown Object (File)
Sat, Jan 10, 9:46 PM
Unknown Object (File)
Sat, Dec 27, 2:57 AM
Unknown Object (File)
Nov 29 2025, 12:30 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 Skipped
Unit
Tests Skipped

Event Timeline

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

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
82

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.

103–104

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
64

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

82

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.

103–104

Right, unnecessary, replaced it with a constant.

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