Page MenuHomeFreeBSD

rk805: add system poweroff support
ClosedPublic

Authored by avg on Jun 16 2021, 10:49 AM.

Details

Summary

On my Rock64 neither EFI nor PSCI shutdown actually power off the board.
RK805 does the job.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 39944
Build 36833: arc lint + arc unit

Event Timeline

avg requested review of this revision.Jun 16 2021, 10:49 AM
avg added reviewers: peterj, bz. avg added 1 blocking reviewer(s): manu.Jun 16 2021, 10:51 AM

It's also compatible with rk808 so perfect.

This revision is now accepted and ready to land.Jun 16 2021, 2:02 PM
sys/arm64/rockchip/rk805.c
864

This cast isn't needed, and could be combined with the device_t dev declaration above.

866

shutdown or power off here?

873

and you don't need two sets of elipses.

944

Why override? Is there some advantage to not trying those methods first?

sys/arm64/rockchip/rk805.c
864

I just copied the predominant style in the file.
But I agree.

866

Both should mean the same in this context.

873

But this is printed (if printed at all) on a separate line.

944

Yes. See the summary / commit message.
Maybe it's not entirely clear, but both of those methods not only fail to power off, but they also get stuck until the software watchdog panic-s the system (or invokes ddb).

sys/arm64/rockchip/rk805.c
866

Except all the other power-off functions in the system say 'power off' because 'shutdown' often means 'while(1);' or similar loop at the end, at least historically.

873

true. You can ignore this.

944

Add add that here explicitly. It's important enough to not be buried in the commit message, I'd think.

address reviews for rk805 poweroff support

Also, rename the shutdown function to poweroff so that it is not
confused with the device_shutdown method.
Always print the "powering off" message (liberate from bootverbose).
If the code still runs after issuing the power-off command then it
failed regardless of whether we had any errors or not.

This revision now requires review to proceed.Jun 17 2021, 7:05 AM
This revision is now accepted and ready to land.Jun 17 2021, 8:00 AM

Works nice on my RockPro64 board. Thanks!

This revision was automatically updated to reflect the committed changes.