ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
power_mgmt.h File Reference

SoC power governor: frequency scaling, thermal throttle, brownout recovery, gating (PC_ENABLE_POWER_MGMT). More...

#include "protocore_config.h"
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Detailed Description

SoC power governor: frequency scaling, thermal throttle, brownout recovery, gating (PC_ENABLE_POWER_MGMT).

services/system/radio_power owns the radio and services/system/sleep_sched decides how long to sleep. Neither owns the SoC itself, which is where the rest of the power budget goes: the CPU clock, the die temperature, and the peripherals nobody is using.

The governor answers one question - given the current load, die temperature, and how the board last reset, what should the CPU clock be right now:

  • Scaling. Busy work runs at the ceiling; an idle server drops to the floor. Running a 240 MHz core to poll an idle socket is the single easiest power win on this part.
  • Thermal throttle. Hot parts clock down, and the restore threshold is lower than the throttle threshold. Without that gap a device sitting exactly at the limit oscillates between full speed and floor forever, which is worse than either.
  • Brownout recovery. A board that just browned out is on a supply that could not hold up the last load it saw, so slamming straight back to full speed invites the same collapse and a boot loop. After a brownout reset it comes up at the floor and stays there for a settle window.
  • Gating. Blocks the firmware never uses still burn current; Bluetooth is the big one, since the controller draws power whether or not anything is connected.

The decision is pure and takes every input explicitly - load, temperature, the brownout flag, the time since boot, and the previous throttle state for the hysteresis - so the whole governor is host-testable with no hardware. The binding only reads the sensors and applies the result.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file power_mgmt.h.