Latest Linux kernel with the Ubuntu configuration. Real-time clock is enabled. LEDs are enabled. CONFIG_DEBUG_INFO is not set. Power-down and reboot are not enabled. Device tree files (.dtb) are installed in the correct directory (/lib/firmware/5.13.12/device-tree/sifive).
Those patches are in. You can enable power down by editing the file /usr/lib/modprobe.d/blacklist_linux-riscv_5.11.0-10xx-generic.conf (10xx because it will be different depending on the version of the last Ubuntu kernel that was installed) and remove the line blacklist da9063_wdt. Then add da9063_wdt to /etc/modules.
However, the power down will happen with sudo shutdown -r and not sudo shutdown.
The reboot patch is just too ugly. It’s not a soft reset. It’s actually powering down momentarily and restarting. Since the ATX power supply is also being commanded to shutdown, it’s a race to restart before the voltage sags. So sometimes it powers down all the way instead of resetting.
There’s also a side effect to these less than stellar power down routines. The NVME drive doesn’t get shut down properly. Here’s my WD Black SN750 stats. Many unsafe shutdowns (although I haven’t had any problems).
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning : 0
temperature : 43 C
available_spare : 100%
available_spare_threshold : 10%
percentage_used : 0%
endurance group critical warning summary: 0
data_units_read : 612214
data_units_written : 1761640
host_read_commands : 5812685
host_write_commands : 6242552
controller_busy_time : 45
power_cycles : 147
power_on_hours : 1915
unsafe_shutdowns : 92
media_errors : 0
num_err_log_entries : 0
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0
Thanks for the clarification. Curious what the reason behind requiring -r for shutdown is? Also whether you’re aware of more correct patches possibly being in the pipeline?
Unrelated to the above, are you aware of any steps to enable the temperature sensor? Couldn’t seem to read this with the stock Ubuntu install.
I don’t think the da9063_wdt kernel module is the correct way to power down the system. I’m guessing it just works by accident after a sudo shutdown -r.
The entire power down and reboot stuff needs to be ironed out. I’m just a hobbyist, so I don’t know what the SiFive or Ubuntu folks are up to.
As for the temperature sensor, it should work with the kernel and u-boot files I linked above. Here’s what it looks like on my system with a NVME.
While complaints about a general lack of grace are fine, I’m wondering if your description of “a race to restart before the voltage sags” is really accurate. AFAIU the process is controlled by a timer in the DA9063, which is powered by the “5VSB” rail. Which means that it gets power even when the PSU is “off”.
I’d be more worried about the voltage not sagging long enough to trigger a system reset…
Strange, but I can’t seem to read the TMP451. I carried out the steps described earlier in this thread and now running kernel 5.13.12. Here is the sensors output: