heads/boards/librem_mini/initrd/bin/set_ec_poweron.sh
Jonathon Hall e9a5b27e6c
librem_mini,librem_mini_v2: Don't use three values for auto poweron
PureBoot doesn't have any other three-valued settings and this doesn't
present very well in the config UI.

Instead make this a two-valued setting; drop the mode that forces the
EC setting to "stay off" at every boot because this is the default.

When disabling automatic power-on, disable the EC BRAM setting too.

Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
2023-06-21 13:26:49 -04:00

17 lines
350 B
Bash
Executable File

#!/bin/bash
# Set the EC BRAM setting for automatic power-on.
# If $1 is 'y', enable automatic power-on. Otherwise, disable it.
# EC BRAM bank 1
BRAMADDR=0x360
BRAMDATA=0x361
outb "$BRAMADDR" 0x29 # Select byte at offset 29h
if [ "$1" = "y" ]; then
outb "$BRAMDATA" 0x00 # 0 -> automatic power-on
else
outb "$BRAMDATA" 0x01 # 1 -> stay off
fi