Re: [PATCH RFC] power: reset: restart-poweroff: convert to module

From: Andrew Lunn
Date: Thu Feb 22 2024 - 09:54:28 EST


> I also didn't understand what is so special about bootloader support
> for this functionality if no data is passed to the bootloader.
> After ARM-specifics was removed from the code quite some time ago
> any platform could re-use the code for the deployments which meant
> to be "always on".

If i'm remembering correctly....

When the box cold boots, the bootloader can see the boot reason, and
chains into Linux. When the user does a shutdown, we re-enter the
bootloader, and it sees it is a warm boot. It then spins, rather than
chaining into Linux. The process of getting into the bootloader, a
watchdog triggered reset, probably disables a lot of clocks and other
bits of hardware, so spinning in the bootloader consumes less power
than if Linux was to spin.

So bootloader needs this functionality, to either chain, or to spin.

Andrew