andreiw / RaspberryPiPkg

DEPRECATED - DO NOT USE | Go here instead ->
https://github.com/tianocore/edk2-platforms/tree/master/Platform/RaspberryPi/RPi3
744 stars 143 forks source link

Power Problem. #42

Closed aiminickwong closed 5 years ago

aiminickwong commented 5 years ago

I found a problem, when shutdown the system or command "init 0" , system will stoped . It's looks like system level has shutdown ,but soon a later system will be auto start, I don't know why , may be it's a issue.

andreiw commented 5 years ago

not an issue, expected behavior on all Pies

A

On Jun 25, 2018, at 9:59 AM, aiminick notifications@github.com wrote:

I found a problem, when shutdown the system or command "init 0" , system will stoped . It's looks like system level has shutdown ,but soon a later system will be auto start, I don't know why , may be it's a issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

aiminickwong commented 5 years ago

@andreiw how to change it to soft power off (not cut down the electricity, just shutdown system and system will not auto start again, not really shutdown the electricity)? in normal mode not efi it comes system stop and not "auto restart" Normally, after we shut down the system, pi will not boot automatically unless power is turned on again after the power is turned off.

andreiw commented 5 years ago

right now there’s no way

Low prio work but I’ll get it done eventually

aiminickwong commented 5 years ago

@andreiw expect! When you done this , this firmware will be perfect!

satmandu commented 5 years ago

I think there is an interesting difference here between what the standard booted images do compared to what an image booted through Tiano Core does. With the standard booted images, doing a powerdown will not power cycle or soft-reset. With Tiano Core, halting does power cycle (or is it a soft-reset?)

(Am I wrong here?) This behavior is expected, so much so that there's provision for adding a soft-reset switch by jumping the P6 header as per here (apparently this was added in rev 2 of the original pi and has carried forward to newer versions.)

https://raspi.tv/2012/making-a-reset-switch-for-your-rev-2-raspberry-pi

It's nice to be able to tell the system to shutdown, so you can remove power or swap an SD card without risking corruption, especially for headless systems. Otherwise you have to time the shutdown command with pulling power as soon as the system has started to power cycle come back up.

Tl;DR: Expected behavior on sending shutdown is to shift the pi into a low power mode which can only be recovered from via power cycle or shorting header P6. With Tiano Core sending shutdown appears to end in a warm-reset.

andreiw commented 5 years ago

Quick workaround: use “halt” instead of “poweroff”.

I don’t disagree with you, I’ll have a fix eventually, but I do think it’s Linux that should cope with PSCI POWER_OFF failing by halting instead. Sigh.

A

On Jul 6, 2018, at 10:55 AM, satmandu notifications@github.com wrote:

I think there is an interesting difference here between what the standard booted images do compared to what an image booted through Tiano Core does. With the standard booted images, doing a powerdown will not power cycle or soft-reset. With Tiano Core, halting does power cycle (or is it a soft-reset?)

(Am I wrong here?) This behavior is expected, so much so that there's provision for adding a soft-reset switch by jumping the P6 header as per here (apparently this was added in rev 2 of the original pi and has carried forward to newer versions.)

https://raspi.tv/2012/making-a-reset-switch-for-your-rev-2-raspberry-pi

It's nice to be able to tell the system to shutdown, so you can remove power or swap an SD card without risking corruption, especially for headless systems. Otherwise you have to time the shutdown command with pulling power as soon as the system has started to power cycle come back up.

Tl;DR: Expected behavior on sending shutdown is to shift the pi into a low power mode which can only be recovered from via power cycle or shorting header P6. With Tiano Core sending shutdown appears to end in a warm-reset.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

satmandu commented 5 years ago

Here's the officially suggested solution https://github.com/raspberrypi/firmware/issues/1016#issuecomment-403139219 , which is to "write 0x555 (plus the usual password) to the RSTS register," before using the watchdog timer to reset the device.

That would be a minor modification to the rpi3_system_reset function in https://github.com/andreiw/raspberry-pi3-atf/blob/master/plat/rpi3/rpi3_pm.c, making rpi3_system_off a special case inside rpi3_system_reset, no?

Or was this what was happening in the originally without a shutdown function before you implemented the https://github.com/andreiw/raspberry-pi3-atf/commit/b1f5b0343b10562685dbe603585cba565a4bb54a commit?

andreiw commented 5 years ago

Sure, I can do that

A

On Jul 6, 2018, at 5:28 PM, satmandu notifications@github.com wrote:

Here's the officially suggested solution raspberrypi/firmware#1016 (comment) , which is to "write 0x555 (plus the usual password) to the RSTS register," before using the watchdog timer to reset the device.

That would be a minor modification to the rpi3_system_reset function in https://github.com/andreiw/raspberry-pi3-atf/blob/master/plat/rpi3/rpi3_pm.c, making rpi3_system_off a special case inside rpi3_system_reset, no?

Or was this what was happening in the originally without a shutdown function before you implemented the andreiw/raspberry-pi3-atf@b1f5b03 commit?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.