From 55155f65588dc878c01760f4081479f22c7d47f0 Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Fri, 23 Jun 2023 12:24:22 -0400 Subject: [PATCH] boards/librem_11: Add Librem 11 Add Librem 11 board. Librem 11 uses coreboot graphics init, which is done with FSP GOP. Set a custom keymap for the volume/power keys. Configure the volume keys as up/down arrows (for navigation in fbwhiptail, and for shell history in the Linux console). Configure the power key as Enter. Signed-off-by: Jonathon Hall --- boards/librem_11/initrd/bin/board-init.sh | 3 ++ boards/librem_11/initrd/etc/librem_11.map | 5 +++ boards/librem_11/librem_11.config | 51 +++++++++++++++++++++++ config/coreboot-librem_11.config | 16 +++++++ initrd/init | 2 +- 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100755 boards/librem_11/initrd/bin/board-init.sh create mode 100644 boards/librem_11/initrd/etc/librem_11.map create mode 100644 boards/librem_11/librem_11.config create mode 100644 config/coreboot-librem_11.config diff --git a/boards/librem_11/initrd/bin/board-init.sh b/boards/librem_11/initrd/bin/board-init.sh new file mode 100755 index 00000000..0e999e09 --- /dev/null +++ b/boards/librem_11/initrd/bin/board-init.sh @@ -0,0 +1,3 @@ +#! /bin/bash +set -e -o pipefail +loadkeys /etc/librem_11.map diff --git a/boards/librem_11/initrd/etc/librem_11.map b/boards/librem_11/initrd/etc/librem_11.map new file mode 100644 index 00000000..78fbdc49 --- /dev/null +++ b/boards/librem_11/initrd/etc/librem_11.map @@ -0,0 +1,5 @@ +keymaps 0-2,4-5,8,12 +# Use volume and power keys on tablet to navigate menus +keycode 114 = Up +keycode 115 = Down +keycode 116 = Return diff --git a/boards/librem_11/librem_11.config b/boards/librem_11/librem_11.config new file mode 100644 index 00000000..d4a4a79f --- /dev/null +++ b/boards/librem_11/librem_11.config @@ -0,0 +1,51 @@ +# Configuration for librem_11 +CONFIG_LINUX_CONFIG=config/linux-librem_common-6.1.8.config +CONFIG_COREBOOT_CONFIG=config/coreboot-librem_11.config + +export CONFIG_COREBOOT=y +export CONFIG_COREBOOT_VERSION=purism +export CONFIG_LINUX_VERSION=6.1.8 + +CONFIG_CRYPTSETUP2=y +CONFIG_FLASHROM=y +CONFIG_FLASHTOOLS=y +CONFIG_GPG2=y +CONFIG_KEXEC=y +CONFIG_UTIL_LINUX=y +CONFIG_KBD=y +CONFIG_KBD_LOADKEYS=y +CONFIG_LVM2=y +CONFIG_MBEDTLS=y +CONFIG_PCIUTILS=y +CONFIG_POPT=y +CONFIG_QRENCODE=y +CONFIG_TPMTOTP=y + +CONFIG_CAIRO=y +CONFIG_FBWHIPTAIL=y +CONFIG_HOTPKEY=y + +CONFIG_LINUX_USB=y + +export CONFIG_TPM=n +export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y +export CONFIG_TOTP_SKIP_QRCODE=y +export CONFIG_OEMRESET_OFFER_DEFAULTS=y + +export CONFIG_BOOTSCRIPT=/bin/gui-init +export CONFIG_BOOT_REQ_HASH=n +export CONFIG_BOOT_REQ_ROLLBACK=n +export CONFIG_BOOT_KERNEL_ADD="" +export CONFIG_BOOT_KERNEL_REMOVE="" +export CONFIG_BOOT_DEV="/dev/nvme0n1p1" +export CONFIG_BOARD_NAME="Librem 11" +export CONFIG_FLASHROM_OPTIONS="-p internal" +export CONFIG_USB_KEYBOARD=y +export CONFIG_AUTO_BOOT_TIMEOUT=5 +export CONFIG_ROOT_DEV="/dev/nvme0n1p2" +export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr" +export CONFIG_ROOT_CHECK_AT_BOOT="n" + +# Librem 11 builds include firmware for integrated AX201 Wi-Fi, Bluetooth, and +# graphics microcontroller. +export CONFIG_SUPPORT_BLOB_JAIL=y diff --git a/config/coreboot-librem_11.config b/config/coreboot-librem_11.config new file mode 100644 index 00000000..ac2f54a2 --- /dev/null +++ b/config/coreboot-librem_11.config @@ -0,0 +1,16 @@ +CONFIG_VENDOR_PURISM=y +CONFIG_IFD_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_jsl/librem_11/flashdescriptor.bin" +CONFIG_ME_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_jsl/librem_11/me.bin" +CONFIG_HAVE_IFD_BIN=y +CONFIG_BOARD_PURISM_LIBREM_11=y +CONFIG_LINUX_COMMAND_LINE="quiet loglevel=2" +CONFIG_FSP_M_FILE="3rdparty/purism-blobs/mainboard/purism/librem_jsl/librem_11/fspm.bin" +CONFIG_FSP_S_FILE="3rdparty/purism-blobs/mainboard/purism/librem_jsl/librem_11/fsps.bin" +CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y +CONFIG_CPU_UCODE_BINARIES="3rdparty/purism-blobs/mainboard/purism/librem_jsl/cpu_microcode_blob.bin" +CONFIG_HAVE_ME_BIN=y +CONFIG_ADD_FSP_BINARIES=y +CONFIG_PAYLOAD_LINUX=y +CONFIG_PAYLOAD_FILE="@BOARD_BUILD_DIR@/bzImage" +CONFIG_LINUX_INITRD="@BOARD_BUILD_DIR@/initrd.cpio.xz" +CONFIG_CBFS_SIZE=0xC00000 diff --git a/initrd/init b/initrd/init index 17dc1c57..56a6392d 100755 --- a/initrd/init +++ b/initrd/init @@ -88,7 +88,7 @@ export GPG_TTY=/dev/console [ -x /bin/bash ] && /bin/key-init # Override CONFIG_USE_BLOB_JAIL if needed and persist via user config -if lspci -n | grep -q "8086:2723"; then +if lspci -n | grep -E -q "8086:(2723|4df0)"; then if ! cat /etc/config.user 2>/dev/null | grep -q "USE_BLOB_JAIL"; then echo "CONFIG_USE_BLOB_JAIL=y" >> /etc/config.user fi