Page MenuHomeFreeBSD

rk805: add system poweroff support
ClosedPublic

Authored by avg on Jun 16 2021, 10:49 AM.
Tags
None
Referenced Files
F81679466: D30786.id98136.diff
Fri, Apr 19, 8:09 PM
Unknown Object (File)
Thu, Apr 18, 5:17 AM
Unknown Object (File)
Thu, Apr 18, 5:16 AM
Unknown Object (File)
Wed, Apr 17, 6:33 PM
Unknown Object (File)
Wed, Apr 17, 4:34 PM
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

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
859

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

861

shutdown or power off here?

868

and you don't need two sets of elipses.

939

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

sys/arm64/rockchip/rk805.c
859

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

861

Both should mean the same in this context.

868

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

939

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
861

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.

868

true. You can ignore this.

939

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.