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)
Tue, Nov 19, 2:34 PM
Unknown Object (File)
Wed, Nov 13, 7:58 PM
Unknown Object (File)
Wed, Nov 13, 7:51 PM
Unknown Object (File)
Tue, Nov 12, 12:12 AM
Unknown Object (File)
Oct 6 2024, 1:40 PM
Unknown Object (File)
Oct 6 2024, 7:19 AM
Unknown Object (File)
Oct 3 2024, 9:40 AM
Unknown Object (File)
Oct 1 2024, 1:31 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 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
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.

945

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.

945

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.

945

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.