mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-24 23:26:44 +00:00
eed8adeb49
Enable the coreboot CMOS option table, which initializes CMOS if the checksum is not valid. There is now a checksum in the CMOS layout since 4.21, update it when updating the Mini v1/v2 EC power-on setting. coreboot 4.21 will reset the CMOS settings during the first boot, since there was no checksum in prior releases. Heads will restore the automatic power-on setting during init based on config.user. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
23 lines
620 B
Bash
Executable File
23 lines
620 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
|
|
|
|
if [ "$1" = "y" ]; then
|
|
BRAM_VALUE="0x00" # 0 -> automatic power-on
|
|
else
|
|
BRAM_VALUE="0x01" # 1 -> stay off
|
|
fi
|
|
|
|
outb "$BRAMADDR" 0x29 # Select byte at offset 29h
|
|
outb "$BRAMDATA" "$BRAM_VALUE"
|
|
# There's also a 16-bit checksum at offset 3eh in bank 1. The only byte
|
|
# included in the checksum is the automatic power-on setting, so the value is
|
|
# the same, and the upper 8 bits remain 0.
|
|
outb "$BRAMADDR" 0x3e
|
|
outb "$BRAMDATA" "$BRAM_VALUE"
|