librem_mini,librem_mini_v2: Enable CMOS layout, update CMOS checksum

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>
This commit is contained in:
Jonathon Hall 2023-08-29 15:55:20 -04:00
parent bde945ea57
commit eed8adeb49
No known key found for this signature in database
GPG Key ID: 1E9C3CA91AE25114
4 changed files with 24 additions and 10 deletions

View File

@ -7,10 +7,16 @@
BRAMADDR=0x360
BRAMDATA=0x361
outb "$BRAMADDR" 0x29 # Select byte at offset 29h
if [ "$1" = "y" ]; then
outb "$BRAMDATA" 0x00 # 0 -> automatic power-on
BRAM_VALUE="0x00" # 0 -> automatic power-on
else
outb "$BRAMDATA" 0x01 # 1 -> stay off
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"

View File

@ -7,10 +7,16 @@
BRAMADDR=0x360
BRAMDATA=0x361
outb "$BRAMADDR" 0x29 # Select byte at offset 29h
if [ "$1" = "y" ]; then
outb "$BRAMDATA" 0x00 # 0 -> automatic power-on
BRAM_VALUE="0x00" # 0 -> automatic power-on
else
outb "$BRAMDATA" 0x01 # 1 -> stay off
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"

View File

@ -1,10 +1,12 @@
CONFIG_CBFS_SIZE=0xC00000
CONFIG_USE_OPTION_TABLE=y
CONFIG_VENDOR_PURISM=y
CONFIG_CBFS_SIZE=0xC00000
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/purism-blobs/mainboard/purism/librem_cnl/mini/vbt.bin"
CONFIG_IFD_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_cnl/mini/flashdescriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_cnl/mini/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_PURISM_LIBREM_MINI=y
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=2 drm_kms_helper.drm_leak_fbdev_smem=1 i915.enable_fbc=0"
CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/purism-blobs/mainboard/purism/librem_cnl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
@ -12,4 +14,3 @@ CONFIG_NO_GFX_INIT=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="@BOARD_BUILD_DIR@/bzImage"
CONFIG_LINUX_INITRD="@BOARD_BUILD_DIR@/initrd.cpio.xz"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=2 drm_kms_helper.drm_leak_fbdev_smem=1 i915.enable_fbc=0"

View File

@ -1,9 +1,12 @@
CONFIG_USE_OPTION_TABLE=y
CONFIG_VENDOR_PURISM=y
CONFIG_CBFS_SIZE=0xC00000
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/purism-blobs/mainboard/purism/librem_cnl/mini/vbt.bin"
CONFIG_IFD_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_cnl/mini_v2/flashdescriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_cnl/mini_v2/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_PURISM_LIBREM_MINI_V2=y
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=2 drm_kms_helper.drm_leak_fbdev_smem=1 i915.enable_fbc=0"
CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/purism-blobs/mainboard/purism/librem_cnl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
@ -11,5 +14,3 @@ CONFIG_NO_GFX_INIT=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="@BOARD_BUILD_DIR@/bzImage"
CONFIG_LINUX_INITRD="@BOARD_BUILD_DIR@/initrd.cpio.xz"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=2 drm_kms_helper.drm_leak_fbdev_smem=1 i915.enable_fbc=0"
CONFIG_CBFS_SIZE=0xC00000