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
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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
858

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

860

shutdown or power off here?

867

and you don't need two sets of elipses.

938

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

sys/arm64/rockchip/rk805.c
858

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

860

Both should mean the same in this context.

867

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

938

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
860

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.

867

true. You can ignore this.

938

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.