intelligent-agent / Refactor

Linux distro for 3D-printers
https://wiki.iagent.no/wiki/Refactor
GNU Affero General Public License v3.0
28 stars 18 forks source link

The input stage does not disable high power domain when issuing shutdown/reboot. #214

Closed eliasbakken closed 3 years ago

eliasbakken commented 3 years ago

It seems that the AR100 firmware is still interfering with the shutdown-routine. A quick test to verify this is to disable Klipper. This will allow the board to shut down completely: systemctl disable klipper After a reboot: shutdown now The board should go completely black.

eliasbakken commented 3 years ago

It seem that the problem might be related to some shared resources between ATF and ar100.bin. If the file is exchanged with a blank file of the same size, there is no issue, but using the ar100.bin we have now, the shutdown does not work. Worth noticing is that halt does not completely turn off the board like shutdown now does.

eliasbakken commented 3 years ago

The problem seems to be related to setting the AR100 clock rate. Commenting that out in the AR100 code seems to make the shutdown routine work again. This is consistent with the documenation in crust: https://github.com/crust-firmware/crust/blob/master/docs/abi.md r_prcm_set_cpus_clk_rate(PLL_PERIPH);

eliasbakken commented 3 years ago

A possible workaround is to flash a file that will reset the AR100 clock to 24 MHz. This can be a separate binary that is flashed in the same way as the original binary, but as a ExecStopPost action in the service file.

eliasbakken commented 3 years ago

Merged to master with PR#220