From 0d812853391810d21bdb92b04cf8d3f968911cc5 Mon Sep 17 00:00:00 2001 From: d-wid <65876951+d-wid@users.noreply.github.com> Date: Mon, 8 May 2023 17:38:41 +0200 Subject: [PATCH] Add Z220 Add files via upload Create z220-cmt-maximized.config Create z220-cmt-hotp-maximized.config Add files via upload Update config.yml Update linux-x230-maximized.config I use an NVME drive. Admittedly adding this to the X230 config isn't ideal because the X230 itself is far from ideal for an NVME SSD. However I suspect someone using something like this or a Z77 board would well like to have the ability to boot from NVME. chmod +x blob download script Update coreboot-z220-cmt.config CBFS now equal to 00ffffff-0001b000 --- .circleci/config.yml | 14 ++++ blobs/z220/download_BIOS_clean.sh | 68 +++++++++++++++++++ .../z220-cmt-hotp-maximized.config | 6 ++ .../z220-cmt-maximized.config | 53 +++++++++++++++ config/coreboot-z220-cmt.config | 26 +++++++ config/linux-x230-maximized.config | 1 + 6 files changed, 168 insertions(+) create mode 100755 blobs/z220/download_BIOS_clean.sh create mode 100644 boards/z220-cmt-hotp-maximized/z220-cmt-hotp-maximized.config create mode 100644 boards/z220-cmt-maximized/z220-cmt-maximized.config create mode 100644 config/coreboot-z220-cmt.config diff --git a/.circleci/config.yml b/.circleci/config.yml index 09c87ae50..843567caf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -532,6 +532,20 @@ workflows: subcommand: "" requires: - librem_14 + + - build: + name: z220-cmt-maximized + target: z220-cmt-maximized + subcommand: "" + requires: + - librem_14 + + - build: + name: z220-cmt-hotp-maximized + target: z220-cmt-hotp-maximized + subcommand: "" + requires: + - librem_14 # - build: # name: kgpe-d16_workstation-usb_keyboard diff --git a/blobs/z220/download_BIOS_clean.sh b/blobs/z220/download_BIOS_clean.sh new file mode 100755 index 000000000..afe8d11a9 --- /dev/null +++ b/blobs/z220/download_BIOS_clean.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# Z220 CMT HP + +function printusage { + echo "Usage: $0 -m (optional)" +} + +BLOBDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +if [ "$#" -eq 0 ]; then printusage; fi + +while getopts ":m:i:" opt; do + case $opt in + m) + if [ -x "$OPTARG" ]; then + MECLEAN="$OPTARG" + fi + ;; + esac + +done + +if [ -z "$MECLEAN" ]; then + MECLEAN=`command -v $BLOBDIR/../../build/x86/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1|head -n1` + if [ -z "$MECLEAN" ]; then + echo "me_cleaner.py required but not found or specified with -m. Aborting." + exit 1; + fi +fi + +BIN_FILE="DOS Flash/K51_0187.BIN" +BIN_TGZ_SHA256SUM="0102d569239fdc14ca86a7afc4b16d2b12703401890b83e188f34d23844870dc sp97120.tgz" +BIN_FILE_SHA256SUM="cc5a9c2d4827e9b1501c2dc0a464f580d4a2d65e4ff83dbab548e51839339d06 $BIN_FILE" +FINAL_IFD_SHA256SUM="6b6bb09af0abbd93a73f2a1bde970d3ab488ed1c9c898d312f2b0676dc40d5ae $BLOBDIR/ifd.bin" +FINAL_ME_SHA256SUM="2ee4bbf3e49e0c1f0215d7955d2a7793c7e108014f3aa4592bfa9785c0033d0d $BLOBDIR/me.bin" +TGZURL="https://ftp.hp.com/pub/softpaq/sp97001-97500/sp97120.tgz" + +TGZFILENAME=`echo $TGZURL | sed 's/.*\///'` +ROMFILENAME=`echo $TGZFILENAME | sed 's/\.zip$/\.ROM/'` + +extractdir=$(mktemp -d) +echo "### Creating temp dir $extractdir " +cd "$extractdir" + +echo "### Downloading $TGZURL" +wget $TGZURL || { echo "ERROR: wget failed $TGZURL" && exit 1; } +echo "### Verifying expected hash of $TGZFILENAME" +echo "$BIN_TGZ_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification on downloaded binary..." && exit 1; } + +echo "### Extracting Archives" +tar -xf $TGZFILENAME DOS\ Flash || { echo "Failed unzipping $TGZFILENAME - Tool installed on host?" && exit 1;} + +echo "### Verifying expected hash of $ROMFILENAME" +echo "$BIN_FILE_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification on extracted binary..." && exit 1; } + +#echo "### extracing BIOS from Capsule" +#dd bs=1024 skip=2 if=P8Z77-V-ASUS-2104.CAP of=P8Z77-V-ASUS-2104.ROM || { echo "Failed to de-cap the ROM..." && exit 1; } + +echo "### Applying me_cleaner to neuter and truncate. EFFS,FCRS whitelisted" +$MECLEAN -S -r -t -d -O /tmp/unneeded.bin -D "$BLOBDIR/ifd.bin" -M "$BLOBDIR/me.bin" "$BIN_FILE" + +echo "### Verifying expected hashes" +echo "$FINAL_IFD_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification on generated IFD bin..." && exit 1; } +echo "$FINAL_ME_SHA256SUM" | sha256sum --check || { echo "Failed sha256sum verification on generated ME binary..." && exit 1; } + +echo "###Cleaning up..." +cd - +rm -r "$extractdir" diff --git a/boards/z220-cmt-hotp-maximized/z220-cmt-hotp-maximized.config b/boards/z220-cmt-hotp-maximized/z220-cmt-hotp-maximized.config new file mode 100644 index 000000000..8095c2a5e --- /dev/null +++ b/boards/z220-cmt-hotp-maximized/z220-cmt-hotp-maximized.config @@ -0,0 +1,6 @@ +# Inherit the rest from the base Z220 CMT config. +include $(pwd)/boards/z220-cmt-maximized/z220-cmt-maximized.config + +CONFIG_HOTPKEY=y + +export CONFIG_BOARD_NAME="Hewlett-Packard Z220 Convertible Minitower (HOTP)" diff --git a/boards/z220-cmt-maximized/z220-cmt-maximized.config b/boards/z220-cmt-maximized/z220-cmt-maximized.config new file mode 100644 index 000000000..f5bea6764 --- /dev/null +++ b/boards/z220-cmt-maximized/z220-cmt-maximized.config @@ -0,0 +1,53 @@ +# Configuration for HP Z220 CMT +# +#Test platform +#BOARD: HP Z220 CMT +#RAM: +#CPU: Intel E3-1275v2 +# +# note: nohz=off is an optional CONFIG_LINUX_COMMAND_LINE parameter to supress repeated NOHZ: local_softirq_pending console output +# +CONFIG_LINUX_CONFIG=config/linux-x230-maximized.config +CONFIG_COREBOOT_CONFIG=config/coreboot-z220-cmt.config + +export CONFIG_COREBOOT=y +export CONFIG_COREBOOT_VERSION=4.17 +export CONFIG_LINUX_VERSION=4.14.62 + +CONFIG_CRYPTSETUP2=y +CONFIG_FLASHROM=y +CONFIG_FLASHTOOLS=y +CONFIG_GPG2=y +CONFIG_KEXEC=y +CONFIG_UTIL_LINUX=y +CONFIG_LVM2=y +CONFIG_MBEDTLS=y +CONFIG_PCIUTILS=y +CONFIG_POPT=y +CONFIG_QRENCODE=y +CONFIG_TPMTOTP=y + +# Dependencies for a graphical menu. Enable CONFIG_SLANG and CONFIG_NEWT instead +# for a console-based menu. +CONFIG_CAIRO=y +CONFIG_FBWHIPTAIL=y + +CONFIG_LINUX_USB=y + +export CONFIG_TPM=y +export CONFIG_BOOTSCRIPT=/bin/gui-init +export CONFIG_BOOT_REQ_HASH=n +export CONFIG_BOOT_REQ_ROLLBACK=n +export CONFIG_BOOT_KERNEL_ADD="intel_iommu=igfx_off" +export CONFIG_BOOT_KERNEL_REMOVE="quiet" +export CONFIG_BOOT_DEV="/dev/sda1" +export CONFIG_BOARD_NAME="Hewlett-Packard Z220 Convertible Minitower" +export CONFIG_FLASHROM_OPTIONS="-p internal" + +# Make the Coreboot build depend on the following 3rd party blobs: +$(build)/coreboot-$(CONFIG_COREBOOT_VERSION)/$(BOARD)/.build: \ + $(pwd)/blobs/z220/me.bin $(pwd)/blobs/z220/ifd.bin + +$(pwd)/blobs/z220/me.bin: + COREBOOT_DIR="$(build)/$(coreboot_base_dir)" \ + $(pwd)/blobs/z220/download_BIOS_clean.sh diff --git a/config/coreboot-z220-cmt.config b/config/coreboot-z220-cmt.config new file mode 100644 index 000000000..8f4c320ff --- /dev/null +++ b/config/coreboot-z220-cmt.config @@ -0,0 +1,26 @@ +CONFIG_VENDOR_HP=y +CONFIG_BOARD_HP_Z220_CMT_WORKSTATION=y +CONFIG_BOARD_HP_Z220_SERIES_COMMON=y + +CONFIG_CBFS_SIZE=0xFE4FFF +CONFIG_HAVE_IFD_BIN=y +CONFIG_HAVE_ME_BIN=y +CONFIG_HAVE_GBE_BIN=y +CONFIG_GBE_BIN_PATH="@BLOB_DIR@/xx30/gbe.bin" +CONFIG_IFD_BIN_PATH="@BLOB_DIR@/z220/ifd.bin" +CONFIG_ME_BIN_PATH="@BLOB_DIR@/z220/me.bin" +CONFIG_NO_GFX_INIT=y +CONFIG_TPM_MEASURED_BOOT=y +CONFIG_TPM1=y +CONFIG_DRIVERS_PS2_KEYBOARD=y +CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=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 nohz=off" +CONFIG_ONBOARD_VGA_IS_PRIMARY=y + +CONFIG_PCIEXP_DEFAULT_MAX_RESIZABLE_BAR_BITS=63 +CONFIG_PCIEXP_L1_SUB_STATE=y +CONFIG_PCIEXP_CLK_PM=y +CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS=y diff --git a/config/linux-x230-maximized.config b/config/linux-x230-maximized.config index c886b9695..a6c6702a3 100644 --- a/config/linux-x230-maximized.config +++ b/config/linux-x230-maximized.config @@ -330,3 +330,4 @@ CONFIG_CRC8=m CONFIG_XZ_DEC_TEST=m CONFIG_CORDIC=m CONFIG_IRQ_POLL=y +CONFIG_BLK_DEV_NVME=y