From c073ee9d4fc4a631c16ff681bb62c29b952878ba Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 02:18:19 +0100 Subject: Restore SeaBIOS 9029a010 update, but with AHCI fix I fixed the AHCI bug, with a patch that I wrote. It works by restoring the old SeaBIOS AHCI initialisation behaviour, whereby the AHCI controller is enabled from its current state; the patch that broke AHCI in coreboot (tested on ThinkPad T420), changed AHCI initialisation behaviour so that the controller's state is first reset, prior to enablement. However, my patch also retains the new AHCI initialisation behaviour, when a CSM is in use. The AHCI reset patch was done, by the author, specifically for SeaBIOS in CSM mode, so it makes sense to only change the behaviour conditionally according to that. This reverts commit 8245f0b3211812ac818adadd6526b0b39c63f3f0. Signed-off-by: Leah Rowe --- .../0001-romfile-implement-a-generic-loader.patch | 12 ++--- ...s-optionroms-implement-mxm-3.0-interrupts.patch | 6 +-- ...the-Libreboot-version-in-the-SeaBIOS-menu.patch | 6 +-- .../0004-ahci-Only-reset-controller-on-CSM.patch | 63 ++++++++++++++++++++++ config/seabios/default/target.cfg | 2 +- 5 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 config/seabios/default/patches/0004-ahci-Only-reset-controller-on-CSM.patch diff --git a/config/seabios/default/patches/0001-romfile-implement-a-generic-loader.patch b/config/seabios/default/patches/0001-romfile-implement-a-generic-loader.patch index 2c042776..dc1464bb 100644 --- a/config/seabios/default/patches/0001-romfile-implement-a-generic-loader.patch +++ b/config/seabios/default/patches/0001-romfile-implement-a-generic-loader.patch @@ -1,7 +1,7 @@ -From 2aff8adc1dcd1315877fdb4ac4ef5e649c5b7d11 Mon Sep 17 00:00:00 2001 +From 04e972e14191f3a480e569e972c195ba8eb53a30 Mon Sep 17 00:00:00 2001 From: Riku Viitanen Date: Sat, 10 Feb 2024 21:23:33 +0200 -Subject: [PATCH 1/2] romfile: implement a generic loader +Subject: [PATCH 1/4] romfile: implement a generic loader romfile_loadfile_g: Based on romfile_loadfile but more flexible. User has to supply pointer @@ -18,7 +18,7 @@ Signed-off-by: Riku Viitanen 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/romfile.c b/src/romfile.c -index b598274edc09..8ccf5139ece8 100644 +index 8072a915..f4d5f82d 100644 --- a/src/romfile.c +++ b/src/romfile.c @@ -47,10 +47,12 @@ romfile_find(const char *name) @@ -69,7 +69,7 @@ index b598274edc09..8ccf5139ece8 100644 } diff --git a/src/romfile.h b/src/romfile.h -index 3e0f820047dd..1b967d86551f 100644 +index ae2f4ac7..f62b2fee 100644 --- a/src/romfile.h +++ b/src/romfile.h @@ -13,6 +13,8 @@ struct romfile_s { @@ -80,7 +80,7 @@ index 3e0f820047dd..1b967d86551f 100644 + void *(*malloc_fn)(u32), int add_len); void *romfile_loadfile(const char *name, int *psize); u64 romfile_loadint(const char *name, u64 defval); - + u32 romfile_loadbool(const char *name, u32 defval); -- -2.43.0 +2.39.5 diff --git a/config/seabios/default/patches/0002-vgahooks-optionroms-implement-mxm-3.0-interrupts.patch b/config/seabios/default/patches/0002-vgahooks-optionroms-implement-mxm-3.0-interrupts.patch index f05a34c2..5224d768 100644 --- a/config/seabios/default/patches/0002-vgahooks-optionroms-implement-mxm-3.0-interrupts.patch +++ b/config/seabios/default/patches/0002-vgahooks-optionroms-implement-mxm-3.0-interrupts.patch @@ -1,7 +1,7 @@ -From 1e7c443d069ef817c4e699bd6675efff4ebddb86 Mon Sep 17 00:00:00 2001 +From 270ac30b862c58c69455dbdace716044d29b20e2 Mon Sep 17 00:00:00 2001 From: Riku Viitanen Date: Sat, 10 Feb 2024 21:38:17 +0200 -Subject: [PATCH 2/2] vgahooks, optionroms: implement mxm 3.0 interrupts +Subject: [PATCH 2/4] vgahooks, optionroms: implement mxm 3.0 interrupts VGAROMs on MXM graphics cards need certain int15h functions present. @@ -184,5 +184,5 @@ index 00000000..f0c203af + +#endif // vgahooks.h -- -2.43.0 +2.39.5 diff --git a/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch b/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch index bff93e9d..acde7f20 100644 --- a/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch +++ b/config/seabios/default/patches/0003-Print-the-Libreboot-version-in-the-SeaBIOS-menu.patch @@ -1,7 +1,7 @@ -From ebd8293eb1af20c204beb3aa1394865185e2f3f0 Mon Sep 17 00:00:00 2001 +From cc6b13ddea9086586d34621d0b82d820af5ae785 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 6 Jan 2025 18:49:58 +0000 -Subject: [PATCH 1/1] Print the Libreboot version in the SeaBIOS menu +Subject: [PATCH 3/4] Print the Libreboot version in the SeaBIOS menu Signed-off-by: Leah Rowe --- @@ -9,7 +9,7 @@ Signed-off-by: Leah Rowe 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootsplash.c b/src/bootsplash.c -index 538b316d..8746098c 100644 +index 538b316d..9eed0b12 100644 --- a/src/bootsplash.c +++ b/src/bootsplash.c @@ -48,7 +48,7 @@ enable_vga_console(void) diff --git a/config/seabios/default/patches/0004-ahci-Only-reset-controller-on-CSM.patch b/config/seabios/default/patches/0004-ahci-Only-reset-controller-on-CSM.patch new file mode 100644 index 00000000..43f2b8a9 --- /dev/null +++ b/config/seabios/default/patches/0004-ahci-Only-reset-controller-on-CSM.patch @@ -0,0 +1,63 @@ +From 5fe2215bc5196d836b54e1e5fb00b63fa096fda7 Mon Sep 17 00:00:00 2001 +From: Leah Rowe +Date: Thu, 1 May 2025 15:46:54 +0100 +Subject: [PATCH 4/4] ahci: Only reset controller on CSM + +Please refer to this commit: + +commit 8863cbbd15a73b03153553c562f5b1fb939ad4d7 +Author: Gerd Hoffmann +Date: Thu Feb 6 12:10:21 2025 +0100 + + ahci: add controller reset + +This commit broke AHCI init on the Lenovo ThinkPad T420, +when tested with SeaBIOS as a coreboot payload. + +Since the above commit was made with CSMs in mind, to make +the AHCI driver work there, that change has been re-worked +so as to only apply when a CSM is in use. + +Signed-off-by: Leah Rowe +--- + src/hw/ahci.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/src/hw/ahci.c b/src/hw/ahci.c +index 2285d33d..b09b198a 100644 +--- a/src/hw/ahci.c ++++ b/src/hw/ahci.c +@@ -637,7 +637,7 @@ static void + ahci_controller_setup(struct pci_device *pci) + { + struct ahci_port_s *port; +- u32 pnr, max; ++ u32 val, pnr, max; + + if (create_bounce_buf() < 0) + return; +@@ -660,8 +660,19 @@ ahci_controller_setup(struct pci_device *pci) + + pci_enable_busmaster(pci); + +- ahci_ctrl_writel(ctrl, HOST_CTL, HOST_CTL_RESET); +- ahci_ctrl_writel(ctrl, HOST_CTL, HOST_CTL_AHCI_EN); ++ /* AHCI controller reset, but only for CSM. Commit 8863cbbd ++ introduced this universally, to make AHCI drivers work in ++ CSM mode, but it broke AHCI setup on the ThinkPad T420 when ++ SeaBIOS is used as a coreboot payload, hence the else clause: */ ++ if (CONFIG_CSM) { ++ /* Enable AHCI controller after resetting its state */ ++ ahci_ctrl_writel(ctrl, HOST_CTL, HOST_CTL_RESET); ++ ahci_ctrl_writel(ctrl, HOST_CTL, HOST_CTL_AHCI_EN); ++ } else { ++ /* Enable AHCI controller from its current state */ ++ val = ahci_ctrl_readl(ctrl, HOST_CTL); ++ ahci_ctrl_writel(ctrl, HOST_CTL, val | HOST_CTL_AHCI_EN); ++ } + + ctrl->caps = ahci_ctrl_readl(ctrl, HOST_CAP); + ctrl->ports = ahci_ctrl_readl(ctrl, HOST_PORTS_IMPL); +-- +2.39.5 + diff --git a/config/seabios/default/target.cfg b/config/seabios/default/target.cfg index 9ff1db3e..92b906f2 100644 --- a/config/seabios/default/target.cfg +++ b/config/seabios/default/target.cfg @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later tree="default" -rev="1602647f1be24fe63d11138d802e735c8e674e63" +rev="9029a010ec413e6c3c0eb52c29c252a5b9a9f774" -- cgit v1.2.1 From 2ae565ba93a84add3dd891e31e894d61cd4be42b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 05:54:36 +0100 Subject: init.sh: move setvars/err_ to lib.sh these functions make more sense in lib.sh i made mk link lib.sh first, so that the functions on init.sh can still use them. Signed-off-by: Leah Rowe --- include/init.sh | 21 --------------------- include/lib.sh | 21 +++++++++++++++++++++ mk | 3 ++- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/include/init.sh b/include/init.sh index 1b8432ce..c06d937a 100644 --- a/include/init.sh +++ b/include/init.sh @@ -16,27 +16,6 @@ xbmkpath="$PATH" err="err_" -setvars() -{ - _setvars="" - if [ $# -lt 2 ]; then - printf "\$err \"setvars: too few args\\n\"" - return 0 - fi - val="$1" - shift 1 - for var in "$@"; do - _setvars="$var=\"$val\"; $_setvars" - done - printf "%s\n" "${_setvars% }" -} - -err_() -{ - printf "ERROR %s: %s\n" "$0" "$1" 1>&2 - exit 1 -} - eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \ datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver`" diff --git a/include/lib.sh b/include/lib.sh index 7a5f2621..853ad654 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -115,3 +115,24 @@ check_defconfig() [ -f "$x" ] && printf "%s\n" "$x" && return 1 done; : } + +setvars() +{ + _setvars="" + if [ $# -lt 2 ]; then + printf "\$err \"setvars: too few args\\n\"" + return 0 + fi + val="$1" + shift 1 + for var in "$@"; do + _setvars="$var=\"$val\"; $_setvars" + done + printf "%s\n" "${_setvars% }" +} + +err_() +{ + printf "ERROR %s: %s\n" "$0" "$1" 1>&2 + exit 1 +} diff --git a/mk b/mk index 7b4d69ae..0ae35b6d 100755 --- a/mk +++ b/mk @@ -12,8 +12,9 @@ if [ "./${0##*/}" != "${0}" ] || [ ! -f "mk" ] || [ -L "mk" ]; then exit 1 fi -. "include/init.sh" . "include/lib.sh" + +. "include/init.sh" . "include/inject.sh" . "include/mrc.sh" -- cgit v1.2.1 From 6c4d88f2686558ef910bed2ebcc024d0347076fd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 07:24:11 +0100 Subject: move x_() to lib.sh Signed-off-by: Leah Rowe --- include/init.sh | 5 ----- include/lib.sh | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/init.sh b/include/init.sh index c06d937a..b8839921 100644 --- a/include/init.sh +++ b/include/init.sh @@ -224,9 +224,4 @@ xbmk_child_exec() exit $xbmk_rval } -x_() -{ - [ $# -lt 1 ] || "$@" || $err "Unhandled error for: $(echo "$@")"; : -} - xbmk_init "$@" diff --git a/include/lib.sh b/include/lib.sh index 853ad654..f5007c7d 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -131,6 +131,11 @@ setvars() printf "%s\n" "${_setvars% }" } +x_() +{ + [ $# -lt 1 ] || "$@" || $err "Unhandled error for: $(echo "$@")"; : +} + err_() { printf "ERROR %s: %s\n" "$0" "$1" 1>&2 -- cgit v1.2.1 From f3ae3dbbbe4f9c0ef6a1d68ed1faf7e9ca19f391 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 07:26:17 +0100 Subject: lib.sh: simplify remkdir() Signed-off-by: Leah Rowe --- include/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index f5007c7d..59676150 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -9,8 +9,8 @@ rmodtool="elf/cbfstool/default/rmodtool" remkdir() { - rm -Rf "$1" || $err "remkdir: !rm -Rf \"$1\"" - mkdir -p "$1" || $err "remkdir: !mkdir -p \"$1\"" + x_ rm -Rf "$1" + x_ mkdir -p "$1" } mkrom_tarball() -- cgit v1.2.1 From 15b76bc202f91156b3cc8234ffac1d3901763309 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 07:26:39 +0100 Subject: lib.sh: support multiple arguments in remkdir() Signed-off-by: Leah Rowe --- include/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index 59676150..87061f2b 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -9,8 +9,8 @@ rmodtool="elf/cbfstool/default/rmodtool" remkdir() { - x_ rm -Rf "$1" - x_ mkdir -p "$1" + x_ rm -Rf "$@" + x_ mkdir -p "$@" } mkrom_tarball() -- cgit v1.2.1 From acb0ea202f2629c13edc278126f09b043037c8bc Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 10:52:38 +0100 Subject: lib.sh: Simplify rmgit() Signed-off-by: Leah Rowe --- include/lib.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index 87061f2b..bef2a16f 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -39,11 +39,8 @@ mksha512sum() rmgit() { - ( - cd "$1" || $err "!cd gitrepo $1" - find . -name ".git" -exec rm -Rf {} + || $err "!rm .git $1" - find . -name ".gitmodules" -exec rm -Rf {} + || $err "!rm .gitmod $1" - ) || $err "Cannot remove .git/.gitmodules in $1" + x_ find "$1" -name ".git" -exec rm -Rf {} + + x_ find "$1" -name ".gitmodules" -exec rm -Rf {} + } # can grab from the internet, or copy locally. -- cgit v1.2.1 From 1f7e4b35cb2e95c7bbf1e3d39b10189b26f8d6ed Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 10:56:14 +0100 Subject: mk: Download vendorfiles before building release Do it just after creating the src archive. This way, everything is downloaded all at once. Otherwise, a momentary lapse of internet uptime will cause a release build to fail later on, and one of lbmk's flaws is that this would then mean you must re-build from scratch. If we assume that the internet is working within a short period of time, then this change would mitigate that possibility. If something did happen during tar archive creation, that's a much shorter amount of time that is "wasted". Signed-off-by: Leah Rowe --- mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk b/mk index 0ae35b6d..ec42d097 100755 --- a/mk +++ b/mk @@ -85,6 +85,7 @@ build_release() touch "$srcdir/lock" || $err "can't make lock file in $srcdir/" ( cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\"" + x_ ./mk -d coreboot mk -b coreboot pico-serprog stm32-vserprog pcsx-redux x_ mv bin ../roms ) || $err "can't build rom images" -- cgit v1.2.1 From 9b11e93686c6b8298a1b4be912da339ac60ba65f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 11:20:55 +0100 Subject: mk: include rom.sh directly remove it from mkhelper files, because rom.sh doesn't initialise any variables globally, except one that never changes. Signed-off-by: Leah Rowe --- config/data/coreboot/mkhelper.cfg | 2 -- config/data/grub/mkhelper.cfg | 2 -- config/data/pcsx-redux/mkhelper.cfg | 2 -- config/data/pico-serprog/mkhelper.cfg | 2 -- config/data/stm32-vserprog/mkhelper.cfg | 2 -- mk | 1 + 6 files changed, 1 insertion(+), 10 deletions(-) diff --git a/config/data/coreboot/mkhelper.cfg b/config/data/coreboot/mkhelper.cfg index 624d4ec2..c993fbd4 100644 --- a/config/data/coreboot/mkhelper.cfg +++ b/config/data/coreboot/mkhelper.cfg @@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -. "include/rom.sh" - makeargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" build_depend="seabios/default grub/default memtest86plus u-boot/amd64coreboot" diff --git a/config/data/grub/mkhelper.cfg b/config/data/grub/mkhelper.cfg index 5d66f42f..8c250f6b 100644 --- a/config/data/grub/mkhelper.cfg +++ b/config/data/grub/mkhelper.cfg @@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -. "include/rom.sh" - bootstrapargs="--gnulib-srcdir=gnulib/ --no-git" autoconfargs="--with-platform=coreboot --disable-werror" makeargs="FS_PAYLOAD_MODULES=\"\"" diff --git a/config/data/pcsx-redux/mkhelper.cfg b/config/data/pcsx-redux/mkhelper.cfg index af744685..6ad20de5 100644 --- a/config/data/pcsx-redux/mkhelper.cfg +++ b/config/data/pcsx-redux/mkhelper.cfg @@ -1,5 +1,3 @@ # SPDX-License-Identifier: GPL-3.0-or-later -. "include/rom.sh" - postmake="copyps1bios" diff --git a/config/data/pico-serprog/mkhelper.cfg b/config/data/pico-serprog/mkhelper.cfg index ccfdc0df..8e902bda 100644 --- a/config/data/pico-serprog/mkhelper.cfg +++ b/config/data/pico-serprog/mkhelper.cfg @@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -. "include/rom.sh" - sersrc="src/pico-serprog" serx="$sersrc/build/pico_serprog.uf2" picosdk="src/pico-sdk" diff --git a/config/data/stm32-vserprog/mkhelper.cfg b/config/data/stm32-vserprog/mkhelper.cfg index 54b05caf..907e890f 100644 --- a/config/data/stm32-vserprog/mkhelper.cfg +++ b/config/data/stm32-vserprog/mkhelper.cfg @@ -1,7 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -. "include/rom.sh" - sersrc="src/stm32-vserprog" serx="$sersrc/stm32-vserprog.hex" serdir="$sersrc/boards" diff --git a/mk b/mk index ec42d097..6a46f93c 100755 --- a/mk +++ b/mk @@ -17,6 +17,7 @@ fi . "include/init.sh" . "include/inject.sh" . "include/mrc.sh" +. "include/rom.sh" eval "`setvars "" vdir src_dirname srcdir mode`" -- cgit v1.2.1 From 773d2deaca05cdee754ef4ec79bae9ddd1f3383c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 2 May 2025 17:05:56 +0100 Subject: NEW MAINBOARD: Dell Precision T1700 SFF and MT This is similar to the 9020SFF, but this board has ECC support. However, the native raminit isn't used here, even though it is otherwise compatible, because the native init doesn't do ECC yet. The broadwell mrc.bin has ECC support, which is also used on the HP EliteBook 820 G2. The MRC for broadwell can be used on haswell boards such as the T1700. Add both the SFF and MT variants. Since these are identical to the 9020 variants, except for slightly different PCH enabling ECC, we can just re-use the 9020 port without issue. We *could* add a variant to coreboot, for T1700, but there is not really any pressing need. It is simply the 9020sff/mt with mrc.bin Signed-off-by: Leah Rowe --- .../t1700mt_bmrc_12mb/config/libgfxinit_corebootfb | 691 +++++++++++++++++++++ .../t1700mt_bmrc_12mb/config/libgfxinit_txtmode | 688 ++++++++++++++++++++ config/coreboot/t1700mt_bmrc_12mb/target.cfg | 12 + .../config/libgfxinit_corebootfb | 691 +++++++++++++++++++++ .../t1700sff_bmrc_12mb/config/libgfxinit_txtmode | 688 ++++++++++++++++++++ config/coreboot/t1700sff_bmrc_12mb/target.cfg | 12 + config/vendor/t1700/pkg.cfg | 9 + include/inject.sh | 2 + include/mrc.sh | 57 +- 9 files changed, 2825 insertions(+), 25 deletions(-) create mode 100644 config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_corebootfb create mode 100644 config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_txtmode create mode 100644 config/coreboot/t1700mt_bmrc_12mb/target.cfg create mode 100644 config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_corebootfb create mode 100644 config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_txtmode create mode 100644 config/coreboot/t1700sff_bmrc_12mb/target.cfg create mode 100644 config/vendor/t1700/pkg.cfg diff --git a/config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_corebootfb b/config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_corebootfb new file mode 100644 index 00000000..969d2c0e --- /dev/null +++ b/config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_corebootfb @@ -0,0 +1,691 @@ +# +# Automatically generated file; DO NOT EDIT. +# coreboot configuration +# + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_CBFS_PREFIX="fallback" +CONFIG_COMPILER_GCC=y +# CONFIG_COMPILER_LLVM_CLANG is not set +# CONFIG_ANY_TOOLCHAIN is not set +# CONFIG_CCACHE is not set +# CONFIG_LTO is not set +# CONFIG_IWYU is not set +# CONFIG_FMD_GENPARSER is not set +# CONFIG_UTIL_GENPARSER is not set +# CONFIG_OPTION_BACKEND_NONE is not set +CONFIG_USE_OPTION_TABLE=y +# CONFIG_USE_CBFS_FILE_OPTION_BACKEND is not set +CONFIG_STATIC_OPTION_TABLE=y +CONFIG_COMPRESS_RAMSTAGE_LZMA=y +# CONFIG_COMPRESS_RAMSTAGE_LZ4 is not set +CONFIG_SEPARATE_ROMSTAGE=y +CONFIG_INCLUDE_CONFIG_FILE=y +CONFIG_COLLECT_TIMESTAMPS=y +# CONFIG_TIMESTAMPS_ON_CONSOLE is not set +CONFIG_USE_BLOBS=y +# CONFIG_USE_AMD_BLOBS is not set +# CONFIG_USE_QC_BLOBS is not set +# CONFIG_COVERAGE is not set +# CONFIG_UBSAN is not set +CONFIG_HAVE_ASAN_IN_ROMSTAGE=y +CONFIG_HAVE_ASAN_IN_RAMSTAGE=y +# CONFIG_ASAN is not set +CONFIG_NO_STAGE_CACHE=y +# CONFIG_TSEG_STAGE_CACHE is not set +# CONFIG_UPDATE_IMAGE is not set +# CONFIG_BOOTSPLASH_IMAGE is not set + +# +# Software Bill Of Materials (SBOM) +# +# CONFIG_SBOM is not set +# end of Software Bill Of Materials (SBOM) +# end of General setup + +# +# Mainboard +# + +# +# Important: Run 'make distclean' before switching boards +# +# CONFIG_VENDOR_51NB is not set +# CONFIG_VENDOR_ACER is not set +# CONFIG_VENDOR_AMD is not set +# CONFIG_VENDOR_AOOSTAR is not set +# CONFIG_VENDOR_AOPEN is not set +# CONFIG_VENDOR_APPLE is not set +# CONFIG_VENDOR_ARM is not set +# CONFIG_VENDOR_ASROCK is not set +# CONFIG_VENDOR_ASUS is not set +# CONFIG_VENDOR_BIOSTAR is not set +# CONFIG_VENDOR_BOSTENTECH is not set +# CONFIG_VENDOR_BYTEDANCE is not set +# CONFIG_VENDOR_CAVIUM is not set +# CONFIG_VENDOR_CLEVO is not set +# CONFIG_VENDOR_COMPULAB is not set +# CONFIG_VENDOR_CWWK is not set +CONFIG_VENDOR_DELL=y +# CONFIG_VENDOR_EMULATION is not set +# CONFIG_VENDOR_ERYING is not set +# CONFIG_VENDOR_EXAMPLE is not set +# CONFIG_VENDOR_FACEBOOK is not set +# CONFIG_VENDOR_FOXCONN is not set +# CONFIG_VENDOR_FRAMEWORK is not set +# CONFIG_VENDOR_GETAC is not set +# CONFIG_VENDOR_GIGABYTE is not set +# CONFIG_VENDOR_GOOGLE is not set +# CONFIG_VENDOR_HARDKERNEL is not set +# CONFIG_VENDOR_HP is not set +# CONFIG_VENDOR_IBASE is not set +# CONFIG_VENDOR_IBM is not set +# CONFIG_VENDOR_INTEL is not set +# CONFIG_VENDOR_INVENTEC is not set +# CONFIG_VENDOR_KONTRON is not set +# CONFIG_VENDOR_LATTEPANDA is not set +# CONFIG_VENDOR_LENOVO is not set +# CONFIG_VENDOR_LIBRETREND is not set +# CONFIG_VENDOR_MITAC_COMPUTING is not set +# CONFIG_VENDOR_MSI is not set +# CONFIG_VENDOR_NOVACUSTOM is not set +# CONFIG_VENDOR_OCP is not set +# CONFIG_VENDOR_OPENCELLULAR is not set +# CONFIG_VENDOR_PACKARDBELL is not set +# CONFIG_VENDOR_PCENGINES is not set +# CONFIG_VENDOR_PINE64 is not set +# CONFIG_VENDOR_PORTWELL is not set +# CONFIG_VENDOR_PRODRIVE is not set +# CONFIG_VENDOR_PROTECTLI is not set +# CONFIG_VENDOR_PURISM is not set +# CONFIG_VENDOR_RAPTOR_CS is not set +# CONFIG_VENDOR_RAZER is not set +# CONFIG_VENDOR_RODA is not set +# CONFIG_VENDOR_SAMSUNG is not set +# CONFIG_VENDOR_SAPPHIRE is not set +# CONFIG_VENDOR_SIEMENS is not set +# CONFIG_VENDOR_SIFIVE is not set +# CONFIG_VENDOR_STARLABS is not set +# CONFIG_VENDOR_SUPERMICRO is not set +# CONFIG_VENDOR_SYSTEM76 is not set +# CONFIG_VENDOR_TI is not set +# CONFIG_VENDOR_TOPTON is not set +# CONFIG_VENDOR_UP is not set +# CONFIG_VENDOR_VIA is not set +CONFIG_BOARD_SPECIFIC_OPTIONS=y +CONFIG_MAINBOARD_PART_NUMBER="Precision T1700 MT" +CONFIG_MAINBOARD_VERSION="1.0" +CONFIG_MAINBOARD_DIR="dell/optiplex_9020" +CONFIG_VGA_BIOS_ID="8086,0166" +CONFIG_DIMM_MAX=4 +CONFIG_DIMM_SPD_SIZE=256 +CONFIG_FMDFILE="" +# CONFIG_NO_POST is not set +CONFIG_MAINBOARD_VENDOR="Dell Inc." +CONFIG_CBFS_SIZE=0x800000 +CONFIG_CONSOLE_SERIAL=y +CONFIG_LINEAR_FRAMEBUFFER_MAX_HEIGHT=2160 +CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH=3840 +CONFIG_MAX_CPUS=8 +# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set +CONFIG_POST_DEVICE=y +CONFIG_POST_IO=y +CONFIG_UART_FOR_CONSOLE=0 +CONFIG_OVERRIDE_DEVICETREE="overridetree_mt.cb" +CONFIG_DEVICETREE="devicetree.cb" +# CONFIG_VBOOT is not set +# CONFIG_VGA_BIOS is not set +CONFIG_PCIEXP_ASPM=y +CONFIG_PCIEXP_L1_SUB_STATE=y +CONFIG_PCIEXP_CLK_PM=y +CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="Dell Inc." +CONFIG_ECAM_MMCONF_BASE_ADDRESS=0xf0000000 +CONFIG_ECAM_MMCONF_BUS_NUMBER=64 +CONFIG_MEMLAYOUT_LD_FILE="src/arch/x86/memlayout.ld" +# CONFIG_FATAL_ASSERTS is not set +CONFIG_INTEL_GMA_VBT_FILE="src/mainboard/$(MAINBOARDDIR)/data.vbt" +CONFIG_PRERAM_CBMEM_CONSOLE_SIZE=0xc00 +CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="OptiPlex 7020/9020 SFF" +# CONFIG_CONSOLE_POST is not set +CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default" +CONFIG_CMOS_LAYOUT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.layout" +CONFIG_MAX_SOCKET=1 +CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0 +CONFIG_TPM_PIRQ=0x0 +# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set +# CONFIG_BOARD_DELL_E4300 is not set +# CONFIG_BOARD_DELL_E6400 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_3050 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_MT is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_USFF is not set +# CONFIG_BOARD_DELL_OPTIPLEX_9020_SFF is not set +CONFIG_BOARD_DELL_OPTIPLEX_9020_MT=y +# CONFIG_BOARD_DELL_LATITUDE_E5420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6220 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6320 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5530 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6230 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6330 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6430 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6530 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_9010 is not set +# CONFIG_BOARD_DELL_PRECISION_T1650 is not set +# CONFIG_BOARD_DELL_XPS_8300 is not set +CONFIG_DCACHE_RAM_BASE=0xff7c0000 +CONFIG_DCACHE_RAM_SIZE=0x10000 +CONFIG_C_ENV_BOOTBLOCK_SIZE=0x40000 +CONFIG_DCACHE_BSP_STACK_SIZE=0x2000 +CONFIG_MAX_ACPI_TABLE_SIZE_KB=144 +CONFIG_HAVE_INTEL_FIRMWARE=y +CONFIG_MRC_SETTINGS_CACHE_SIZE=0x10000 +CONFIG_SPI_FLASH_INCLUDE_ALL_DRIVERS=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_DRIVERS_INTEL_WIFI=y +CONFIG_IFD_BIN_PATH="../../../config/ifd/dell9020mt/12_ifd" +CONFIG_ME_BIN_PATH="../../../vendorfiles/t440p/me.bin" +CONFIG_GBE_BIN_PATH="../../../config/ifd/dell9020mt/gbe" +CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000 +# CONFIG_ENABLE_DDR_2X_REFRESH is not set +CONFIG_PCIEXP_AER=y +CONFIG_CARDBUS_PLUGIN_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_STMICRO=y +# CONFIG_DEBUG_SMI is not set +CONFIG_HAVE_IFD_BIN=y +CONFIG_PS2K_EISAID="PNP0303" +CONFIG_PS2M_EISAID="PNP0F13" +CONFIG_GFX_GMA_PANEL_1_PORT="eDP" +CONFIG_TTYS0_BAUD=115200 +CONFIG_D3COLD_SUPPORT=y +CONFIG_GFX_GMA_PANEL_1_ON_EDP=y +CONFIG_DRIVERS_UART_8250IO=y +CONFIG_PC_CMOS_BASE_PORT_BANK1=0x72 +CONFIG_HEAP_SIZE=0x100000 +CONFIG_EC_GPE_SCI=0x50 +CONFIG_EC_STARLABS_BATTERY_MODEL="Unknown" +CONFIG_EC_STARLABS_BATTERY_TYPE="LION" +CONFIG_EC_STARLABS_BATTERY_OEM="Unknown" +# CONFIG_TPM_MEASURED_BOOT is not set +CONFIG_BOARD_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_1024 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_2048 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_4096 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_5120 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_6144 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_8192 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_10240 is not set +CONFIG_COREBOOT_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_16384 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_24576 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_32768 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_65536 is not set +CONFIG_COREBOOT_ROMSIZE_KB=12288 +CONFIG_ROM_SIZE=0x00c00000 +CONFIG_HAVE_POWER_STATE_AFTER_FAILURE=y +CONFIG_HAVE_POWER_STATE_PREVIOUS_AFTER_FAILURE=y +CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y +# CONFIG_POWER_STATE_ON_AFTER_FAILURE is not set +# CONFIG_POWER_STATE_PREVIOUS_AFTER_FAILURE is not set +CONFIG_MAINBOARD_POWER_FAILURE_STATE=0 +# end of Mainboard + +# +# Chipset +# + +# +# SoC +# +CONFIG_CHIPSET_DEVICETREE="" +CONFIG_CBFS_MCACHE_SIZE=0x4000 +CONFIG_ROMSTAGE_ADDR=0x2000000 +CONFIG_VERSTAGE_ADDR=0x2000000 +CONFIG_SMM_TSEG_SIZE=0x800000 +CONFIG_SMM_RESERVED_SIZE=0x100000 +CONFIG_SMM_MODULE_STACK_SIZE=0x400 +CONFIG_SERIRQ_CONTINUOUS_MODE=y +CONFIG_PRERAM_CBFS_CACHE_SIZE=0x4000 +CONFIG_DOMAIN_RESOURCE_32BIT_LIMIT=0xf0000000 +CONFIG_EHCI_BAR=0xd8000000 +CONFIG_ACPI_CPU_STRING="CP%02X" +CONFIG_STACK_SIZE=0x2000 +CONFIG_IED_REGION_SIZE=0x400000 +CONFIG_INTEL_GMA_BCLV_OFFSET=0x48254 +CONFIG_INTEL_GMA_BCLV_WIDTH=16 +CONFIG_INTEL_GMA_BCLM_OFFSET=0xc8256 +CONFIG_INTEL_GMA_BCLM_WIDTH=16 +CONFIG_BOOTBLOCK_IN_CBFS=y +CONFIG_HAVE_MRC=y +CONFIG_MRC_FILE="../../../mrc/broadwell/mrc.bin" +CONFIG_DCACHE_RAM_MRC_VAR_SIZE=0x30000 +CONFIG_HPET_MIN_TICKS=0x80 +CONFIG_FIXED_MCHBAR_MMIO_BASE=0xfed10000 +CONFIG_FIXED_DMIBAR_MMIO_BASE=0xfed18000 +CONFIG_FIXED_EPBAR_MMIO_BASE=0xfed19000 +CONFIG_PCIEXP_COMMON_CLOCK=y +CONFIG_DISABLE_ME_PCI=y +CONFIG_CPU_INTEL_NUM_FIT_ENTRIES=6 +CONFIG_SOC_PHYSICAL_ADDRESS_WIDTH=0 +# CONFIG_ALWAYS_ALLOW_ABOVE_4G_ALLOCATION is not set +CONFIG_FIXED_SMBUS_IO_BASE=0x400 +CONFIG_CBFS_CACHE_ALIGN=8 + +# +# CPU +# +CONFIG_CPU_INTEL_HASWELL=y +CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE=y +CONFIG_CPU_INTEL_COMMON=y +CONFIG_ENABLE_VMX=y +CONFIG_SET_IA32_FC_LOCK_BIT=y +CONFIG_SET_MSR_AESNI_LOCK_BIT=y +CONFIG_CPU_INTEL_COMMON_TIMEBASE=y +CONFIG_CPU_INTEL_COMMON_VOLTAGE=y +CONFIG_CPU_INTEL_COMMON_SMM=y +CONFIG_PARALLEL_MP=y +CONFIG_XAPIC_ONLY=y +# CONFIG_X2APIC_ONLY is not set +# CONFIG_X2APIC_RUNTIME is not set +# CONFIG_X2APIC_LATE_WORKAROUND is not set +CONFIG_UDELAY_TSC=y +CONFIG_TSC_MONOTONIC_TIMER=y +CONFIG_TSC_SYNC_MFENCE=y +CONFIG_HAVE_SMI_HANDLER=y +CONFIG_CPU_PT_ROM_MAP_GB=512 +CONFIG_SMM_TSEG=y +CONFIG_SMM_PCI_RESOURCE_STORE_NUM_SLOTS=8 +CONFIG_AP_STACK_SIZE=0x800 +CONFIG_SMP=y +CONFIG_SSE=y +CONFIG_SSE2=y +CONFIG_SUPPORT_CPU_UCODE_IN_CBFS=y +CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y +CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS=y +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS is not set +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER is not set +# CONFIG_CPU_MICROCODE_CBFS_NONE is not set + +# +# Northbridge +# +CONFIG_NORTHBRIDGE_INTEL_HASWELL=y +# CONFIG_USE_NATIVE_RAMINIT is not set +CONFIG_USE_BROADWELL_MRC=y +# CONFIG_HASWELL_HIDE_PEG_FROM_MRC is not set + +# +# Southbridge +# +# CONFIG_PCIEXP_HOTPLUG is not set +CONFIG_INTEL_DESCRIPTOR_MODE_REQUIRED=y +CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT=y +CONFIG_FINALIZE_USB_ROUTE_XHCI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RESET=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RTC=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMCLIB=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMBASE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_GPIO=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_EARLY_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI_ICH9=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PIRQ_ACPI_GEN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RCBA_PIRQ=y +CONFIG_HAVE_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_FINALIZE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_USB_DEBUG=y +CONFIG_INTEL_DESCRIPTOR_MODE_CAPABLE=y +# CONFIG_VALIDATE_INTEL_DESCRIPTOR is not set +CONFIG_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_TCO_SPACE_NOT_YET_SPLIT=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_WATCHDOG=y +CONFIG_FIXED_RCBA_MMIO_BASE=0xfed1c000 +CONFIG_RCBA_LENGTH=0x4000 + +# +# Super I/O +# +CONFIG_SUPERIO_SMSC_SCH555x=y + +# +# Embedded Controllers +# + +# +# Intel Firmware +# +CONFIG_HAVE_ME_BIN=y +# CONFIG_STITCH_ME_BIN is not set +# CONFIG_CHECK_ME is not set +# CONFIG_ME_REGION_ALLOW_CPU_READ_ACCESS is not set +# CONFIG_USE_ME_CLEANER is not set +CONFIG_MAINBOARD_USES_IFD_GBE_REGION=y +CONFIG_HAVE_GBE_BIN=y +# CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION is not set +# CONFIG_LOCK_MANAGEMENT_ENGINE is not set +CONFIG_UNLOCK_FLASH_REGIONS=y +CONFIG_ACPI_FNKEY_GEN_SCANCODE=0 +# CONFIG_GOOGLE_PVMFW_CBMEM is not set +CONFIG_ARCH_X86=y +CONFIG_ARCH_BOOTBLOCK_X86_32=y +CONFIG_ARCH_VERSTAGE_X86_32=y +CONFIG_ARCH_ROMSTAGE_X86_32=y +CONFIG_ARCH_POSTCAR_X86_32=y +CONFIG_ARCH_RAMSTAGE_X86_32=y +CONFIG_ARCH_ALL_STAGES_X86_32=y +CONFIG_RESERVED_PHYSICAL_ADDRESS_BITS_SUPPORT=y +CONFIG_X86_TOP4G_BOOTMEDIA_MAP=y +CONFIG_POSTRAM_CBFS_CACHE_IN_BSS=y +CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000 +CONFIG_PC80_SYSTEM=y +CONFIG_HAVE_CMOS_DEFAULT=y +CONFIG_POSTCAR_STAGE=y +CONFIG_BOOTBLOCK_SIMPLE=y +# CONFIG_BOOTBLOCK_NORMAL is not set +CONFIG_COLLECT_TIMESTAMPS_TSC=y +CONFIG_HAVE_CF9_RESET=y +CONFIG_DEBUG_HW_BREAKPOINTS=y +CONFIG_DEBUG_NULL_DEREF_BREAKPOINTS=y +# CONFIG_DUMP_SMBIOS_TYPE17 is not set +CONFIG_X86_BOOTBLOCK_EXTRA_PROGRAM_SZ=0 +CONFIG_DEFAULT_EBDA_LOWMEM=0x100000 +CONFIG_DEFAULT_EBDA_SEGMENT=0xF600 +CONFIG_DEFAULT_EBDA_SIZE=0x400 +# end of Chipset + +# +# Devices +# +CONFIG_HAVE_VGA_TEXT_FRAMEBUFFER=y +CONFIG_HAVE_LINEAR_FRAMEBUFFER=y +CONFIG_MAINBOARD_HAS_LIBGFXINIT=y +CONFIG_MAINBOARD_USE_LIBGFXINIT=y +# CONFIG_VGA_ROM_RUN is not set +# CONFIG_NO_GFX_INIT is not set +CONFIG_NO_EARLY_GFX_INIT=y + +# +# Display +# +# CONFIG_VGA_TEXT_FRAMEBUFFER is not set +CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y +CONFIG_LINEAR_FRAMEBUFFER=y +# CONFIG_BOOTSPLASH is not set +CONFIG_DEFAULT_SCREEN_ROTATION_INT=0 +# end of Display + +CONFIG_PCI=y +CONFIG_ECAM_MMCONF_SUPPORT=y +CONFIG_PCIX_PLUGIN_SUPPORT=y +CONFIG_AZALIA_HDA_CODEC_SUPPORT=y +CONFIG_PCIEXP_PLUGIN_SUPPORT=y +CONFIG_ECAM_MMCONF_LENGTH=0x04000000 +CONFIG_PCI_ALLOW_BUS_MASTER=y +CONFIG_PCI_SET_BUS_MASTER_PCI_BRIDGES=y +CONFIG_PCI_ALLOW_BUS_MASTER_ANY_DEVICE=y +# CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS is not set +# CONFIG_PCIEXP_LANE_ERR_STAT_CLEAR is not set +# CONFIG_EARLY_PCI_BRIDGE is not set +CONFIG_SUBSYSTEM_VENDOR_ID=0x0000 +CONFIG_SUBSYSTEM_DEVICE_ID=0x0000 +CONFIG_INTEL_GMA_HAVE_VBT=y +CONFIG_INTEL_GMA_ADD_VBT=y +# CONFIG_SOFTWARE_I2C is not set +CONFIG_I2C_TRANSFER_TIMEOUT_US=500000 +CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y +CONFIG_USE_DDR3=y +# end of Devices + +# +# Generic Drivers +# +CONFIG_CRB_TPM_BASE_ADDRESS=0xfed40000 +# CONFIG_ELOG is not set +CONFIG_CACHE_MRC_SETTINGS=y +# CONFIG_MRC_SETTINGS_PROTECT is not set +# CONFIG_DRIVERS_OPTION_CFR is not set +# CONFIG_SMMSTORE is not set +CONFIG_SPI_FLASH=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY=y +# CONFIG_SPI_FLASH_NO_FAST_READ is not set +CONFIG_SPI_FLASH_ADESTO=y +CONFIG_SPI_FLASH_AMIC=y +CONFIG_SPI_FLASH_ATMEL=y +CONFIG_SPI_FLASH_EON=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_SST=y +CONFIG_SPI_FLASH_ISSI=y +CONFIG_HAVE_EM100PRO_SPI_CONSOLE_SUPPORT=y +CONFIG_TPM_INIT_RAMSTAGE=y +# CONFIG_TPM_PPI is not set +CONFIG_DRIVERS_UART=y +# CONFIG_DRIVERS_UART_OXPCIE is not set +CONFIG_HAVE_USBDEBUG=y +CONFIG_HAVE_USBDEBUG_OPTIONS=y +# CONFIG_USBDEBUG is not set +# CONFIG_VPD is not set +# CONFIG_DRIVERS_EMULATION_QEMU_FW_CFG is not set +# CONFIG_DRIVERS_GENERIC_CBFS_SERIAL is not set +# CONFIG_DRIVERS_GENERIC_CBFS_UUID is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9750 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9755 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9763E is not set +# CONFIG_DRIVERS_I2C_MAX98396 is not set +CONFIG_INTEL_DDI=y +CONFIG_INTEL_INT15=y +CONFIG_INTEL_GMA_ACPI=y +CONFIG_VBT_CBFS_COMPRESSION_LZMA=y +# CONFIG_VBT_CBFS_COMPRESSION_LZ4 is not set +# CONFIG_VBT_CBFS_COMPRESSION_NONE is not set +CONFIG_VBT_CBFS_COMPRESSION_ALGORITHM="lzma" +CONFIG_GFX_GMA=y +CONFIG_GFX_GMA_DYN_CPU=y +CONFIG_GFX_GMA_GENERATION="Haswell" +CONFIG_GFX_GMA_PCH="Lynx_Point" +CONFIG_GFX_GMA_PANEL_2_PORT="Disabled" +CONFIG_GFX_GMA_ANALOG_I2C_PORT="PCH_DAC" +# CONFIG_DRIVERS_NXP_UWB_SR1XX is not set +# CONFIG_DRIVERS_PS2_KEYBOARD is not set +CONFIG_DRIVERS_MC146818=y +# CONFIG_USE_PC_CMOS_ALTCENTURY is not set +CONFIG_PC_CMOS_BASE_PORT_BANK0=0x70 +CONFIG_MEMORY_MAPPED_TPM=y +CONFIG_TPM_TIS_BASE_ADDRESS=0xfed40000 +# CONFIG_DRIVERS_SIL_3114 is not set +CONFIG_DRIVERS_WIFI_GENERIC=y +CONFIG_DRIVERS_MTK_WIFI=y +# end of Generic Drivers + +# +# Security +# + +# +# CBFS verification +# +# CONFIG_CBFS_VERIFICATION is not set +# end of CBFS verification + +# +# Verified Boot (vboot) +# +# end of Verified Boot (vboot) + +# +# Trusted Platform Module +# +CONFIG_TPM1=y +# CONFIG_TPM2 is not set +CONFIG_TPM=y +CONFIG_MAINBOARD_HAS_TPM1=y +# CONFIG_TPM_DEACTIVATE is not set +# CONFIG_DEBUG_TPM is not set +CONFIG_PCR_BOOT_MODE=1 +CONFIG_PCR_HWID=1 +CONFIG_PCR_SRTM=2 +CONFIG_PCR_FW_VER=10 +CONFIG_PCR_RUNTIME_DATA=3 +# end of Trusted Platform Module + +# +# Memory initialization +# +CONFIG_PLATFORM_HAS_DRAM_CLEAR=y +CONFIG_SECURITY_CLEAR_DRAM_ON_REGULAR_BOOT=y +# end of Memory initialization + +# CONFIG_INTEL_TXT is not set +# CONFIG_STM is not set +# CONFIG_INTEL_CBNT_SUPPORT is not set +CONFIG_BOOTMEDIA_LOCK_NONE=y +# CONFIG_BOOTMEDIA_LOCK_CONTROLLER is not set +# CONFIG_BOOTMEDIA_LOCK_CHIP is not set +# CONFIG_BOOTMEDIA_SMM_BWP is not set +# end of Security + +CONFIG_ACPI_HAVE_PCAT_8259=y +CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES=y +CONFIG_ACPI_SOC_NVS=y +CONFIG_ACPI_NO_CUSTOM_MADT=y +CONFIG_ACPI_COMMON_MADT_LAPIC=y +CONFIG_ACPI_COMMON_MADT_IOAPIC=y +CONFIG_HAVE_ACPI_TABLES=y +CONFIG_BOOT_DEVICE_SPI_FLASH=y +CONFIG_BOOT_DEVICE_MEMORY_MAPPED=y +CONFIG_BOOT_DEVICE_SUPPORTS_WRITES=y +CONFIG_RTC=y + +# +# Console +# +CONFIG_BOOTBLOCK_CONSOLE=y +CONFIG_POSTCAR_CONSOLE=y +CONFIG_SQUELCH_EARLY_SMP=y + +# +# I/O mapped, 8250-compatible +# +CONFIG_TTYS0_BASE=0x3f8 + +# +# Serial port base address = 0x3f8 +# +# CONFIG_CONSOLE_SERIAL_921600 is not set +# CONFIG_CONSOLE_SERIAL_460800 is not set +# CONFIG_CONSOLE_SERIAL_230400 is not set +CONFIG_CONSOLE_SERIAL_115200=y +# CONFIG_CONSOLE_SERIAL_57600 is not set +# CONFIG_CONSOLE_SERIAL_38400 is not set +# CONFIG_CONSOLE_SERIAL_19200 is not set +# CONFIG_CONSOLE_SERIAL_9600 is not set +CONFIG_TTYS0_LCS=3 +# CONFIG_SPKMODEM is not set +# CONFIG_CONSOLE_NE2K is not set +CONFIG_CONSOLE_CBMEM=y +# CONFIG_CONSOLE_SPI_FLASH is not set +# CONFIG_CONSOLE_I2C_SMBUS is not set +# CONFIG_EM100PRO_SPI_CONSOLE is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL_7=y +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_4 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_2 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL=7 +CONFIG_CONSOLE_USE_LOGLEVEL_PREFIX=y +CONFIG_CONSOLE_USE_ANSI_ESCAPES=y +# CONFIG_CMOS_POST is not set +CONFIG_POST_DEVICE_NONE=y +# CONFIG_POST_DEVICE_LPC is not set +# CONFIG_POST_DEVICE_PCI_PCIE is not set +CONFIG_POST_IO_PORT=0x80 +CONFIG_HWBASE_DEBUG_CB=y +# end of Console + +CONFIG_HAVE_ACPI_RESUME=y +CONFIG_RESUME_PATH_SAME_AS_BOOT=y +CONFIG_HAVE_MONOTONIC_TIMER=y +CONFIG_HAVE_OPTION_TABLE=y +CONFIG_IOAPIC=y +CONFIG_USE_WATCHDOG_ON_BOOT=y + +# +# System tables +# +CONFIG_GENERATE_SMBIOS_TABLES=y +CONFIG_BIOS_VENDOR="coreboot" +CONFIG_MAINBOARD_SERIAL_NUMBER="123456789" +# end of System tables + +# +# Payload +# +CONFIG_PAYLOAD_NONE=y +# end of Payload + +# +# Debugging +# + +# +# CPU Debug Settings +# +# CONFIG_DISPLAY_MTRRS is not set + +# +# Vendorcode Debug Settings +# + +# +# BLOB Debug Settings +# + +# +# General Debug Settings +# +# CONFIG_GDB_STUB is not set +# CONFIG_DEBUG_CBFS is not set +CONFIG_HAVE_DEBUG_SMBUS=y +# CONFIG_DEBUG_SMBUS is not set +# CONFIG_DEBUG_MALLOC is not set +# CONFIG_DEBUG_CONSOLE_INIT is not set +# CONFIG_DEBUG_SPI_FLASH is not set +# CONFIG_DEBUG_BOOT_STATE is not set +# CONFIG_DEBUG_ADA_CODE is not set +CONFIG_HAVE_EM100_SUPPORT=y +# CONFIG_EM100 is not set +# CONFIG_DEBUG_ACPICA_COMPATIBLE is not set +# end of Debugging + +CONFIG_RAMSTAGE_ADA=y +CONFIG_RAMSTAGE_LIBHWBASE=y +CONFIG_HWBASE_DYNAMIC_MMIO=y +CONFIG_HWBASE_DEFAULT_MMCONF=0xf0000000 +CONFIG_HWBASE_DIRECT_PCIDEV=y +CONFIG_DECOMPRESS_OFAST=y + +# +# Boot Logo Configuration +# +# CONFIG_BMP_LOGO is not set +# end of Boot Logo Configuration + +CONFIG_WARNINGS_ARE_ERRORS=y +CONFIG_MAX_REBOOT_CNT=3 +CONFIG_RELOCATABLE_MODULES=y +CONFIG_HAVE_BOOTBLOCK=y +CONFIG_HAVE_ROMSTAGE=y +CONFIG_HAVE_RAMSTAGE=y diff --git a/config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_txtmode b/config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_txtmode new file mode 100644 index 00000000..d16adf1e --- /dev/null +++ b/config/coreboot/t1700mt_bmrc_12mb/config/libgfxinit_txtmode @@ -0,0 +1,688 @@ +# +# Automatically generated file; DO NOT EDIT. +# coreboot configuration +# + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_CBFS_PREFIX="fallback" +CONFIG_COMPILER_GCC=y +# CONFIG_COMPILER_LLVM_CLANG is not set +# CONFIG_ANY_TOOLCHAIN is not set +# CONFIG_CCACHE is not set +# CONFIG_LTO is not set +# CONFIG_IWYU is not set +# CONFIG_FMD_GENPARSER is not set +# CONFIG_UTIL_GENPARSER is not set +# CONFIG_OPTION_BACKEND_NONE is not set +CONFIG_USE_OPTION_TABLE=y +# CONFIG_USE_CBFS_FILE_OPTION_BACKEND is not set +CONFIG_STATIC_OPTION_TABLE=y +CONFIG_COMPRESS_RAMSTAGE_LZMA=y +# CONFIG_COMPRESS_RAMSTAGE_LZ4 is not set +CONFIG_SEPARATE_ROMSTAGE=y +CONFIG_INCLUDE_CONFIG_FILE=y +CONFIG_COLLECT_TIMESTAMPS=y +# CONFIG_TIMESTAMPS_ON_CONSOLE is not set +CONFIG_USE_BLOBS=y +# CONFIG_USE_AMD_BLOBS is not set +# CONFIG_USE_QC_BLOBS is not set +# CONFIG_COVERAGE is not set +# CONFIG_UBSAN is not set +CONFIG_HAVE_ASAN_IN_ROMSTAGE=y +CONFIG_HAVE_ASAN_IN_RAMSTAGE=y +# CONFIG_ASAN is not set +CONFIG_NO_STAGE_CACHE=y +# CONFIG_TSEG_STAGE_CACHE is not set +# CONFIG_UPDATE_IMAGE is not set +# CONFIG_BOOTSPLASH_IMAGE is not set + +# +# Software Bill Of Materials (SBOM) +# +# CONFIG_SBOM is not set +# end of Software Bill Of Materials (SBOM) +# end of General setup + +# +# Mainboard +# + +# +# Important: Run 'make distclean' before switching boards +# +# CONFIG_VENDOR_51NB is not set +# CONFIG_VENDOR_ACER is not set +# CONFIG_VENDOR_AMD is not set +# CONFIG_VENDOR_AOOSTAR is not set +# CONFIG_VENDOR_AOPEN is not set +# CONFIG_VENDOR_APPLE is not set +# CONFIG_VENDOR_ARM is not set +# CONFIG_VENDOR_ASROCK is not set +# CONFIG_VENDOR_ASUS is not set +# CONFIG_VENDOR_BIOSTAR is not set +# CONFIG_VENDOR_BOSTENTECH is not set +# CONFIG_VENDOR_BYTEDANCE is not set +# CONFIG_VENDOR_CAVIUM is not set +# CONFIG_VENDOR_CLEVO is not set +# CONFIG_VENDOR_COMPULAB is not set +# CONFIG_VENDOR_CWWK is not set +CONFIG_VENDOR_DELL=y +# CONFIG_VENDOR_EMULATION is not set +# CONFIG_VENDOR_ERYING is not set +# CONFIG_VENDOR_EXAMPLE is not set +# CONFIG_VENDOR_FACEBOOK is not set +# CONFIG_VENDOR_FOXCONN is not set +# CONFIG_VENDOR_FRAMEWORK is not set +# CONFIG_VENDOR_GETAC is not set +# CONFIG_VENDOR_GIGABYTE is not set +# CONFIG_VENDOR_GOOGLE is not set +# CONFIG_VENDOR_HARDKERNEL is not set +# CONFIG_VENDOR_HP is not set +# CONFIG_VENDOR_IBASE is not set +# CONFIG_VENDOR_IBM is not set +# CONFIG_VENDOR_INTEL is not set +# CONFIG_VENDOR_INVENTEC is not set +# CONFIG_VENDOR_KONTRON is not set +# CONFIG_VENDOR_LATTEPANDA is not set +# CONFIG_VENDOR_LENOVO is not set +# CONFIG_VENDOR_LIBRETREND is not set +# CONFIG_VENDOR_MITAC_COMPUTING is not set +# CONFIG_VENDOR_MSI is not set +# CONFIG_VENDOR_NOVACUSTOM is not set +# CONFIG_VENDOR_OCP is not set +# CONFIG_VENDOR_OPENCELLULAR is not set +# CONFIG_VENDOR_PACKARDBELL is not set +# CONFIG_VENDOR_PCENGINES is not set +# CONFIG_VENDOR_PINE64 is not set +# CONFIG_VENDOR_PORTWELL is not set +# CONFIG_VENDOR_PRODRIVE is not set +# CONFIG_VENDOR_PROTECTLI is not set +# CONFIG_VENDOR_PURISM is not set +# CONFIG_VENDOR_RAPTOR_CS is not set +# CONFIG_VENDOR_RAZER is not set +# CONFIG_VENDOR_RODA is not set +# CONFIG_VENDOR_SAMSUNG is not set +# CONFIG_VENDOR_SAPPHIRE is not set +# CONFIG_VENDOR_SIEMENS is not set +# CONFIG_VENDOR_SIFIVE is not set +# CONFIG_VENDOR_STARLABS is not set +# CONFIG_VENDOR_SUPERMICRO is not set +# CONFIG_VENDOR_SYSTEM76 is not set +# CONFIG_VENDOR_TI is not set +# CONFIG_VENDOR_TOPTON is not set +# CONFIG_VENDOR_UP is not set +# CONFIG_VENDOR_VIA is not set +CONFIG_BOARD_SPECIFIC_OPTIONS=y +CONFIG_MAINBOARD_PART_NUMBER="Precision T1700 MT" +CONFIG_MAINBOARD_VERSION="1.0" +CONFIG_MAINBOARD_DIR="dell/optiplex_9020" +CONFIG_VGA_BIOS_ID="8086,0166" +CONFIG_DIMM_MAX=4 +CONFIG_DIMM_SPD_SIZE=256 +CONFIG_FMDFILE="" +# CONFIG_NO_POST is not set +CONFIG_MAINBOARD_VENDOR="Dell Inc." +CONFIG_CBFS_SIZE=0x800000 +CONFIG_CONSOLE_SERIAL=y +CONFIG_MAX_CPUS=8 +# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set +CONFIG_POST_DEVICE=y +CONFIG_POST_IO=y +CONFIG_UART_FOR_CONSOLE=0 +CONFIG_OVERRIDE_DEVICETREE="overridetree_mt.cb" +CONFIG_DEVICETREE="devicetree.cb" +# CONFIG_VBOOT is not set +# CONFIG_VGA_BIOS is not set +CONFIG_PCIEXP_ASPM=y +CONFIG_PCIEXP_L1_SUB_STATE=y +CONFIG_PCIEXP_CLK_PM=y +CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="Dell Inc." +CONFIG_ECAM_MMCONF_BASE_ADDRESS=0xf0000000 +CONFIG_ECAM_MMCONF_BUS_NUMBER=64 +CONFIG_MEMLAYOUT_LD_FILE="src/arch/x86/memlayout.ld" +# CONFIG_FATAL_ASSERTS is not set +CONFIG_INTEL_GMA_VBT_FILE="src/mainboard/$(MAINBOARDDIR)/data.vbt" +CONFIG_PRERAM_CBMEM_CONSOLE_SIZE=0xc00 +CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="OptiPlex 7020/9020 SFF" +# CONFIG_CONSOLE_POST is not set +CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default" +CONFIG_CMOS_LAYOUT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.layout" +CONFIG_MAX_SOCKET=1 +CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0 +CONFIG_TPM_PIRQ=0x0 +# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set +# CONFIG_BOARD_DELL_E4300 is not set +# CONFIG_BOARD_DELL_E6400 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_3050 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_MT is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_USFF is not set +# CONFIG_BOARD_DELL_OPTIPLEX_9020_SFF is not set +CONFIG_BOARD_DELL_OPTIPLEX_9020_MT=y +# CONFIG_BOARD_DELL_LATITUDE_E5420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6220 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6320 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5530 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6230 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6330 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6430 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6530 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_9010 is not set +# CONFIG_BOARD_DELL_PRECISION_T1650 is not set +# CONFIG_BOARD_DELL_XPS_8300 is not set +CONFIG_DCACHE_RAM_BASE=0xff7c0000 +CONFIG_DCACHE_RAM_SIZE=0x10000 +CONFIG_C_ENV_BOOTBLOCK_SIZE=0x40000 +CONFIG_DCACHE_BSP_STACK_SIZE=0x2000 +CONFIG_MAX_ACPI_TABLE_SIZE_KB=144 +CONFIG_HAVE_INTEL_FIRMWARE=y +CONFIG_MRC_SETTINGS_CACHE_SIZE=0x10000 +CONFIG_SPI_FLASH_INCLUDE_ALL_DRIVERS=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_DRIVERS_INTEL_WIFI=y +CONFIG_IFD_BIN_PATH="../../../config/ifd/dell9020mt/12_ifd" +CONFIG_ME_BIN_PATH="../../../vendorfiles/t440p/me.bin" +CONFIG_GBE_BIN_PATH="../../../config/ifd/dell9020mt/gbe" +CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000 +# CONFIG_ENABLE_DDR_2X_REFRESH is not set +CONFIG_PCIEXP_AER=y +CONFIG_CARDBUS_PLUGIN_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_STMICRO=y +# CONFIG_DEBUG_SMI is not set +CONFIG_HAVE_IFD_BIN=y +CONFIG_PS2K_EISAID="PNP0303" +CONFIG_PS2M_EISAID="PNP0F13" +CONFIG_GFX_GMA_PANEL_1_PORT="eDP" +CONFIG_TTYS0_BAUD=115200 +CONFIG_D3COLD_SUPPORT=y +CONFIG_GFX_GMA_PANEL_1_ON_EDP=y +CONFIG_DRIVERS_UART_8250IO=y +CONFIG_PC_CMOS_BASE_PORT_BANK1=0x72 +CONFIG_HEAP_SIZE=0x100000 +CONFIG_EC_GPE_SCI=0x50 +CONFIG_EC_STARLABS_BATTERY_MODEL="Unknown" +CONFIG_EC_STARLABS_BATTERY_TYPE="LION" +CONFIG_EC_STARLABS_BATTERY_OEM="Unknown" +# CONFIG_TPM_MEASURED_BOOT is not set +CONFIG_BOARD_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_1024 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_2048 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_4096 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_5120 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_6144 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_8192 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_10240 is not set +CONFIG_COREBOOT_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_16384 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_24576 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_32768 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_65536 is not set +CONFIG_COREBOOT_ROMSIZE_KB=12288 +CONFIG_ROM_SIZE=0x00c00000 +CONFIG_HAVE_POWER_STATE_AFTER_FAILURE=y +CONFIG_HAVE_POWER_STATE_PREVIOUS_AFTER_FAILURE=y +CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y +# CONFIG_POWER_STATE_ON_AFTER_FAILURE is not set +# CONFIG_POWER_STATE_PREVIOUS_AFTER_FAILURE is not set +CONFIG_MAINBOARD_POWER_FAILURE_STATE=0 +# end of Mainboard + +# +# Chipset +# + +# +# SoC +# +CONFIG_CHIPSET_DEVICETREE="" +CONFIG_CBFS_MCACHE_SIZE=0x4000 +CONFIG_ROMSTAGE_ADDR=0x2000000 +CONFIG_VERSTAGE_ADDR=0x2000000 +CONFIG_SMM_TSEG_SIZE=0x800000 +CONFIG_SMM_RESERVED_SIZE=0x100000 +CONFIG_SMM_MODULE_STACK_SIZE=0x400 +CONFIG_SERIRQ_CONTINUOUS_MODE=y +CONFIG_PRERAM_CBFS_CACHE_SIZE=0x4000 +CONFIG_DOMAIN_RESOURCE_32BIT_LIMIT=0xf0000000 +CONFIG_EHCI_BAR=0xd8000000 +CONFIG_ACPI_CPU_STRING="CP%02X" +CONFIG_STACK_SIZE=0x2000 +CONFIG_IED_REGION_SIZE=0x400000 +CONFIG_INTEL_GMA_BCLV_OFFSET=0x48254 +CONFIG_INTEL_GMA_BCLV_WIDTH=16 +CONFIG_INTEL_GMA_BCLM_OFFSET=0xc8256 +CONFIG_INTEL_GMA_BCLM_WIDTH=16 +CONFIG_BOOTBLOCK_IN_CBFS=y +CONFIG_HAVE_MRC=y +CONFIG_MRC_FILE="../../../mrc/broadwell/mrc.bin" +CONFIG_DCACHE_RAM_MRC_VAR_SIZE=0x30000 +CONFIG_HPET_MIN_TICKS=0x80 +CONFIG_FIXED_MCHBAR_MMIO_BASE=0xfed10000 +CONFIG_FIXED_DMIBAR_MMIO_BASE=0xfed18000 +CONFIG_FIXED_EPBAR_MMIO_BASE=0xfed19000 +CONFIG_PCIEXP_COMMON_CLOCK=y +CONFIG_DISABLE_ME_PCI=y +CONFIG_CPU_INTEL_NUM_FIT_ENTRIES=6 +CONFIG_SOC_PHYSICAL_ADDRESS_WIDTH=0 +# CONFIG_ALWAYS_ALLOW_ABOVE_4G_ALLOCATION is not set +CONFIG_FIXED_SMBUS_IO_BASE=0x400 +CONFIG_CBFS_CACHE_ALIGN=8 + +# +# CPU +# +CONFIG_CPU_INTEL_HASWELL=y +CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE=y +CONFIG_CPU_INTEL_COMMON=y +CONFIG_ENABLE_VMX=y +CONFIG_SET_IA32_FC_LOCK_BIT=y +CONFIG_SET_MSR_AESNI_LOCK_BIT=y +CONFIG_CPU_INTEL_COMMON_TIMEBASE=y +CONFIG_CPU_INTEL_COMMON_VOLTAGE=y +CONFIG_CPU_INTEL_COMMON_SMM=y +CONFIG_PARALLEL_MP=y +CONFIG_XAPIC_ONLY=y +# CONFIG_X2APIC_ONLY is not set +# CONFIG_X2APIC_RUNTIME is not set +# CONFIG_X2APIC_LATE_WORKAROUND is not set +CONFIG_UDELAY_TSC=y +CONFIG_TSC_MONOTONIC_TIMER=y +CONFIG_TSC_SYNC_MFENCE=y +CONFIG_HAVE_SMI_HANDLER=y +CONFIG_CPU_PT_ROM_MAP_GB=512 +CONFIG_SMM_TSEG=y +CONFIG_SMM_PCI_RESOURCE_STORE_NUM_SLOTS=8 +CONFIG_AP_STACK_SIZE=0x800 +CONFIG_SMP=y +CONFIG_SSE=y +CONFIG_SSE2=y +CONFIG_SUPPORT_CPU_UCODE_IN_CBFS=y +CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y +CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS=y +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS is not set +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER is not set +# CONFIG_CPU_MICROCODE_CBFS_NONE is not set + +# +# Northbridge +# +CONFIG_NORTHBRIDGE_INTEL_HASWELL=y +# CONFIG_USE_NATIVE_RAMINIT is not set +CONFIG_USE_BROADWELL_MRC=y +# CONFIG_HASWELL_HIDE_PEG_FROM_MRC is not set + +# +# Southbridge +# +# CONFIG_PCIEXP_HOTPLUG is not set +CONFIG_INTEL_DESCRIPTOR_MODE_REQUIRED=y +CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT=y +CONFIG_FINALIZE_USB_ROUTE_XHCI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RESET=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RTC=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMCLIB=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMBASE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_GPIO=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_EARLY_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI_ICH9=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PIRQ_ACPI_GEN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RCBA_PIRQ=y +CONFIG_HAVE_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_FINALIZE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_USB_DEBUG=y +CONFIG_INTEL_DESCRIPTOR_MODE_CAPABLE=y +# CONFIG_VALIDATE_INTEL_DESCRIPTOR is not set +CONFIG_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_TCO_SPACE_NOT_YET_SPLIT=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_WATCHDOG=y +CONFIG_FIXED_RCBA_MMIO_BASE=0xfed1c000 +CONFIG_RCBA_LENGTH=0x4000 + +# +# Super I/O +# +CONFIG_SUPERIO_SMSC_SCH555x=y + +# +# Embedded Controllers +# + +# +# Intel Firmware +# +CONFIG_HAVE_ME_BIN=y +# CONFIG_STITCH_ME_BIN is not set +# CONFIG_CHECK_ME is not set +# CONFIG_ME_REGION_ALLOW_CPU_READ_ACCESS is not set +# CONFIG_USE_ME_CLEANER is not set +CONFIG_MAINBOARD_USES_IFD_GBE_REGION=y +CONFIG_HAVE_GBE_BIN=y +# CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION is not set +# CONFIG_LOCK_MANAGEMENT_ENGINE is not set +CONFIG_UNLOCK_FLASH_REGIONS=y +CONFIG_ACPI_FNKEY_GEN_SCANCODE=0 +# CONFIG_GOOGLE_PVMFW_CBMEM is not set +CONFIG_ARCH_X86=y +CONFIG_ARCH_BOOTBLOCK_X86_32=y +CONFIG_ARCH_VERSTAGE_X86_32=y +CONFIG_ARCH_ROMSTAGE_X86_32=y +CONFIG_ARCH_POSTCAR_X86_32=y +CONFIG_ARCH_RAMSTAGE_X86_32=y +CONFIG_ARCH_ALL_STAGES_X86_32=y +CONFIG_RESERVED_PHYSICAL_ADDRESS_BITS_SUPPORT=y +CONFIG_X86_TOP4G_BOOTMEDIA_MAP=y +CONFIG_POSTRAM_CBFS_CACHE_IN_BSS=y +CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000 +CONFIG_PC80_SYSTEM=y +CONFIG_HAVE_CMOS_DEFAULT=y +CONFIG_POSTCAR_STAGE=y +CONFIG_BOOTBLOCK_SIMPLE=y +# CONFIG_BOOTBLOCK_NORMAL is not set +CONFIG_COLLECT_TIMESTAMPS_TSC=y +CONFIG_HAVE_CF9_RESET=y +CONFIG_DEBUG_HW_BREAKPOINTS=y +CONFIG_DEBUG_NULL_DEREF_BREAKPOINTS=y +# CONFIG_DUMP_SMBIOS_TYPE17 is not set +CONFIG_X86_BOOTBLOCK_EXTRA_PROGRAM_SZ=0 +CONFIG_DEFAULT_EBDA_LOWMEM=0x100000 +CONFIG_DEFAULT_EBDA_SEGMENT=0xF600 +CONFIG_DEFAULT_EBDA_SIZE=0x400 +# end of Chipset + +# +# Devices +# +CONFIG_HAVE_VGA_TEXT_FRAMEBUFFER=y +CONFIG_HAVE_LINEAR_FRAMEBUFFER=y +CONFIG_MAINBOARD_HAS_LIBGFXINIT=y +CONFIG_MAINBOARD_USE_LIBGFXINIT=y +# CONFIG_VGA_ROM_RUN is not set +# CONFIG_NO_GFX_INIT is not set +CONFIG_NO_EARLY_GFX_INIT=y + +# +# Display +# +CONFIG_VGA_TEXT_FRAMEBUFFER=y +# CONFIG_GENERIC_LINEAR_FRAMEBUFFER is not set +CONFIG_DEFAULT_SCREEN_ROTATION_INT=0 +# end of Display + +CONFIG_PCI=y +CONFIG_ECAM_MMCONF_SUPPORT=y +CONFIG_PCIX_PLUGIN_SUPPORT=y +CONFIG_AZALIA_HDA_CODEC_SUPPORT=y +CONFIG_PCIEXP_PLUGIN_SUPPORT=y +CONFIG_ECAM_MMCONF_LENGTH=0x04000000 +CONFIG_PCI_ALLOW_BUS_MASTER=y +CONFIG_PCI_SET_BUS_MASTER_PCI_BRIDGES=y +CONFIG_PCI_ALLOW_BUS_MASTER_ANY_DEVICE=y +# CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS is not set +# CONFIG_PCIEXP_LANE_ERR_STAT_CLEAR is not set +# CONFIG_EARLY_PCI_BRIDGE is not set +CONFIG_SUBSYSTEM_VENDOR_ID=0x0000 +CONFIG_SUBSYSTEM_DEVICE_ID=0x0000 +CONFIG_INTEL_GMA_HAVE_VBT=y +CONFIG_INTEL_GMA_ADD_VBT=y +# CONFIG_SOFTWARE_I2C is not set +CONFIG_I2C_TRANSFER_TIMEOUT_US=500000 +CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y +CONFIG_USE_DDR3=y +# end of Devices + +# +# Generic Drivers +# +CONFIG_CRB_TPM_BASE_ADDRESS=0xfed40000 +# CONFIG_ELOG is not set +CONFIG_CACHE_MRC_SETTINGS=y +# CONFIG_MRC_SETTINGS_PROTECT is not set +# CONFIG_DRIVERS_OPTION_CFR is not set +# CONFIG_SMMSTORE is not set +CONFIG_SPI_FLASH=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY=y +# CONFIG_SPI_FLASH_NO_FAST_READ is not set +CONFIG_SPI_FLASH_ADESTO=y +CONFIG_SPI_FLASH_AMIC=y +CONFIG_SPI_FLASH_ATMEL=y +CONFIG_SPI_FLASH_EON=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_SST=y +CONFIG_SPI_FLASH_ISSI=y +CONFIG_HAVE_EM100PRO_SPI_CONSOLE_SUPPORT=y +CONFIG_TPM_INIT_RAMSTAGE=y +# CONFIG_TPM_PPI is not set +CONFIG_DRIVERS_UART=y +# CONFIG_DRIVERS_UART_OXPCIE is not set +CONFIG_HAVE_USBDEBUG=y +CONFIG_HAVE_USBDEBUG_OPTIONS=y +# CONFIG_USBDEBUG is not set +# CONFIG_VPD is not set +# CONFIG_DRIVERS_EMULATION_QEMU_FW_CFG is not set +# CONFIG_DRIVERS_GENERIC_CBFS_SERIAL is not set +# CONFIG_DRIVERS_GENERIC_CBFS_UUID is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9750 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9755 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9763E is not set +# CONFIG_DRIVERS_I2C_MAX98396 is not set +CONFIG_INTEL_DDI=y +CONFIG_INTEL_INT15=y +CONFIG_INTEL_GMA_ACPI=y +CONFIG_VBT_CBFS_COMPRESSION_LZMA=y +# CONFIG_VBT_CBFS_COMPRESSION_LZ4 is not set +# CONFIG_VBT_CBFS_COMPRESSION_NONE is not set +CONFIG_VBT_CBFS_COMPRESSION_ALGORITHM="lzma" +CONFIG_GFX_GMA=y +CONFIG_GFX_GMA_DYN_CPU=y +CONFIG_GFX_GMA_GENERATION="Haswell" +CONFIG_GFX_GMA_PCH="Lynx_Point" +CONFIG_GFX_GMA_PANEL_2_PORT="Disabled" +CONFIG_GFX_GMA_ANALOG_I2C_PORT="PCH_DAC" +# CONFIG_DRIVERS_NXP_UWB_SR1XX is not set +# CONFIG_DRIVERS_PS2_KEYBOARD is not set +CONFIG_DRIVERS_MC146818=y +# CONFIG_USE_PC_CMOS_ALTCENTURY is not set +CONFIG_PC_CMOS_BASE_PORT_BANK0=0x70 +CONFIG_MEMORY_MAPPED_TPM=y +CONFIG_TPM_TIS_BASE_ADDRESS=0xfed40000 +CONFIG_VGA=y +# CONFIG_DRIVERS_SIL_3114 is not set +CONFIG_DRIVERS_WIFI_GENERIC=y +CONFIG_DRIVERS_MTK_WIFI=y +# end of Generic Drivers + +# +# Security +# + +# +# CBFS verification +# +# CONFIG_CBFS_VERIFICATION is not set +# end of CBFS verification + +# +# Verified Boot (vboot) +# +# end of Verified Boot (vboot) + +# +# Trusted Platform Module +# +CONFIG_TPM1=y +# CONFIG_TPM2 is not set +CONFIG_TPM=y +CONFIG_MAINBOARD_HAS_TPM1=y +# CONFIG_TPM_DEACTIVATE is not set +# CONFIG_DEBUG_TPM is not set +CONFIG_PCR_BOOT_MODE=1 +CONFIG_PCR_HWID=1 +CONFIG_PCR_SRTM=2 +CONFIG_PCR_FW_VER=10 +CONFIG_PCR_RUNTIME_DATA=3 +# end of Trusted Platform Module + +# +# Memory initialization +# +CONFIG_PLATFORM_HAS_DRAM_CLEAR=y +CONFIG_SECURITY_CLEAR_DRAM_ON_REGULAR_BOOT=y +# end of Memory initialization + +# CONFIG_INTEL_TXT is not set +# CONFIG_STM is not set +# CONFIG_INTEL_CBNT_SUPPORT is not set +CONFIG_BOOTMEDIA_LOCK_NONE=y +# CONFIG_BOOTMEDIA_LOCK_CONTROLLER is not set +# CONFIG_BOOTMEDIA_LOCK_CHIP is not set +# CONFIG_BOOTMEDIA_SMM_BWP is not set +# end of Security + +CONFIG_ACPI_HAVE_PCAT_8259=y +CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES=y +CONFIG_ACPI_SOC_NVS=y +CONFIG_ACPI_NO_CUSTOM_MADT=y +CONFIG_ACPI_COMMON_MADT_LAPIC=y +CONFIG_ACPI_COMMON_MADT_IOAPIC=y +CONFIG_HAVE_ACPI_TABLES=y +CONFIG_BOOT_DEVICE_SPI_FLASH=y +CONFIG_BOOT_DEVICE_MEMORY_MAPPED=y +CONFIG_BOOT_DEVICE_SUPPORTS_WRITES=y +CONFIG_RTC=y + +# +# Console +# +CONFIG_BOOTBLOCK_CONSOLE=y +CONFIG_POSTCAR_CONSOLE=y +CONFIG_SQUELCH_EARLY_SMP=y + +# +# I/O mapped, 8250-compatible +# +CONFIG_TTYS0_BASE=0x3f8 + +# +# Serial port base address = 0x3f8 +# +# CONFIG_CONSOLE_SERIAL_921600 is not set +# CONFIG_CONSOLE_SERIAL_460800 is not set +# CONFIG_CONSOLE_SERIAL_230400 is not set +CONFIG_CONSOLE_SERIAL_115200=y +# CONFIG_CONSOLE_SERIAL_57600 is not set +# CONFIG_CONSOLE_SERIAL_38400 is not set +# CONFIG_CONSOLE_SERIAL_19200 is not set +# CONFIG_CONSOLE_SERIAL_9600 is not set +CONFIG_TTYS0_LCS=3 +# CONFIG_SPKMODEM is not set +# CONFIG_CONSOLE_NE2K is not set +CONFIG_CONSOLE_CBMEM=y +# CONFIG_CONSOLE_SPI_FLASH is not set +# CONFIG_CONSOLE_I2C_SMBUS is not set +# CONFIG_EM100PRO_SPI_CONSOLE is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL_7=y +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_4 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_2 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL=7 +CONFIG_CONSOLE_USE_LOGLEVEL_PREFIX=y +CONFIG_CONSOLE_USE_ANSI_ESCAPES=y +# CONFIG_CMOS_POST is not set +CONFIG_POST_DEVICE_NONE=y +# CONFIG_POST_DEVICE_LPC is not set +# CONFIG_POST_DEVICE_PCI_PCIE is not set +CONFIG_POST_IO_PORT=0x80 +CONFIG_HWBASE_DEBUG_CB=y +# end of Console + +CONFIG_HAVE_ACPI_RESUME=y +CONFIG_RESUME_PATH_SAME_AS_BOOT=y +CONFIG_HAVE_MONOTONIC_TIMER=y +CONFIG_HAVE_OPTION_TABLE=y +CONFIG_IOAPIC=y +CONFIG_USE_WATCHDOG_ON_BOOT=y + +# +# System tables +# +CONFIG_GENERATE_SMBIOS_TABLES=y +CONFIG_BIOS_VENDOR="coreboot" +CONFIG_MAINBOARD_SERIAL_NUMBER="123456789" +# end of System tables + +# +# Payload +# +CONFIG_PAYLOAD_NONE=y +# end of Payload + +# +# Debugging +# + +# +# CPU Debug Settings +# +# CONFIG_DISPLAY_MTRRS is not set + +# +# Vendorcode Debug Settings +# + +# +# BLOB Debug Settings +# + +# +# General Debug Settings +# +# CONFIG_GDB_STUB is not set +# CONFIG_DEBUG_CBFS is not set +CONFIG_HAVE_DEBUG_SMBUS=y +# CONFIG_DEBUG_SMBUS is not set +# CONFIG_DEBUG_MALLOC is not set +# CONFIG_DEBUG_CONSOLE_INIT is not set +# CONFIG_DEBUG_SPI_FLASH is not set +# CONFIG_DEBUG_BOOT_STATE is not set +# CONFIG_DEBUG_ADA_CODE is not set +CONFIG_HAVE_EM100_SUPPORT=y +# CONFIG_EM100 is not set +# CONFIG_DEBUG_ACPICA_COMPATIBLE is not set +# end of Debugging + +CONFIG_RAMSTAGE_ADA=y +CONFIG_RAMSTAGE_LIBHWBASE=y +CONFIG_HWBASE_DYNAMIC_MMIO=y +CONFIG_HWBASE_DEFAULT_MMCONF=0xf0000000 +CONFIG_HWBASE_DIRECT_PCIDEV=y +CONFIG_DECOMPRESS_OFAST=y + +# +# Boot Logo Configuration +# +# CONFIG_BMP_LOGO is not set +# end of Boot Logo Configuration + +CONFIG_WARNINGS_ARE_ERRORS=y +CONFIG_MAX_REBOOT_CNT=3 +CONFIG_RELOCATABLE_MODULES=y +CONFIG_HAVE_BOOTBLOCK=y +CONFIG_HAVE_ROMSTAGE=y +CONFIG_HAVE_RAMSTAGE=y diff --git a/config/coreboot/t1700mt_bmrc_12mb/target.cfg b/config/coreboot/t1700mt_bmrc_12mb/target.cfg new file mode 100644 index 00000000..06de408c --- /dev/null +++ b/config/coreboot/t1700mt_bmrc_12mb/target.cfg @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +tree="default" +xarch="i386-elf" +payload_seabios="y" +payload_grub="y" +payload_memtest="y" +grub_scan_disk="nvme ahci" +grubtree="xhci" +vcfg="t1700" +build_depend="seabios/default grub/xhci memtest86plus u-boot/amd64coreboot" +payload_uboot_amd64="y" diff --git a/config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_corebootfb b/config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_corebootfb new file mode 100644 index 00000000..56f97e4c --- /dev/null +++ b/config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_corebootfb @@ -0,0 +1,691 @@ +# +# Automatically generated file; DO NOT EDIT. +# coreboot configuration +# + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_CBFS_PREFIX="fallback" +CONFIG_COMPILER_GCC=y +# CONFIG_COMPILER_LLVM_CLANG is not set +# CONFIG_ANY_TOOLCHAIN is not set +# CONFIG_CCACHE is not set +# CONFIG_LTO is not set +# CONFIG_IWYU is not set +# CONFIG_FMD_GENPARSER is not set +# CONFIG_UTIL_GENPARSER is not set +# CONFIG_OPTION_BACKEND_NONE is not set +CONFIG_USE_OPTION_TABLE=y +# CONFIG_USE_CBFS_FILE_OPTION_BACKEND is not set +CONFIG_STATIC_OPTION_TABLE=y +CONFIG_COMPRESS_RAMSTAGE_LZMA=y +# CONFIG_COMPRESS_RAMSTAGE_LZ4 is not set +CONFIG_SEPARATE_ROMSTAGE=y +CONFIG_INCLUDE_CONFIG_FILE=y +CONFIG_COLLECT_TIMESTAMPS=y +# CONFIG_TIMESTAMPS_ON_CONSOLE is not set +CONFIG_USE_BLOBS=y +# CONFIG_USE_AMD_BLOBS is not set +# CONFIG_USE_QC_BLOBS is not set +# CONFIG_COVERAGE is not set +# CONFIG_UBSAN is not set +CONFIG_HAVE_ASAN_IN_ROMSTAGE=y +CONFIG_HAVE_ASAN_IN_RAMSTAGE=y +# CONFIG_ASAN is not set +CONFIG_NO_STAGE_CACHE=y +# CONFIG_TSEG_STAGE_CACHE is not set +# CONFIG_UPDATE_IMAGE is not set +# CONFIG_BOOTSPLASH_IMAGE is not set + +# +# Software Bill Of Materials (SBOM) +# +# CONFIG_SBOM is not set +# end of Software Bill Of Materials (SBOM) +# end of General setup + +# +# Mainboard +# + +# +# Important: Run 'make distclean' before switching boards +# +# CONFIG_VENDOR_51NB is not set +# CONFIG_VENDOR_ACER is not set +# CONFIG_VENDOR_AMD is not set +# CONFIG_VENDOR_AOOSTAR is not set +# CONFIG_VENDOR_AOPEN is not set +# CONFIG_VENDOR_APPLE is not set +# CONFIG_VENDOR_ARM is not set +# CONFIG_VENDOR_ASROCK is not set +# CONFIG_VENDOR_ASUS is not set +# CONFIG_VENDOR_BIOSTAR is not set +# CONFIG_VENDOR_BOSTENTECH is not set +# CONFIG_VENDOR_BYTEDANCE is not set +# CONFIG_VENDOR_CAVIUM is not set +# CONFIG_VENDOR_CLEVO is not set +# CONFIG_VENDOR_COMPULAB is not set +# CONFIG_VENDOR_CWWK is not set +CONFIG_VENDOR_DELL=y +# CONFIG_VENDOR_EMULATION is not set +# CONFIG_VENDOR_ERYING is not set +# CONFIG_VENDOR_EXAMPLE is not set +# CONFIG_VENDOR_FACEBOOK is not set +# CONFIG_VENDOR_FOXCONN is not set +# CONFIG_VENDOR_FRAMEWORK is not set +# CONFIG_VENDOR_GETAC is not set +# CONFIG_VENDOR_GIGABYTE is not set +# CONFIG_VENDOR_GOOGLE is not set +# CONFIG_VENDOR_HARDKERNEL is not set +# CONFIG_VENDOR_HP is not set +# CONFIG_VENDOR_IBASE is not set +# CONFIG_VENDOR_IBM is not set +# CONFIG_VENDOR_INTEL is not set +# CONFIG_VENDOR_INVENTEC is not set +# CONFIG_VENDOR_KONTRON is not set +# CONFIG_VENDOR_LATTEPANDA is not set +# CONFIG_VENDOR_LENOVO is not set +# CONFIG_VENDOR_LIBRETREND is not set +# CONFIG_VENDOR_MITAC_COMPUTING is not set +# CONFIG_VENDOR_MSI is not set +# CONFIG_VENDOR_NOVACUSTOM is not set +# CONFIG_VENDOR_OCP is not set +# CONFIG_VENDOR_OPENCELLULAR is not set +# CONFIG_VENDOR_PACKARDBELL is not set +# CONFIG_VENDOR_PCENGINES is not set +# CONFIG_VENDOR_PINE64 is not set +# CONFIG_VENDOR_PORTWELL is not set +# CONFIG_VENDOR_PRODRIVE is not set +# CONFIG_VENDOR_PROTECTLI is not set +# CONFIG_VENDOR_PURISM is not set +# CONFIG_VENDOR_RAPTOR_CS is not set +# CONFIG_VENDOR_RAZER is not set +# CONFIG_VENDOR_RODA is not set +# CONFIG_VENDOR_SAMSUNG is not set +# CONFIG_VENDOR_SAPPHIRE is not set +# CONFIG_VENDOR_SIEMENS is not set +# CONFIG_VENDOR_SIFIVE is not set +# CONFIG_VENDOR_STARLABS is not set +# CONFIG_VENDOR_SUPERMICRO is not set +# CONFIG_VENDOR_SYSTEM76 is not set +# CONFIG_VENDOR_TI is not set +# CONFIG_VENDOR_TOPTON is not set +# CONFIG_VENDOR_UP is not set +# CONFIG_VENDOR_VIA is not set +CONFIG_BOARD_SPECIFIC_OPTIONS=y +CONFIG_MAINBOARD_PART_NUMBER="Precision T1700 SFF" +CONFIG_MAINBOARD_VERSION="1.0" +CONFIG_MAINBOARD_DIR="dell/optiplex_9020" +CONFIG_VGA_BIOS_ID="8086,0166" +CONFIG_DIMM_MAX=4 +CONFIG_DIMM_SPD_SIZE=256 +CONFIG_FMDFILE="" +# CONFIG_NO_POST is not set +CONFIG_MAINBOARD_VENDOR="Dell Inc." +CONFIG_CBFS_SIZE=0x800000 +CONFIG_CONSOLE_SERIAL=y +CONFIG_LINEAR_FRAMEBUFFER_MAX_HEIGHT=2160 +CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH=3840 +CONFIG_MAX_CPUS=8 +# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set +CONFIG_POST_DEVICE=y +CONFIG_POST_IO=y +CONFIG_UART_FOR_CONSOLE=0 +CONFIG_OVERRIDE_DEVICETREE="" +CONFIG_DEVICETREE="devicetree.cb" +# CONFIG_VBOOT is not set +# CONFIG_VGA_BIOS is not set +CONFIG_PCIEXP_ASPM=y +CONFIG_PCIEXP_L1_SUB_STATE=y +CONFIG_PCIEXP_CLK_PM=y +CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="Dell Inc." +CONFIG_ECAM_MMCONF_BASE_ADDRESS=0xf0000000 +CONFIG_ECAM_MMCONF_BUS_NUMBER=64 +CONFIG_MEMLAYOUT_LD_FILE="src/arch/x86/memlayout.ld" +# CONFIG_FATAL_ASSERTS is not set +CONFIG_INTEL_GMA_VBT_FILE="src/mainboard/$(MAINBOARDDIR)/data.vbt" +CONFIG_PRERAM_CBMEM_CONSOLE_SIZE=0xc00 +CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="OptiPlex 7020/9020 SFF" +# CONFIG_CONSOLE_POST is not set +CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default" +CONFIG_CMOS_LAYOUT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.layout" +CONFIG_MAX_SOCKET=1 +CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0 +CONFIG_TPM_PIRQ=0x0 +# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set +# CONFIG_BOARD_DELL_E4300 is not set +# CONFIG_BOARD_DELL_E6400 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_3050 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_MT is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_USFF is not set +CONFIG_BOARD_DELL_OPTIPLEX_9020_SFF=y +# CONFIG_BOARD_DELL_OPTIPLEX_9020_MT is not set +# CONFIG_BOARD_DELL_LATITUDE_E5420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6220 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6320 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5530 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6230 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6330 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6430 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6530 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_9010 is not set +# CONFIG_BOARD_DELL_PRECISION_T1650 is not set +# CONFIG_BOARD_DELL_XPS_8300 is not set +CONFIG_DCACHE_RAM_BASE=0xff7c0000 +CONFIG_DCACHE_RAM_SIZE=0x10000 +CONFIG_C_ENV_BOOTBLOCK_SIZE=0x40000 +CONFIG_DCACHE_BSP_STACK_SIZE=0x2000 +CONFIG_MAX_ACPI_TABLE_SIZE_KB=144 +CONFIG_HAVE_INTEL_FIRMWARE=y +CONFIG_MRC_SETTINGS_CACHE_SIZE=0x10000 +CONFIG_SPI_FLASH_INCLUDE_ALL_DRIVERS=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_DRIVERS_INTEL_WIFI=y +CONFIG_IFD_BIN_PATH="../../../config/ifd/dell9020mt/12_ifd" +CONFIG_ME_BIN_PATH="../../../vendorfiles/t440p/me.bin" +CONFIG_GBE_BIN_PATH="../../../config/ifd/dell9020mt/gbe" +CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000 +# CONFIG_ENABLE_DDR_2X_REFRESH is not set +CONFIG_PCIEXP_AER=y +CONFIG_CARDBUS_PLUGIN_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_STMICRO=y +# CONFIG_DEBUG_SMI is not set +CONFIG_HAVE_IFD_BIN=y +CONFIG_PS2K_EISAID="PNP0303" +CONFIG_PS2M_EISAID="PNP0F13" +CONFIG_GFX_GMA_PANEL_1_PORT="eDP" +CONFIG_TTYS0_BAUD=115200 +CONFIG_D3COLD_SUPPORT=y +CONFIG_GFX_GMA_PANEL_1_ON_EDP=y +CONFIG_DRIVERS_UART_8250IO=y +CONFIG_PC_CMOS_BASE_PORT_BANK1=0x72 +CONFIG_HEAP_SIZE=0x100000 +CONFIG_EC_GPE_SCI=0x50 +CONFIG_EC_STARLABS_BATTERY_MODEL="Unknown" +CONFIG_EC_STARLABS_BATTERY_TYPE="LION" +CONFIG_EC_STARLABS_BATTERY_OEM="Unknown" +# CONFIG_TPM_MEASURED_BOOT is not set +CONFIG_BOARD_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_1024 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_2048 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_4096 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_5120 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_6144 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_8192 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_10240 is not set +CONFIG_COREBOOT_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_16384 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_24576 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_32768 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_65536 is not set +CONFIG_COREBOOT_ROMSIZE_KB=12288 +CONFIG_ROM_SIZE=0x00c00000 +CONFIG_HAVE_POWER_STATE_AFTER_FAILURE=y +CONFIG_HAVE_POWER_STATE_PREVIOUS_AFTER_FAILURE=y +CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y +# CONFIG_POWER_STATE_ON_AFTER_FAILURE is not set +# CONFIG_POWER_STATE_PREVIOUS_AFTER_FAILURE is not set +CONFIG_MAINBOARD_POWER_FAILURE_STATE=0 +# end of Mainboard + +# +# Chipset +# + +# +# SoC +# +CONFIG_CHIPSET_DEVICETREE="" +CONFIG_CBFS_MCACHE_SIZE=0x4000 +CONFIG_ROMSTAGE_ADDR=0x2000000 +CONFIG_VERSTAGE_ADDR=0x2000000 +CONFIG_SMM_TSEG_SIZE=0x800000 +CONFIG_SMM_RESERVED_SIZE=0x100000 +CONFIG_SMM_MODULE_STACK_SIZE=0x400 +CONFIG_SERIRQ_CONTINUOUS_MODE=y +CONFIG_PRERAM_CBFS_CACHE_SIZE=0x4000 +CONFIG_DOMAIN_RESOURCE_32BIT_LIMIT=0xf0000000 +CONFIG_EHCI_BAR=0xd8000000 +CONFIG_ACPI_CPU_STRING="CP%02X" +CONFIG_STACK_SIZE=0x2000 +CONFIG_IED_REGION_SIZE=0x400000 +CONFIG_INTEL_GMA_BCLV_OFFSET=0x48254 +CONFIG_INTEL_GMA_BCLV_WIDTH=16 +CONFIG_INTEL_GMA_BCLM_OFFSET=0xc8256 +CONFIG_INTEL_GMA_BCLM_WIDTH=16 +CONFIG_BOOTBLOCK_IN_CBFS=y +CONFIG_HAVE_MRC=y +CONFIG_MRC_FILE="../../../mrc/broadwell/mrc.bin" +CONFIG_DCACHE_RAM_MRC_VAR_SIZE=0x30000 +CONFIG_HPET_MIN_TICKS=0x80 +CONFIG_FIXED_MCHBAR_MMIO_BASE=0xfed10000 +CONFIG_FIXED_DMIBAR_MMIO_BASE=0xfed18000 +CONFIG_FIXED_EPBAR_MMIO_BASE=0xfed19000 +CONFIG_PCIEXP_COMMON_CLOCK=y +CONFIG_DISABLE_ME_PCI=y +CONFIG_CPU_INTEL_NUM_FIT_ENTRIES=6 +CONFIG_SOC_PHYSICAL_ADDRESS_WIDTH=0 +# CONFIG_ALWAYS_ALLOW_ABOVE_4G_ALLOCATION is not set +CONFIG_FIXED_SMBUS_IO_BASE=0x400 +CONFIG_CBFS_CACHE_ALIGN=8 + +# +# CPU +# +CONFIG_CPU_INTEL_HASWELL=y +CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE=y +CONFIG_CPU_INTEL_COMMON=y +CONFIG_ENABLE_VMX=y +CONFIG_SET_IA32_FC_LOCK_BIT=y +CONFIG_SET_MSR_AESNI_LOCK_BIT=y +CONFIG_CPU_INTEL_COMMON_TIMEBASE=y +CONFIG_CPU_INTEL_COMMON_VOLTAGE=y +CONFIG_CPU_INTEL_COMMON_SMM=y +CONFIG_PARALLEL_MP=y +CONFIG_XAPIC_ONLY=y +# CONFIG_X2APIC_ONLY is not set +# CONFIG_X2APIC_RUNTIME is not set +# CONFIG_X2APIC_LATE_WORKAROUND is not set +CONFIG_UDELAY_TSC=y +CONFIG_TSC_MONOTONIC_TIMER=y +CONFIG_TSC_SYNC_MFENCE=y +CONFIG_HAVE_SMI_HANDLER=y +CONFIG_CPU_PT_ROM_MAP_GB=512 +CONFIG_SMM_TSEG=y +CONFIG_SMM_PCI_RESOURCE_STORE_NUM_SLOTS=8 +CONFIG_AP_STACK_SIZE=0x800 +CONFIG_SMP=y +CONFIG_SSE=y +CONFIG_SSE2=y +CONFIG_SUPPORT_CPU_UCODE_IN_CBFS=y +CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y +CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS=y +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS is not set +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER is not set +# CONFIG_CPU_MICROCODE_CBFS_NONE is not set + +# +# Northbridge +# +CONFIG_NORTHBRIDGE_INTEL_HASWELL=y +# CONFIG_USE_NATIVE_RAMINIT is not set +CONFIG_USE_BROADWELL_MRC=y +# CONFIG_HASWELL_HIDE_PEG_FROM_MRC is not set + +# +# Southbridge +# +# CONFIG_PCIEXP_HOTPLUG is not set +CONFIG_INTEL_DESCRIPTOR_MODE_REQUIRED=y +CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT=y +CONFIG_FINALIZE_USB_ROUTE_XHCI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RESET=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RTC=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMCLIB=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMBASE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_GPIO=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_EARLY_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI_ICH9=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PIRQ_ACPI_GEN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RCBA_PIRQ=y +CONFIG_HAVE_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_FINALIZE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_USB_DEBUG=y +CONFIG_INTEL_DESCRIPTOR_MODE_CAPABLE=y +# CONFIG_VALIDATE_INTEL_DESCRIPTOR is not set +CONFIG_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_TCO_SPACE_NOT_YET_SPLIT=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_WATCHDOG=y +CONFIG_FIXED_RCBA_MMIO_BASE=0xfed1c000 +CONFIG_RCBA_LENGTH=0x4000 + +# +# Super I/O +# +CONFIG_SUPERIO_SMSC_SCH555x=y + +# +# Embedded Controllers +# + +# +# Intel Firmware +# +CONFIG_HAVE_ME_BIN=y +# CONFIG_STITCH_ME_BIN is not set +# CONFIG_CHECK_ME is not set +# CONFIG_ME_REGION_ALLOW_CPU_READ_ACCESS is not set +# CONFIG_USE_ME_CLEANER is not set +CONFIG_MAINBOARD_USES_IFD_GBE_REGION=y +CONFIG_HAVE_GBE_BIN=y +# CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION is not set +# CONFIG_LOCK_MANAGEMENT_ENGINE is not set +CONFIG_UNLOCK_FLASH_REGIONS=y +CONFIG_ACPI_FNKEY_GEN_SCANCODE=0 +# CONFIG_GOOGLE_PVMFW_CBMEM is not set +CONFIG_ARCH_X86=y +CONFIG_ARCH_BOOTBLOCK_X86_32=y +CONFIG_ARCH_VERSTAGE_X86_32=y +CONFIG_ARCH_ROMSTAGE_X86_32=y +CONFIG_ARCH_POSTCAR_X86_32=y +CONFIG_ARCH_RAMSTAGE_X86_32=y +CONFIG_ARCH_ALL_STAGES_X86_32=y +CONFIG_RESERVED_PHYSICAL_ADDRESS_BITS_SUPPORT=y +CONFIG_X86_TOP4G_BOOTMEDIA_MAP=y +CONFIG_POSTRAM_CBFS_CACHE_IN_BSS=y +CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000 +CONFIG_PC80_SYSTEM=y +CONFIG_HAVE_CMOS_DEFAULT=y +CONFIG_POSTCAR_STAGE=y +CONFIG_BOOTBLOCK_SIMPLE=y +# CONFIG_BOOTBLOCK_NORMAL is not set +CONFIG_COLLECT_TIMESTAMPS_TSC=y +CONFIG_HAVE_CF9_RESET=y +CONFIG_DEBUG_HW_BREAKPOINTS=y +CONFIG_DEBUG_NULL_DEREF_BREAKPOINTS=y +# CONFIG_DUMP_SMBIOS_TYPE17 is not set +CONFIG_X86_BOOTBLOCK_EXTRA_PROGRAM_SZ=0 +CONFIG_DEFAULT_EBDA_LOWMEM=0x100000 +CONFIG_DEFAULT_EBDA_SEGMENT=0xF600 +CONFIG_DEFAULT_EBDA_SIZE=0x400 +# end of Chipset + +# +# Devices +# +CONFIG_HAVE_VGA_TEXT_FRAMEBUFFER=y +CONFIG_HAVE_LINEAR_FRAMEBUFFER=y +CONFIG_MAINBOARD_HAS_LIBGFXINIT=y +CONFIG_MAINBOARD_USE_LIBGFXINIT=y +# CONFIG_VGA_ROM_RUN is not set +# CONFIG_NO_GFX_INIT is not set +CONFIG_NO_EARLY_GFX_INIT=y + +# +# Display +# +# CONFIG_VGA_TEXT_FRAMEBUFFER is not set +CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y +CONFIG_LINEAR_FRAMEBUFFER=y +# CONFIG_BOOTSPLASH is not set +CONFIG_DEFAULT_SCREEN_ROTATION_INT=0 +# end of Display + +CONFIG_PCI=y +CONFIG_ECAM_MMCONF_SUPPORT=y +CONFIG_PCIX_PLUGIN_SUPPORT=y +CONFIG_AZALIA_HDA_CODEC_SUPPORT=y +CONFIG_PCIEXP_PLUGIN_SUPPORT=y +CONFIG_ECAM_MMCONF_LENGTH=0x04000000 +CONFIG_PCI_ALLOW_BUS_MASTER=y +CONFIG_PCI_SET_BUS_MASTER_PCI_BRIDGES=y +CONFIG_PCI_ALLOW_BUS_MASTER_ANY_DEVICE=y +# CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS is not set +# CONFIG_PCIEXP_LANE_ERR_STAT_CLEAR is not set +# CONFIG_EARLY_PCI_BRIDGE is not set +CONFIG_SUBSYSTEM_VENDOR_ID=0x0000 +CONFIG_SUBSYSTEM_DEVICE_ID=0x0000 +CONFIG_INTEL_GMA_HAVE_VBT=y +CONFIG_INTEL_GMA_ADD_VBT=y +# CONFIG_SOFTWARE_I2C is not set +CONFIG_I2C_TRANSFER_TIMEOUT_US=500000 +CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y +CONFIG_USE_DDR3=y +# end of Devices + +# +# Generic Drivers +# +CONFIG_CRB_TPM_BASE_ADDRESS=0xfed40000 +# CONFIG_ELOG is not set +CONFIG_CACHE_MRC_SETTINGS=y +# CONFIG_MRC_SETTINGS_PROTECT is not set +# CONFIG_DRIVERS_OPTION_CFR is not set +# CONFIG_SMMSTORE is not set +CONFIG_SPI_FLASH=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY=y +# CONFIG_SPI_FLASH_NO_FAST_READ is not set +CONFIG_SPI_FLASH_ADESTO=y +CONFIG_SPI_FLASH_AMIC=y +CONFIG_SPI_FLASH_ATMEL=y +CONFIG_SPI_FLASH_EON=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_SST=y +CONFIG_SPI_FLASH_ISSI=y +CONFIG_HAVE_EM100PRO_SPI_CONSOLE_SUPPORT=y +CONFIG_TPM_INIT_RAMSTAGE=y +# CONFIG_TPM_PPI is not set +CONFIG_DRIVERS_UART=y +# CONFIG_DRIVERS_UART_OXPCIE is not set +CONFIG_HAVE_USBDEBUG=y +CONFIG_HAVE_USBDEBUG_OPTIONS=y +# CONFIG_USBDEBUG is not set +# CONFIG_VPD is not set +# CONFIG_DRIVERS_EMULATION_QEMU_FW_CFG is not set +# CONFIG_DRIVERS_GENERIC_CBFS_SERIAL is not set +# CONFIG_DRIVERS_GENERIC_CBFS_UUID is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9750 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9755 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9763E is not set +# CONFIG_DRIVERS_I2C_MAX98396 is not set +CONFIG_INTEL_DDI=y +CONFIG_INTEL_INT15=y +CONFIG_INTEL_GMA_ACPI=y +CONFIG_VBT_CBFS_COMPRESSION_LZMA=y +# CONFIG_VBT_CBFS_COMPRESSION_LZ4 is not set +# CONFIG_VBT_CBFS_COMPRESSION_NONE is not set +CONFIG_VBT_CBFS_COMPRESSION_ALGORITHM="lzma" +CONFIG_GFX_GMA=y +CONFIG_GFX_GMA_DYN_CPU=y +CONFIG_GFX_GMA_GENERATION="Haswell" +CONFIG_GFX_GMA_PCH="Lynx_Point" +CONFIG_GFX_GMA_PANEL_2_PORT="Disabled" +CONFIG_GFX_GMA_ANALOG_I2C_PORT="PCH_DAC" +# CONFIG_DRIVERS_NXP_UWB_SR1XX is not set +# CONFIG_DRIVERS_PS2_KEYBOARD is not set +CONFIG_DRIVERS_MC146818=y +# CONFIG_USE_PC_CMOS_ALTCENTURY is not set +CONFIG_PC_CMOS_BASE_PORT_BANK0=0x70 +CONFIG_MEMORY_MAPPED_TPM=y +CONFIG_TPM_TIS_BASE_ADDRESS=0xfed40000 +# CONFIG_DRIVERS_SIL_3114 is not set +CONFIG_DRIVERS_WIFI_GENERIC=y +CONFIG_DRIVERS_MTK_WIFI=y +# end of Generic Drivers + +# +# Security +# + +# +# CBFS verification +# +# CONFIG_CBFS_VERIFICATION is not set +# end of CBFS verification + +# +# Verified Boot (vboot) +# +# end of Verified Boot (vboot) + +# +# Trusted Platform Module +# +CONFIG_TPM1=y +# CONFIG_TPM2 is not set +CONFIG_TPM=y +CONFIG_MAINBOARD_HAS_TPM1=y +# CONFIG_TPM_DEACTIVATE is not set +# CONFIG_DEBUG_TPM is not set +CONFIG_PCR_BOOT_MODE=1 +CONFIG_PCR_HWID=1 +CONFIG_PCR_SRTM=2 +CONFIG_PCR_FW_VER=10 +CONFIG_PCR_RUNTIME_DATA=3 +# end of Trusted Platform Module + +# +# Memory initialization +# +CONFIG_PLATFORM_HAS_DRAM_CLEAR=y +CONFIG_SECURITY_CLEAR_DRAM_ON_REGULAR_BOOT=y +# end of Memory initialization + +# CONFIG_INTEL_TXT is not set +# CONFIG_STM is not set +# CONFIG_INTEL_CBNT_SUPPORT is not set +CONFIG_BOOTMEDIA_LOCK_NONE=y +# CONFIG_BOOTMEDIA_LOCK_CONTROLLER is not set +# CONFIG_BOOTMEDIA_LOCK_CHIP is not set +# CONFIG_BOOTMEDIA_SMM_BWP is not set +# end of Security + +CONFIG_ACPI_HAVE_PCAT_8259=y +CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES=y +CONFIG_ACPI_SOC_NVS=y +CONFIG_ACPI_NO_CUSTOM_MADT=y +CONFIG_ACPI_COMMON_MADT_LAPIC=y +CONFIG_ACPI_COMMON_MADT_IOAPIC=y +CONFIG_HAVE_ACPI_TABLES=y +CONFIG_BOOT_DEVICE_SPI_FLASH=y +CONFIG_BOOT_DEVICE_MEMORY_MAPPED=y +CONFIG_BOOT_DEVICE_SUPPORTS_WRITES=y +CONFIG_RTC=y + +# +# Console +# +CONFIG_BOOTBLOCK_CONSOLE=y +CONFIG_POSTCAR_CONSOLE=y +CONFIG_SQUELCH_EARLY_SMP=y + +# +# I/O mapped, 8250-compatible +# +CONFIG_TTYS0_BASE=0x3f8 + +# +# Serial port base address = 0x3f8 +# +# CONFIG_CONSOLE_SERIAL_921600 is not set +# CONFIG_CONSOLE_SERIAL_460800 is not set +# CONFIG_CONSOLE_SERIAL_230400 is not set +CONFIG_CONSOLE_SERIAL_115200=y +# CONFIG_CONSOLE_SERIAL_57600 is not set +# CONFIG_CONSOLE_SERIAL_38400 is not set +# CONFIG_CONSOLE_SERIAL_19200 is not set +# CONFIG_CONSOLE_SERIAL_9600 is not set +CONFIG_TTYS0_LCS=3 +# CONFIG_SPKMODEM is not set +# CONFIG_CONSOLE_NE2K is not set +CONFIG_CONSOLE_CBMEM=y +# CONFIG_CONSOLE_SPI_FLASH is not set +# CONFIG_CONSOLE_I2C_SMBUS is not set +# CONFIG_EM100PRO_SPI_CONSOLE is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL_7=y +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_4 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_2 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL=7 +CONFIG_CONSOLE_USE_LOGLEVEL_PREFIX=y +CONFIG_CONSOLE_USE_ANSI_ESCAPES=y +# CONFIG_CMOS_POST is not set +CONFIG_POST_DEVICE_NONE=y +# CONFIG_POST_DEVICE_LPC is not set +# CONFIG_POST_DEVICE_PCI_PCIE is not set +CONFIG_POST_IO_PORT=0x80 +CONFIG_HWBASE_DEBUG_CB=y +# end of Console + +CONFIG_HAVE_ACPI_RESUME=y +CONFIG_RESUME_PATH_SAME_AS_BOOT=y +CONFIG_HAVE_MONOTONIC_TIMER=y +CONFIG_HAVE_OPTION_TABLE=y +CONFIG_IOAPIC=y +CONFIG_USE_WATCHDOG_ON_BOOT=y + +# +# System tables +# +CONFIG_GENERATE_SMBIOS_TABLES=y +CONFIG_BIOS_VENDOR="coreboot" +CONFIG_MAINBOARD_SERIAL_NUMBER="123456789" +# end of System tables + +# +# Payload +# +CONFIG_PAYLOAD_NONE=y +# end of Payload + +# +# Debugging +# + +# +# CPU Debug Settings +# +# CONFIG_DISPLAY_MTRRS is not set + +# +# Vendorcode Debug Settings +# + +# +# BLOB Debug Settings +# + +# +# General Debug Settings +# +# CONFIG_GDB_STUB is not set +# CONFIG_DEBUG_CBFS is not set +CONFIG_HAVE_DEBUG_SMBUS=y +# CONFIG_DEBUG_SMBUS is not set +# CONFIG_DEBUG_MALLOC is not set +# CONFIG_DEBUG_CONSOLE_INIT is not set +# CONFIG_DEBUG_SPI_FLASH is not set +# CONFIG_DEBUG_BOOT_STATE is not set +# CONFIG_DEBUG_ADA_CODE is not set +CONFIG_HAVE_EM100_SUPPORT=y +# CONFIG_EM100 is not set +# CONFIG_DEBUG_ACPICA_COMPATIBLE is not set +# end of Debugging + +CONFIG_RAMSTAGE_ADA=y +CONFIG_RAMSTAGE_LIBHWBASE=y +CONFIG_HWBASE_DYNAMIC_MMIO=y +CONFIG_HWBASE_DEFAULT_MMCONF=0xf0000000 +CONFIG_HWBASE_DIRECT_PCIDEV=y +CONFIG_DECOMPRESS_OFAST=y + +# +# Boot Logo Configuration +# +# CONFIG_BMP_LOGO is not set +# end of Boot Logo Configuration + +CONFIG_WARNINGS_ARE_ERRORS=y +CONFIG_MAX_REBOOT_CNT=3 +CONFIG_RELOCATABLE_MODULES=y +CONFIG_HAVE_BOOTBLOCK=y +CONFIG_HAVE_ROMSTAGE=y +CONFIG_HAVE_RAMSTAGE=y diff --git a/config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_txtmode b/config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_txtmode new file mode 100644 index 00000000..84f97bde --- /dev/null +++ b/config/coreboot/t1700sff_bmrc_12mb/config/libgfxinit_txtmode @@ -0,0 +1,688 @@ +# +# Automatically generated file; DO NOT EDIT. +# coreboot configuration +# + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_CBFS_PREFIX="fallback" +CONFIG_COMPILER_GCC=y +# CONFIG_COMPILER_LLVM_CLANG is not set +# CONFIG_ANY_TOOLCHAIN is not set +# CONFIG_CCACHE is not set +# CONFIG_LTO is not set +# CONFIG_IWYU is not set +# CONFIG_FMD_GENPARSER is not set +# CONFIG_UTIL_GENPARSER is not set +# CONFIG_OPTION_BACKEND_NONE is not set +CONFIG_USE_OPTION_TABLE=y +# CONFIG_USE_CBFS_FILE_OPTION_BACKEND is not set +CONFIG_STATIC_OPTION_TABLE=y +CONFIG_COMPRESS_RAMSTAGE_LZMA=y +# CONFIG_COMPRESS_RAMSTAGE_LZ4 is not set +CONFIG_SEPARATE_ROMSTAGE=y +CONFIG_INCLUDE_CONFIG_FILE=y +CONFIG_COLLECT_TIMESTAMPS=y +# CONFIG_TIMESTAMPS_ON_CONSOLE is not set +CONFIG_USE_BLOBS=y +# CONFIG_USE_AMD_BLOBS is not set +# CONFIG_USE_QC_BLOBS is not set +# CONFIG_COVERAGE is not set +# CONFIG_UBSAN is not set +CONFIG_HAVE_ASAN_IN_ROMSTAGE=y +CONFIG_HAVE_ASAN_IN_RAMSTAGE=y +# CONFIG_ASAN is not set +CONFIG_NO_STAGE_CACHE=y +# CONFIG_TSEG_STAGE_CACHE is not set +# CONFIG_UPDATE_IMAGE is not set +# CONFIG_BOOTSPLASH_IMAGE is not set + +# +# Software Bill Of Materials (SBOM) +# +# CONFIG_SBOM is not set +# end of Software Bill Of Materials (SBOM) +# end of General setup + +# +# Mainboard +# + +# +# Important: Run 'make distclean' before switching boards +# +# CONFIG_VENDOR_51NB is not set +# CONFIG_VENDOR_ACER is not set +# CONFIG_VENDOR_AMD is not set +# CONFIG_VENDOR_AOOSTAR is not set +# CONFIG_VENDOR_AOPEN is not set +# CONFIG_VENDOR_APPLE is not set +# CONFIG_VENDOR_ARM is not set +# CONFIG_VENDOR_ASROCK is not set +# CONFIG_VENDOR_ASUS is not set +# CONFIG_VENDOR_BIOSTAR is not set +# CONFIG_VENDOR_BOSTENTECH is not set +# CONFIG_VENDOR_BYTEDANCE is not set +# CONFIG_VENDOR_CAVIUM is not set +# CONFIG_VENDOR_CLEVO is not set +# CONFIG_VENDOR_COMPULAB is not set +# CONFIG_VENDOR_CWWK is not set +CONFIG_VENDOR_DELL=y +# CONFIG_VENDOR_EMULATION is not set +# CONFIG_VENDOR_ERYING is not set +# CONFIG_VENDOR_EXAMPLE is not set +# CONFIG_VENDOR_FACEBOOK is not set +# CONFIG_VENDOR_FOXCONN is not set +# CONFIG_VENDOR_FRAMEWORK is not set +# CONFIG_VENDOR_GETAC is not set +# CONFIG_VENDOR_GIGABYTE is not set +# CONFIG_VENDOR_GOOGLE is not set +# CONFIG_VENDOR_HARDKERNEL is not set +# CONFIG_VENDOR_HP is not set +# CONFIG_VENDOR_IBASE is not set +# CONFIG_VENDOR_IBM is not set +# CONFIG_VENDOR_INTEL is not set +# CONFIG_VENDOR_INVENTEC is not set +# CONFIG_VENDOR_KONTRON is not set +# CONFIG_VENDOR_LATTEPANDA is not set +# CONFIG_VENDOR_LENOVO is not set +# CONFIG_VENDOR_LIBRETREND is not set +# CONFIG_VENDOR_MITAC_COMPUTING is not set +# CONFIG_VENDOR_MSI is not set +# CONFIG_VENDOR_NOVACUSTOM is not set +# CONFIG_VENDOR_OCP is not set +# CONFIG_VENDOR_OPENCELLULAR is not set +# CONFIG_VENDOR_PACKARDBELL is not set +# CONFIG_VENDOR_PCENGINES is not set +# CONFIG_VENDOR_PINE64 is not set +# CONFIG_VENDOR_PORTWELL is not set +# CONFIG_VENDOR_PRODRIVE is not set +# CONFIG_VENDOR_PROTECTLI is not set +# CONFIG_VENDOR_PURISM is not set +# CONFIG_VENDOR_RAPTOR_CS is not set +# CONFIG_VENDOR_RAZER is not set +# CONFIG_VENDOR_RODA is not set +# CONFIG_VENDOR_SAMSUNG is not set +# CONFIG_VENDOR_SAPPHIRE is not set +# CONFIG_VENDOR_SIEMENS is not set +# CONFIG_VENDOR_SIFIVE is not set +# CONFIG_VENDOR_STARLABS is not set +# CONFIG_VENDOR_SUPERMICRO is not set +# CONFIG_VENDOR_SYSTEM76 is not set +# CONFIG_VENDOR_TI is not set +# CONFIG_VENDOR_TOPTON is not set +# CONFIG_VENDOR_UP is not set +# CONFIG_VENDOR_VIA is not set +CONFIG_BOARD_SPECIFIC_OPTIONS=y +CONFIG_MAINBOARD_PART_NUMBER="Precision T1700 SFF" +CONFIG_MAINBOARD_VERSION="1.0" +CONFIG_MAINBOARD_DIR="dell/optiplex_9020" +CONFIG_VGA_BIOS_ID="8086,0166" +CONFIG_DIMM_MAX=4 +CONFIG_DIMM_SPD_SIZE=256 +CONFIG_FMDFILE="" +# CONFIG_NO_POST is not set +CONFIG_MAINBOARD_VENDOR="Dell Inc." +CONFIG_CBFS_SIZE=0x800000 +CONFIG_CONSOLE_SERIAL=y +CONFIG_MAX_CPUS=8 +# CONFIG_ONBOARD_VGA_IS_PRIMARY is not set +CONFIG_POST_DEVICE=y +CONFIG_POST_IO=y +CONFIG_UART_FOR_CONSOLE=0 +CONFIG_OVERRIDE_DEVICETREE="" +CONFIG_DEVICETREE="devicetree.cb" +# CONFIG_VBOOT is not set +# CONFIG_VGA_BIOS is not set +CONFIG_PCIEXP_ASPM=y +CONFIG_PCIEXP_L1_SUB_STATE=y +CONFIG_PCIEXP_CLK_PM=y +CONFIG_MAINBOARD_SMBIOS_MANUFACTURER="Dell Inc." +CONFIG_ECAM_MMCONF_BASE_ADDRESS=0xf0000000 +CONFIG_ECAM_MMCONF_BUS_NUMBER=64 +CONFIG_MEMLAYOUT_LD_FILE="src/arch/x86/memlayout.ld" +# CONFIG_FATAL_ASSERTS is not set +CONFIG_INTEL_GMA_VBT_FILE="src/mainboard/$(MAINBOARDDIR)/data.vbt" +CONFIG_PRERAM_CBMEM_CONSOLE_SIZE=0xc00 +CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME="OptiPlex 7020/9020 SFF" +# CONFIG_CONSOLE_POST is not set +CONFIG_CMOS_DEFAULT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.default" +CONFIG_CMOS_LAYOUT_FILE="src/mainboard/$(MAINBOARDDIR)/cmos.layout" +CONFIG_MAX_SOCKET=1 +CONFIG_BOOT_DEVICE_SPI_FLASH_BUS=0 +CONFIG_TPM_PIRQ=0x0 +# CONFIG_BOARD_DELL_LATITUDE_E7240 is not set +# CONFIG_BOARD_DELL_E4300 is not set +# CONFIG_BOARD_DELL_E6400 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_3050 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_MT is not set +# CONFIG_BOARD_DELL_OPTIPLEX_780_USFF is not set +CONFIG_BOARD_DELL_OPTIPLEX_9020_SFF=y +# CONFIG_BOARD_DELL_OPTIPLEX_9020_MT is not set +# CONFIG_BOARD_DELL_LATITUDE_E5420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6220 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6320 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6420 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6520 is not set +# CONFIG_BOARD_DELL_LATITUDE_E5530 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6230 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6330 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6430 is not set +# CONFIG_BOARD_DELL_LATITUDE_E6530 is not set +# CONFIG_BOARD_DELL_OPTIPLEX_9010 is not set +# CONFIG_BOARD_DELL_PRECISION_T1650 is not set +# CONFIG_BOARD_DELL_XPS_8300 is not set +CONFIG_DCACHE_RAM_BASE=0xff7c0000 +CONFIG_DCACHE_RAM_SIZE=0x10000 +CONFIG_C_ENV_BOOTBLOCK_SIZE=0x40000 +CONFIG_DCACHE_BSP_STACK_SIZE=0x2000 +CONFIG_MAX_ACPI_TABLE_SIZE_KB=144 +CONFIG_HAVE_INTEL_FIRMWARE=y +CONFIG_MRC_SETTINGS_CACHE_SIZE=0x10000 +CONFIG_SPI_FLASH_INCLUDE_ALL_DRIVERS=y +CONFIG_SPI_FLASH_WINBOND=y +CONFIG_DRIVERS_INTEL_WIFI=y +CONFIG_IFD_BIN_PATH="../../../config/ifd/dell9020mt/12_ifd" +CONFIG_ME_BIN_PATH="../../../vendorfiles/t440p/me.bin" +CONFIG_GBE_BIN_PATH="../../../config/ifd/dell9020mt/gbe" +CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000 +# CONFIG_ENABLE_DDR_2X_REFRESH is not set +CONFIG_PCIEXP_AER=y +CONFIG_CARDBUS_PLUGIN_SUPPORT=y +CONFIG_SPI_FLASH_GIGADEVICE=y +CONFIG_SPI_FLASH_STMICRO=y +# CONFIG_DEBUG_SMI is not set +CONFIG_HAVE_IFD_BIN=y +CONFIG_PS2K_EISAID="PNP0303" +CONFIG_PS2M_EISAID="PNP0F13" +CONFIG_GFX_GMA_PANEL_1_PORT="eDP" +CONFIG_TTYS0_BAUD=115200 +CONFIG_D3COLD_SUPPORT=y +CONFIG_GFX_GMA_PANEL_1_ON_EDP=y +CONFIG_DRIVERS_UART_8250IO=y +CONFIG_PC_CMOS_BASE_PORT_BANK1=0x72 +CONFIG_HEAP_SIZE=0x100000 +CONFIG_EC_GPE_SCI=0x50 +CONFIG_EC_STARLABS_BATTERY_MODEL="Unknown" +CONFIG_EC_STARLABS_BATTERY_TYPE="LION" +CONFIG_EC_STARLABS_BATTERY_OEM="Unknown" +# CONFIG_TPM_MEASURED_BOOT is not set +CONFIG_BOARD_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_256 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_512 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_1024 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_2048 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_4096 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_5120 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_6144 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_8192 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_10240 is not set +CONFIG_COREBOOT_ROMSIZE_KB_12288=y +# CONFIG_COREBOOT_ROMSIZE_KB_16384 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_24576 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_32768 is not set +# CONFIG_COREBOOT_ROMSIZE_KB_65536 is not set +CONFIG_COREBOOT_ROMSIZE_KB=12288 +CONFIG_ROM_SIZE=0x00c00000 +CONFIG_HAVE_POWER_STATE_AFTER_FAILURE=y +CONFIG_HAVE_POWER_STATE_PREVIOUS_AFTER_FAILURE=y +CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y +# CONFIG_POWER_STATE_ON_AFTER_FAILURE is not set +# CONFIG_POWER_STATE_PREVIOUS_AFTER_FAILURE is not set +CONFIG_MAINBOARD_POWER_FAILURE_STATE=0 +# end of Mainboard + +# +# Chipset +# + +# +# SoC +# +CONFIG_CHIPSET_DEVICETREE="" +CONFIG_CBFS_MCACHE_SIZE=0x4000 +CONFIG_ROMSTAGE_ADDR=0x2000000 +CONFIG_VERSTAGE_ADDR=0x2000000 +CONFIG_SMM_TSEG_SIZE=0x800000 +CONFIG_SMM_RESERVED_SIZE=0x100000 +CONFIG_SMM_MODULE_STACK_SIZE=0x400 +CONFIG_SERIRQ_CONTINUOUS_MODE=y +CONFIG_PRERAM_CBFS_CACHE_SIZE=0x4000 +CONFIG_DOMAIN_RESOURCE_32BIT_LIMIT=0xf0000000 +CONFIG_EHCI_BAR=0xd8000000 +CONFIG_ACPI_CPU_STRING="CP%02X" +CONFIG_STACK_SIZE=0x2000 +CONFIG_IED_REGION_SIZE=0x400000 +CONFIG_INTEL_GMA_BCLV_OFFSET=0x48254 +CONFIG_INTEL_GMA_BCLV_WIDTH=16 +CONFIG_INTEL_GMA_BCLM_OFFSET=0xc8256 +CONFIG_INTEL_GMA_BCLM_WIDTH=16 +CONFIG_BOOTBLOCK_IN_CBFS=y +CONFIG_HAVE_MRC=y +CONFIG_MRC_FILE="../../../mrc/broadwell/mrc.bin" +CONFIG_DCACHE_RAM_MRC_VAR_SIZE=0x30000 +CONFIG_HPET_MIN_TICKS=0x80 +CONFIG_FIXED_MCHBAR_MMIO_BASE=0xfed10000 +CONFIG_FIXED_DMIBAR_MMIO_BASE=0xfed18000 +CONFIG_FIXED_EPBAR_MMIO_BASE=0xfed19000 +CONFIG_PCIEXP_COMMON_CLOCK=y +CONFIG_DISABLE_ME_PCI=y +CONFIG_CPU_INTEL_NUM_FIT_ENTRIES=6 +CONFIG_SOC_PHYSICAL_ADDRESS_WIDTH=0 +# CONFIG_ALWAYS_ALLOW_ABOVE_4G_ALLOCATION is not set +CONFIG_FIXED_SMBUS_IO_BASE=0x400 +CONFIG_CBFS_CACHE_ALIGN=8 + +# +# CPU +# +CONFIG_CPU_INTEL_HASWELL=y +CONFIG_CPU_INTEL_FIRMWARE_INTERFACE_TABLE=y +CONFIG_CPU_INTEL_COMMON=y +CONFIG_ENABLE_VMX=y +CONFIG_SET_IA32_FC_LOCK_BIT=y +CONFIG_SET_MSR_AESNI_LOCK_BIT=y +CONFIG_CPU_INTEL_COMMON_TIMEBASE=y +CONFIG_CPU_INTEL_COMMON_VOLTAGE=y +CONFIG_CPU_INTEL_COMMON_SMM=y +CONFIG_PARALLEL_MP=y +CONFIG_XAPIC_ONLY=y +# CONFIG_X2APIC_ONLY is not set +# CONFIG_X2APIC_RUNTIME is not set +# CONFIG_X2APIC_LATE_WORKAROUND is not set +CONFIG_UDELAY_TSC=y +CONFIG_TSC_MONOTONIC_TIMER=y +CONFIG_TSC_SYNC_MFENCE=y +CONFIG_HAVE_SMI_HANDLER=y +CONFIG_CPU_PT_ROM_MAP_GB=512 +CONFIG_SMM_TSEG=y +CONFIG_SMM_PCI_RESOURCE_STORE_NUM_SLOTS=8 +CONFIG_AP_STACK_SIZE=0x800 +CONFIG_SMP=y +CONFIG_SSE=y +CONFIG_SSE2=y +CONFIG_SUPPORT_CPU_UCODE_IN_CBFS=y +CONFIG_USE_CPU_MICROCODE_CBFS_BINS=y +CONFIG_CPU_MICROCODE_CBFS_DEFAULT_BINS=y +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS is not set +# CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_HEADER is not set +# CONFIG_CPU_MICROCODE_CBFS_NONE is not set + +# +# Northbridge +# +CONFIG_NORTHBRIDGE_INTEL_HASWELL=y +# CONFIG_USE_NATIVE_RAMINIT is not set +CONFIG_USE_BROADWELL_MRC=y +# CONFIG_HASWELL_HIDE_PEG_FROM_MRC is not set + +# +# Southbridge +# +# CONFIG_PCIEXP_HOTPLUG is not set +CONFIG_INTEL_DESCRIPTOR_MODE_REQUIRED=y +CONFIG_SOUTHBRIDGE_INTEL_LYNXPOINT=y +CONFIG_FINALIZE_USB_ROUTE_XHCI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RESET=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RTC=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMCLIB=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PMBASE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_GPIO=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_EARLY_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SMBUS=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_SPI_ICH9=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_PIRQ_ACPI_GEN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_RCBA_PIRQ=y +CONFIG_HAVE_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_FINALIZE=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_USB_DEBUG=y +CONFIG_INTEL_DESCRIPTOR_MODE_CAPABLE=y +# CONFIG_VALIDATE_INTEL_DESCRIPTOR is not set +CONFIG_INTEL_CHIPSET_LOCKDOWN=y +CONFIG_TCO_SPACE_NOT_YET_SPLIT=y +CONFIG_SOUTHBRIDGE_INTEL_COMMON_WATCHDOG=y +CONFIG_FIXED_RCBA_MMIO_BASE=0xfed1c000 +CONFIG_RCBA_LENGTH=0x4000 + +# +# Super I/O +# +CONFIG_SUPERIO_SMSC_SCH555x=y + +# +# Embedded Controllers +# + +# +# Intel Firmware +# +CONFIG_HAVE_ME_BIN=y +# CONFIG_STITCH_ME_BIN is not set +# CONFIG_CHECK_ME is not set +# CONFIG_ME_REGION_ALLOW_CPU_READ_ACCESS is not set +# CONFIG_USE_ME_CLEANER is not set +CONFIG_MAINBOARD_USES_IFD_GBE_REGION=y +CONFIG_HAVE_GBE_BIN=y +# CONFIG_DO_NOT_TOUCH_DESCRIPTOR_REGION is not set +# CONFIG_LOCK_MANAGEMENT_ENGINE is not set +CONFIG_UNLOCK_FLASH_REGIONS=y +CONFIG_ACPI_FNKEY_GEN_SCANCODE=0 +# CONFIG_GOOGLE_PVMFW_CBMEM is not set +CONFIG_ARCH_X86=y +CONFIG_ARCH_BOOTBLOCK_X86_32=y +CONFIG_ARCH_VERSTAGE_X86_32=y +CONFIG_ARCH_ROMSTAGE_X86_32=y +CONFIG_ARCH_POSTCAR_X86_32=y +CONFIG_ARCH_RAMSTAGE_X86_32=y +CONFIG_ARCH_ALL_STAGES_X86_32=y +CONFIG_RESERVED_PHYSICAL_ADDRESS_BITS_SUPPORT=y +CONFIG_X86_TOP4G_BOOTMEDIA_MAP=y +CONFIG_POSTRAM_CBFS_CACHE_IN_BSS=y +CONFIG_RAMSTAGE_CBFS_CACHE_SIZE=0x4000 +CONFIG_PC80_SYSTEM=y +CONFIG_HAVE_CMOS_DEFAULT=y +CONFIG_POSTCAR_STAGE=y +CONFIG_BOOTBLOCK_SIMPLE=y +# CONFIG_BOOTBLOCK_NORMAL is not set +CONFIG_COLLECT_TIMESTAMPS_TSC=y +CONFIG_HAVE_CF9_RESET=y +CONFIG_DEBUG_HW_BREAKPOINTS=y +CONFIG_DEBUG_NULL_DEREF_BREAKPOINTS=y +# CONFIG_DUMP_SMBIOS_TYPE17 is not set +CONFIG_X86_BOOTBLOCK_EXTRA_PROGRAM_SZ=0 +CONFIG_DEFAULT_EBDA_LOWMEM=0x100000 +CONFIG_DEFAULT_EBDA_SEGMENT=0xF600 +CONFIG_DEFAULT_EBDA_SIZE=0x400 +# end of Chipset + +# +# Devices +# +CONFIG_HAVE_VGA_TEXT_FRAMEBUFFER=y +CONFIG_HAVE_LINEAR_FRAMEBUFFER=y +CONFIG_MAINBOARD_HAS_LIBGFXINIT=y +CONFIG_MAINBOARD_USE_LIBGFXINIT=y +# CONFIG_VGA_ROM_RUN is not set +# CONFIG_NO_GFX_INIT is not set +CONFIG_NO_EARLY_GFX_INIT=y + +# +# Display +# +CONFIG_VGA_TEXT_FRAMEBUFFER=y +# CONFIG_GENERIC_LINEAR_FRAMEBUFFER is not set +CONFIG_DEFAULT_SCREEN_ROTATION_INT=0 +# end of Display + +CONFIG_PCI=y +CONFIG_ECAM_MMCONF_SUPPORT=y +CONFIG_PCIX_PLUGIN_SUPPORT=y +CONFIG_AZALIA_HDA_CODEC_SUPPORT=y +CONFIG_PCIEXP_PLUGIN_SUPPORT=y +CONFIG_ECAM_MMCONF_LENGTH=0x04000000 +CONFIG_PCI_ALLOW_BUS_MASTER=y +CONFIG_PCI_SET_BUS_MASTER_PCI_BRIDGES=y +CONFIG_PCI_ALLOW_BUS_MASTER_ANY_DEVICE=y +# CONFIG_PCIEXP_SUPPORT_RESIZABLE_BARS is not set +# CONFIG_PCIEXP_LANE_ERR_STAT_CLEAR is not set +# CONFIG_EARLY_PCI_BRIDGE is not set +CONFIG_SUBSYSTEM_VENDOR_ID=0x0000 +CONFIG_SUBSYSTEM_DEVICE_ID=0x0000 +CONFIG_INTEL_GMA_HAVE_VBT=y +CONFIG_INTEL_GMA_ADD_VBT=y +# CONFIG_SOFTWARE_I2C is not set +CONFIG_I2C_TRANSFER_TIMEOUT_US=500000 +CONFIG_RESOURCE_ALLOCATION_TOP_DOWN=y +CONFIG_USE_DDR3=y +# end of Devices + +# +# Generic Drivers +# +CONFIG_CRB_TPM_BASE_ADDRESS=0xfed40000 +# CONFIG_ELOG is not set +CONFIG_CACHE_MRC_SETTINGS=y +# CONFIG_MRC_SETTINGS_PROTECT is not set +# CONFIG_DRIVERS_OPTION_CFR is not set +# CONFIG_SMMSTORE is not set +CONFIG_SPI_FLASH=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP=y +CONFIG_BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY=y +# CONFIG_SPI_FLASH_NO_FAST_READ is not set +CONFIG_SPI_FLASH_ADESTO=y +CONFIG_SPI_FLASH_AMIC=y +CONFIG_SPI_FLASH_ATMEL=y +CONFIG_SPI_FLASH_EON=y +CONFIG_SPI_FLASH_MACRONIX=y +CONFIG_SPI_FLASH_SPANSION=y +CONFIG_SPI_FLASH_SST=y +CONFIG_SPI_FLASH_ISSI=y +CONFIG_HAVE_EM100PRO_SPI_CONSOLE_SUPPORT=y +CONFIG_TPM_INIT_RAMSTAGE=y +# CONFIG_TPM_PPI is not set +CONFIG_DRIVERS_UART=y +# CONFIG_DRIVERS_UART_OXPCIE is not set +CONFIG_HAVE_USBDEBUG=y +CONFIG_HAVE_USBDEBUG_OPTIONS=y +# CONFIG_USBDEBUG is not set +# CONFIG_VPD is not set +# CONFIG_DRIVERS_EMULATION_QEMU_FW_CFG is not set +# CONFIG_DRIVERS_GENERIC_CBFS_SERIAL is not set +# CONFIG_DRIVERS_GENERIC_CBFS_UUID is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9750 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9755 is not set +# CONFIG_DRIVERS_GENESYSLOGIC_GL9763E is not set +# CONFIG_DRIVERS_I2C_MAX98396 is not set +CONFIG_INTEL_DDI=y +CONFIG_INTEL_INT15=y +CONFIG_INTEL_GMA_ACPI=y +CONFIG_VBT_CBFS_COMPRESSION_LZMA=y +# CONFIG_VBT_CBFS_COMPRESSION_LZ4 is not set +# CONFIG_VBT_CBFS_COMPRESSION_NONE is not set +CONFIG_VBT_CBFS_COMPRESSION_ALGORITHM="lzma" +CONFIG_GFX_GMA=y +CONFIG_GFX_GMA_DYN_CPU=y +CONFIG_GFX_GMA_GENERATION="Haswell" +CONFIG_GFX_GMA_PCH="Lynx_Point" +CONFIG_GFX_GMA_PANEL_2_PORT="Disabled" +CONFIG_GFX_GMA_ANALOG_I2C_PORT="PCH_DAC" +# CONFIG_DRIVERS_NXP_UWB_SR1XX is not set +# CONFIG_DRIVERS_PS2_KEYBOARD is not set +CONFIG_DRIVERS_MC146818=y +# CONFIG_USE_PC_CMOS_ALTCENTURY is not set +CONFIG_PC_CMOS_BASE_PORT_BANK0=0x70 +CONFIG_MEMORY_MAPPED_TPM=y +CONFIG_TPM_TIS_BASE_ADDRESS=0xfed40000 +CONFIG_VGA=y +# CONFIG_DRIVERS_SIL_3114 is not set +CONFIG_DRIVERS_WIFI_GENERIC=y +CONFIG_DRIVERS_MTK_WIFI=y +# end of Generic Drivers + +# +# Security +# + +# +# CBFS verification +# +# CONFIG_CBFS_VERIFICATION is not set +# end of CBFS verification + +# +# Verified Boot (vboot) +# +# end of Verified Boot (vboot) + +# +# Trusted Platform Module +# +CONFIG_TPM1=y +# CONFIG_TPM2 is not set +CONFIG_TPM=y +CONFIG_MAINBOARD_HAS_TPM1=y +# CONFIG_TPM_DEACTIVATE is not set +# CONFIG_DEBUG_TPM is not set +CONFIG_PCR_BOOT_MODE=1 +CONFIG_PCR_HWID=1 +CONFIG_PCR_SRTM=2 +CONFIG_PCR_FW_VER=10 +CONFIG_PCR_RUNTIME_DATA=3 +# end of Trusted Platform Module + +# +# Memory initialization +# +CONFIG_PLATFORM_HAS_DRAM_CLEAR=y +CONFIG_SECURITY_CLEAR_DRAM_ON_REGULAR_BOOT=y +# end of Memory initialization + +# CONFIG_INTEL_TXT is not set +# CONFIG_STM is not set +# CONFIG_INTEL_CBNT_SUPPORT is not set +CONFIG_BOOTMEDIA_LOCK_NONE=y +# CONFIG_BOOTMEDIA_LOCK_CONTROLLER is not set +# CONFIG_BOOTMEDIA_LOCK_CHIP is not set +# CONFIG_BOOTMEDIA_SMM_BWP is not set +# end of Security + +CONFIG_ACPI_HAVE_PCAT_8259=y +CONFIG_ACPI_INTEL_HARDWARE_SLEEP_VALUES=y +CONFIG_ACPI_SOC_NVS=y +CONFIG_ACPI_NO_CUSTOM_MADT=y +CONFIG_ACPI_COMMON_MADT_LAPIC=y +CONFIG_ACPI_COMMON_MADT_IOAPIC=y +CONFIG_HAVE_ACPI_TABLES=y +CONFIG_BOOT_DEVICE_SPI_FLASH=y +CONFIG_BOOT_DEVICE_MEMORY_MAPPED=y +CONFIG_BOOT_DEVICE_SUPPORTS_WRITES=y +CONFIG_RTC=y + +# +# Console +# +CONFIG_BOOTBLOCK_CONSOLE=y +CONFIG_POSTCAR_CONSOLE=y +CONFIG_SQUELCH_EARLY_SMP=y + +# +# I/O mapped, 8250-compatible +# +CONFIG_TTYS0_BASE=0x3f8 + +# +# Serial port base address = 0x3f8 +# +# CONFIG_CONSOLE_SERIAL_921600 is not set +# CONFIG_CONSOLE_SERIAL_460800 is not set +# CONFIG_CONSOLE_SERIAL_230400 is not set +CONFIG_CONSOLE_SERIAL_115200=y +# CONFIG_CONSOLE_SERIAL_57600 is not set +# CONFIG_CONSOLE_SERIAL_38400 is not set +# CONFIG_CONSOLE_SERIAL_19200 is not set +# CONFIG_CONSOLE_SERIAL_9600 is not set +CONFIG_TTYS0_LCS=3 +# CONFIG_SPKMODEM is not set +# CONFIG_CONSOLE_NE2K is not set +CONFIG_CONSOLE_CBMEM=y +# CONFIG_CONSOLE_SPI_FLASH is not set +# CONFIG_CONSOLE_I2C_SMBUS is not set +# CONFIG_EM100PRO_SPI_CONSOLE is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL_7=y +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_6 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_5 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_4 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_3 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_2 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_1 is not set +# CONFIG_DEFAULT_CONSOLE_LOGLEVEL_0 is not set +CONFIG_DEFAULT_CONSOLE_LOGLEVEL=7 +CONFIG_CONSOLE_USE_LOGLEVEL_PREFIX=y +CONFIG_CONSOLE_USE_ANSI_ESCAPES=y +# CONFIG_CMOS_POST is not set +CONFIG_POST_DEVICE_NONE=y +# CONFIG_POST_DEVICE_LPC is not set +# CONFIG_POST_DEVICE_PCI_PCIE is not set +CONFIG_POST_IO_PORT=0x80 +CONFIG_HWBASE_DEBUG_CB=y +# end of Console + +CONFIG_HAVE_ACPI_RESUME=y +CONFIG_RESUME_PATH_SAME_AS_BOOT=y +CONFIG_HAVE_MONOTONIC_TIMER=y +CONFIG_HAVE_OPTION_TABLE=y +CONFIG_IOAPIC=y +CONFIG_USE_WATCHDOG_ON_BOOT=y + +# +# System tables +# +CONFIG_GENERATE_SMBIOS_TABLES=y +CONFIG_BIOS_VENDOR="coreboot" +CONFIG_MAINBOARD_SERIAL_NUMBER="123456789" +# end of System tables + +# +# Payload +# +CONFIG_PAYLOAD_NONE=y +# end of Payload + +# +# Debugging +# + +# +# CPU Debug Settings +# +# CONFIG_DISPLAY_MTRRS is not set + +# +# Vendorcode Debug Settings +# + +# +# BLOB Debug Settings +# + +# +# General Debug Settings +# +# CONFIG_GDB_STUB is not set +# CONFIG_DEBUG_CBFS is not set +CONFIG_HAVE_DEBUG_SMBUS=y +# CONFIG_DEBUG_SMBUS is not set +# CONFIG_DEBUG_MALLOC is not set +# CONFIG_DEBUG_CONSOLE_INIT is not set +# CONFIG_DEBUG_SPI_FLASH is not set +# CONFIG_DEBUG_BOOT_STATE is not set +# CONFIG_DEBUG_ADA_CODE is not set +CONFIG_HAVE_EM100_SUPPORT=y +# CONFIG_EM100 is not set +# CONFIG_DEBUG_ACPICA_COMPATIBLE is not set +# end of Debugging + +CONFIG_RAMSTAGE_ADA=y +CONFIG_RAMSTAGE_LIBHWBASE=y +CONFIG_HWBASE_DYNAMIC_MMIO=y +CONFIG_HWBASE_DEFAULT_MMCONF=0xf0000000 +CONFIG_HWBASE_DIRECT_PCIDEV=y +CONFIG_DECOMPRESS_OFAST=y + +# +# Boot Logo Configuration +# +# CONFIG_BMP_LOGO is not set +# end of Boot Logo Configuration + +CONFIG_WARNINGS_ARE_ERRORS=y +CONFIG_MAX_REBOOT_CNT=3 +CONFIG_RELOCATABLE_MODULES=y +CONFIG_HAVE_BOOTBLOCK=y +CONFIG_HAVE_ROMSTAGE=y +CONFIG_HAVE_RAMSTAGE=y diff --git a/config/coreboot/t1700sff_bmrc_12mb/target.cfg b/config/coreboot/t1700sff_bmrc_12mb/target.cfg new file mode 100644 index 00000000..06de408c --- /dev/null +++ b/config/coreboot/t1700sff_bmrc_12mb/target.cfg @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +tree="default" +xarch="i386-elf" +payload_seabios="y" +payload_grub="y" +payload_memtest="y" +grub_scan_disk="nvme ahci" +grubtree="xhci" +vcfg="t1700" +build_depend="seabios/default grub/xhci memtest86plus u-boot/amd64coreboot" +payload_uboot_amd64="y" diff --git a/config/vendor/t1700/pkg.cfg b/config/vendor/t1700/pkg.cfg new file mode 100644 index 00000000..cc100683 --- /dev/null +++ b/config/vendor/t1700/pkg.cfg @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-3.0-or-later + +DL_hash="f3d79aec805c8b0094a4081be76b3a22d329c479ad18210449b7acc3236ccfc4a2103eaa7c5b79a4872bfd699eede047efd46dfb06dc8f47e3216fc254612998" +DL_url="https://download.lenovo.com/pccbbs/mobiles/glrg22ww.exe" +DL_url_bkup="https://web.archive.org/web/20211120031520/https://download.lenovo.com/pccbbs/mobiles/glrg22ww.exe" +MRC_url="https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13904.77.0_samus_recovery_stable-channel_mp-v3.bin.zip" +MRC_url_bkup="https://web.archive.org/web/20220310155922/https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_13904.77.0_samus_recovery_stable-channel_mp-v3.bin.zip" +MRC_hash="3ff1599c52539f0707a07a8664a84ce51cd3fed1569df4bb7aa6722fc8dec0af1754250333b6ca1a9794d970a4de7b29a5cf2499f5b61e4c3eab64d1314aaea9" +MRC_board="samus" diff --git a/include/inject.sh b/include/inject.sh index 6b316729..e5282861 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -86,6 +86,8 @@ getfiles() "$E6400_VGA_DL_url_bkup" "$E6400_VGA_DL_hash" "$CONFIG_VGA_BIOS_FILE" [ -z "$CONFIG_HAVE_MRC" ] || fetch "mrc" "$MRC_url" "$MRC_url_bkup" \ "$MRC_hash" "$CONFIG_MRC_FILE" + [ -n "$CONFIG_REFCODE_BLOB_FILE" ] && fetch "refcode" "$MRC_url" \ + "$MRC_url_bkup" "$MRC_hash" "$CONFIG_REFCODE_BLOB_FILE" [ -z "$CONFIG_LENOVO_TBFW_BIN" ] || fetch "tbfw" "$TBFW_url" \ "$TBFW_url_bkup" "$TBFW_hash" "$CONFIG_LENOVO_TBFW_BIN" # diff --git a/include/mrc.sh b/include/mrc.sh index 6e00292b..eaf39dcb 100644 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -8,35 +8,12 @@ eval "`setvars "" MRC_url MRC_url_bkup MRC_hash MRC_board SHELLBALL`" extract_mrc() { - chkvars "MRC_board" "CONFIG_MRC_FILE" - SHELLBALL="chromeos-firmwareupdate-$MRC_board" - - ( - x_ cd "$appdir" - extract_partition "${MRC_url##*/}" - extract_archive "$SHELLBALL" . - ) || $err "mrc download/extract failure" + extract_shellball "$cbfstool" "$appdir/"bios.bin extract -n mrc.bin \ -f "$_dest" -r RO_SECTION || $err "extract_mrc: !$cbfstool $_dest" - [ -n "$CONFIG_REFCODE_BLOB_FILE" ] && extract_refcode; : -} - -extract_partition() -{ - printf "Extracting ROOT-A partition\n" - ROOTP=$( printf "unit\nB\nprint\nquit\n" | \ - parted "${1%.zip}" 2>/dev/null | grep "ROOT-A" ) - - START=$(( $( echo $ROOTP | cut -f2 -d\ | tr -d "B" ) )) - SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) )) - - dd if="${1%.zip}" of="root-a.ext2" bs=1024 skip=$(( $START / 1024 )) \ - count=$(( $SIZE / 1024 )) || $err "ex dd ${1%.zip}, root-a.ext2" - - printf "cd /usr/sbin\ndump chromeos-firmwareupdate %s\nquit" \ - "$SHELLBALL" | debugfs "root-a.ext2" || $err "!extract shellball" + [ -n "$CONFIG_REFCODE_BLOB_FILE" ] && extract_refcode extra; : } extract_refcode() @@ -44,6 +21,8 @@ extract_refcode() _refdest="${CONFIG_REFCODE_BLOB_FILE##*../}" e "$_refdest" f && return 0 + [ $# -lt 1 ] && extract_shellball + # cbfstool changed the attributes scheme for stage files, # incompatible with older versions before coreboot 4.14, # so we need coreboot 4.13 cbfstool for certain refcode files @@ -57,3 +36,31 @@ extract_refcode() [ -z "$MRC_refcode_gbe" ] || x_ dd if="config/ifd/hp820g2/1.bin" \ of="$_refdest" bs=1 seek=$MRC_refcode_gbe count=1 conv=notrunc; : } + +extract_shellball() +{ + chkvars "MRC_board" "CONFIG_MRC_FILE" + SHELLBALL="chromeos-firmwareupdate-$MRC_board" + + ( + x_ cd "$appdir" + extract_partition "${MRC_url##*/}" + extract_archive "$SHELLBALL" . + ) || $err "mrc download/extract failure"; : +} + +extract_partition() +{ + printf "Extracting ROOT-A partition\n" + ROOTP=$( printf "unit\nB\nprint\nquit\n" | \ + parted "${1%.zip}" 2>/dev/null | grep "ROOT-A" ) + + START=$(( $( echo $ROOTP | cut -f2 -d\ | tr -d "B" ) )) + SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) )) + + dd if="${1%.zip}" of="root-a.ext2" bs=1024 skip=$(( $START / 1024 )) \ + count=$(( $SIZE / 1024 )) || $err "ex dd ${1%.zip}, root-a.ext2" + + printf "cd /usr/sbin\ndump chromeos-firmwareupdate %s\nquit" \ + "$SHELLBALL" | debugfs "root-a.ext2" || $err "!extract shellball" +} -- cgit v1.2.1 From d18d1c2cae2c1c43c56d5c10adb469266d1eb08b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 04:16:10 +0100 Subject: lbmk: unified execution on find commands We have a lot of places in lbmk where the output of find is used, and then some function is executed on the result. This is messy, and bloats several of these functions. Now this is unified, into a new function: fx_ What fx_ does is execute a given function, for each result found, with the arguments for a find command appended. For example: find -name ".git" If you wanted to do: foo "$arg" Where "arg" is a search result from find, and you wanted to execute "foo" on each one, you would do: fx_ foo -name ".git" The find utility does have an -exec feature, but I've found that it only works for executables, not functions. fx_ does not return errors, so "foo" in this example would have to do its own error handling. Signed-off-by: Leah Rowe --- include/inject.sh | 43 ++++++++++++++++++------------------------- include/lib.sh | 11 +++++++++++ mk | 23 +++++++++-------------- 3 files changed, 38 insertions(+), 39 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index e5282861..0886adc8 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -282,19 +282,18 @@ extract_tbfw() { chkvars TBFW_size # size in bytes, matching TBFW's flash IC x_ mkdir -p tmp - x_ rm -f tmp/tb.bin - find "$appdir" -type f -name "TBT.bin" > "tmp/tb.txt" || \ - $err "extract_tbfw $_dest: Can't extract TBT.bin - $dontflash" - while read -r f; do - [ -f "$f" ] || continue - [ -L "$f" ] && continue - x_ cp "$f" "tmp/tb.bin" - break - done < "tmp/tb.txt" + + x_ rm -f tmp/tb.bin && fx_ copy_tbfw "$appdir" -type f -name "TBT.bin" + x_ dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size x_ cp "tmp/tb.bin" "$_dest" } +copy_tbfw() +{ + [ -f "$1" ] && [ ! -L "$1" ] && x_ cp "$1" "tmp/tb.bin" && return 1; : +} + extract_fspm() { copy_fsp M; : @@ -419,16 +418,10 @@ patch_release_roms() hashfile="$_hashes" && break; : done - x_ mkdir -p "tmp" && [ -L "tmp/rom.list" ] && \ - $err "'$archive' -> tmp/rom.list is a symlink - $dontflash" - - find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" > "tmp/rom.list" \ - || $err "'$archive' -> Can't make tmp/rom.list - $dontflash" + x_ mkdir -p "tmp" if readkconfig; then - while read -r _xrom ; do - process_release_rom "$_xrom" || break - done < "tmp/rom.list" + fx_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom" [ "$nukemode" != "nuke" ] || \ printf "Make sure you inserted vendor files: %s\n" \ "$vguide" > "$tmpromdir/README.md" || : @@ -462,7 +455,7 @@ patch_release_roms() "$archive" || $err "'$archive' -> Can't overwrite - $dontflash"; : } -process_release_rom() +prep_rom() { _xrom="$1" _xromname="${1##*/}" @@ -578,13 +571,7 @@ modify_mac() [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \ x_ "$nvm" tmp/gbe setmac "$new_mac" - find "$tmpromdir" -maxdepth 1 -type f -name "*.rom" > "tmp/rom.list" \ - || $err "'$archive' -> Can't make tmp/rom.list - $dontflash" - - while read -r _xrom; do - e "$_xrom" f && xchanged="y" && x_ \ - "$ifdtool" $ifdprefix -i GbE:tmp/gbe "$_xrom" -O "$_xrom" - done < "tmp/rom.list" + fx_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom" printf "\nGbE NVM written to '%s':\n" "$archive" x_ "$nvm" tmp/gbe dump | grep -v "bytes read from file" || : @@ -593,3 +580,9 @@ modify_mac() printf "\nDefault GbE file '%s' written, unmodified.\n" \ "${CONFIG_GBE_BIN_PATH##*../}"; : } + +newmac() +{ + e "$1" f && xchanged="y" && x_ \ + "$ifdtool" $ifdprefix -i GbE:tmp/gbe "$1" -O "$1"; : +} diff --git a/include/lib.sh b/include/lib.sh index bef2a16f..507a37c1 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -128,6 +128,17 @@ setvars() printf "%s\n" "${_setvars% }" } +fx_() +{ + fd="`mktemp`" + xx="$1" && shift 1 + find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\"" + while read -r fx; do + "$xx" "$fx" || break; : + done < "$fd" + x_ rm -f "$fd" +} + x_() { [ $# -lt 1 ] || "$@" || $err "Unhandled error for: $(echo "$@")"; : diff --git a/mk b/mk index 6a46f93c..8884d61e 100755 --- a/mk +++ b/mk @@ -278,20 +278,9 @@ check_project_hashes() [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \ read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree" - x_ rm -f "$xbmktmp/project.list" "$xbmktmp/project.hash" \ - "$xbmktmp/project.tmp" - x_ touch "$xbmktmp/project.tmp" "$xbmktmp/project.hash" - - for rmchk in "$datadir" "$configdir/$tree" "$mdir"; do - [ ! -d "$rmchk" ] || find "$rmchk" -type f -not -path \ - "*/.git*/*" >> "$xbmktmp/project.tmp" || $err "!fh $rmchk" - done - sort "$xbmktmp/project.tmp" > "$xbmktmp/project.list" || $err "!pj srt" - - while read -r rmchk; do - [ ! -f "$rmchk" ] || x_ sha512sum "$rmchk" | awk \ - '{print $1}' >> "$xbmktmp/project.hash" || $err "!h $rmchk" - done < "$xbmktmp/project.list" + x_ rm -f "$xbmktmp/project.hash" + fx_ create_project_hash "$datadir" "$configdir/$tree" "$mdir" \ + -type f -not -path "*/.git*/*" pjhash="$(sha512sum "$xbmktmp/project.hash" | awk '{print $1}')" || : [ "$pjhash" != "$old_pjhash" ] && badhash="y" @@ -304,6 +293,12 @@ check_project_hashes() "elf/$project/$tree" "elf/$project/$target"; : } +create_project_hash() +{ + [ ! -f "$1" ] || x_ sha512sum "$1" | awk \ + '{print $1}' >> "$xbmktmp/project.hash" || $err "!h $1"; : +} + check_cross_compiler() { xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" -- cgit v1.2.1 From 47762c84ad0f5e2a6fbe5ceec0bff623239e1e9a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 05:25:11 +0100 Subject: lib.sh: add fe_ which is fx_ but err on find In the mk script, we need fx_ to not return errors on the find command, since it's searching a bunch of directories where some of them may not exist. All other instances where fx_ is used, must return an error if the directory being searched doesn't exist. For this, fe_() is introduced, which does the same as fx_ but with this much stricter check. Signed-off-by: Leah Rowe --- include/inject.sh | 6 +++--- include/lib.sh | 13 ++++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 0886adc8..2e821d86 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -283,7 +283,7 @@ extract_tbfw() chkvars TBFW_size # size in bytes, matching TBFW's flash IC x_ mkdir -p tmp - x_ rm -f tmp/tb.bin && fx_ copy_tbfw "$appdir" -type f -name "TBT.bin" + x_ rm -f tmp/tb.bin && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" x_ dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size x_ cp "tmp/tb.bin" "$_dest" @@ -421,7 +421,7 @@ patch_release_roms() x_ mkdir -p "tmp" if readkconfig; then - fx_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom" + fe_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom" [ "$nukemode" != "nuke" ] || \ printf "Make sure you inserted vendor files: %s\n" \ "$vguide" > "$tmpromdir/README.md" || : @@ -571,7 +571,7 @@ modify_mac() [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \ x_ "$nvm" tmp/gbe setmac "$new_mac" - fx_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom" + fe_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom" printf "\nGbE NVM written to '%s':\n" "$archive" x_ "$nvm" tmp/gbe dump | grep -v "bytes read from file" || : diff --git a/include/lib.sh b/include/lib.sh index 507a37c1..3f5e5d37 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -128,11 +128,22 @@ setvars() printf "%s\n" "${_setvars% }" } +fe_() +{ + find_ex "x_" "$@" +} + fx_() { + find_ex "" "$@" +} + +find_ex() +{ + errx="$1" && shift 1 fd="`mktemp`" xx="$1" && shift 1 - find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\"" + $errx find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\"" while read -r fx; do "$xx" "$fx" || break; : done < "$fd" -- cgit v1.2.1 From fcc52b986e7612d8bb53e9b51f305c62f611a35b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 05:32:01 +0100 Subject: init.sh: unified handling of ./tmp not to be confused with /tmp we use ./tmp inside the lbmk work directory, for large files, because /tmp might not be very big, or might be a tmpfs Signed-off-by: Leah Rowe --- include/init.sh | 6 +++++- include/inject.sh | 8 +------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/init.sh b/include/init.sh index b8839921..9e0e3a37 100644 --- a/include/init.sh +++ b/include/init.sh @@ -194,6 +194,10 @@ xbmk_create_tmpdir() export TMPDIR="/tmp" export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)" xbmktmp="$TMPDIR" + + # /tmp might be a tmpfs, so for large files we use ./tmp, + # not to be confused with xbmktmp (xbmktmp points to /tmp) + x_ mkdir -p tmp } xbmk_lock() @@ -219,7 +223,7 @@ xbmk_child_exec() { xbmk_rval=0 ( x_ ./mk "$@" ) || xbmk_rval=1 - rm -Rf "$xbmktmp" || xbmk_rval=1 + rm -Rf tmp "$xbmktmp" || xbmk_rval=1 rm -f lock || xbmk_rval=1 exit $xbmk_rval } diff --git a/include/inject.sh b/include/inject.sh index 2e821d86..26bcd02f 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -148,8 +148,6 @@ extract_intel_me() chkvars ME11delta ME11version ME11sku ME11pch [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard - x_ mkdir -p tmp - extract_intel_me_bruteforce if [ "$ME11bootguard" = "y" ]; then apply_me11_deguard_mod @@ -281,7 +279,6 @@ extract_sch5545ec() extract_tbfw() { chkvars TBFW_size # size in bytes, matching TBFW's flash IC - x_ mkdir -p tmp x_ rm -f tmp/tb.bin && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" @@ -418,8 +415,6 @@ patch_release_roms() hashfile="$_hashes" && break; : done - x_ mkdir -p "tmp" - if readkconfig; then fe_ prep_rom "$tmpromdir" -maxdepth 1 -type f -name "*.rom" [ "$nukemode" != "nuke" ] || \ @@ -551,7 +546,6 @@ insert() elif [ "$nukemode" = "nuke" ]; then x_ "$cbfstool" "$rom" remove -n "$cbfsname" elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode - x_ mkdir -p tmp x_ rm -f "tmp/refcode" "$rmodtool" -i "$_dest" -o "tmp/refcode" || "!reloc refcode" "$cbfstool" "$rom" add-stage -f "tmp/refcode" -n "$cbfsname" \ @@ -567,7 +561,7 @@ modify_mac() { [ -n "$CONFIG_GBE_BIN_PATH" ] || return 1 - x_ mkdir -p tmp && x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe + x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \ x_ "$nvm" tmp/gbe setmac "$new_mac" -- cgit v1.2.1 From 0ffaf5c7331ae0fac9db8cf8a2b670e156fad7e9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 05:33:02 +0100 Subject: init.sh: Explicitly create the xbmktmp directory mktemp would normally do it, but we must not rely on that Signed-off-by: Leah Rowe --- include/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/init.sh b/include/init.sh index 9e0e3a37..c40894a1 100644 --- a/include/init.sh +++ b/include/init.sh @@ -197,7 +197,7 @@ xbmk_create_tmpdir() # /tmp might be a tmpfs, so for large files we use ./tmp, # not to be confused with xbmktmp (xbmktmp points to /tmp) - x_ mkdir -p tmp + x_ mkdir -p "$xbmktmp" tmp } xbmk_lock() -- cgit v1.2.1 From a17875c34593cf966e61aacb9285f324723bb245 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 05:57:39 +0100 Subject: lib.sh find_ex: explicitly create the tmp file Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lib.sh b/include/lib.sh index 3f5e5d37..8bad16ce 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -141,7 +141,7 @@ fx_() find_ex() { errx="$1" && shift 1 - fd="`mktemp`" + fd="`mktemp`" && x_ rm -f "$fd" && x_ touch rm -f "$fd" xx="$1" && shift 1 $errx find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\"" while read -r fx; do -- cgit v1.2.1 From 44a1cc9ef85626a0d45c7b838a3637ec9f316540 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 06:23:10 +0100 Subject: util/nvmutil: use x, not ?, for random characters A user reported that '?' causes an error on zsh. See: https://codeberg.org/libreboot/lbmk/issues/261 For example: ./mk inject libreboot-XXXXXX.tar.xz setmac ??:??:??:??:??:?? The user got: zsh: no matches found: ??:??:??:??:??:?? The mitigation here is to double-quote, e.g.: ./mk inject libreboot-XXXXXX.tar.xz setmac "??:??:??:??:??:??" However, a lot of people won't do that. Therefore, I will retain the current behaviour but support x/X for randomness. Now lbmk uses x by default, instead. I will now update the documentation, accordingly. Signed-off-by: Leah Rowe --- include/inject.sh | 2 +- util/nvmutil/nvmutil.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 26bcd02f..beaebf4d 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -328,7 +328,7 @@ inject() eval "`setvars "" nukemode new_mac xchanged`" archive="$1"; - new_mac="??:??:??:??:??:??" + new_mac="xx:xx:xx:xx:xx:xx" [ $# -gt 1 ] && case "$2" in nuke) diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 12aabe4d..05459bb7 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -40,7 +40,7 @@ size_t partsize, gbe[2]; uint8_t nvmPartChanged[2] = {0, 0}, do_read[2] = {1, 1}; int flags, rfd, fd, part; -const char *strMac = NULL, *strRMac = "??:??:??:??:??:??", *filename = NULL; +const char *strMac = NULL, *strRMac = "xx:xx:xx:xx:xx:xx", *filename = NULL; typedef struct op { char *str; @@ -278,8 +278,11 @@ parseMacString(const char *strMac, uint16_t *mac) err(errno = EINVAL, "Invalid character '%c'", strMac[i + nib]); + /* If random, ensure that local/unicast bits are set */ if ((byte == 0) && (nib == 1)) - if (strMac[i + nib] == '?') /* ?=random */ + if ((strMac[i + nib] == '?') || + (strMac[i + nib] == 'x') || + (strMac[i + nib] == 'X')) /* random */ h = (h & 0xE) | 2; /* local, unicast */ mac[byte >> 1] |= ((uint16_t ) h) @@ -302,7 +305,10 @@ hextonum(char ch) return ch - 'A' + 10; else if ((ch >= 'a') && (ch <= 'f')) return ch - 'a' + 10; - return (ch == '?') ? rhex() : 16; + else if ((ch == '?') || (ch == 'x') || (ch == 'X')) + return rhex(); /* random hex value */ + else + return 16; /* error: invalid character */ } uint8_t -- cgit v1.2.1 From 308df9ca4061e66ca1bdfb4c5c23cc4153d3ce31 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 06:28:14 +0100 Subject: inject.sh: always re-build nvmutil it's not a lot of code, and takes less than a second. the previous change uses x instead of ?, but this would cause an error if the nvmutil was already built, because the makefile might cause a build to be skipped. therefore, force a re-build to mitigate the error. Signed-off-by: Leah Rowe --- include/inject.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/inject.sh b/include/inject.sh index beaebf4d..8fb0a34e 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -562,7 +562,8 @@ modify_mac() [ -n "$CONFIG_GBE_BIN_PATH" ] || return 1 x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe - [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil && \ + [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil clean && \ + x_ make -C util/nvmutil && \ x_ "$nvm" tmp/gbe setmac "$new_mac" fe_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom" -- cgit v1.2.1 From 0b09d970732cb396f1868c41ee9842b4a96f0c36 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 06:35:48 +0100 Subject: inject.sh: Only build nvmutil once Signed-off-by: Leah Rowe --- include/inject.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 8fb0a34e..0aefc210 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -341,6 +341,11 @@ inject() esac [ "$new_mac" = "keep" ] && new_mac="" + if [ -n "$new_mac" ] && [ "$new_mac" != "restore" ]; then + x_ make -C util/nvmutil clean + x_ make -C util/nvmutil + fi + check_release "$archive" || $err "'$archive' is not a release archive" readcfg && need_files="y" @@ -562,8 +567,7 @@ modify_mac() [ -n "$CONFIG_GBE_BIN_PATH" ] || return 1 x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe - [ "$new_mac" != "restore" ] && x_ make -C util/nvmutil clean && \ - x_ make -C util/nvmutil && \ + [ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \ x_ "$nvm" tmp/gbe setmac "$new_mac" fe_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom" -- cgit v1.2.1 From 7fadb17fd9ed7e916f62849132d73648ea9a099d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 06:36:43 +0100 Subject: lib.sh: Fix bad touch command Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lib.sh b/include/lib.sh index 8bad16ce..3c603bae 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -141,7 +141,7 @@ fx_() find_ex() { errx="$1" && shift 1 - fd="`mktemp`" && x_ rm -f "$fd" && x_ touch rm -f "$fd" + fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd" xx="$1" && shift 1 $errx find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\"" while read -r fx; do -- cgit v1.2.1 From 0f7b3691abafdbb46ea8e7bc95332da9d4be80d2 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 06:41:20 +0100 Subject: lib.sh: redirect find errors to /dev/null this silences confusing error messages that the user sees on the screen, that are actually benign, and it will thus reduce the number of people who ask questions on #libreboot irc Signed-off-by: Leah Rowe --- include/lib.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/lib.sh b/include/lib.sh index 3c603bae..d58716c3 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -143,7 +143,8 @@ find_ex() errx="$1" && shift 1 fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd" xx="$1" && shift 1 - $errx find "$@" | sort > "$fd" || $err "!find $(echo "$@") > \"$fd\"" + $errx find "$@" 2>/dev/null | sort > "$fd" || \ + $err "!find $(echo "$@") > \"$fd\"" while read -r fx; do "$xx" "$fx" || break; : done < "$fd" -- cgit v1.2.1 From 00d22f20829251f55cd2e859d6fae9a61220c072 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 06:53:25 +0100 Subject: lbmk: Unified local ./tmp handling Make it an absolute directory, relative to xbmktmp. Signed-off-by: Leah Rowe --- include/git.sh | 2 +- include/init.sh | 8 +++++--- include/inject.sh | 32 +++++++++++++++++--------------- mk | 1 - 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/include/git.sh b/include/git.sh index 9be79527..37f5bbae 100644 --- a/include/git.sh +++ b/include/git.sh @@ -5,7 +5,7 @@ eval "`setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \ depend subfile_bkup repofail`" -tmpgit="$xbmkpwd/tmp/gitclone" +tmpgit="$xbmklocal/gitclone" fetch_targets() { diff --git a/include/init.sh b/include/init.sh index c40894a1..a5180d07 100644 --- a/include/init.sh +++ b/include/init.sh @@ -17,11 +17,13 @@ xbmkpath="$PATH" err="err_" eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \ - datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver`" + datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver xbmklocal`" xbmk_init() { xbmkpwd="`pwd`" || $err "Cannot generate PWD" + xbmklocal="$xbmkpwd/tmp" + export PWD="$xbmkpwd" if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then @@ -197,7 +199,7 @@ xbmk_create_tmpdir() # /tmp might be a tmpfs, so for large files we use ./tmp, # not to be confused with xbmktmp (xbmktmp points to /tmp) - x_ mkdir -p "$xbmktmp" tmp + x_ mkdir -p "$xbmktmp" "$xbmklocal" } xbmk_lock() @@ -223,7 +225,7 @@ xbmk_child_exec() { xbmk_rval=0 ( x_ ./mk "$@" ) || xbmk_rval=1 - rm -Rf tmp "$xbmktmp" || xbmk_rval=1 + rm -Rf "$xbmklocal" "$xbmktmp" || xbmk_rval=1 rm -f lock || xbmk_rval=1 exit $xbmk_rval } diff --git a/include/inject.sh b/include/inject.sh index 0aefc210..805415ef 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -14,7 +14,7 @@ hashfiles="vendorhashes blobhashes" # blobhashes for backwards compatibility dontflash="!!! AN ERROR OCCURED! Please DO NOT flash if injection failed. !!!" vfix="DO_NOT_FLASH_YET._FIRST,_INJECT_FILES_VIA_INSTRUCTIONS_ON_LIBREBOOT.ORG_" vguide="https://libreboot.org/docs/install/ivy_has_common.html" -tmpromdel="$xbmkpwd/tmp/DO_NOT_FLASH" +tmpromdel="$xbmklocal/DO_NOT_FLASH" nvm="util/nvmutil/nvm" ifdtool="elf/ifdtool/default/ifdtool" @@ -142,7 +142,7 @@ extract_intel_me() cdir="$xbmkpwd/$appdir" _me="$xbmkpwd/$_dest" - _metmp="$xbmkpwd/tmp/me.bin" + _metmp="$xbmklocal/me.bin" mfs="" && [ "$ME11bootguard" = "y" ] && mfs="--whitelist MFS" && \ chkvars ME11delta ME11version ME11sku ME11pch @@ -280,15 +280,17 @@ extract_tbfw() { chkvars TBFW_size # size in bytes, matching TBFW's flash IC - x_ rm -f tmp/tb.bin && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" + tbtmp="$xbmklocal/tb.bin" + x_ rm -f "$tbtmp" && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" - x_ dd if=/dev/null of=tmp/tb.bin bs=1 seek=$TBFW_size - x_ cp "tmp/tb.bin" "$_dest" + x_ dd if=/dev/null of="$tbtmp" bs=1 seek=$TBFW_size + x_ cp "$tbtmp" "$_dest" } copy_tbfw() { - [ -f "$1" ] && [ ! -L "$1" ] && x_ cp "$1" "tmp/tb.bin" && return 1; : + [ -f "$1" ] && [ ! -L "$1" ] && x_ cp "$1" "$xbmklocal/tb.bin" && \ + return 1; : } extract_fspm() @@ -409,7 +411,7 @@ readcfg() patch_release_roms() { has_hashes="n" - tmpromdir="tmp/DO_NOT_FLASH/bin/$board" + tmpromdir="$xbmklocal/DO_NOT_FLASH/bin/$board" remkdir "${tmpromdir%"/bin/$board"}" x_ tar -xf "$archive" -C "${tmpromdir%"/bin/$board"}" @@ -551,10 +553,10 @@ insert() elif [ "$nukemode" = "nuke" ]; then x_ "$cbfstool" "$rom" remove -n "$cbfsname" elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode - x_ rm -f "tmp/refcode" - "$rmodtool" -i "$_dest" -o "tmp/refcode" || "!reloc refcode" - "$cbfstool" "$rom" add-stage -f "tmp/refcode" -n "$cbfsname" \ - -t stage || $err "$rom: !add ref" + x_ rm -f "$xbmklocal/refcode" + "$rmodtool" -i "$_dest" -o "$xbmklocal/refcode" || "!reloc ref" + "$cbfstool" "$rom" add-stage -f "$xbmklocal/refcode" \ + -n "$cbfsname" -t stage || $err "$rom: !add ref" else "$cbfstool" "$rom" add -f "$_dest" -n "$cbfsname" \ -t $_t $_offset || $err "$rom !add $_t ($_dest)" @@ -566,14 +568,14 @@ modify_mac() { [ -n "$CONFIG_GBE_BIN_PATH" ] || return 1 - x_ cp "${CONFIG_GBE_BIN_PATH##*../}" tmp/gbe + x_ cp "${CONFIG_GBE_BIN_PATH##*../}" "$xbmklocal/gbe" [ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \ - x_ "$nvm" tmp/gbe setmac "$new_mac" + x_ "$nvm" "$xbmklocal/gbe" setmac "$new_mac" fe_ newmac "$tmpromdir" -maxdepth 1 -type f -name "*.rom" printf "\nGbE NVM written to '%s':\n" "$archive" - x_ "$nvm" tmp/gbe dump | grep -v "bytes read from file" || : + x_ "$nvm" "$xbmklocal/gbe" dump | grep -v "bytes read from file" || : [ "$new_mac" = "restore" ] && \ printf "\nDefault GbE file '%s' written, unmodified.\n" \ @@ -583,5 +585,5 @@ modify_mac() newmac() { e "$1" f && xchanged="y" && x_ \ - "$ifdtool" $ifdprefix -i GbE:tmp/gbe "$1" -O "$1"; : + "$ifdtool" $ifdprefix -i GbE:"$xbmklocal/gbe" "$1" -O "$1"; : } diff --git a/mk b/mk index 8884d61e..312ffce3 100755 --- a/mk +++ b/mk @@ -68,7 +68,6 @@ build_release() cd "$srcdir" || $err "$vdir: !cd \"$srcdir\"" ./mk -f - x_ rm -Rf tmp rmgit . x_ mv src/docs docs ) || $err "can't create release files" -- cgit v1.2.1 From 498f5a26cc82db8063c37876058091e1b1279d45 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 07:04:34 +0100 Subject: init.sh: Always create xbmklocal If we're in a release work directory, TMPDIR is already set, so the local ./tmp won't be created, which would lead to an error. Fix it by creating xbmklocal before checking TMPDIR. Signed-off-by: Leah Rowe --- include/init.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/init.sh b/include/init.sh index a5180d07..c4650576 100644 --- a/include/init.sh +++ b/include/init.sh @@ -186,6 +186,8 @@ xbmk_git_init() xbmk_create_tmpdir() { + x_ mkdir -p "$xbmklocal" + # unify all temporary files/directories in a single TMPDIR [ -z "${TMPDIR+x}" ] || [ "${TMPDIR%_*}" = "/tmp/xbmk" ] || \ unset TMPDIR -- cgit v1.2.1 From 530e4109a2b4ad2d26c3e29eda652e2ab180cf84 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 07:05:38 +0100 Subject: init.sh: *Re-create* tmpdirs on parent instance To make sure any old files are removed, always re-create. Signed-off-by: Leah Rowe --- include/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/init.sh b/include/init.sh index c4650576..3f813ea7 100644 --- a/include/init.sh +++ b/include/init.sh @@ -201,7 +201,7 @@ xbmk_create_tmpdir() # /tmp might be a tmpfs, so for large files we use ./tmp, # not to be confused with xbmktmp (xbmktmp points to /tmp) - x_ mkdir -p "$xbmktmp" "$xbmklocal" + remkdir "$xbmktmp" "$xbmklocal" } xbmk_lock() -- cgit v1.2.1 From 8de0ed811fb9bc48659f95918a36317f24be3d8e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 07:17:21 +0100 Subject: inject.sh: Stricter TBFW handling Don't copy it until it has been padded properly. Otherwise, erroneous padding would result in an error, and who knows what would be left in vendorfiles/ ? Signed-off-by: Leah Rowe --- include/inject.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 805415ef..c5e41f6d 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -278,19 +278,23 @@ extract_sch5545ec() # https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t480-type-20l5-20l6/20l5/solutions/ht508988 extract_tbfw() { - chkvars TBFW_size # size in bytes, matching TBFW's flash IC - - tbtmp="$xbmklocal/tb.bin" - x_ rm -f "$tbtmp" && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" - - x_ dd if=/dev/null of="$tbtmp" bs=1 seek=$TBFW_size - x_ cp "$tbtmp" "$_dest" + chkvars TBFW_size + fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" + [ -f "$_dest" ] || $err "$board: Could not extract tbfw"; : } copy_tbfw() { - [ -f "$1" ] && [ ! -L "$1" ] && x_ cp "$1" "$xbmklocal/tb.bin" && \ - return 1; : + [ -f "$1" ] || return 0 + [ -L "$1" ] && return 0 + + tbtmp="$xbmklocal/tb.bin" + x_ rm -f "$tbtmp" + + x_ dd if=/dev/null of="$1" bs=1 seek=$TBFW_size + x_ mv "$1" "$_dest" + + return 1 } extract_fspm() -- cgit v1.2.1 From bf569d2b4dcbf8efc648da1a87803eefd4b892dc Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 07:20:48 +0100 Subject: inject.sh: Remove redundant code in copy_tbfw We don't use the tbtmp variable anymore, in this function. Signed-off-by: Leah Rowe --- include/inject.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index c5e41f6d..b0f3f502 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -288,9 +288,6 @@ copy_tbfw() [ -f "$1" ] || return 0 [ -L "$1" ] && return 0 - tbtmp="$xbmklocal/tb.bin" - x_ rm -f "$tbtmp" - x_ dd if=/dev/null of="$1" bs=1 seek=$TBFW_size x_ mv "$1" "$_dest" -- cgit v1.2.1 From 72f4412a52df60bd2d3f01a4c8dc138334ffe434 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 13:15:40 +0100 Subject: inject.sh: simplified fsp extraction we know that _dest is always what's set in the coreboot config, without the ../../../ in it, so just copy both files in a single function, and call the function twice. if both files are done on the first call, the second call will be skipped. if only the first file was done on the first call, running the download script again will skip the first one, and grab the second one. this also avoids having to run the decat function twice, in most cases, so it's a tiny optimisation. this optimisation only works if both fsp files (s and m) are to be extracted into the same directory, which is the case anyway, and this will always be the case. Signed-off-by: Leah Rowe --- include/inject.sh | 51 +++++++++++++-------------------------------------- 1 file changed, 13 insertions(+), 38 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index b0f3f502..a9d1350a 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -95,9 +95,9 @@ getfiles() # therefore, handle them separately, in case one of them is libre; if # one of them was, the path wouldn't be set. # - [ -z "$CONFIG_FSP_M_FILE" ] || fetch "fspm" "$CONFIG_FSP_FD_PATH" \ + [ -z "$CONFIG_FSP_M_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_M_FILE" copy - [ -z "$CONFIG_FSP_S_FILE" ] || fetch "fsps" "$CONFIG_FSP_FD_PATH" \ + [ -z "$CONFIG_FSP_S_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_S_FILE" copy; : } @@ -111,14 +111,12 @@ fetch() [ "$5" = "/dev/null" ] && return 0 _dl="$XBMK_CACHE/file/$dlsum" - if [ "$dl_type" = "fspm" ] || [ "$dl_type" = "fsps" ]; then - # HACK: if grabbing fsp from coreboot, fix the path for lbmk - for _cdl in dl dl_bkup; do - eval "$_cdl=\"\${$_cdl##*../}\"; _cdp=\"\$$_cdl\"" - [ -f "$_cdp" ] || _cdp="$cbdir/$_cdp" - [ -f "$_cdp" ] && eval "$_cdl=\"$_cdp\"" - done - fi + # HACK: if grabbing fsp from coreboot, fix the path for lbmk + [ "$dl_type" = "fsp" ] && for _cdl in dl dl_bkup; do + eval "$_cdl=\"\${$_cdl##*../}\"; _cdp=\"\$$_cdl\"" + [ -f "$_cdp" ] || _cdp="$cbdir/$_cdp" + [ -f "$_cdp" ] && eval "$_cdl=\"$_cdp\"" + done; : dlop="curl" && [ $# -gt 5 ] && dlop="$6" xbmkget "$dl" "$dl_bkup" "$_dl" "$dlsum" "$dlop" @@ -205,12 +203,9 @@ apply_me11_deguard_mod() extract_archive() { - if [ $# -gt 2 ]; then - if [ "$3" = "fspm" ] || [ "$3" = "fsps" ]; then - decat_fspfd "$1" "$2" - return 0 - fi - fi + [ $# -gt 2 ] && [ "$3" = "fsp" ] && x_ python \ + "$cbdir/3rdparty/fsp/Tools/SplitFspBin.py" split -f "$1" -o "$2" \ + -n "Fsp.fd" && return 0 innoextract "$1" -d "$2" || python "$pfs_extract" "$1" -e || 7z x \ "$1" -o"$2" || unar "$1" -o "$2" || unzip "$1" -d "$2" || return 1 @@ -219,15 +214,6 @@ extract_archive() $err "!mv '${_dl}_extracted' '$2' - $dontflash"; : } -decat_fspfd() -{ - _fspfd="$1" - _fspdir="$2" - _fspsplit="$cbdir/3rdparty/fsp/Tools/SplitFspBin.py" - - x_ $python "$_fspsplit" split -f "$_fspfd" -o "$_fspdir" -n "Fsp.fd" -} - extract_kbc1126ec() { x_ e "$kbc1126_ec_dump" f @@ -294,20 +280,9 @@ copy_tbfw() return 1 } -extract_fspm() -{ - copy_fsp M; : -} - -extract_fsps() -{ - copy_fsp S; : -} - -# this copies the fsp s/m; re-base is handled by ./mk inject -copy_fsp() +extract_fsp() { - x_ cp "$appdir/Fsp_$1.fd" "$_dest" + x_ cp "$appdir/"Fsp_*.fd "${_dest%/*}" } fail_inject() -- cgit v1.2.1 From 5499ae66bd8e7c36fd6f298b68365d39672a2cfa Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 13:35:28 +0100 Subject: inject.sh: simplify extract_archive() Signed-off-by: Leah Rowe --- include/inject.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index a9d1350a..a200981f 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -210,8 +210,7 @@ extract_archive() innoextract "$1" -d "$2" || python "$pfs_extract" "$1" -e || 7z x \ "$1" -o"$2" || unar "$1" -o "$2" || unzip "$1" -d "$2" || return 1 - [ ! -d "${_dl}_extracted" ] || cp -R "${_dl}_extracted" "$2" || \ - $err "!mv '${_dl}_extracted' '$2' - $dontflash"; : + [ ! -d "${_dl}_extracted" ] || x_ cp -R "${_dl}_extracted" "$2"; : } extract_kbc1126ec() -- cgit v1.2.1 From 46b968a6e859ca7a0406c1c446ff1a53d74ad887 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 13:49:49 +0100 Subject: inject.sh: minor code cleanup Signed-off-by: Leah Rowe --- include/inject.sh | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index a200981f..9bfda2db 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -228,9 +228,7 @@ extract_kbc1126ec() ) || $err "$board: can't extract kbc1126 ec firmware - $dontflash" x_ e "$appdir/ec.bin.fw1" f && x_ e "$appdir/ec.bin.fw2" f - - cp "$appdir/"ec.bin.fw* "${_dest%/*}/" || \ - $err "!cp 1126ec $_dest - $dontflash"; : + x_ cp "$appdir/"ec.bin.fw* "${_dest%/*}/" } extract_e6400vga() @@ -318,10 +316,8 @@ inject() esac [ "$new_mac" = "keep" ] && new_mac="" - if [ -n "$new_mac" ] && [ "$new_mac" != "restore" ]; then - x_ make -C util/nvmutil clean - x_ make -C util/nvmutil - fi + [ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \ + x_ make -C util/nvmutil clean && x_ make -C util/nvmutil check_release "$archive" || $err "'$archive' is not a release archive" @@ -510,11 +506,10 @@ insert() _offset="" - if [ "$_t" = "fsp" ]; then - [ $# -gt 3 ] && _offset="$4" - else - [ $# -gt 3 ] && _offset="-b $4" && [ -z "$4" ] && \ - $err "insert $*, $rom: offset given but empty (undefined)" + if [ "$_t" = "fsp" ] && [ $# -gt 3 ]; then + _offset="$4" + elif [ $# -gt 3 ] && _offset="-b $4" && [ -z "$4" ]; then + $err "insert $*, $rom: offset given but empty (undefined)" fi [ "$nukemode" = "nuke" ] || x_ e "$_dest" f @@ -551,10 +546,6 @@ modify_mac() printf "\nGbE NVM written to '%s':\n" "$archive" x_ "$nvm" "$xbmklocal/gbe" dump | grep -v "bytes read from file" || : - - [ "$new_mac" = "restore" ] && \ - printf "\nDefault GbE file '%s' written, unmodified.\n" \ - "${CONFIG_GBE_BIN_PATH##*../}"; : } newmac() -- cgit v1.2.1 From 7a2f33264d713919bee5a6a4422f3664474b3420 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 18:04:47 +0100 Subject: mk: simplify check_gnu_path() the initial checks are unnecessary, since i always know what arguments are being provided. the -f check in the for loop is now an -x instead, more efficient and complete. Signed-off-by: Leah Rowe --- mk | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/mk b/mk index 312ffce3..06a77522 100755 --- a/mk +++ b/mk @@ -332,35 +332,25 @@ check_cross_compiler() # gnat in PATH never resolves to gnat-14, because gnat-14 was "experimental" check_gnu_path() { - [ $# -lt 2 ] && $err "check_gnu_path: Too few arguments" - [ "$1" = "$2" ] && $err "check_gnu_path: Both arguments identical" - for _gnuarg in 1 2; do - eval "[ \"\$$_gnuarg\" = \"gcc\" ] && continue" - eval "[ \"\$$_gnuarg\" = \"gnat\" ] && continue" - $err "check_gnu_path: Invalid argument \"$_gnuarg\"" - done command -v "$1" 1>/dev/null || $err "Host '$1' unavailable" eval "`setvars "" gccver gccfull gnatver gnatfull gccdir gnatdir`" - gnu_setver "$1" "$1" || $err "Command '$1' unavailable." - gnu_setver "$2" "$2" || : + x_ gnu_setver "$1" "$1" && gnu_setver "$2" "$2" || : eval "[ -z \"\$$1ver\" ] && $err \"Cannot detect host '$1' version\"" [ "$gnatfull" = "$gccfull" ] && return 0 eval "$1dir=\"$(dirname "$(command -v "$1")")\"" eval "_gnudir=\"\$$1dir\"; _gnuver=\"\$$1ver\"" - for _gnubin in "$_gnudir/$2-"*; do - [ -f "$_gnubin" ] || continue - [ "${_gnubin#"$_gnudir/$2-"}" = "$_gnuver" ] || continue - _gnuver="${_gnubin#"$_gnudir/$2-"}"; break + for _bin in "$_gnudir/$2-"*; do + [ "${_bin#"$_gnudir/$2-"}" = "$_gnuver" ] && [ -x "$_bin" ] \ + && _gnuver="${_bin#"$_gnudir/$2-"}" && break; : done gnu_setver "$2" "$_gnudir/$2-$_gnuver" || return 1 [ "$gnatfull" = "$gccfull" ] || return 1 ( - rm -f "$XBMK_CACHE/gnupath/"* || $err "Cannot clear gnupath/" - cd "$XBMK_CACHE/gnupath" || $err "Can't cd to gnupath/" + remkdir "$XBMK_CACHE/gnupath" && x_ cd "$XBMK_CACHE/gnupath" for _gnubin in "$_gnudir/$2"*"-$_gnuver"; do _gnuutil="${_gnubin##*/}" && [ -e "$_gnubin" ] && \ x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}" -- cgit v1.2.1 From 8f828e6cd35d82b0a0fa20b202d49ab092161fa3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 18:14:59 +0100 Subject: mk: tidy up check_project_hashes() sha512sum check the extra function isn't needed at all. awk can just handle every line all at once. Signed-off-by: Leah Rowe --- mk | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/mk b/mk index 06a77522..2020115b 100755 --- a/mk +++ b/mk @@ -277,9 +277,9 @@ check_project_hashes() [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \ read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree" - x_ rm -f "$xbmktmp/project.hash" - fx_ create_project_hash "$datadir" "$configdir/$tree" "$mdir" \ - -type f -not -path "*/.git*/*" + fx_ sha512sum "$datadir" "$configdir/$tree" "$mdir" \ + -type f -not -path "*/.git*/*" | awk '{print $1}' > \ + "$xbmktmp/project.hash" || $err "!h $project $tree" pjhash="$(sha512sum "$xbmktmp/project.hash" | awk '{print $1}')" || : [ "$pjhash" != "$old_pjhash" ] && badhash="y" @@ -292,12 +292,6 @@ check_project_hashes() "elf/$project/$tree" "elf/$project/$target"; : } -create_project_hash() -{ - [ ! -f "$1" ] || x_ sha512sum "$1" | awk \ - '{print $1}' >> "$xbmktmp/project.hash" || $err "!h $1"; : -} - check_cross_compiler() { xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" -- cgit v1.2.1 From aa4083443b14335c8ada088034434b584aacc789 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 3 May 2025 18:30:37 +0100 Subject: mk: Allow use of x_ on prefix functions Use this for the sha512sum command, on the main mk script at the function check_project_hashes(). Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index d58716c3..50813352 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -146,7 +146,7 @@ find_ex() $errx find "$@" 2>/dev/null | sort > "$fd" || \ $err "!find $(echo "$@") > \"$fd\"" while read -r fx; do - "$xx" "$fx" || break; : + $xx "$fx" || break; : done < "$fd" x_ rm -f "$fd" } diff --git a/mk b/mk index 2020115b..28a4cb0c 100755 --- a/mk +++ b/mk @@ -277,7 +277,7 @@ check_project_hashes() [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \ read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree" - fx_ sha512sum "$datadir" "$configdir/$tree" "$mdir" \ + fx_ "x_ sha512sum" "$datadir" "$configdir/$tree" "$mdir" \ -type f -not -path "*/.git*/*" | awk '{print $1}' > \ "$xbmktmp/project.hash" || $err "!h $project $tree" -- cgit v1.2.1 From c33467df1e6119e07608e4e35193815bd2050b1c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:02:14 +0100 Subject: mk: reduce indentation in check_cross_compiler() we only call it in one place. the resulting code is still quite clear. Signed-off-by: Leah Rowe --- mk | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/mk b/mk index 28a4cb0c..765772b4 100755 --- a/mk +++ b/mk @@ -211,7 +211,9 @@ handle_defconfig() if [ "$mode" = "distclean" ] || [ "$mode" = "crossgcc-clean" ]; then [ -d "$srcdir" ] || return 0 fi - [ -z "$mode" ] && $dry check_cross_compiler + [ -z "$mode" ] && for _xarch in $xarch; do + $dry check_cross_compiler "$_xarch" + done; : for y in "$target_dir/config"/*; do [ "$_f" = "-d" ] || [ -f "$y" ] || continue @@ -295,29 +297,28 @@ check_project_hashes() check_cross_compiler() { xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" - for _xarch in $xarch; do - cbdir="src/coreboot/$tree" - [ "$project" != "coreboot" ] && cbdir="src/coreboot/default" - [ -n "$xtree" ] && cbdir="src/coreboot/$xtree" - x_ ./mk -f coreboot "${cbdir#src/coreboot/}" + cbdir="src/coreboot/$tree" + [ "$project" != "coreboot" ] && cbdir="src/coreboot/default" + [ -n "$xtree" ] && cbdir="src/coreboot/$xtree" - export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH" - export CROSS_COMPILE="${xarch% *}-" - [ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang" + x_ ./mk -f coreboot "${cbdir#src/coreboot/}" - xfix="${_xarch%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64" + export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH" + export CROSS_COMPILE="${xarch% *}-" + [ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang" - # match gnat-X to gcc - check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc + xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64" - # sometimes buildgcc fails for like no reason. try twice. - make -C "$cbdir" crossgcc-$xfix $xgccargs || \ - x_ make -C "$cbdir" crossgcc-$xfix $xgccargs + # match gnat-X to gcc + check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc - # we only want to mess with hostcc to build xgcc - rm -f "$XBMK_CACHE/gnupath/"* || $err "Can't clear gnupath/"; : - done; : + # sometimes buildgcc fails for like no reason. try twice. + make -C "$cbdir" crossgcc-$xfix $xgccargs || \ + x_ make -C "$cbdir" crossgcc-$xfix $xgccargs + + # we only want to mess with hostcc to build xgcc + rm -f "$XBMK_CACHE/gnupath/"* || $err "Can't clear gnupath/"; : } # fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024, -- cgit v1.2.1 From 488d52e784f4520f679e5823ff2c48057037cbd8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:04:36 +0100 Subject: mk: re-make gnupath/ for each cross compiler it could be that some were left over before, for some reason. that isn't currently the case, but this will avoid the possibility in future. therefore, this is a preemptive bug fix. Signed-off-by: Leah Rowe --- mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk b/mk index 765772b4..4d7cf116 100755 --- a/mk +++ b/mk @@ -296,6 +296,7 @@ check_project_hashes() check_cross_compiler() { + remkdir "$XBMK_CACHE/gnupath" xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" cbdir="src/coreboot/$tree" -- cgit v1.2.1 From 1b7a9fd637d2ca98d1da5ded0e2090bd311b4b8c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:07:06 +0100 Subject: mk: tidy up check_cross_compiler only initialise variables at the point they're needed. Signed-off-by: Leah Rowe --- mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mk b/mk index 4d7cf116..2dd9379b 100755 --- a/mk +++ b/mk @@ -297,7 +297,6 @@ check_project_hashes() check_cross_compiler() { remkdir "$XBMK_CACHE/gnupath" - xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" cbdir="src/coreboot/$tree" [ "$project" != "coreboot" ] && cbdir="src/coreboot/default" @@ -309,12 +308,11 @@ check_cross_compiler() export CROSS_COMPILE="${xarch% *}-" [ -n "$xlang" ] && export BUILD_LANGUAGES="$xlang" - xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64" - # match gnat-X to gcc check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc - # sometimes buildgcc fails for like no reason. try twice. + xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64" + xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" make -C "$cbdir" crossgcc-$xfix $xgccargs || \ x_ make -C "$cbdir" crossgcc-$xfix $xgccargs -- cgit v1.2.1 From f5b2bdb88681bd16f2a32c8fb3f51cfc65da9448 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:07:53 +0100 Subject: mk: re-make gnupath/ after handling crossgcc instead of deleting every file within Signed-off-by: Leah Rowe --- mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk b/mk index 2dd9379b..c87acfe7 100755 --- a/mk +++ b/mk @@ -317,7 +317,7 @@ check_cross_compiler() x_ make -C "$cbdir" crossgcc-$xfix $xgccargs # we only want to mess with hostcc to build xgcc - rm -f "$XBMK_CACHE/gnupath/"* || $err "Can't clear gnupath/"; : + remkdir "$XBMK_CACHE/gnupath" } # fix mismatching gcc/gnat versions on debian trixie/sid. as of december 2024, -- cgit v1.2.1 From b6a2dc4ea3ca18bff174014d1724aebd5dc28b84 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:10:36 +0100 Subject: init.sh: tidy up pathdir creation we can use remkdir here. it does the same thing. Signed-off-by: Leah Rowe --- include/init.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/init.sh b/include/init.sh index 3f813ea7..7026594a 100644 --- a/include/init.sh +++ b/include/init.sh @@ -212,8 +212,7 @@ xbmk_lock() xbmk_create_pathdirs() { - x_ rm -Rf "$XBMK_CACHE/xbmkpath" "$XBMK_CACHE/gnupath" - x_ mkdir -p "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" + remkdir "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath" export PATH="$XBMK_CACHE/xbmkpath:$XBMK_CACHE/gnupath:$PATH" ( # set up python v3.x in PATH, in case it's not set up correctly. -- cgit v1.2.1 From 184871bc17cdc5716d8d8bcfff03b0f7412b7a1a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:10:59 +0100 Subject: mk: remove useless code this was added a few commits ago, but the previous commit made me realise it's not needed at all. Signed-off-by: Leah Rowe --- mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/mk b/mk index c87acfe7..49cebaf1 100755 --- a/mk +++ b/mk @@ -296,8 +296,6 @@ check_project_hashes() check_cross_compiler() { - remkdir "$XBMK_CACHE/gnupath" - cbdir="src/coreboot/$tree" [ "$project" != "coreboot" ] && cbdir="src/coreboot/default" [ -n "$xtree" ] && cbdir="src/coreboot/$xtree" -- cgit v1.2.1 From fc71e52fdfc559d207ea54059a86edb81e928e33 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:14:44 +0100 Subject: mk: tidy up xgccargs handling Signed-off-by: Leah Rowe --- mk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mk b/mk index 49cebaf1..5a4afadf 100755 --- a/mk +++ b/mk @@ -310,9 +310,8 @@ check_cross_compiler() check_gnu_path gcc gnat || x_ check_gnu_path gnat gcc xfix="${1%-*}" && [ "$xfix" = "x86_64" ] && xfix="x64" - xgccargs="UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" - make -C "$cbdir" crossgcc-$xfix $xgccargs || \ - x_ make -C "$cbdir" crossgcc-$xfix $xgccargs + xgccargs="crossgcc-$xfix UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS" + make -C "$cbdir" $xgccargs || x_ make -C "$cbdir" $xgccargs # we only want to mess with hostcc to build xgcc remkdir "$XBMK_CACHE/gnupath" -- cgit v1.2.1 From 93ba36ae456cad1e0766c1020ac2dfdb013b6411 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:19:17 +0100 Subject: rom.sh: tidy up copyps1bios() Signed-off-by: Leah Rowe --- include/rom.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/rom.sh b/include/rom.sh index f74912af..ec464d85 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -29,8 +29,7 @@ mkserprog() copyps1bios() { - x_ rm -Rf bin/playstation - x_ mkdir -p bin/playstation + remkdir "bin/playstation" x_ cp src/pcsx-redux/src/mips/openbios/openbios.bin bin/playstation printf "MIT License\n\nCopyright (c) 2019-2024 PCSX-Redux authors\n\n" \ -- cgit v1.2.1 From 7acec7a3a1d40a38b88b56e9c56087da263f30d1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:29:19 +0100 Subject: init.sh: simplify dependencies handling Signed-off-by: Leah Rowe --- include/init.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/init.sh b/include/init.sh index 7026594a..fc321605 100644 --- a/include/init.sh +++ b/include/init.sh @@ -26,10 +26,7 @@ xbmk_init() export PWD="$xbmkpwd" - if [ $# -gt 0 ] && [ "$1" = "dependencies" ]; then - install_packages "$@" || exit 1 - exit 0 - fi + [ $# -gt 0 ] && [ "$1" = "dependencies" ] && x_ xbmkpkg "$@" && exit 0 id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)" [ "$(id -u)" != "0" ] || $err "this command as root is not permitted" @@ -40,7 +37,7 @@ xbmk_init() done } -install_packages() +xbmkpkg() { [ $# -lt 2 ] && $err "fewer than two arguments" [ $# -gt 2 ] && reinstall="$3" -- cgit v1.2.1 From 7392f6fc8ecbff10661be6ae66306afd89f1a3e3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:33:17 +0100 Subject: init.sh: move non-init functions to lib.sh these were missed in a previous cleanup Signed-off-by: Leah Rowe --- include/init.sh | 16 ---------------- include/lib.sh | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/init.sh b/include/init.sh index fc321605..4807e1cf 100644 --- a/include/init.sh +++ b/include/init.sh @@ -51,22 +51,6 @@ xbmkpkg() printf "You need AUR packages: %s\n" "$aur_notice" 1>&2; : } -setcfg() -{ - [ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2" - [ $# -gt 1 ] || \ - printf "e \"%s\" f not && %s \"Missing config\";\n" "$1" "$err" - printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err" -} - -chkvars() -{ - for var in "$@"; do - eval "[ -n \"\${$var+x}\" ] || \$err \"$var unset\"" - eval "[ -n \"\$$var\" ] || \$err \"$var unset\"" - done; : -} - xbmk_set_pyver() { pyv="import sys; print(sys.version_info[:])" diff --git a/include/lib.sh b/include/lib.sh index 50813352..93680cee 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -128,6 +128,22 @@ setvars() printf "%s\n" "${_setvars% }" } +setcfg() +{ + [ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2" + [ $# -gt 1 ] || \ + printf "e \"%s\" f not && %s \"Missing config\";\n" "$1" "$err" + printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err" +} + +chkvars() +{ + for var in "$@"; do + eval "[ -n \"\${$var+x}\" ] || \$err \"$var unset\"" + eval "[ -n \"\$$var\" ] || \$err \"$var unset\"" + done; : +} + fe_() { find_ex "x_" "$@" -- cgit v1.2.1 From 6e447876cca283434163328ce08b6e9d0b5a1d24 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:47:12 +0100 Subject: init.sh: tidy up the python version check Signed-off-by: Leah Rowe --- include/init.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/include/init.sh b/include/init.sh index 4807e1cf..9f6e7162 100644 --- a/include/init.sh +++ b/include/init.sh @@ -60,11 +60,9 @@ xbmk_set_pyver() pybin "$python" 1>/dev/null || pyver="" [ -z "$pyver" ] || "`pybin "$python"`" -c "$pyv" 1>/dev/null \ 2>/dev/null || $err "Cannot detect host Python version." - if [ -n "$pyver" ]; then - pyver="$("$(pybin "$python")" -c "$pyv" | awk '{print $1}')" - pyver="${pyver#(}" - pyver="${pyver%,}" - fi + [ -n "$pyver" ] && \ + pyver="$("$(pybin "$python")" -c "$pyv" | awk '{print $1}')" && \ + pyver="${pyver#(}" && pyver="${pyver%,}" [ "${pyver%%.*}" = "3" ] || $err "Bad python version (must by 3.x)"; : } @@ -94,8 +92,7 @@ pybin() [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \ [ -x "$pypath/$1" ] && printf "%s/%s\n" "$pypath" "$1" && \ return 0 - done - [ $venv -gt 0 ] && return 1 + done && return 1 # Defer to normal command -v if not a venv command -v "$1" 2>/dev/null || return 1 -- cgit v1.2.1 From 439020fbda5ca7862bf2eaf4d59ab68aae230c33 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:47:56 +0100 Subject: inject.sh: remove useless comment block Signed-off-by: Leah Rowe --- include/inject.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 9bfda2db..d956cdd1 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -90,11 +90,6 @@ getfiles() "$MRC_url_bkup" "$MRC_hash" "$CONFIG_REFCODE_BLOB_FILE" [ -z "$CONFIG_LENOVO_TBFW_BIN" ] || fetch "tbfw" "$TBFW_url" \ "$TBFW_url_bkup" "$TBFW_hash" "$CONFIG_LENOVO_TBFW_BIN" - # - # in the future, we might have libre fsp-s and then fsp-m. - # therefore, handle them separately, in case one of them is libre; if - # one of them was, the path wouldn't be set. - # [ -z "$CONFIG_FSP_M_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ "$CONFIG_FSP_FD_PATH" "$FSPFD_hash" "$CONFIG_FSP_M_FILE" copy [ -z "$CONFIG_FSP_S_FILE" ] || fetch "fsp" "$CONFIG_FSP_FD_PATH" \ -- cgit v1.2.1 From b19c4f8f674b04fdaa0b07b2c43766a76545ed09 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 08:50:23 +0100 Subject: inject.sh: tidy up TBFW handling Signed-off-by: Leah Rowe --- include/inject.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index d956cdd1..837f34c1 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -256,20 +256,14 @@ extract_sch5545ec() # https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-t-series-laptops/thinkpad-t480-type-20l5-20l6/20l5/solutions/ht508988 extract_tbfw() { - chkvars TBFW_size - fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" + chkvars TBFW_size && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" [ -f "$_dest" ] || $err "$board: Could not extract tbfw"; : } copy_tbfw() { - [ -f "$1" ] || return 0 - [ -L "$1" ] && return 0 - - x_ dd if=/dev/null of="$1" bs=1 seek=$TBFW_size - x_ mv "$1" "$_dest" - - return 1 + [ -f "$1" ] && [ ! -L "$1" ] && x_ dd if=/dev/null of="$1" bs=1 \ + seek=$TBFW_size && x_ mv "$1" "$_dest" && return 1; : } extract_fsp() -- cgit v1.2.1 From 91bb6cbede0405f764c3f2a686fbba5c7aa9f2fb Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 09:10:24 +0100 Subject: lib.sh: Make err_ always exit no matter what Always certainly redundant, since if -u -e isn't set, it'll continue to exit anyway. However, we want to be pedantic about this, since the safety of lbmk relies entirely on this function NOT misbehaving. Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lib.sh b/include/lib.sh index 93680cee..c5790bf7 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -174,6 +174,6 @@ x_() err_() { - printf "ERROR %s: %s\n" "$0" "$1" 1>&2 + [ $# -lt 1 ] || printf "ERROR %s: %s\n" "$0" "$1" 1>&2 || : exit 1 } -- cgit v1.2.1 From 59c94664e3e3382375e79ee478fc68d3802d794a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 09:14:09 +0100 Subject: lib.sh: Make x_ err if first arg is empty Signed-off-by: Leah Rowe --- include/lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/include/lib.sh b/include/lib.sh index c5790bf7..abf4de3b 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -169,6 +169,7 @@ find_ex() x_() { + [ $# -lt 1 ] || [ -n "$1" ] || $err "Empty first arg: x_ $(echo "$@")" [ $# -lt 1 ] || "$@" || $err "Unhandled error for: $(echo "$@")"; : } -- cgit v1.2.1 From 3f7dc2a55f5b2273e73e17e4cec75faffe65740f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 09:17:23 +0100 Subject: lib.sh: rename errx to xmsg Signed-off-by: Leah Rowe --- include/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index abf4de3b..b2888fb6 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -156,10 +156,10 @@ fx_() find_ex() { - errx="$1" && shift 1 + xmsg="$1" && shift 1 fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd" xx="$1" && shift 1 - $errx find "$@" 2>/dev/null | sort > "$fd" || \ + $xmsg find "$@" 2>/dev/null | sort > "$fd" || \ $err "!find $(echo "$@") > \"$fd\"" while read -r fx; do $xx "$fx" || break; : -- cgit v1.2.1 From 54291ebb7209c314bb52f507bc6a1ecf2a28fbc9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 09:56:21 +0100 Subject: lbmk: MUCH safer err function Don't directly call a variable. Call a function that checks the variable instead. The new err function also checks whether an exit was actually done, and exits 1 if not. If an exit was done by the given function, but the exit was zero, this is also corrected to perform an exit 1. This fixes a longstanding design flaw of lbmk. Signed-off-by: Leah Rowe --- include/git.sh | 24 ++++++++--------- include/init.sh | 38 +++++++++++++-------------- include/inject.sh | 78 +++++++++++++++++++++++++++---------------------------- include/lib.sh | 63 +++++++++++++++++++++++++++++++------------- include/mrc.sh | 10 +++---- include/rom.sh | 18 ++++++------- mk | 68 ++++++++++++++++++++++++------------------------ 7 files changed, 163 insertions(+), 136 deletions(-) diff --git a/include/git.sh b/include/git.sh index 37f5bbae..ded12625 100644 --- a/include/git.sh +++ b/include/git.sh @@ -63,7 +63,7 @@ git_prep() [ "$XBMK_RELEASE" = "y" ] && rmgit "$tmpgit" [ "$_loc" = "${_loc%/*}" ] || x_ mkdir -p "${_loc%/*}" - mv "$tmpgit" "$_loc" || $err "git_prep: !mv $tmpgit $_loc" + mv "$tmpgit" "$_loc" || err "git_prep: !mv $tmpgit $_loc" } # return 0 if project is single-tree, otherwise 1 @@ -80,20 +80,20 @@ fetch_submodule() mcfgdir="$mdir/${1##*/}"; eval \ "`setvars "" subhash subrepo subrepo_bkup subfile subfile_bkup st`" [ ! -f "$mcfgdir/module.cfg" ] || . "$mcfgdir/module.cfg" || \ - $err "! . $mcfgdir/module.cfg" + err "! . $mcfgdir/module.cfg" for xt in repo file; do _seval="if [ -n \"\$sub$xt\" ] || [ -n \"\$sub${xt}_bkup\" ]" eval "$_seval; then st=\"\$st \$xt\"; fi" done - st="${st# }" && [ "$st" = "repo file" ] && $err "$mdir: repo+file" + st="${st# }" && [ "$st" = "repo file" ] && err "$mdir: repo+file" [ -z "$st" ] && return 0 # subrepo/subfile not defined chkvars "sub${st}" "sub${st}_bkup" "subhash" [ "$st" = "file" ] && xbmkget "$subfile" "$subfile_bkup" \ "$tmpgit/$1" "$subhash" && return 0 - rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'" + rm -Rf "$tmpgit/$1" || err "!rm '$mdir' '$1'" tmpclone "$subrepo" "$subrepo_bkup" "$tmpgit/$1" "$subhash" \ "$mdir/${1##*/}/patches" } @@ -105,25 +105,25 @@ tmpclone() repofail="n" - [ $# -lt 6 ] || rm -Rf "$3" || $err "git retry: !rm $3 ($1)" + [ $# -lt 6 ] || rm -Rf "$3" || err "git retry: !rm $3 ($1)" repodir="$XBMK_CACHE/repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3" - mkdir -p "$XBMK_CACHE/repo" || $err "!rmdir $XBMK_CACHE/repo" + mkdir -p "$XBMK_CACHE/repo" || err "!rmdir $XBMK_CACHE/repo" if [ "$livepull" = "y" ] && [ ! -d "$repodir" ]; then git clone "$1" "$repodir" || git clone $2 "$repodir" || \ - $err "!clone $1 $2 $repodir $4 $5" # + err "!clone $1 $2 $repodir $4 $5" # elif [ -d "$repodir" ] && [ $# -lt 6 ]; then git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \ || sleep 3 || git -C "$repodir" pull || : fi ( - [ $# -gt 5 ] || git clone "$repodir" "$3" || $err "!clone $repodir $3" - git -C "$3" reset --hard "$4" || $err "!reset $1 $2 $3 $4 $5" + [ $# -gt 5 ] || git clone "$repodir" "$3" || err "!clone $repodir $3" + git -C "$3" reset --hard "$4" || err "!reset $1 $2 $3 $4 $5" git_am_patches "$3" "$5" ) || repofail="y" [ "$repofail" = "y" ] && [ $# -lt 6 ] && tmpclone "$@" retry - [ "$repofail" = "y" ] && $err "!clone $1 $2 $3 $4 $5"; : + [ "$repofail" = "y" ] && err "!clone $1 $2 $3 $4 $5"; : } git_am_patches() @@ -132,7 +132,7 @@ git_am_patches() [ -L "$p" ] && continue [ -e "$p" ] || continue [ -d "$p" ] && git_am_patches "$1" "$p" && continue - [ ! -f "$p" ] || git -C "$1" am "$p" || $err "$1 $2: !am $p" + [ ! -f "$p" ] || git -C "$1" am "$p" || err "$1 $2: !am $p" done; : } @@ -140,6 +140,6 @@ nuke() { e "config/${1%/}/nuke.list" f missing || while read -r nukefile; do rmf="src/${2%/}/$nukefile" && [ -L "$rmf" ] && continue - e "$rmf" e missing || rm -Rf "$rmf" || $err "!rm $rmf, ${2%/}" + e "$rmf" e missing || rm -Rf "$rmf" || err "!rm $rmf, ${2%/}" done < "config/${1%/}/nuke.list"; : } diff --git a/include/init.sh b/include/init.sh index 9f6e7162..ce9cf9a9 100644 --- a/include/init.sh +++ b/include/init.sh @@ -14,22 +14,22 @@ projectsite="https://libreboot.org/" export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" xbmkpath="$PATH" -err="err_" +xbmk_err="err_" eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \ datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver xbmklocal`" xbmk_init() { - xbmkpwd="`pwd`" || $err "Cannot generate PWD" + xbmkpwd="`pwd`" || err "Cannot generate PWD" xbmklocal="$xbmkpwd/tmp" export PWD="$xbmkpwd" [ $# -gt 0 ] && [ "$1" = "dependencies" ] && x_ xbmkpkg "$@" && exit 0 - id -u 1>/dev/null 2>/dev/null || $err "suid check failed (id -u)" - [ "$(id -u)" != "0" ] || $err "this command as root is not permitted" + id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)" + [ "$(id -u)" != "0" ] || err "this command as root is not permitted" for init_cmd in set_pyver set_env set_version git_init create_tmpdir \ lock create_pathdirs child_exec; do @@ -39,13 +39,13 @@ xbmk_init() xbmkpkg() { - [ $# -lt 2 ] && $err "fewer than two arguments" + [ $# -lt 2 ] && err "fewer than two arguments" [ $# -gt 2 ] && reinstall="$3" eval "`setcfg "config/dependencies/$2"`" chkvars pkg_add pkglist - $pkg_add $pkglist || $err "Cannot install packages" + $pkg_add $pkglist || err "Cannot install packages" [ -n "$aur_notice" ] && \ printf "You need AUR packages: %s\n" "$aur_notice" 1>&2; : @@ -59,11 +59,11 @@ xbmk_set_pyver() pyver="2" && [ "$python" = "python3" ] && pyver="3" pybin "$python" 1>/dev/null || pyver="" [ -z "$pyver" ] || "`pybin "$python"`" -c "$pyv" 1>/dev/null \ - 2>/dev/null || $err "Cannot detect host Python version." + 2>/dev/null || err "Cannot detect host Python version." [ -n "$pyver" ] && \ pyver="$("$(pybin "$python")" -c "$pyv" | awk '{print $1}')" && \ pyver="${pyver#(}" && pyver="${pyver%,}" - [ "${pyver%%.*}" = "3" ] || $err "Bad python version (must by 3.x)"; : + [ "${pyver%%.*}" = "3" ] || err "Bad python version (must by 3.x)"; : } # Use direct path, to prevent a hang if Python is using a virtual environment, @@ -104,9 +104,9 @@ xbmk_set_env() [ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache" [ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache" [ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \ - $err "cachedir '$xbmkpwd/cache' is a symlink" + err "cachedir '$xbmkpwd/cache' is a symlink" [ -L "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache" - [ -f "$XBMK_CACHE" ] && $err "cachedir '$XBMK_CACHE' is a file"; : + [ -f "$XBMK_CACHE" ] && err "cachedir '$XBMK_CACHE' is a file"; : # if "y": a coreboot target won't be built if target.cfg says release="n" # (this is used to exclude certain build targets from releases) @@ -124,9 +124,9 @@ xbmk_set_version() [ ! -f ".versiondate" ] || read -r versiondate < ".versiondate" || :; : [ -e ".git" ] || [ -f ".version" ] || printf "unknown\n" > ".version" \ - || $err "Cannot generate unknown .version file" + || err "Cannot generate unknown .version file" [ -e ".git" ] || [ -f ".versiondate" ] || printf "1716415872\n" > \ - ".versiondate" || $err "Can't generate unknown versiondate file"; : + ".versiondate" || err "Can't generate unknown versiondate file"; : version_="$version" [ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \ @@ -136,8 +136,8 @@ xbmk_set_version() --pretty='%ct' HEAD)" || versiondate="$versiondate_" chkvars version versiondate - printf "%s\n" "$version" > ".version" || $err "can't save version" - printf "%s\n" "$versiondate" > ".versiondate" || $err "can't save date" + printf "%s\n" "$version" > ".version" || err "can't save version" + printf "%s\n" "$versiondate" > ".versiondate" || err "can't save date" relname="$projectname-$version" export LOCALVERSION="-$projectname-${version%%-*}" @@ -157,7 +157,7 @@ xbmk_git_init() 2>/dev/null for gitarg in "--global user.name" "--global user.email"; do - gitcmd="git config $gitarg"; $gitcmd || $err \ + gitcmd="git config $gitarg"; $gitcmd || err \ "Please run this first: $gitcmd \"your ${gitcmd##*.}\"" done } @@ -184,8 +184,8 @@ xbmk_create_tmpdir() xbmk_lock() { - [ -f "lock" ] && $err "$xbmkpwd/lock exists. Is a build running?" - touch lock || $err "cannot create 'lock' file"; : + [ -f "lock" ] && err "$xbmkpwd/lock exists. Is a build running?" + touch lock || err "cannot create 'lock' file"; : } xbmk_create_pathdirs() @@ -195,9 +195,9 @@ xbmk_create_pathdirs() ( # set up python v3.x in PATH, in case it's not set up correctly. # see code above that detected the correct python3 command. - cd "$XBMK_CACHE/xbmkpath" || $err "can't cd $XBMK_CACHE/xbmkpath" + cd "$XBMK_CACHE/xbmkpath" || err "can't cd $XBMK_CACHE/xbmkpath" x_ ln -s "`pybin "$python"`" python - ) || $err "Can't set up python symlink in $XBMK_CACHE/xbmkpath"; : + ) || err "Can't set up python symlink in $XBMK_CACHE/xbmkpath"; : } xbmk_child_exec() diff --git a/include/inject.sh b/include/inject.sh index 837f34c1..e2987aad 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -41,7 +41,7 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ download() { - [ $# -gt 0 ] || $err "No argument given" + [ $# -gt 0 ] || err "No argument given" export PATH="$PATH:/sbin" board="$1" && readcfg && readkconfig && bootstrap && getfiles; : } @@ -116,22 +116,22 @@ fetch() dlop="curl" && [ $# -gt 5 ] && dlop="$6" xbmkget "$dl" "$dl_bkup" "$_dl" "$dlsum" "$dlop" - rm -Rf "${_dl}_extracted" || $err "!rm ${_ul}_extracted. $dontflash" + rm -Rf "${_dl}_extracted" || err "!rm ${_ul}_extracted. $dontflash" e "$_dest" f && return 0 x_ mkdir -p "${_dest%/*}" remkdir "$appdir" extract_archive "$_dl" "$appdir" "$dl_type" || \ - [ "$dl_type" = "e6400vga" ] || $err "$_dest $dl_type: !extract" + [ "$dl_type" = "e6400vga" ] || err "$_dest $dl_type: !extract" eval "extract_$dl_type" set -u -e - e "$_dest" f missing && $err "!extract_$dl_type. $dontflash"; : + e "$_dest" f missing && err "!extract_$dl_type. $dontflash"; : } extract_intel_me() { - e "$mecleaner" f not && $err "$cbdir: me_cleaner missing. $dontflash" + e "$mecleaner" f not && err "$cbdir: me_cleaner missing. $dontflash" cdir="$xbmkpwd/$appdir" _me="$xbmkpwd/$_dest" @@ -145,7 +145,7 @@ extract_intel_me() if [ "$ME11bootguard" = "y" ]; then apply_me11_deguard_mod else - mv "$_metmp" "$_me" || $err "!mv $_metmp $_me - $dontflash" + mv "$_metmp" "$_me" || err "!mv $_metmp $_me - $dontflash" fi } @@ -160,7 +160,7 @@ extract_intel_me_bruteforce() set +u +e ( [ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}" - cd "$cdir" || $err "extract_intel_me: !cd \"$cdir\" - $dontflash" + cd "$cdir" || err "extract_intel_me: !cd \"$cdir\" - $dontflash" for i in *; do e "$_metmp" f && break [ -L "$i" ] && continue @@ -182,7 +182,7 @@ extract_intel_me_bruteforce() cd "$cdir" || : done ) || : - rm -Rf "$sdir" || $err "extract_intel_me: !rm -Rf $sdir - $dontflash" + rm -Rf "$sdir" || err "extract_intel_me: !rm -Rf $sdir - $dontflash" } apply_me11_deguard_mod() @@ -193,7 +193,7 @@ apply_me11_deguard_mod() --version "$ME11version" \ --pch "$ME11pch" --sku "$ME11sku" --fake-fpfs data/fpfs/zero \ --input "$_metmp" --output "$_me" - ) || $err "Error running deguard for $_me - $dontflash" + ) || err "Error running deguard for $_me - $dontflash" } extract_archive() @@ -216,11 +216,11 @@ extract_kbc1126ec() mv Rompaq/68*.BIN ec.bin || : if [ ! -f "ec.bin" ]; then unar -D ROM.CAB Rom.bin || unar -D Rom.CAB Rom.bin || \ - unar -D 68*.CAB Rom.bin || $err "kbc1126 unar failed" + unar -D 68*.CAB Rom.bin || err "kbc1126 unar failed" x_ mv Rom.bin ec.bin fi x_ e ec.bin f && x_ "$kbc1126_ec_dump" ec.bin - ) || $err "$board: can't extract kbc1126 ec firmware - $dontflash" + ) || err "$board: can't extract kbc1126 ec firmware - $dontflash" x_ e "$appdir/ec.bin.fw1" f && x_ e "$appdir/ec.bin.fw2" f x_ cp "$appdir/"ec.bin.fw* "${_dest%/*}/" @@ -235,7 +235,7 @@ extract_e6400vga() x_ cd "$appdir" x_ e "bios.bin" f "$e6400_unpack" bios.bin || printf "TODO: fix dell extract util\n" - ) || $err "can't extract e6400 vga rom - $dontflosh" + ) || err "can't extract e6400 vga rom - $dontflosh" x_ cp "$appdir/$E6400_VGA_romname" "$_dest" } @@ -248,7 +248,7 @@ extract_sch5545ec() _sch5545ec_fw="$_sch5545ec_fw/54 D386BEB8-4B54-4E69-94F5-06091F67E0D3" _sch5545ec_fw="$_sch5545ec_fw/0 Raw section/body.bin" # <-- this! - "$uefiextract" "$_bios" || $err "sch5545 !extract - $dontflash" + "$uefiextract" "$_bios" || err "sch5545 !extract - $dontflash" x_ cp "$_sch5545ec_fw" "$_dest" } @@ -257,7 +257,7 @@ extract_sch5545ec() extract_tbfw() { chkvars TBFW_size && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" - [ -f "$_dest" ] || $err "$board: Could not extract tbfw"; : + [ -f "$_dest" ] || err "$board: Could not extract tbfw"; : } copy_tbfw() @@ -284,11 +284,11 @@ fail_inject() inject() { need_files="n" - err="fail_inject" + xbmk_err="fail_inject" remkdir "$tmpromdel" set +u +e - [ $# -lt 1 ] && $err "No options specified. - $dontflash" + [ $# -lt 1 ] && err "No options specified. - $dontflash" eval "`setvars "" nukemode new_mac xchanged`" archive="$1"; @@ -300,15 +300,15 @@ inject() nukemode="nuke" ;; setmac) [ $# -gt 2 ] && new_mac="$3" && \ - [ -z "$new_mac" ] && $err "Empty MAC address specified" ;; - *) $err "Unrecognised inject mode: '$2'" + [ -z "$new_mac" ] && err "Empty MAC address specified" ;; + *) err "Unrecognised inject mode: '$2'" esac [ "$new_mac" = "keep" ] && new_mac="" [ -n "$new_mac" ] && [ "$new_mac" != "restore" ] && \ x_ make -C util/nvmutil clean && x_ make -C util/nvmutil - check_release "$archive" || $err "'$archive' is not a release archive" + check_release "$archive" || err "'$archive' is not a release archive" readcfg && need_files="y" if [ "$need_files" = "y" ] || [ -n "$new_mac" ]; then @@ -324,20 +324,20 @@ inject() check_release() { - [ -L "$archive" ] && $err "'$archive' is a symlink. $dontflash" + [ -L "$archive" ] && err "'$archive' is a symlink. $dontflash" e "$archive" f missing && return 1 archivename="`basename "$archive"`" - [ -z "$archivename" ] && $err "Can't determine archive name. $dontflash" + [ -z "$archivename" ] && err "Can't determine archive name. $dontflash" case "$archivename" in *_src.tar.xz) - $err "'$archive' is a src archive, silly!" ;; + err "'$archive' is a src archive, silly!" ;; grub_*|seagrub_*|custom_*|seauboot_*|seabios_withgrub_*) return 1 ;; *.tar.xz) _stripped_prefix="${archivename#*_}" board="${_stripped_prefix%.tar.xz}" ;; - *) $err "'$archive': could not detect board type - $dontflash" + *) err "'$archive': could not detect board type - $dontflash" esac; : } @@ -355,8 +355,8 @@ readcfg() [ -z "$vcfg" ] && return 1 vfile="config/vendor/$vcfg/pkg.cfg" - [ -L "$vfile" ] && $err "'$archive', '$board': $vfile is a symlink" - [ -f "$vfile" ] || $err "'$archive', '$board': $vfile doesn't exist" + [ -L "$vfile" ] && err "'$archive', '$board': $vfile is a symlink" + [ -f "$vfile" ] || err "'$archive', '$board': $vfile doesn't exist" cbdir="src/coreboot/$tree" cbfstool="elf/cbfstool/$tree/cbfstool" @@ -394,14 +394,14 @@ patch_release_roms() ( [ "$need_files" = "y" ] || exit 0 - cd "$tmpromdir" || $err "patch '$archive': can't cd $tmpromdir" + cd "$tmpromdir" || err "patch '$archive': can't cd $tmpromdir" # NOTE: For compatibility with older rom releases, defer to sha1 if [ "$has_hashes" = "y" ] && [ "$nukemode" != "nuke" ]; then sha512sum --status -c "$hashfile" || \ x_ sha1sum --status -c "$hashfile" x_ rm -f "$hashfile" fi - ) || $err "'$archive' -> Can't verify vendor hashes. $dontflash" + ) || err "'$archive' -> Can't verify vendor hashes. $dontflash" [ -z "$new_mac" ] || modify_mac || printf "\nGbE not defined\n" 1>&2 @@ -411,10 +411,10 @@ patch_release_roms() ( x_ cd "${tmpromdir%"/bin/$board"}" mkrom_tarball "bin/$board" - ) || $err "Cannot re-generate '$archive' - $dontflash" + ) || err "Cannot re-generate '$archive' - $dontflash" mv "${tmpromdir%"/bin/$board"}/bin/${relname}_${board}.tar.xz" \ - "$archive" || $err "'$archive' -> Can't overwrite - $dontflash"; : + "$archive" || err "'$archive' -> Can't overwrite - $dontflash"; : } prep_rom() @@ -425,16 +425,16 @@ prep_rom() [ "$nukemode" = "nuke" ] && _xromnew="${_xrom%/*}/$vfix${_xrom##*/}" e "$_xrom" f missing && return 0 - [ -z "${_xromname#"$vfix"}" ] && $err "$_xromname / $vfix: name match" + [ -z "${_xromname#"$vfix"}" ] && err "$_xromname / $vfix: name match" # Remove the prefix and 1-byte pad if [ "$nukemode" != "nuke" ] && \ [ "${_xromname#"$vfix"}" != "$_xromname" ]; then - xromsize="$(expr $(stat -c '%s' "$_xrom") - 1)" || $err "!int" - [ $xromsize -lt 524288 ] && $err "too small, $xromsize: $_xrom" + xromsize="$(expr $(stat -c '%s' "$_xrom") - 1)" || err "!int" + [ $xromsize -lt 524288 ] && err "too small, $xromsize: $_xrom" x_ dd if="$_xrom" of="$_xromnew" bs=$xromsize count=1 - rm -f "$_xrom" || $err "Can't rm $_xrom - $dontflash" + rm -f "$_xrom" || err "Can't rm $_xrom - $dontflash" _xrom="$_xromnew" fi @@ -445,7 +445,7 @@ prep_rom() [ "$nukemode" != "nuke" ] && return 0 # Rename the file, prefixing a warning saying not to flash - cat "$_xrom" config/data/coreboot/0 > "$_xromnew" || $err "!pad $_xrom" + cat "$_xrom" config/data/coreboot/0 > "$_xromnew" || err "!pad $_xrom" x_ rm -f "$_xrom" } @@ -498,7 +498,7 @@ insert() if [ "$_t" = "fsp" ] && [ $# -gt 3 ]; then _offset="$4" elif [ $# -gt 3 ] && _offset="-b $4" && [ -z "$4" ]; then - $err "insert $*, $rom: offset given but empty (undefined)" + err "insert $*, $rom: offset given but empty (undefined)" fi [ "$nukemode" = "nuke" ] || x_ e "$_dest" f @@ -506,19 +506,19 @@ insert() if [ "$cbfsname" = "IFD" ]; then [ "$nukemode" = "nuke" ] || "$ifdtool" $ifdprefix -i \ $_t:$_dest "$rom" -O "$rom" || \ - $err "failed: insert '$_t' '$_dest' on '$rom'" + err "failed: insert '$_t' '$_dest' on '$rom'" [ "$nukemode" != "nuke" ] || "$ifdtool" $ifdprefix --nuke $_t \ - "$rom" -O "$rom" || $err "$rom: !nuke IFD/$_t" + "$rom" -O "$rom" || err "$rom: !nuke IFD/$_t" elif [ "$nukemode" = "nuke" ]; then x_ "$cbfstool" "$rom" remove -n "$cbfsname" elif [ "$_t" = "stage" ]; then # the only stage we handle is refcode x_ rm -f "$xbmklocal/refcode" "$rmodtool" -i "$_dest" -o "$xbmklocal/refcode" || "!reloc ref" "$cbfstool" "$rom" add-stage -f "$xbmklocal/refcode" \ - -n "$cbfsname" -t stage || $err "$rom: !add ref" + -n "$cbfsname" -t stage || err "$rom: !add ref" else "$cbfstool" "$rom" add -f "$_dest" -n "$cbfsname" \ - -t $_t $_offset || $err "$rom !add $_t ($_dest)" + -t $_t $_offset || err "$rom !add $_t ($_dest)" fi xchanged="y"; : } diff --git a/include/lib.sh b/include/lib.sh index b2888fb6..eb4cddca 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -15,8 +15,8 @@ remkdir() mkrom_tarball() { - printf "%s\n" "$version" > "$1/.version" || $err "$1 !version" - printf "%s\n" "$versiondate" > "$1/.versiondate" || $err "$1 !vdate" + printf "%s\n" "$version" > "$1/.version" || err "$1 !version" + printf "%s\n" "$versiondate" > "$1/.versiondate" || err "$1 !vdate" mktarball "$1" "${1%/*}/${relname}_${1##*/}.tar.xz" x_ rm -Rf "$1" @@ -26,15 +26,15 @@ mktarball() { printf "Creating tar archive '%s' from directory '%s'\n" "$2" "$1" [ "${2%/*}" = "$2" ] || x_ mkdir -p "${2%/*}" - x_ tar -c "$1" | xz -T$XBMK_THREADS -9e > "$2" || $err "mktarball2, $1" + x_ tar -c "$1" | xz -T$XBMK_THREADS -9e > "$2" || err "mktarball2, $1" } mksha512sum() { ( [ "${1%/*}" != "$1" ] && x_ cd "${1%/*}" - sha512sum ./"${1##*/}" >> "$2" || $err "!sha512sum \"$1\" > \"$2\"" - ) || $err "failed to create tarball checksum" + sha512sum ./"${1##*/}" >> "$2" || err "!sha512sum \"$1\" > \"$2\"" + ) || err "failed to create tarball checksum" } rmgit() @@ -58,7 +58,7 @@ xbmkget() for url in "$1" "$2"; do [ "$dl_fail" = "n" ] && break [ -z "$url" ] && continue - rm -f "$cached" || $err "!rm -f '$cached'" + rm -f "$cached" || err "!rm -f '$cached'" if [ "$_dlop" = "curl" ]; then curl --location --retry 3 -A "$_ua" "$url" \ -o "$cached" || wget --tries 3 -U "$_ua" "$url" \ @@ -72,11 +72,11 @@ xbmkget() "$1" "$2" "$3" "$4" "$url" 1>&2 && continue cp "$url" "$cached" || continue else - $err "$1 $2 $3 $4: Unsupported dlop type: '$_dlop'" + err "$1 $2 $3 $4: Unsupported dlop type: '$_dlop'" fi bad_checksum "$4" "$cached" || dl_fail="n" done - [ "$dl_fail" = "y" ] && $err "$1 $2 $3 $4: not downloaded" + [ "$dl_fail" = "y" ] && err "$1 $2 $3 $4: not downloaded" [ "$cached" = "$3" ] || x_ cp "$cached" "$3"; : } @@ -99,7 +99,7 @@ e() mk() { - mk_flag="$1" || $err "No argument given" + mk_flag="$1" || err "No argument given" shift 1 && for mk_arg in "$@"; do x_ ./mk $mk_flag $mk_arg done; : @@ -107,7 +107,7 @@ mk() check_defconfig() { - [ -d "$1" ] || $err "Target '$1' not defined." + [ -d "$1" ] || err "Target '$1' not defined." for x in "$1"/config/*; do [ -f "$x" ] && printf "%s\n" "$x" && return 1 done; : @@ -117,7 +117,7 @@ setvars() { _setvars="" if [ $# -lt 2 ]; then - printf "\$err \"setvars: too few args\\n\"" + printf "err \"setvars: too few args\\n\"" return 0 fi val="$1" @@ -132,15 +132,15 @@ setcfg() { [ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2" [ $# -gt 1 ] || \ - printf "e \"%s\" f not && %s \"Missing config\";\n" "$1" "$err" - printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err" + printf "e \"%s\" f not && err \"Missing config\";\n" "$1" + printf ". \"%s\" || err \"Could not read config\";\n" "$1" } chkvars() { for var in "$@"; do - eval "[ -n \"\${$var+x}\" ] || \$err \"$var unset\"" - eval "[ -n \"\$$var\" ] || \$err \"$var unset\"" + eval "[ -n \"\${$var+x}\" ] || err \"$var unset\"" + eval "[ -n \"\$$var\" ] || err \"$var unset\"" done; : } @@ -160,7 +160,7 @@ find_ex() fd="`mktemp`" && x_ rm -f "$fd" && x_ touch "$fd" xx="$1" && shift 1 $xmsg find "$@" 2>/dev/null | sort > "$fd" || \ - $err "!find $(echo "$@") > \"$fd\"" + err "!find $(echo "$@") > \"$fd\"" while read -r fx; do $xx "$fx" || break; : done < "$fd" @@ -169,8 +169,35 @@ find_ex() x_() { - [ $# -lt 1 ] || [ -n "$1" ] || $err "Empty first arg: x_ $(echo "$@")" - [ $# -lt 1 ] || "$@" || $err "Unhandled error for: $(echo "$@")"; : + [ $# -lt 1 ] || [ -n "$1" ] || err "Empty first arg: x_ $(echo "$@")" + [ $# -lt 1 ] || "$@" || err "Unhandled error for: $(echo "$@")"; : +} + +err() +{ + xbmk_err_val=0 + + real_err="$xbmk_err" + if [ -z "$xbmk_err" ]; then + printf "WARNING: err not set. Args: %s\n" "$(echo "$@")" 1>&2 + printf "REMARK: Setting err to default 'err_' value\n" 1>&2 + real_err="err_" + fi + + ( + $real_err "$@" || printf \ + "WARNING: Err function '%s' *returned* 1. Will exit 1 anyway\n" \ + "$real_err" + printf "WARNING: Err function '%s' didn't exit. Will exit 1 anyway\n" \ + "$real_err" 1>&2 + exit 1 + ) || xbmk_err_val=1 # otherwise, it wrongly did exit 0, not exit 1 + + [ $xbmk_err_val -eq 0 ] && printf \ + "WARNING: Err function '%s' did exit 0. Will exit 1 anyway.\n" \ + "$real_err" 1>&2 + + exit 1 } err_() diff --git a/include/mrc.sh b/include/mrc.sh index eaf39dcb..a1dcb140 100644 --- a/include/mrc.sh +++ b/include/mrc.sh @@ -11,7 +11,7 @@ extract_mrc() extract_shellball "$cbfstool" "$appdir/"bios.bin extract -n mrc.bin \ - -f "$_dest" -r RO_SECTION || $err "extract_mrc: !$cbfstool $_dest" + -f "$_dest" -r RO_SECTION || err "extract_mrc: !$cbfstool $_dest" [ -n "$CONFIG_REFCODE_BLOB_FILE" ] && extract_refcode extra; : } @@ -27,7 +27,7 @@ extract_refcode() # incompatible with older versions before coreboot 4.14, # so we need coreboot 4.13 cbfstool for certain refcode files chkvars cbfstoolref - mkdir -p "${_refdest%/*}" || $err "ref: !mkdir -p ${_refdest%/*}" + mkdir -p "${_refdest%/*}" || err "ref: !mkdir -p ${_refdest%/*}" x_ "$cbfstoolref" "$appdir/bios.bin" extract \ -m x86 -n fallback/refcode -f "$_refdest" -r RO_SECTION @@ -46,7 +46,7 @@ extract_shellball() x_ cd "$appdir" extract_partition "${MRC_url##*/}" extract_archive "$SHELLBALL" . - ) || $err "mrc download/extract failure"; : + ) || err "mrc download/extract failure"; : } extract_partition() @@ -59,8 +59,8 @@ extract_partition() SIZE=$(( $( echo $ROOTP | cut -f4 -d\ | tr -d "B" ) )) dd if="${1%.zip}" of="root-a.ext2" bs=1024 skip=$(( $START / 1024 )) \ - count=$(( $SIZE / 1024 )) || $err "ex dd ${1%.zip}, root-a.ext2" + count=$(( $SIZE / 1024 )) || err "ex dd ${1%.zip}, root-a.ext2" printf "cd /usr/sbin\ndump chromeos-firmwareupdate %s\nquit" \ - "$SHELLBALL" | debugfs "root-a.ext2" || $err "!extract shellball" + "$SHELLBALL" | debugfs "root-a.ext2" || err "!extract shellball" } diff --git a/include/rom.sh b/include/rom.sh index ec464d85..af739d92 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -11,7 +11,7 @@ mkserprog() { [ "$_f" = "-d" ] && return 0 # dry run basename -as .h "$serdir/"*.h > "$xbmktmp/ser" || \ - $err "!mk $1 $xbmktmp" + err "!mk $1 $xbmktmp" while read -r sertarget; do [ "$1" = "pico" ] && x_ cmake -DPICO_BOARD="$sertarget" \ @@ -33,8 +33,8 @@ copyps1bios() x_ cp src/pcsx-redux/src/mips/openbios/openbios.bin bin/playstation printf "MIT License\n\nCopyright (c) 2019-2024 PCSX-Redux authors\n\n" \ - > bin/playstation/COPYING.txt || $err "!pcsx-redux copyright" - cat config/snippet/mit >>bin/playstation/COPYING.txt || $err "!pcsx MIT" + > bin/playstation/COPYING.txt || err "!pcsx-redux copyright" + cat config/snippet/mit >>bin/playstation/COPYING.txt || err "!pcsx MIT" } mkpayload_grub() @@ -55,7 +55,7 @@ mkvendorfiles() [ -z "$mode" ] && $dry cook_coreboot_config check_coreboot_utils "$tree" printf "%s\n" "${version%%-*}" > "$srcdir/.coreboot-version" || \ - $err "!mk $srcdir .coreboot-version" + err "!mk $srcdir .coreboot-version" [ -z "$mode" ] && [ "$target" != "$tree" ] && \ x_ ./mk download "$target"; : } @@ -64,8 +64,8 @@ cook_coreboot_config() { [ -f "$srcdir/.config" ] || return 0 printf "CONFIG_CCACHE=y\n" >> "$srcdir/.config" || \ - $err "$srcdir/.config: Could not enable ccache" - make -C "$srcdir" oldconfig || $err "Could not cook $srcdir/.config"; : + err "$srcdir/.config: Could not enable ccache" + make -C "$srcdir" oldconfig || err "Could not cook $srcdir/.config"; : } check_coreboot_utils() @@ -105,7 +105,7 @@ mkcorebootbin() [ "$payload_uboot_i386" = "y" ] && \ [ "$payload_uboot_amd64" = "y" ] && \ - $err "'$target' enables 32- and 64-bit x86 U-Boot" + err "'$target' enables 32- and 64-bit x86 U-Boot" if [ "$payload_uboot_i386" = "y" ] || \ [ "$payload_uboot_amd64" = "y" ]; then @@ -118,7 +118,7 @@ mkcorebootbin() [ "$payload_uboot" = "y" ] || payload_seabios="y" [ "$payload_grub" = "y" ] && payload_seabios="y" [ "$payload_seabios" = "y" ] && [ "$payload_uboot" = "y" ] && \ - $dry $err "$target: U-Boot(arm64) and SeaBIOS/GRUB both enabled." + $dry err "$target: U-Boot(arm64) and SeaBIOS/GRUB both enabled." [ -z "$grub_scan_disk" ] && grub_scan_disk="nvme ahci ata" @@ -180,7 +180,7 @@ add_grub() _grubname="fallback/payload" cbfs "$tmprom" "$grubelf" "$_grubname" printf "set grub_scan_disk=\"%s\"\n" "$grub_scan_disk" \ - > "$xbmktmp/tmpcfg" || $err "$target: !insert scandisk" + > "$xbmktmp/tmpcfg" || err "$target: !insert scandisk" cbfs "$tmprom" "$xbmktmp/tmpcfg" scan.cfg raw [ "$initmode" != "normal" ] && [ "$displaymode" != "txtmode" ] && \ cbfs "$tmprom" "$grubdata/background/background1280x800.png" \ diff --git a/mk b/mk index 5a4afadf..55f67a92 100755 --- a/mk +++ b/mk @@ -29,7 +29,7 @@ main() version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;; release|download|inject) $cmd "$@" ;; -*) return 1 ;; - *) $err "bad command" ;; + *) err "bad command" ;; esac set -u -e # some commands disable them. turn them on! } @@ -40,11 +40,11 @@ release() vdir="release" while getopts d:m: option; do - [ -z "$OPTARG" ] && $err "empty argument not allowed" + [ -z "$OPTARG" ] && err "empty argument not allowed" case "$option" in d) vdir="$OPTARG" ;; m) mode="$OPTARG" ;; - *) $err "invalid option '-$option'" ;; + *) err "invalid option '-$option'" ;; esac done @@ -52,10 +52,10 @@ release() src_dirname="${relname}_src" srcdir="$vdir/$src_dirname" - [ -e "$vdir" ] && $err "already exists: \"$vdir\"" - mkdir -p "$vdir" || $err "mkvdir: !mkdir -p \"$vdir\"" - git clone . "$srcdir" || $err "mkdir: !gitclone \"$srcdir\"" - touch "$srcdir/lock" || $err "can't make lock file in $srcdir/" + [ -e "$vdir" ] && err "already exists: \"$vdir\"" + mkdir -p "$vdir" || err "mkvdir: !mkdir -p \"$vdir\"" + git clone . "$srcdir" || err "mkdir: !gitclone \"$srcdir\"" + touch "$srcdir/lock" || err "can't make lock file in $srcdir/" build_release @@ -65,32 +65,32 @@ release() build_release() { ( - cd "$srcdir" || $err "$vdir: !cd \"$srcdir\"" + cd "$srcdir" || err "$vdir: !cd \"$srcdir\"" ./mk -f rmgit . x_ mv src/docs docs - ) || $err "can't create release files" + ) || err "can't create release files" git log --graph --pretty=format:'%Cred%h%Creset %s %Creset' \ - --abbrev-commit > "$srcdir/CHANGELOG" || $err "!gitlog $srcdir" - rm -f "$srcdir/lock" || $err "can't remove lock file in $srcdir" + --abbrev-commit > "$srcdir/CHANGELOG" || err "!gitlog $srcdir" + rm -f "$srcdir/lock" || err "can't remove lock file in $srcdir" ( - cd "${srcdir%/*}" || $err "$vdir: mktarball \"$srcdir\"" - mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || $err "$vdir: mksrc" - ) || $err "can't create src tarball" + cd "${srcdir%/*}" || err "$vdir: mktarball \"$srcdir\"" + mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || err "$vdir: mksrc" + ) || err "can't create src tarball" [ "$mode" = "src" ] && return 0 - touch "$srcdir/lock" || $err "can't make lock file in $srcdir/" + touch "$srcdir/lock" || err "can't make lock file in $srcdir/" ( - cd "$srcdir" || $err "$vdir: 2 !cd \"$srcdir\"" + cd "$srcdir" || err "$vdir: 2 !cd \"$srcdir\"" x_ ./mk -d coreboot mk -b coreboot pico-serprog stm32-vserprog pcsx-redux x_ mv bin ../roms - ) || $err "can't build rom images" + ) || err "can't build rom images" - rm -Rf "$srcdir" || $err "!rm -Rf $srcdir" + rm -Rf "$srcdir" || err "!rm -Rf $srcdir" } main "$@" && exit 0 @@ -110,7 +110,7 @@ trees() flags="f:b:m:u:c:x:s:l:n:d:" while getopts $flags option; do - [ -n "$_f" ] && $err "only one flag is permitted" + [ -n "$_f" ] && err "only one flag is permitted" _f="$1" case "$_f" in @@ -126,7 +126,7 @@ trees() -s) mode="savedefconfig" ;; -l) mode="olddefconfig" ;; -n) mode="nconfig" ;; - *) $err "invalid option '-$option'" ;; + *) err "invalid option '-$option'" ;; esac if [ -z "${OPTARG+x}" ]; then @@ -137,14 +137,14 @@ trees() project="${OPTARG#src/}" shift 2 done - [ -z "$_f" ] && $err "missing flag ($flags)" + [ -z "$_f" ] && err "missing flag ($flags)" if [ -z "$project" ]; then mk $_f $(ls -1 config/git) return 1 fi [ -f "config/git/$project/pkg.cfg" ] || \ - $err "config/git/$project/pkg.cfg missing" + err "config/git/$project/pkg.cfg missing" for d in "elf" "config/data" "config" "src"; do eval "${d#*/}dir=\"$d/$project\"" @@ -180,8 +180,8 @@ build_project() build_targets() { - [ -d "$configdir" ] || $err "directory, $configdir, does not exist" - [ $# -gt 0 ] || targets="$(ls -1 "$configdir")" || $err "!o $configdir" + [ -d "$configdir" ] || err "directory, $configdir, does not exist" + [ $# -gt 0 ] || targets="$(ls -1 "$configdir")" || err "!o $configdir" for x in $targets; do unset CROSS_COMPILE @@ -267,7 +267,7 @@ build_dependencies() for bd in $build_depend; do bd_p="${bd%%/*}" bd_t="${bd##*/}" - [ -z "$bd_p" ] && $dry $err "$project/$tree: !bd '$bd'" + [ -z "$bd_p" ] && $dry err "$project/$tree: !bd '$bd'" [ "${bd##*/}" = "$bd" ] && bd_t="" [ -z "$bd_p" ] || $dry x_ ./mk -b $bd_p $bd_t; : done; : @@ -281,14 +281,14 @@ check_project_hashes() fx_ "x_ sha512sum" "$datadir" "$configdir/$tree" "$mdir" \ -type f -not -path "*/.git*/*" | awk '{print $1}' > \ - "$xbmktmp/project.hash" || $err "!h $project $tree" + "$xbmktmp/project.hash" || err "!h $project $tree" pjhash="$(sha512sum "$xbmktmp/project.hash" | awk '{print $1}')" || : [ "$pjhash" != "$old_pjhash" ] && badhash="y" [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y" printf "%s\n" "$pjhash" > "$XBMK_CACHE/hash/$project$tree" || \ - $err "!mk $XBMK_CACHE/hash/$project$tree" + err "!mk $XBMK_CACHE/hash/$project$tree" [ "$badhash" != "y" ] || x_ rm -Rf "src/$project/$tree" \ "elf/$project/$tree" "elf/$project/$target"; : @@ -323,12 +323,12 @@ check_cross_compiler() # gnat in PATH never resolves to gnat-14, because gnat-14 was "experimental" check_gnu_path() { - command -v "$1" 1>/dev/null || $err "Host '$1' unavailable" + command -v "$1" 1>/dev/null || err "Host '$1' unavailable" eval "`setvars "" gccver gccfull gnatver gnatfull gccdir gnatdir`" x_ gnu_setver "$1" "$1" && gnu_setver "$2" "$2" || : - eval "[ -z \"\$$1ver\" ] && $err \"Cannot detect host '$1' version\"" + eval "[ -z \"\$$1ver\" ] && err \"Cannot detect host '$1' version\"" [ "$gnatfull" = "$gccfull" ] && return 0 eval "$1dir=\"$(dirname "$(command -v "$1")")\"" @@ -346,7 +346,7 @@ check_gnu_path() _gnuutil="${_gnubin##*/}" && [ -e "$_gnubin" ] && \ x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}" done - ) || $err "Cannot create $2-$_gnuver link in $_gnudir"; : + ) || err "Cannot create $2-$_gnuver link in $_gnudir"; : } gnu_setver() @@ -360,7 +360,7 @@ gnu_setver() check_defconfig() { - [ -f "$defconfig" ] || $dry $err "$project/$target: missing defconfig" + [ -f "$defconfig" ] || $dry err "$project/$target: missing defconfig" dest_dir="$elfdir/$target/${defconfig#"$target_dir/config/"}" $dry elfcheck || return 1 # skip build if a previous one exists @@ -383,7 +383,7 @@ handle_makefile() [ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \ "$srcdir" silentoldconfig || make -C "$srcdir" oldconfig || : - run_make_command || $err "handle_makefile $srcdir: no makefile!" + run_make_command || err "handle_makefile $srcdir: no makefile!" _copy=".config" && [ "$mode" = "savedefconfig" ] && _copy="defconfig" [ "${mode%config}" = "$mode" ] || \ @@ -419,11 +419,11 @@ check_cmake() check_autoconf() { ( - cd "$1" || $err "!cd $1" + cd "$1" || err "!cd $1" [ -f "bootstrap" ] && x_ ./bootstrap $bootstrapargs [ -f "autogen.sh" ] && x_ ./autogen.sh $autogenargs [ -f "configure" ] && x_ ./configure $autoconfargs; : - ) || $err "can't bootstrap project: $1"; : + ) || err "can't bootstrap project: $1"; : } check_makefile() -- cgit v1.2.1 From 37ca0c90e1cc8dc3f85b9cdd96c9cd6faea0862a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 10:18:33 +0100 Subject: lib.sh err: add missing redirect to stderr Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/lib.sh b/include/lib.sh index eb4cddca..1bfe2060 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -187,7 +187,7 @@ err() ( $real_err "$@" || printf \ "WARNING: Err function '%s' *returned* 1. Will exit 1 anyway\n" \ - "$real_err" + "$real_err" 1>&2 printf "WARNING: Err function '%s' didn't exit. Will exit 1 anyway\n" \ "$real_err" 1>&2 exit 1 -- cgit v1.2.1 From 9611c19e7ed1be42c8da8228235d9626eb853acf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:03:34 +0100 Subject: init.sh: tidy up xbmk_child_exec() make the command style more consistent, for example relying on x_ inside a subshell to print the command and arguments if a command failed. this is a good style, and i'll probably use it in other places on lbmk. Signed-off-by: Leah Rowe --- include/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/init.sh b/include/init.sh index ce9cf9a9..e8ff6b63 100644 --- a/include/init.sh +++ b/include/init.sh @@ -204,8 +204,8 @@ xbmk_child_exec() { xbmk_rval=0 ( x_ ./mk "$@" ) || xbmk_rval=1 - rm -Rf "$xbmklocal" "$xbmktmp" || xbmk_rval=1 - rm -f lock || xbmk_rval=1 + ( x_ rm -Rf "$xbmklocal" "$xbmktmp" ) || xbmk_rval=1 + ( x_ rm -f lock ) || xbmk_rval=1 exit $xbmk_rval } -- cgit v1.2.1 From 8b7bd992f66d554c50495fb87426bf3b8580dcb9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:12:23 +0100 Subject: init.sh: define lock file in a variable instead don't hardcode it. Signed-off-by: Leah Rowe --- include/init.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/init.sh b/include/init.sh index e8ff6b63..9e05d503 100644 --- a/include/init.sh +++ b/include/init.sh @@ -17,12 +17,14 @@ xbmkpath="$PATH" xbmk_err="err_" eval "`setvars "" _nogit board reinstall versiondate aur_notice configdir \ - datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver xbmklocal`" + datadir version xbmkpwd relname xbmkpwd xbmktmp python pyver xbmklocal \ + xbmklock`" xbmk_init() { xbmkpwd="`pwd`" || err "Cannot generate PWD" xbmklocal="$xbmkpwd/tmp" + xbmklock="$xbmkpwd/lock" export PWD="$xbmkpwd" @@ -184,8 +186,8 @@ xbmk_create_tmpdir() xbmk_lock() { - [ -f "lock" ] && err "$xbmkpwd/lock exists. Is a build running?" - touch lock || err "cannot create 'lock' file"; : + [ -f "$xbmklock" ] && err "$xbmklock exists. Is a build running?" + touch "$xbmklock" || err "cannot create '$xbmklock'"; : } xbmk_create_pathdirs() @@ -205,7 +207,7 @@ xbmk_child_exec() xbmk_rval=0 ( x_ ./mk "$@" ) || xbmk_rval=1 ( x_ rm -Rf "$xbmklocal" "$xbmktmp" ) || xbmk_rval=1 - ( x_ rm -f lock ) || xbmk_rval=1 + ( x_ rm -f "$xbmklock" ) || xbmk_rval=1 exit $xbmk_rval } -- cgit v1.2.1 From b51846da6dead8f138858dcdb3da0b78d713e580 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:14:50 +0100 Subject: init.sh: single-quote xbmklock in xbmk_lock() Signed-off-by: Leah Rowe --- include/init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/init.sh b/include/init.sh index 9e05d503..349d40ed 100644 --- a/include/init.sh +++ b/include/init.sh @@ -186,7 +186,7 @@ xbmk_create_tmpdir() xbmk_lock() { - [ -f "$xbmklock" ] && err "$xbmklock exists. Is a build running?" + [ -f "$xbmklock" ] && err "'$xbmklock' exists. Is a build running?" touch "$xbmklock" || err "cannot create '$xbmklock'"; : } -- cgit v1.2.1 From 4020fb432805cfc7ebd243b0873574f25182ba40 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:23:11 +0100 Subject: lib.sh: simplify err() Rely once again on err_, but still explicitly add an exit just below, in case I made a mistake one day. err() is essentially a trap that triggers in case I mess up an error function, so that it doesn't reliably exit. So, the idea is that everything calls err(), and err() is almost never modified, or modified very carefully. If error exits were ever broken, the result could be quite unpredictable, so lbmk has very strict error handling, and great care is taken to ensure that it does reliably exit. Signed-off-by: Leah Rowe --- include/lib.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index 1bfe2060..e7b5bd3d 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -185,19 +185,13 @@ err() fi ( - $real_err "$@" || printf \ - "WARNING: Err function '%s' *returned* 1. Will exit 1 anyway\n" \ - "$real_err" 1>&2 - printf "WARNING: Err function '%s' didn't exit. Will exit 1 anyway\n" \ - "$real_err" 1>&2 - exit 1 + $real_err "$@" || err_ "Error function '$real_err' *returned* 1" + err_ "Error function '$real_err' didn't exit" + exit 1 # just in case! ) || xbmk_err_val=1 # otherwise, it wrongly did exit 0, not exit 1 - [ $xbmk_err_val -eq 0 ] && printf \ - "WARNING: Err function '%s' did exit 0. Will exit 1 anyway.\n" \ - "$real_err" 1>&2 - - exit 1 + [ $xbmk_err_val -eq 0 ] && err_ "Error function '$real_err' did exit 0" + exit 1 # just in case! } err_() -- cgit v1.2.1 From 61e5fd1a0b2791b2819a5d0e58fa76208a4e8774 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:28:22 +0100 Subject: lib.sh: Add warning if x_ is called without args Signed-off-by: Leah Rowe --- include/lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/include/lib.sh b/include/lib.sh index e7b5bd3d..fbbb92da 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -169,6 +169,7 @@ find_ex() x_() { + [ $# -lt 1 ] && printf "WARNING: x_ called without arguments\n" 1>&2 [ $# -lt 1 ] || [ -n "$1" ] || err "Empty first arg: x_ $(echo "$@")" [ $# -lt 1 ] || "$@" || err "Unhandled error for: $(echo "$@")"; : } -- cgit v1.2.1 From 51b2a1159d0d915c080565ba8d2f41203cef6f80 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:30:45 +0100 Subject: lib.sh: simplify err-not-set handling Signed-off-by: Leah Rowe --- include/lib.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index fbbb92da..e54fd6b4 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -180,8 +180,7 @@ err() real_err="$xbmk_err" if [ -z "$xbmk_err" ]; then - printf "WARNING: err not set. Args: %s\n" "$(echo "$@")" 1>&2 - printf "REMARK: Setting err to default 'err_' value\n" 1>&2 + printf "WARNING: err not set. Defaulting to 'err_'\n" 1>&2 real_err="err_" fi -- cgit v1.2.1 From a3b5626f53db69ed22dc395221ba515d3f74b728 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:32:03 +0100 Subject: lib.sh: stricter xbmk_err check in err() Signed-off-by: Leah Rowe --- include/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/lib.sh b/include/lib.sh index e54fd6b4..c9be740a 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -177,9 +177,9 @@ x_() err() { xbmk_err_val=0 + real_err="" && [ -n "${xbmk_err+x}" ] && real_err="$xbmk_err" - real_err="$xbmk_err" - if [ -z "$xbmk_err" ]; then + if [ -z "$real_err" ]; then printf "WARNING: err not set. Defaulting to 'err_'\n" 1>&2 real_err="err_" fi -- cgit v1.2.1 From 5e3aaa1eb8b6f0198723ca67cda07b0990744132 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:49:30 +0100 Subject: init.sh: Run git name/email check before init Otherwise, it returns if init is already done, which later leads to build errors in coreboot. Signed-off-by: Leah Rowe --- include/init.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/init.sh b/include/init.sh index 349d40ed..b9df34bb 100644 --- a/include/init.sh +++ b/include/init.sh @@ -147,6 +147,11 @@ xbmk_set_version() xbmk_git_init() { + for gitarg in "--global user.name" "--global user.email"; do + gitcmd="git config $gitarg"; $gitcmd || err \ + "Please run this first: $gitcmd \"your ${gitcmd##*.}\"" + done + [ -L ".git" ] && return 1 [ -e ".git" ] && return 0 eval "`setvars "$(date -Rud @$versiondate)" cdate _nogit`" @@ -156,12 +161,7 @@ xbmk_git_init() x_ git commit -m "$projectname $version" --date "$cdate" \ --author="xbmk " 1>/dev/null 2>/dev/null x_ git tag -a "$version" -m "$projectname $version" 1>/dev/null \ - 2>/dev/null - - for gitarg in "--global user.name" "--global user.email"; do - gitcmd="git config $gitarg"; $gitcmd || err \ - "Please run this first: $gitcmd \"your ${gitcmd##*.}\"" - done + 2>/dev/null; : } xbmk_create_tmpdir() -- cgit v1.2.1 From 35265731c5b1bfef4bd4e94722c67be8284c7d64 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:50:50 +0100 Subject: init.sh: Silence the output of git config --global Signed-off-by: Leah Rowe --- include/init.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/init.sh b/include/init.sh index b9df34bb..8f5ab059 100644 --- a/include/init.sh +++ b/include/init.sh @@ -148,8 +148,8 @@ xbmk_set_version() xbmk_git_init() { for gitarg in "--global user.name" "--global user.email"; do - gitcmd="git config $gitarg"; $gitcmd || err \ - "Please run this first: $gitcmd \"your ${gitcmd##*.}\"" + gitcmd="git config $gitarg"; $gitcmd 1>/dev/null 2>/dev/null \ + || err "Run this first: $gitcmd \"your ${gitcmd##*.}\"" done [ -L ".git" ] && return 1 -- cgit v1.2.1 From 20c873085874c277ce0e10ec7792bbee94d1c63f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 4 May 2025 16:53:02 +0100 Subject: lib.sh: Provide error message where none is given Signed-off-by: Leah Rowe --- include/lib.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/include/lib.sh b/include/lib.sh index c9be740a..71183874 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -196,6 +196,7 @@ err() err_() { + [ $# -lt 1 ] && printf "ERROR (but no error message provided)\n" 1>&2 [ $# -lt 1 ] || printf "ERROR %s: %s\n" "$0" "$1" 1>&2 || : exit 1 } -- cgit v1.2.1 From 428c46ca2b1fee04625d37bec65c30f0baf87530 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 05:20:47 +0100 Subject: lib.sh: set -u -e in err() Some parts of lbmk set +u +e, to be reset later on under normal conditions upon exit. We must ensure such level of integrity in err() as well. Signed-off-by: Leah Rowe --- include/lib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/lib.sh b/include/lib.sh index 71183874..43b1a318 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -176,6 +176,8 @@ x_() err() { + set -u -e + xbmk_err_val=0 real_err="" && [ -n "${xbmk_err+x}" ] && real_err="$xbmk_err" -- cgit v1.2.1 From 153dd76a82e98a7260424cf37d5a139fff39d2ab Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 05:41:21 +0100 Subject: inject.sh: tidy up the deguard command Signed-off-by: Leah Rowe --- include/inject.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index e2987aad..0e81c63f 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -189,10 +189,9 @@ apply_me11_deguard_mod() { ( x_ cd src/deguard/ - x_ ./finalimage.py --delta "data/delta/$ME11delta" \ - --version "$ME11version" \ - --pch "$ME11pch" --sku "$ME11sku" --fake-fpfs data/fpfs/zero \ - --input "$_metmp" --output "$_me" + x_ ./finalimage.py --delta "data/delta/$ME11delta" --version \ + "$ME11version" --pch "$ME11pch" --sku "$ME11sku" --fake-fpfs \ + data/fpfs/zero --input "$_metmp" --output "$_me" ) || err "Error running deguard for $_me - $dontflash" } -- cgit v1.2.1 From eb882de94cbe78e575b97ced611a06553f94dbc7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 05:43:38 +0100 Subject: inject.sh: tidy up intel me handling Signed-off-by: Leah Rowe --- include/inject.sh | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 0e81c63f..c6c8c2d2 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -142,8 +142,12 @@ extract_intel_me() [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard extract_intel_me_bruteforce - if [ "$ME11bootguard" = "y" ]; then - apply_me11_deguard_mod + if [ "$ME11bootguard" = "y" ]; then ( + x_ cd src/deguard/ + x_ ./finalimage.py --delta "data/delta/$ME11delta" --version \ + "$ME11version" --pch "$ME11pch" --sku "$ME11sku" \ + --fake-fpfs data/fpfs/zero --input "$_metmp" --output "$_me" + ) || err "Error running deguard for $_me - $dontflash" else mv "$_metmp" "$_me" || err "!mv $_metmp $_me - $dontflash" fi @@ -185,16 +189,6 @@ extract_intel_me_bruteforce() rm -Rf "$sdir" || err "extract_intel_me: !rm -Rf $sdir - $dontflash" } -apply_me11_deguard_mod() -{ - ( - x_ cd src/deguard/ - x_ ./finalimage.py --delta "data/delta/$ME11delta" --version \ - "$ME11version" --pch "$ME11pch" --sku "$ME11sku" --fake-fpfs \ - data/fpfs/zero --input "$_metmp" --output "$_me" - ) || err "Error running deguard for $_me - $dontflash" -} - extract_archive() { [ $# -gt 2 ] && [ "$3" = "fsp" ] && x_ python \ -- cgit v1.2.1 From 4cbc950c01fadd09b408de873cbb7a221b64bea9 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 06:00:23 +0100 Subject: inject.sh: Move FSP extraction only to extract_fsp Don't do FSP-specific extraction in extract_archive, as that is not what the latter is for. Signed-off-by: Leah Rowe --- include/inject.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index c6c8c2d2..bdccb881 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: GPL-3.0-only +# SPD-License-Identifier: GPL-3.0-only # Copyright (c) 2022 Caleb La Grange # Copyright (c) 2022 Ferass El Hafidi # Copyright (c) 2023-2025 Leah Rowe @@ -121,10 +121,10 @@ fetch() x_ mkdir -p "${_dest%/*}" remkdir "$appdir" - extract_archive "$_dl" "$appdir" "$dl_type" || \ + [ "$dl_type" = "fsp" ] || extract_archive "$_dl" "$appdir" || \ [ "$dl_type" = "e6400vga" ] || err "$_dest $dl_type: !extract" - eval "extract_$dl_type" + x_ extract_$dl_type "$_dl" "$appdir" set -u -e e "$_dest" f missing && err "!extract_$dl_type. $dontflash"; : } @@ -191,10 +191,6 @@ extract_intel_me_bruteforce() extract_archive() { - [ $# -gt 2 ] && [ "$3" = "fsp" ] && x_ python \ - "$cbdir/3rdparty/fsp/Tools/SplitFspBin.py" split -f "$1" -o "$2" \ - -n "Fsp.fd" && return 0 - innoextract "$1" -d "$2" || python "$pfs_extract" "$1" -e || 7z x \ "$1" -o"$2" || unar "$1" -o "$2" || unzip "$1" -d "$2" || return 1 @@ -261,7 +257,8 @@ copy_tbfw() extract_fsp() { - x_ cp "$appdir/"Fsp_*.fd "${_dest%/*}" + x_ python "$cbdir/3rdparty/fsp/Tools/SplitFspBin.py" split -f "$1" \ + -o "$2" -n "Fsp.fd" && x_ cp "$appdir/"Fsp_*.fd "${_dest%/*}" } fail_inject() -- cgit v1.2.1 From a662ec90d9b0b9f768508cbce648bf532741ab3c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 06:11:47 +0100 Subject: inject.sh extract_intel_me(): reduce indentation Signed-off-by: Leah Rowe --- include/inject.sh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index bdccb881..93f60c68 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -142,15 +142,14 @@ extract_intel_me() [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard extract_intel_me_bruteforce - if [ "$ME11bootguard" = "y" ]; then ( - x_ cd src/deguard/ - x_ ./finalimage.py --delta "data/delta/$ME11delta" --version \ - "$ME11version" --pch "$ME11pch" --sku "$ME11sku" \ - --fake-fpfs data/fpfs/zero --input "$_metmp" --output "$_me" - ) || err "Error running deguard for $_me - $dontflash" - else - mv "$_metmp" "$_me" || err "!mv $_metmp $_me - $dontflash" - fi + [ "$ME11bootguard" != "y" ] && x_ mv "$_metmp" "$_me" && return 0 + + ( + x_ cd src/deguard/ + x_ ./finalimage.py --delta "data/delta/$ME11delta" --version \ + "$ME11version" --pch "$ME11pch" --sku "$ME11sku" \ + --fake-fpfs data/fpfs/zero --input "$_metmp" --output "$_me" + ) || err "Error running deguard for $_me - $dontflash"; : } extract_intel_me_bruteforce() -- cgit v1.2.1 From 9bb1ca0a5fe826a8498da6a731a1326b2f06812e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 06:21:04 +0100 Subject: inject.sh: Remove unnecessary check _dest is already checked in the calling function fetch(), after extract_tbfw() has been called. Signed-off-by: Leah Rowe --- include/inject.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/include/inject.sh b/include/inject.sh index 93f60c68..43cb5542 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -245,7 +245,6 @@ extract_sch5545ec() extract_tbfw() { chkvars TBFW_size && fe_ copy_tbfw "$appdir" -type f -name "TBT.bin" - [ -f "$_dest" ] || err "$board: Could not extract tbfw"; : } copy_tbfw() -- cgit v1.2.1 From 4fda30c9602b6d092a9e7cf58a0c36d1c6248a35 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 06:26:38 +0100 Subject: inject.sh: simplify extract_intel_me_bruteforce() Signed-off-by: Leah Rowe --- include/inject.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/inject.sh b/include/inject.sh index 43cb5542..f1ecb0d5 100644 --- a/include/inject.sh +++ b/include/inject.sh @@ -165,9 +165,11 @@ extract_intel_me_bruteforce() [ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}" cd "$cdir" || err "extract_intel_me: !cd \"$cdir\" - $dontflash" for i in *; do - e "$_metmp" f && break + c=0 && e "$_metmp" f && break [ -L "$i" ] && continue - if [ -f "$i" ]; then + [ -e "$i" ] || continue + [ -d "$i" ] && extract_intel_me_bruteforce "$cdir/$i" && c=1 + if [ $c -eq 0 ] && [ -f "$i" ]; then _r="-r" && [ -n "$mfs" ] && _r="" "$mecleaner" $mfs $_r -t -O "$sdir/vendorfile" \ -M "$_metmp" "$i" && break @@ -176,10 +178,6 @@ extract_intel_me_bruteforce() _7ztest="${_7ztest}a" extract_archive "$i" "$_7ztest" || continue extract_intel_me_bruteforce "$cdir/$_7ztest" - elif [ -d "$i" ]; then - extract_intel_me_bruteforce "$cdir/$i" - else - continue fi cdir="$1"; [ "${cdir#/a}" != "$cdir" ] && cdir="${cdir#/}" cd "$cdir" || : -- cgit v1.2.1 From d35cbcb3e4949aa6a5747708f54925b23d2fc4b0 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 5 May 2025 07:14:38 +0100 Subject: GRUB: Mark E820 reserved on coreboot memory See, coreboot bug report: https://ticket.coreboot.org/issues/590 We hadn't noticed this for quite a while, since we always just booted with iomem=relaxed when needing to run cbmem, since in practise it was always combined with other tasks that require access to lower memory. GRUB currently matches coreboot's own mmap for cbmem, but for example SeaBIOS marks cbmem as E820 reserved. Therefore, this change replicates the SeaBIOS behaviour. Without this patch, Linux needs to boot with iomem=relaxed for cbmem access, for example when running ./cbmem -1 With this patch, cbmem is now accessible regardless. This patch also prevents Linux from overwriting parts of CBMEM. Thanks go to Paul Menzel, who wrote this GRUB patch. Thanks also go to Nicholas Chin, who provided testing, all the way from Coreboot 25.03 back to Coreboot 4.20. It seems that this is just something the payloads have to handle. This means that both SeaBIOS and GRUB no longer have this bug, in Libreboot; now what remains is to replicate the test with our U-Boot payload. Signed-off-by: Leah Rowe --- .../0014-kern-coreboot-mmap-Map-to-reserved.patch | 37 ++++++++++++++++++++++ .../0015-kern-coreboot-mmap-Map-to-reserved.patch | 37 ++++++++++++++++++++++ .../0026-kern-coreboot-mmap-Map-to-reserved.patch | 37 ++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 config/grub/default/patches/0014-kern-coreboot-mmap-Map-to-reserved.patch create mode 100644 config/grub/nvme/patches/0015-kern-coreboot-mmap-Map-to-reserved.patch create mode 100644 config/grub/xhci/patches/0026-kern-coreboot-mmap-Map-to-reserved.patch diff --git a/config/grub/default/patches/0014-kern-coreboot-mmap-Map-to-reserved.patch b/config/grub/default/patches/0014-kern-coreboot-mmap-Map-to-reserved.patch new file mode 100644 index 00000000..5d93ac1d --- /dev/null +++ b/config/grub/default/patches/0014-kern-coreboot-mmap-Map-to-reserved.patch @@ -0,0 +1,37 @@ +From d675307bfcac2f9e05ed119c5b5af3de48e56fb9 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Mon, 17 May 2021 10:24:36 +0200 +Subject: [PATCH] kern/coreboot/mmap: Map to reserved + +https://git.savannah.gnu.org/cgit/grub.git/commit/?id=6de9ee86bf9ae50967413e6a73b5dfd13e5ffb50 + +Signed-off-by: Paul Menzel +--- + grub-core/kern/coreboot/mmap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/coreboot/mmap.c b/grub-core/kern/coreboot/mmap.c +index caf8f7cef..2fc316e8d 100644 +--- a/grub-core/kern/coreboot/mmap.c ++++ b/grub-core/kern/coreboot/mmap.c +@@ -59,7 +59,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) + /* Multiboot mmaps match with the coreboot mmap + definition. Therefore, we can just pass type + through. */ +- mem_region->type, ++ (mem_region->type >= 13) ? 2 : mem_region->type, + ctx->hook_data)) + return 1; + if (start < 0xa0000) +@@ -81,7 +81,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) + /* Multiboot mmaps match with the coreboot mmap + definition. Therefore, we can just pass type + through. */ +- mem_region->type, ++ (mem_region->type >= 13) ? 2 : mem_region->type, + ctx->hook_data)) + return 1; + } +-- +2.31.1 + diff --git a/config/grub/nvme/patches/0015-kern-coreboot-mmap-Map-to-reserved.patch b/config/grub/nvme/patches/0015-kern-coreboot-mmap-Map-to-reserved.patch new file mode 100644 index 00000000..5d93ac1d --- /dev/null +++ b/config/grub/nvme/patches/0015-kern-coreboot-mmap-Map-to-reserved.patch @@ -0,0 +1,37 @@ +From d675307bfcac2f9e05ed119c5b5af3de48e56fb9 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Mon, 17 May 2021 10:24:36 +0200 +Subject: [PATCH] kern/coreboot/mmap: Map to reserved + +https://git.savannah.gnu.org/cgit/grub.git/commit/?id=6de9ee86bf9ae50967413e6a73b5dfd13e5ffb50 + +Signed-off-by: Paul Menzel +--- + grub-core/kern/coreboot/mmap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/coreboot/mmap.c b/grub-core/kern/coreboot/mmap.c +index caf8f7cef..2fc316e8d 100644 +--- a/grub-core/kern/coreboot/mmap.c ++++ b/grub-core/kern/coreboot/mmap.c +@@ -59,7 +59,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) + /* Multiboot mmaps match with the coreboot mmap + definition. Therefore, we can just pass type + through. */ +- mem_region->type, ++ (mem_region->type >= 13) ? 2 : mem_region->type, + ctx->hook_data)) + return 1; + if (start < 0xa0000) +@@ -81,7 +81,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) + /* Multiboot mmaps match with the coreboot mmap + definition. Therefore, we can just pass type + through. */ +- mem_region->type, ++ (mem_region->type >= 13) ? 2 : mem_region->type, + ctx->hook_data)) + return 1; + } +-- +2.31.1 + diff --git a/config/grub/xhci/patches/0026-kern-coreboot-mmap-Map-to-reserved.patch b/config/grub/xhci/patches/0026-kern-coreboot-mmap-Map-to-reserved.patch new file mode 100644 index 00000000..5d93ac1d --- /dev/null +++ b/config/grub/xhci/patches/0026-kern-coreboot-mmap-Map-to-reserved.patch @@ -0,0 +1,37 @@ +From d675307bfcac2f9e05ed119c5b5af3de48e56fb9 Mon Sep 17 00:00:00 2001 +From: Paul Menzel +Date: Mon, 17 May 2021 10:24:36 +0200 +Subject: [PATCH] kern/coreboot/mmap: Map to reserved + +https://git.savannah.gnu.org/cgit/grub.git/commit/?id=6de9ee86bf9ae50967413e6a73b5dfd13e5ffb50 + +Signed-off-by: Paul Menzel +--- + grub-core/kern/coreboot/mmap.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/grub-core/kern/coreboot/mmap.c b/grub-core/kern/coreboot/mmap.c +index caf8f7cef..2fc316e8d 100644 +--- a/grub-core/kern/coreboot/mmap.c ++++ b/grub-core/kern/coreboot/mmap.c +@@ -59,7 +59,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) + /* Multiboot mmaps match with the coreboot mmap + definition. Therefore, we can just pass type + through. */ +- mem_region->type, ++ (mem_region->type >= 13) ? 2 : mem_region->type, + ctx->hook_data)) + return 1; + if (start < 0xa0000) +@@ -81,7 +81,7 @@ iterate_linuxbios_table (grub_linuxbios_table_item_t table_item, void *data) + /* Multiboot mmaps match with the coreboot mmap + definition. Therefore, we can just pass type + through. */ +- mem_region->type, ++ (mem_region->type >= 13) ? 2 : mem_region->type, + ctx->hook_data)) + return 1; + } +-- +2.31.1 + -- cgit v1.2.1