summaryrefslogtreecommitdiffstats
path: root/payloads
Commit message (Collapse)AuthorAgeFilesLines
* payloads/tianocore: Remove the option for CorebootPayloadPkgSean Rhodes2022-08-073-39/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Recent changes to both coreboot and edk2 means that UefiPayloadPkg seems to work on all hardware. It has been tested on: * Intel Core 2nd, 3rd, 4th, 5th, 6th, 8th, 8th, 9th, 10th, 11th and 12th generation processors * Intel Small Core BYT, BSW, APL, GLK and GLK-R processors * AMD Stoney Ridge and Picasso This includes the problematic Lenovo X230s. The most likely fixes are: * Configuring the PCI Base and Length in edk2 * Fixes to the HostBridgeLib in edk2 * Adjustment to the SD/eMMC initialisation timeout This means we can now remove the already deprecated option for CorebootPayloadPkg and the legacy 8254 timer build option. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ice7b7576eb3d32ea46e5138266b7df3fbcdcf7ea Reviewed-on: https://review.coreboot.org/c/coreboot/+/65721 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore/Makefile: Fix restoring default boot logoMatt DeVillier2022-08-021-1/+1
| | | | | | | | | | | | | | the missing `; \` at the end of the line meant subsequent lines were no longer run from $project_dir, so Logo.bmp was silently failing to restore. This led to the working dir being dirty, and on subsequent runs, any change to a different branch in the same repo would fail. Change-Id: I17a323bc2dda19b69d809e398b273f24e14b43af Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66321 Reviewed-by: Sean Rhodes <sean@starlabs.systems> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Enable PCIe driver for sc7280Veerabhadrarao Badiganti2022-08-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enable PCIe driver for herobrine board. BUG=b:182963902,b:216686574,b:181098581 TEST=Verified on Qualcomm sc7280 development board with NVMe card (Koixa NVMe, Model-KBG40ZPZ256G with FW AEGA0102). Confirmed NVMe is getting detected in response to 'storage init' command in depthcharge CLI prompt. Output logs: ->dpch: storage init Initializing NVMe controller 1e0f:0001 Identified NVMe model KBG40ZPZ256G TOSHIBA MEMORY Added NVMe drive "NVMe Namespace 1" lbasize:512, count:0x1dcf32b0 * 0: NVMe Namespace 1 1 devices total Also verified NVMe boot path, that is depthcharge is able to load the kernel image from NVMe storage. Change-Id: Idb693ca219ba1e5dfc8aec34027085b53af49a2c Signed-off-by: Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65661 Reviewed-by: Shelley Chen <shchen@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload/pci: Add pci_map_bus function for Qualcomm platformPrasad Malisetty2022-08-013-0/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'pci_map_bus' function and PCIE_QCOM config for Qualcomm platform. BUG=b:182963902,b:216686574,b:181098581 TEST=Verified on Qualcomm sc7280 development board with NVMe endpoint (Koixa NVMe, Model-KBG40ZPZ256G with FW AEGA0102). Confirmed NVMe is getting detected in response to 'storage init' command in depthcharge CLI prompt. Output logs: ->dpch: storage init Initializing NVMe controller 1e0f:0001 Identified NVMe model KBG40ZPZ256G TOSHIBA MEMORY Added NVMe drive "NVMe Namespace 1" lbasize:512, count:0x1dcf32b0 * 0: NVMe Namespace 1 1 devices total Also verified NVMe boot path that is depthcharge is able to load the kernel image from NVMe storage. Change-Id: I7d1217502cbd7d4d0cdd298919ae82435630d61c Signed-off-by: Prasad Malisetty <quic_pmaliset@quicinc.com> Signed-off-by: Veerabhadrarao Badiganti <quic_vbadigan@quicinc.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57615 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/tianocore: Update MrChromebox’ default branch to 202207Sean Rhodes2022-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Update MrChromebox’ default branch from uefipayload_202107 to uefipayload_202207. This is based on upstream edk2, commit f26b70c (UefiPayloadPkg: Add support for logging to CBMEM console). Tested on: * StarBook Mk V * StarLite Mk III Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I16a012485e4b4957439e776914ffd016b4506a47 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66083 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
* payloads/tianocore: Use SMMSTORE when branch is MrChromeBoxMatt DeVillier2022-07-302-0/+2
| | | | | | | | | | | | | | | | | SMMSTORE support in edk2 was not allowed in upstream edk2 as it was bootloader specific. Shortly, it will be built from edk2-platforms and then, it will be retired. For now, the patches exist in the MrChromeBox fork (TIANOCORE_UEFIPAYLOAD), so enable these by default when SMMSTORE_v2 is enabled. Change-Id: I1861bf739c2e25f661b4f06a303348f0537dc8b3 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65867 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/tianocore: Allow passing custom build params to all versionsSean Rhodes2022-07-302-8/+4
| | | | | | | | | | | | Allow passing custom build parameters to any version of edk2, not just forks. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I4eed535415ba15ae73e22cada9153820538f5f6d Reviewed-on: https://review.coreboot.org/c/coreboot/+/66210 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Bind the PCDs for screen size to KconfigSean Rhodes2022-07-273-0/+11
| | | | | | | | | | | | Bind the PCDs that allow edk2 to use the whole display to a Kconfig option called TIANOCORE_FULL_SCREEN_SETUP. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ic977a199f3b308c566391e37f126c4fe518b2eb6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66162 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Correct the multiplication of the SD/MMC timeoutSean Rhodes2022-07-271-1/+1
| | | | | | | | | | | | | | | | The `call int-multiply` couldn't handle the Kconfig option being a string so do the calculation in bash. Tested on: * Qemu * StarLite Mk III Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I1879d7efd504e2c42dadb12d2d8add4f69ca7b9c Reviewed-on: https://review.coreboot.org/c/coreboot/+/66161 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Add missing CONFIG for SERIAL_SUPPORTSean Rhodes2022-07-271-1/+1
| | | | | | | | | | | This caused edk2 serial output to be disabled 100% of the time. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: If272369b405e7745fe82f49026cbed0abc50f355 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66160 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: use BMP (vs SVG) logo file as defaultMatt DeVillier2022-07-271-1/+1
| | | | | | | | | | | | | | | | converting the SVG logo to BMP at compile time using 'convert' introduces terrible aliasing artifacts, so use a properly converted BMP file as the default instead. Test: boot qemu w/Tianocore, observe lack of aliasing in coreboot logo Change-Id: I62d643c24abca57fa35b79732d8cedc83b94815f Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66144 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* payloads/tianocore: Fix bootsplash/logo handlingMatt DeVillier2022-07-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | commit 108e53792804 ("payloads/tianocore: Add a proper target for the Boot Splash") introduced 2 bugs in bootsplash handling: - the "logo" make target added a spurious "/edk2" to the project dir - the "logo" make target failed to account for the case where no user- defined logo file is used (the upstream Tianocore one will be used in this case) Fix both these issues. Test: build/boot qemu w/Tianocore w/o user-defined bootsplash file. Change-Id: Ieebc547670213459823f58956ae87c6bf94b74ef Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66142 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/ext/tianocore/Makefile: Fix word in commentAngel Pons2022-07-271-1/+1
| | | | | | | | | | | revalant ---> relevant Change-Id: Id31a57644947bf8c0f461dbfc9ca8b1984e9acb8 Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66151 Reviewed-by: Sean Rhodes <sean@starlabs.systems> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Add a proper target for the Boot SplashSean Rhodes2022-07-252-24/+41
| | | | | | | | | | | | | | edk2's default is to show a Boot Splash with their own logo which looks like it's from the 1960's. Therefore, we replace this image with coreboot's logo, taken from https://coreboot.org unless a custom one is specified. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I1b133e2a2cfd45a6650e4523b267f7508974137b Reviewed-on: https://review.coreboot.org/c/coreboot/+/65881 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
* payloads/tianocore: Increase default timeout for SD MMC init to 10msSean Rhodes2022-07-192-4/+4
| | | | | | | | | | | | | | | | | | | Firstly, change the unit of `μs` to `ms` so it's easier to read. This patch changes the default amount of time allowed to initialise SD Card Readers and eMMC drives from 1ms to 10ms. Having a timeout too short will stop certain devices from booting, which was seen on google/akemi; it throws an exception when attempting to boot from the internal eMMC drive. This new value is still lower than upstream edk2's value of 1s. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Id1f66d5d50f889f07a34836ab2932b28ef7fb245 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65813 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* Remove executable flag from source codes and text filesPetr Cvek2022-07-141-0/+0
| | | | | | | | | | | Markdown, definition file and sconfig source codes don't need to be executables. This patch fixes that. Signed-off-by: Petr Cvek <petrcvekcz@gmail.com> Change-Id: Ic97d684318c689259f7895e3dfbd552434c3882e Reviewed-on: https://review.coreboot.org/c/coreboot/+/65807 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* payloads/tianocore: Limit legacy build options to CorebootPayloadPkgSean Rhodes2022-07-131-0/+2
| | | | | | | | | | | Limited to two legacy build options to only be set when CorebootPayloadPkg is used, as they don't exist in UefiPayloadPkg. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I71aaa940543075962e167b52b23f45976d39c616 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65779 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Allow edk2 to use the full framebufferSean Rhodes2022-07-131-0/+8
| | | | | | | | | | | Set all PCDs relating to console size to 0, which allows edk2 to use the full framebuffer. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Id105a2c822a2b05da6e45dac9deeca1f155bfa33 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65778 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Hook up PCI Express Base Address and LengthSean Rhodes2022-07-132-0/+9
| | | | | | | | | | | | | | | | | Hook up edk2 build options PCIE_BASE_ADDRESS and PCIE_BASE_LENGTH to CONFIG_ECAM_MMCONF_BASE_ADDRESS and CONFIG_ECAM_MMCONF_LENGTH. This patch has been reviewed upstream but not yet merged (2022/07/08). It won't cause any problems for any existing branches or forks that do not have this build option hooked up. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ie5d50cc4619354d3c98adf6cde12c192be759869 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65644 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/external/tianocore: Hook up debug builds to serial supportSean Rhodes2022-07-063-0/+13
| | | | | | | | | | | | | | | | ConSplitterDxe uses the intersection of all outputs, which includes serial, for the list of supported text modes. When serial output is supported, this slows down performance and limits the size of FrontPage. Only enable edk2's serial support when it's a debug build as it's the only case where there will be debug output. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ic3633767dabb3543e865aa65c4101840a7b69cc1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65643 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* treewide: Unify Google brandingJon Murphy2022-07-045-6/+6
| | | | | | | | | | | | | | | | | Branding changes to unify and update Chrome OS to ChromeOS (removing the space). This CL also includes changing Chromium OS to ChromiumOS as well. BUG=None TEST=N/A Change-Id: I39af9f1069b62747dbfeebdd62d85fabfa655dcd Signed-off-by: Jon Murphy <jpmurphy@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65479 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* payloads/tianocore: Show build optionsSean Rhodes2022-06-231-1/+11
| | | | | | | | | | Show the build options that are passed to edk2 in one clear block. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I917a8c1d3ac8f2a223e584fec10689679835630c Reviewed-on: https://review.coreboot.org/c/coreboot/+/65184 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* payloads/tianocore/Makefile.inc: Alphabetise Kconfig optionsSean Rhodes2022-06-221-1/+1
| | | | | | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I12a18acd24a0aede8113e1daa607c852eba67049 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65160 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* payloads/external/tianocore: Allow Kconfig options for all UefiPayloadPkg ↵Sean Rhodes2022-06-211-1/+1
| | | | | | | | | | | | | | | versions Most of the Kconfig options are upstream, so they should exist in most forks. Therefore, allow them to be set and passed when using a custom repository or upstream edk2. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I31e6e267ee6e4e3a254f733e1dfc1ecb3a3d3576 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65040 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
* libpayload/Makefile.inc: Initialize vboot submoduleNicholas Chin2022-06-201-0/+11
| | | | | | | | | | | | | | | | | | | | | | | After commit 63e54275f684 (libpayload: Implement new CBFS access API), libpayload includes headers from commonlib/bsd, which in turn include vb2_sha.h from vboot after commit 0655f78041ef (commonlib/bsd: Add new CBFS core implementation). Usually submodules are initialized by the top level Makefile.inc, but since this file is never read when building libpayload based payloads outside the main coreboot build, the header cannot be found unless the vboot submodule had previously been initialized. This is especially evident when following Tutorial 1 in the documentation, where the coreboot repo is cloned without recursing into submodules and coreinfo is built separately from the coreboot build using `make -C payloads/coreinfo`. TEST=Deinitialize submodules and run `make -C payloads/coreinfo`. Coreinfo should build without error. Change-Id: I29b16525999921fbce51c2459d3d534b64e00b3c Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65222 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/LinuxBoot: Use wildcardsArthur Heymans2022-06-171-4/+1
| | | | | | | | | | | If no directory is found then no harm is done either. Change-Id: I0842ec106f11eca80bf01fd4771e1dfc4588b3fa Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65153 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
* libpayload/libcbfs: Fix file hash checkYu-Ping Wu2022-06-162-7/+31
| | | | | | | | | | | | | | Fix the buffer pointer passed to cbfs_file_hash_mismatch(). Add a test case with LZ4 compression, which would catch the bug we are fixing. Change-Id: I36605e2dbc0423fa6743087512f2042b37c49d35 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/65149 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* libpayload/Makefile.payload: Fix CFLAGSNico Huber2022-06-151-1/+1
| | | | | | | | | | | | | | GCC_CFLAGS_<arch> contains only the flags that are GCC specific, iow. flags that don't work with Clang. CFLAGS_<arch>, OTOH, contains all flags that should be used and auto- matically includes GCC_CFLAGS_<arch> if GCC is selected. Change-Id: I5ec15f169d51c7a32ca86e54a98a2ce0e3b51e6d Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62248 Reviewed-by: Thomas Heijligen <src@posteo.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload/Makefile.payload: Include libpayload's .configNico Huber2022-06-151-0/+2
| | | | | | | | | | It's required to tell xcompile what compiler to use. Change-Id: I9f1ddef96a20df1d83bfd4883b2e006ba78ce7c4 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62269 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* libpayload/Makefile.payload: Revise config strategyNico Huber2022-06-151-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Payloads often just use one of the defconfigs for libpayload. When the `Makefile.payload` was introduced, it also added dependencies to pass a `make oldconfig` or `make defconfig` for the payload on to libpayload. Turned out, this creates some dependency madness when, for instance, `make oldconfig` gets called without a libpay- load `.config` available, or when we try to include the `.config` in the `Makefile`. To make things worse, Kconfig's `Makefile` that is imported from Linux contains some rarely used paths that are generally incompa- tible to our environment. So let's get rid of the hard-to-control automatism. Payloads that don't want to use a libpayload defconfig need to clear the `$(LIBPAYLOAD_DEFCONFIG)` variable and manually run the respective config target to generate a `.config`. To fully support this, the rule to create a `.config` via `defconfig` is guarded by `$(LIBPAYLOAD_DEFCONFIG)`. Otherwise we'd have a spurious, broken recipe when the variable is unset. We keep the option to call libpayload targets with an `lp-` prefix for convenience. The existing, explicit targets `lp-defconfig` and `lp-oldconfig` are replaced with a pattern match, so all config and other targets should work. Change-Id: Ie3fcce58d98e248c7182cd47f2a797fe066dd18a Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/62273 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de>
* external/LinuxBoot: Fix cleanup mechanismPatrik Tesarik2022-06-141-2/+5
| | | | | | | | | | | | `make clean` never thoroughly removed LinuxBoot build artifacts. This change checks for kernel directories present in the project directory and deletes all of them, if found. Signed-off-by: Patrik Tesarik <patrik.tesarik@9elements.com> Change-Id: Ia056ac6608e3631dfc270ba5c2f32216c3e1ac50 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65098 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* external/LinuxBoot: Kconfig defaults to systembootPatrik Tesarik2022-06-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | In addition to change CB:40316 this commit proposes a change of default behavior inside of the LinuxBoot toolchain. Currently the defaults build a LinuxBoot payload which boots into the u-root shell and waits for input. In fact it does not deliver any bootloader with it, but the build image is on the other hand rather small. This commit changes the defaults in a way that the LinuxBoot bootloader will actually be able to boot a local or remote system image. In consequence the build payload size is rather big, but accepted for a working out-of-the-box startup behavior. See discussion on that topic in the above mentioned change. Signed-off-by: Patrik Tesarik <mail@patrik-tesarik.de> Change-Id: Ieaba7e523aef10c467a8bea29ae323e22324b225 Reviewed-on: https://review.coreboot.org/c/coreboot/+/40527 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/external/LinuxBoot: Adopt u-root changePatrik Tesarik2022-06-133-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | The u-root toolkit dropped the original uinit bootloader in the master branch and respectively the systemboot-option in templates.go. In consequence the LinuxBoot builds will boot into the u-root shell and waiting for input. This commit enables the reuse of the -uinitcmd flag to specify a command, which runs after the u-root init-process. Systemboot as a bootloader wrapper will mimic a BIOS/UEFI boot device selection. Other preselections, i.e. stboot and boot2 are implemented as well. Custom strings or programs can be set as well, but they cannot contain program flags. E.g. 'fbnetboot -class linuxboot' will not work, because they aren't symlinkable. This commit and its respective LinuxBoot builds with systemboot, none and one custom option have been tested successfully on a UP squared single board computer with the intended behavior. Change-Id: I4ac3409040ea77a1836f90f43fba07d2cd05a952 Signed-off-by: Patrik Tesarik <mail@patrik-tesarik.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/40316 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Christian Walter <christian.walter@9elements.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* external/LinuxBoot: Deprecate GOPATH in u-rootPatrik Tesarik2022-06-131-6/+8
| | | | | | | | | | | | | | | | | | | | This is a breaking change for now when using latest u-root main, which is the default behavior in LinuxBoot. u-root switched to golang modules and therefore `go get` is not the standard behavior anymore. The workaround for this is to pull the repository and build directly in the directory for now. Another apporach would be to use `go install $pkg@latest` to install the binary at that particular version into the golang binary path. Currently missing is a control structure to enable the build process for legacy versions <v0.8.0. Signed-off-by: Patrik Tesarik <patrik.tesarik@9elements.com> Change-Id: Ifa03504da6fa321ffc6d2506b27ebd2e3ed9961b Reviewed-on: https://review.coreboot.org/c/coreboot/+/65090 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Christian Walter <christian.walter@9elements.com>
* payloads/tianocore: Allow custom build parametersMichał Żygowski2022-06-093-0/+19
| | | | | | | | | | | | | Currently, custom TianoCore builds are allowed, but those may need different parameters. Add a Kconfig option to specify additional parameters to be appended to build command. Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com> Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com> Change-Id: I025459ae94592103b4be0c68b422100b7c649d34 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62497 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
* libpayload: Add commonlib/bsd/elog and its dependencyHsuan Ting Chen2022-06-092-0/+5
| | | | | | | | | | | | | | | | Add commonlib/bsd/elog dependency in libpayload. This will allow other payloads (e.g. depthcharge) to implement their own eventlog read and write utilities. Also include commonlib/bsd/elog.c source to libc-srcs. This ensure payloads could utilize commonlib elog helper functions. Change-Id: I64d0fdd2a8eff1d89a1ac451d37b61787b5564e7 Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63115 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org>
* payloads/external: Reword help of SEAGRUB_ALLOW_SEABIOS_BOOTMENUBill XIE2022-06-071-2/+3
| | | | | | | | | | | | The sentence about "to bypass the secure mechanism implemented in the GRUB runtime config" sounded confusing, so reword it. Signed-off-by: Bill XIE <persmule@hardenedlinux.org> Change-Id: I9c6f40d6d11d459fe4be40a624921c2632a89564 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64970 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
* commonlib: Clean up compiler.hJulius Werner2022-06-074-56/+7
| | | | | | | | | | | | | | | | | | | | | | | This patch contains several minor cleanups related to compiler.h: - Replace __always_unused() (which is a Linux-specific concept that doesn't make sense without also having __maybe_unused(), and had zero uses in the codebase) with __unused() which moves here from helpers.h - Add __underscores__ to the names of all attributes in the compiler attribute shorthand macros. This is necessary to make them work in files where the same name was already used for an identifier (e.g. cbfstool/cbfs.h's `unused` array of file types). - Remove libpayload's own copy of compiler.h and make it directly pull in the commonlib/bsd copy. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I9644da594bb69133843c6b7f12ce50b2e45fd24b Reviewed-on: https://review.coreboot.org/c/coreboot/+/64737 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
* payloads/external: Add support for coreDOOM payloadNicholas Chin2022-05-287-0/+100
| | | | | | | | | | | | | | | | | | coreDOOM is a port of DOOM to libpayload, based on the doomgeneric source port. It renders the game to the coreboot linear framebuffer, and loads WAD files from CBFS. Tested with QEMU i440fx/q35 and a Dell Latitude E6400 using the libgfxinit provided linear framebuffer. Project page: https://github.com/nic3-14159/coreDOOM Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> Change-Id: Ice0403b003a4b2717afee585f28303c2f5abea5d Reviewed-on: https://review.coreboot.org/c/coreboot/+/57222 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
* payloads/tianocore: Fix unclean working directory detectionNicholas Chin2022-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit ae48b42683 (payloads/tianocore: Init submodules), Tianocore's Makefile no longer detects an unclean working directory and thus always performs a `git checkout`, overwriting any uncommited changes made in the cloned sources. The change of "clean" to "dirty" effectively inverts the logic of the if-else condition, which would normally swap the two possible code paths of the branch. However, since `git status` outputs multiple lines, most of which do not contain "clean", the -v option (select non-matching lines) causes grep to always match at least 1 line and thus return success. This causes the if-else branch containing the `git checkout` to always be taken regardless of the state of the working tree, masking the issue of the inverted logic. Removing the -v option addresses both of these issues and restores the intended behavior of the if-else block. TEST: 1) Build coreboot successfully with the Tianocore UefiPayloadPkg option. 2) Make a change in the cloned Tianocore sources that results in an unclean working directory and check for the "Working directory not clean" message when building coreboot. Change-Id: Icd4952b40c147d0fba676089ced5a8b59b93ad50 Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64608 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
* payloads/external: Add more option related to SeaBIOS and GRUB2Bill XIE2022-05-247-13/+104
| | | | | | | | | | | | | | | | | | | Also known as "SeaGRUB", running GRUB2 atop SeaBIOS proves to be a useful configuration, since SeaBIOS has improved its hardware compatibility. For example, some USB drive can work under SeaBIOS but do not work under native GRUB2, and GRUB2 can use BIOS call (provided by SeaBIOS) as a fallback method to access hardware if it is present. But more option is added addition to "SeaGRUB": now GRUB2 and SeaBIOS can be built as secondary payloads, and "SeaGRUB" is now implemented as "Primary SeaBIOS + Secondary GRUB2 (selected) + config files". Signed-off-by: Bill XIE <persmule@hardenedlinux.org> Change-Id: Ie681fa231abfe4a8f1e4510b3c17957550a9d2f8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/60640 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
* libpayload/pci: Add pci_map_bus function for MediaTek platformJianjun Wang2022-05-203-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'pci_map_bus' function and PCIE_MEDIATEK config for MediaTek platform. TEST=Build pass and boot up to kernel successfully via SSD on Dojo board, here is the SSD information in boot log: == NVME IDENTIFY CONTROLLER DATA == PCI VID : 0x15b7 PCI SSVID : 0x15b7 SN : 21517J440114 MN : WDC PC SN530 SDBPTPZ-256G-1006 RAB : 0x4 AERL : 0x7 SQES : 0x66 CQES : 0x44 NN : 0x1 Identified NVMe model WDC PC SN530 SDBPTPZ-256G-1006 BUG=b:178565024 BRANCH=cherry Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com> Change-Id: I9ea7d111fed6b816fa2352fe93c268116519a577 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56794 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* libpayload/pci: Add support for bus mappingJianjun Wang2022-05-206-45/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the common APIs to pci_ops.c and IO based operations to pci_io_ops.c, and add pci_map_bus_ops.c to support bus mapping. TEST=Build pass and boot up to kernel successfully via SSD on Dojo board, here is the SSD information in boot log: == NVME IDENTIFY CONTROLLER DATA == PCI VID : 0x15b7 PCI SSVID : 0x15b7 SN : 21517J440114 MN : WDC PC SN530 SDBPTPZ-256G-1006 RAB : 0x4 AERL : 0x7 SQES : 0x66 CQES : 0x44 NN : 0x1 Identified NVMe model WDC PC SN530 SDBPTPZ-256G-1006 BUG=b:178565024 BRANCH=cherry Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com> Change-Id: Ie74801bd4f3de51cbb574e86cd9bb09931152554 Reviewed-on: https://review.coreboot.org/c/coreboot/+/56789 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* coreboot_tables: Add PCIe info to coreboot tableJianjun Wang2022-05-193-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add 'lb_fill_pcie' function to pass PCIe information from coreboot to libpayload, and add CB_ERR_NOT_IMPLEMENTED to the cb_err enum for the __weak function. ARM platform usually does not have common address for PCIe to access the configuration space of devices. Therefore, new API is added to pass the base address of PCIe controller for payloads to access PCIe devices. TEST=Build pass and boot up to kernel successfully via SSD on Dojo board, here is the SSD information in boot log: == NVME IDENTIFY CONTROLLER DATA == PCI VID : 0x15b7 PCI SSVID : 0x15b7 SN : 21517J440114 MN : WDC PC SN530 SDBPTPZ-256G-1006 RAB : 0x4 AERL : 0x7 SQES : 0x66 CQES : 0x44 NN : 0x1 Identified NVMe model WDC PC SN530 SDBPTPZ-256G-1006 BUG=b:178565024 BRANCH=cherry Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com> Change-Id: I6cdce21efc66aa441ec077e6fc1d5d1c6a9aafb0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63251 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Shelley Chen <shchen@google.com>
* libpayload: Fix guards in include/{arm,arm64,x86}/arch/barrier.hDavid Hendricks2022-05-163-3/+3
| | | | | | | | | Change-Id: Ib4897c4f5837f7f3173d5062eecb893adbe36964 Signed-off-by: David Hendricks <david.hendricks@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64365 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* payloads/coreinfo/coreboot_module.c: Remove 'break' after 'return'Elyes Haouas2022-05-161-1/+0
| | | | | | | | Change-Id: Icb60115349ef7c4c35635021784138d45c5a8872 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61954 Reviewed-by: Martin L Roth <gaumless@tutanota.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/nvramcui/nvramcui.c: Reformat codeElyes Haouas2022-05-161-23/+12
| | | | | | | | Change-Id: If5b4ae7d9f9046e56ca098c0469b503130bc8707 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/61955 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@tutanota.com>
* libpayload/nvme: Fix controller disablement in (de)init sequenceNico Huber2022-05-111-2/+2
| | | | | | | | | | | | | | | We wrote to the wrong register. The EN bit is in the CC (Controller Configuration) register at 0x14. Fixes re-initialization in QEMU and on siemens/chili during a second FILO run. Change-Id: I125de55d7f1a7c9f070437190c5a08a288b274f8 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63935 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* libpayload/nvme: Test for NVMe-command-set bit individuallyNico Huber2022-05-111-1/+1
| | | | | | | | | | | | | | We only need to know if the NVMe command set is supported. Other command-set bits can be set too, but we don't have to care. Fixes init in QEMU which has more command-set bits set by now. Change-Id: I29a693cf8cc13775e94dc671e8d0412ad86fef9c Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63934 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* libpayload/nvme: Fix error paths of nvme_init()Nico Huber2022-05-111-11/+12
| | | | | | | | | | | | | | We mustn't try to release resources that we haven't acquired yet. Also, sending commands to the NVMe device is futile if we already timed out. Fixes hangs after a failed init noticed in QEMU and on siemens/chili. Change-Id: Ib83c7785d6e0dc3c44fbd50a30694c74932750d6 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63933 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>