User avatar
MartyMacGyver
Posts: 32
Joined: Sat Jan 26, 2013 1:37 am

During halt powerdown, what code blinks the led ten times?

Sun Feb 08, 2015 12:34 am

During a system halt (power down) what code actually blinks the act LED 10 times?

I've been perusing the code and what appears to happen during the processing of the halt command, but I don't see where the activity LED (led0) is blinked ten times before the actual halt (and it's part of halt itself - "halt -d -f -p" will indeed immediately halt the system with the ten blinks). Anyone happen to know the kernel/CPU code enough to say?

Note that I've been poring over the code in https://github.com/raspberrypi/linux but I'm not finding it there. It's been suggested it might be in the GPU blob but I'm not sure of that either.

Is there a good architectural description of a Pi's instance lifecycle, from power on to halt/power off? When the "blob" hands over to the kernel and when or if it resumes control before the halt?

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: During halt powerdown, what code blinks the led ten time

Sun Feb 08, 2015 12:46 am

It's the GPU code shutting down. As soon as the ten winks are done you can safely pull the power.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
MartyMacGyver
Posts: 32
Joined: Sat Jan 26, 2013 1:37 am

Re: During halt powerdown, what code blinks the led ten time

Sun Feb 08, 2015 10:22 am

Interesting! I thought perhaps the GPU only mediated bootup.

Do you happen to know at what point in the kernel code the Pi hands over to the GPU for the final part of the shutdown? Is it "pm_power_off()"?

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: During halt powerdown, what code blinks the led ten time

Sun Feb 08, 2015 12:42 pm

MartyMacGyver wrote:Interesting! I thought perhaps the GPU only mediated bootup.

Do you happen to know at what point in the kernel code the Pi hands over to the GPU for the final part of the shutdown? Is it "pm_power_off()"?
The GPU has always full control...
The ten times blink routine is apparently in bootcode.bin.
I had some fun using the arm_stop(),arm_halt() then arm_setup(),arm_start() videocore routines.

User avatar
MartyMacGyver
Posts: 32
Joined: Sat Jan 26, 2013 1:37 am

Re: During halt powerdown, what code blinks the led ten time

Sun Feb 08, 2015 9:51 pm

mimi123 wrote: The GPU has always full control...
The ten times blink routine is apparently in bootcode.bin.
I had some fun using the arm_stop(),arm_halt() then arm_setup(),arm_start() videocore routines.
Still getting my head wrapped around the GPU being superior to the CU in the hierarchy.

How did you manage to find those routines anyway? (I notice some are buried in the elf binaries...)

mimi123
Posts: 583
Joined: Thu Aug 22, 2013 3:32 pm

Re: During halt powerdown, what code blinks the led ten time

Mon Feb 09, 2015 3:18 pm

MartyMacGyver wrote:
mimi123 wrote: The GPU has always full control...
The ten times blink routine is apparently in bootcode.bin.
I had some fun using the arm_stop(),arm_halt() then arm_setup(),arm_start() videocore routines.
Still getting my head wrapped around the GPU being superior to the CU in the hierarchy.

How did you manage to find those routines anyway? (I notice some are buried in the elf binaries...)
I have a unstripped blob.
commit affe5cd9d3e1e8dcc29509f12fc3ed5153f3fb67 in raspberrypi/firmware

Return to “Advanced users”