Page MenuHomeFreeBSD

rk805: add system poweroff support
ClosedPublic

Authored by avg on Jun 16 2021, 10:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 1:56 PM
Unknown Object (File)
Mar 3 2024, 12:00 PM
Unknown Object (File)
Jan 31 2024, 5:27 AM
Unknown Object (File)
Jan 27 2024, 5:40 PM
Unknown Object (File)
Dec 23 2023, 10:25 PM
Unknown Object (File)
Dec 23 2023, 3:51 AM
Unknown Object (File)
Dec 12 2023, 5:09 PM
Unknown Object (File)
Nov 27 2023, 10:19 PM

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 Passed
Unit
No Test Coverage
Build Status
Buildable 39929
Build 36818: 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
865

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

867

shutdown or power off here?

874

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
865

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

867

Both should mean the same in this context.

874

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
867

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.

874

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.