From 401c0882aaec059eab62b5ce467d3efbc1472d1f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 7 Jan 2024 13:25:33 +0000 Subject: NEW MAINBOARD: HP EliteBook 820 G2 This is of Broadwell platform, one generation above Haswell. Of note: this uses HP Sure Start. Although the flash is 16MB, our CBFS section (and IFD configuration) assumes 12MB flash, so the final 4MB will be left unflashed on installation, after blanking the private flash. The coreboot documents have more information about this. Some minor design changes in lbmk were made, to accomodate this port: Support for extracting refcode binaries added (pulled from Google recovery images). The refcode file is an ELF that initialises the MRC and the PCH. It is also responsible for enabling or disabling the Intel GbE device, where Google does not enable it, but lbmk modifies it per the instructions on the coreboot documentation, so as to enable Intel GbE. Google's recovery image stores the refcode as a stage file, but coreboot changed the format (for CBFS files) after 4.13 so coreboot 4.13's cbfstool is used to extract refcode. This realisation made me also change the script logic to use a cbfstool and ifdtool version matching the coreboot tree, for all parts of lbmk, whereas lbmk previously used only the default tree for cbfstool/ifdtool, on insertion and deletion of vendor files - it was 81dc20e744 that broke extraction of refcode on google's recovery images, where google used an older version of cbfstool to insert the files in their coreboot ROMs. A further backported patch has been added, copying coreboot revision f22f408956 which is a build fix from Nico Huber. Iru Cai submitted an ACPI bugfix after the revision lbmk currently uses, for coreboot/default, and this fix is needed for rebooting to work on Linux 6.1 or higher. This patch has been backported to lbmk, while it still uses the same October 2023 revision of coreboot. Broadwell MRC is inserted at the same offset as Haswell, so I didn't need to tweak that. Signed-off-by: Leah Rowe --- script/vendor/download | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'script/vendor/download') diff --git a/script/vendor/download b/script/vendor/download index 1f96c665..592c14bc 100755 --- a/script/vendor/download +++ b/script/vendor/download @@ -2,7 +2,7 @@ # SPDX-License-Identifier: GPL-3.0-only # SPDX-FileCopyrightText: 2022 Caleb La Grange # SPDX-FileCopyrightText: 2022 Ferass El Hafidi -# SPDX-FileCopyrightText: 2023 Leah Rowe +# SPDX-FileCopyrightText: 2023-2024 Leah Rowe . "include/err.sh" . "include/option.sh" @@ -14,16 +14,15 @@ _ua="Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0" _7ztest="a" e6400_unpack="${PWD}/src/bios_extract/dell_inspiron_1100_unpacker.py" -kbc1126_ec_dump="${PWD}/${cbdir}/util/kbc1126/kbc1126_ec_dump" me7updateparser="${PWD}/util/me7_update_parser/me7_update_parser.py" -mecleaner="${PWD}/${cbdir}/util/me_cleaner/me_cleaner.py" pfs_extract="${PWD}/src/biosutilities/Dell_PFS_Extract.py" uefiextract="${PWD}/src/uefitool/uefiextract" eval "$(setvars "" _b _dl EC_url EC_url_bkup EC_hash DL_hash DL_url DL_url_bkup \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname SCH5545EC_DL_url SCH5545EC_DL_url_bkup SCH5545EC_DL_hash \ - is_rom)" + is_rom tree mecleaner kbc1126_ec_dump MRC_refcode_cbtree cbfstoolref \ + MRC_refcode_gbe)" main() { @@ -50,6 +49,13 @@ detect_firmware() set -- "${boarddir}/config/"* . "${1}" 2>/dev/null + . "${boarddir}/target.cfg" 2>/dev/null + [ -z "$tree" ] && err "detect_firmware $boarddir: tree undefined" + cbdir="src/coreboot/$tree" + cbfstool="cbutils/$tree/cbfstool" + + mecleaner="${PWD}/${cbdir}/util/me_cleaner/me_cleaner.py" + kbc1126_ec_dump="${PWD}/${cbdir}/util/kbc1126/kbc1126_ec_dump" for c in CONFIG_HAVE_MRC CONFIG_HAVE_ME_BIN CONFIG_KBC1126_FIRMWARE \ CONFIG_VGA_BIOS_FILE CONFIG_INCLUDE_SMSC_SCH5545_EC_FW; do @@ -66,9 +72,14 @@ build_dependencies() x_ ./update trees -f "${d}" done [ -f "${uefiextract}" ] || x_ ./update trees -b uefitool - [ -f "${kbc1126_ec_dump}" ] || x_ make -C "${cbdir}/util/kbc1126" + [ ! -d "${kbc1126_ec_dump%/*}" ] || [ -f "${kbc1126_ec_dump}" ] || x_ \ + make -C "${cbdir}/util/kbc1126" + [ -n "$MRC_refcode_cbtree" ] && \ + cbfstoolref="cbutils/$MRC_refcode_cbtree/cbfstool" + [ -z "$cbfstoolref" ] || [ -f "$cbfstoolref" ] || \ + x_ ./update trees -b coreboot utils $MRC_refcode_cbtree [ -f "${cbfstool}" ] && [ -f "${ifdtool}" ] && return 0 - x_ ./update trees -b coreboot utils default + x_ ./update trees -b coreboot utils $tree } download_vendorfiles() @@ -87,6 +98,10 @@ download_vendorfiles() "$E6400_VGA_DL_hash" "$CONFIG_VGA_BIOS_FILE" [ -z "${CONFIG_HAVE_MRC}" ] && return 0 fetch "mrc" "$MRC_url" "$MRC_url_bkup" "$MRC_hash" "$CONFIG_MRC_FILE" + + # in case only mrc downloaded before, in a pair of mrc/refcode: + [ -n "$CONFIG_REFCODE_BLOB_FILE" ] && fetch "ref" "$MRC_url" \ + "$MRC_url_bkup" "$MRC_hash" "$CONFIG_REFCODE_BLOB_FILE"; return 0 } fetch() @@ -156,6 +171,9 @@ mkdirs() extract_intel_me() { + [ ! -f "$mecleaner" ] && \ + err "extract_intel_me $cbdir: me_cleaner missing" + _me="${PWD}/${_dest}" # must always be an absolute path cdir="${PWD}/${appdir}" # must always be an absolute path [ $# -gt 0 ] && _me="${1}" && cdir="${2}" @@ -198,6 +216,8 @@ extract_archive() extract_kbc1126ec() { + [ ! -f "$kbc1126_ec_dump" ] && \ + err "extract_kbc1126ec $cbdir: kbc1126_ec_dump missing" ( x_ cd "${appdir}/" mv Rompaq/68*.BIN ec.bin || : -- cgit v1.2.1