This patch adds support for the cvitek restart controller.
This controller is present on the Milk-V riscv SoCs.
Details
- Reviewers
br
Tested on a Milk-V Duo S board.
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
| sys/riscv/cvitek/cvitek_restart.c | ||
|---|---|---|
| 118 | Don't need to check this | |
| sys/riscv/cvitek/cvitek_restart.c | ||
|---|---|---|
| 47 | why this header is needed? | |
| sys/riscv/cvitek/cvitek_restart.c | ||
|---|---|---|
| 77 | You can't use a switch statement here; howto is a bitmask not an enum. You'll need to check each flag in an if case. Off the top of my head it is possible to have RB_HALT and RB_POWEROFF both set (and possibly other cases). | |
| sys/riscv/cvitek/cvitek_restart.c | ||
|---|---|---|
| 77 | Yes. RB_POWEROFF and RB_POWERCYCLE will never be set at the same time. | |
| sys/riscv/cvitek/cvitek_restart.c | ||
|---|---|---|
| 47 | Thanks for catching this, I've removed the stray header. | |
| 77 |
Oh, was not aware of that, thanks!
The manual is a bit vague and uses both terms interchangeably, but it appears that it does remove power. | |
| sys/riscv/cvitek/cvitek_restart.c | ||
|---|---|---|
| 103 | although this is correct, but to match style of other drivers, could we return success at the end of function unless some issue arise, i.e. cvitek_restart_probe(device_t dev)
{
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "cvitek,restart"))
return (ENXIO);
device_set_desc(dev, "Cvitek restart controller");
return (BUS_PROBE_DEFAULT); | |