summaryrefslogtreecommitdiffstats
path: root/payloads
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Move list.h to commonlibMaximilian Brune2024-02-242-0/+6
| | | | | | | | | | | It is needed in order to move device_tree.c into commonlib in a subsequent commit. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I16eb7b743fb1d36301f0eda563a62364e7a9cfec Reviewed-on: https://review.coreboot.org/c/coreboot/+/77968 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* vboot: Enable new arm64 SIMD crypto accelerationJulius Werner2024-02-242-0/+13
| | | | | | | | | | | | | | | | This patch passes the correct flag to vboot to enable SIMD crypto acceleration on arm64 devices. This uses a core part of the ISA and should thus be supported on all arm64 SoCs -- so we normally always want it enabled, but there should still be a Kconfig in case a SoC wants to use the hwcrypto interface for its own (off-CPU) crypto acceleration engine instead. (You could also disable it to save a small amount of code size at the cost of speed, if necessary.) Change-Id: I3820bd6b7505202b7edb6768385ce5deb18777a4 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80710 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* libpayload: Remove legacy CBFS APIJulius Werner2024-02-2218-1268/+0
| | | | | | | | | | | | | | | It's been several years already since we announced the deprecation of the legacy CBFS API for payloads. It's time to remove it completely. Change-Id: I0ed157ac2d1376b8dff4537af9a63731064b45f6 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80650 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Jakub Czapiga <czapiga@google.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
* payloads: Add SPDX headers to KconfigMartin Roth2024-02-1823-0/+46
| | | | | | | | | Change-Id: Iea569fd457b3cd1f4746fbc6a96319eb42733a6b Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80586 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
* Treewide: Fix incorrect SPDX license stringsMartin Roth2024-02-181-1/+1
| | | | | | | | | | | These strings didn't match the license names exactly, so update them to match. Change-Id: Ib946eb15ca5fa64cbd6b657350b989b4a4c1b7b7 Signed-off-by: Martin Roth <gaumless@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80583 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
* libpayload: timer: Revert timer_hz() return type to 64-bitsJulius Werner2024-02-085-10/+8
| | | | | | | | | | | | | | | | | | It seems that reducing the return type of timer_hz() to uint32_t in CB:78888 was a bad idea... some Intel platforms actually use their raw CPU clock for the timestamp counter which can be higher than 4GHz. This patch reverts it back to uint64_t. Also remove the redundant assertion in timer/generic.c since timer_us() itself already does that check. Cq-Depend: chromium:5274555 Change-Id: I471c7de7a28aec5bb965b23525ed579481ac8361 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80320 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Yidi Lin <yidilin@google.com>
* commonlib: Change GCD function to always use 64 bitsJulius Werner2024-02-082-2/+2
| | | | | | | | | | | | | | | | | | | | It seems that we have some applications where we need to calculate a GCD in 64 bits. Now, we could instantiate the algorithm multiple times for different bit width combinations to be able to use the most efficient one for each problem... but considering that the function usually only gets called once per callsite per stage, and that software emulation of 64-bit division on 32-bit systems doesn't take *that* long either, we would probably usually be paying more time loading the second instance of the function than we save with faster divisions. So let's just make things easy and always do it in 64-bit and then nobody has to spend time thinking on which version to call. Change-Id: I028361444c4048a0d76ba4f80c7334a9d9983c87 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80319 Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yidi Lin <yidilin@google.com>
* libpayload: Switch to commonlib ipchksum() algorithmJulius Werner2024-02-025-94/+4
| | | | | | | | | | | | | This patch moves libpayload over to the commonlib implementation for calculating the IP checksum. Change-Id: Ie8d323ce9f8d946758619761b4b22d54bce222b6 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80253 Reviewed-by: Jakub Czapiga <czapiga@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Yidi Lin <yidilin@google.com>
* payloads/Kconfig: Make flat-binary configurableMaximilian Brune2024-01-261-2/+3
| | | | | | | | | | | | | | | | | | This adds the ability to add a flat-binary using menuconfig. Test: boot hifive-unmatched mainboard with the following config: CONFIG_PAYLOAD_NONE=n CONFIG_PAYLOAD_ELF=y CONFIG_PAYLOAD_FILE="~/repos/linux-riscv/arch/riscv/boot/Image" CONFIG_PAYLOAD_IS_FLAT_BINARY=y CONFIG_PAYLOAD_OPTIONS="-l 0x82000000 -e 0x82000000" CONFIG_COMPRESSED_PAYLOAD_LZMA=y Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I48c6b53a0c9f5b173c89f1a294a0c37fa1a58f31 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79950 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads: Rename Makefiles from .inc to .mkMartin Roth2024-01-2421-7/+7
| | | | | | | | | | | | | | | | The .inc suffix is confusing to various tools as it's not specific to Makefiles. This means that editors don't recognize the files, and don't open them with highlighting and any other specific editor functionality. This issue is also seen in the release notes generation script where Makefiles get renamed before running cloc. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: Ie7038712de8cc646632d5e7d29550e3260bf2c62 Reviewed-on: https://review.coreboot.org/c/coreboot/+/80103 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* Makefiles: Rename top-level Makefiles from .inc to .mkMartin Roth2024-01-243-3/+3
| | | | | | | | | | | | | | | | | | | The .inc suffix is confusing to various tools as it's not specific to Makefiles. This means that editors don't recognize the files, and don't open them with highlighting and any other specific editor functionality. This issue is also seen in the release notes generation script where Makefiles get renamed before running cloc. The rest of the Makefiles will be renamed in following commits. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: Idaf69c6871d0bc1ee5e2e53157b8631c55eb3db9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/80063 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* libpayload/arch/arm64/mmu: Specify ttb_buffer section name explicitlyYu-Ping Wu2024-01-221-4/+7
| | | | | | | | | | | | | | Although a section ".bss.ttb_buffer" is created automatically for 'ttb_buffer' with the GCC option '-fdata-sections', specify the section name explicitly to make the name stand out to code readers, and to reduce the chance of accidentally changing the section name by renaming the variable. Change-Id: I2930f238f63b555c4caa65709768afa314d9cf87 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80014 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* payload/grub2: Update from 2.06 to 2.12Felix Singer2024-01-212-3/+3
| | | | | | | | Change-Id: I267d341075b907ac72439cf28c2c1458cbeb8d4b Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80019 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
* payload/seabios: Update from 1.16.2 to 1.16.3Felix Singer2024-01-212-2/+2
| | | | | | | | Change-Id: Idfe479272abf2db93f8fc4bc1ba02d8b8072fcfe Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80018 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
* libpayload/vboot/Makefile.inc: Pass FIRMWARE_ARCH=mock if LP_ARCH_MOCKYu-Ping Wu2024-01-181-8/+11
| | | | | | | | | | | | | | | | If CONFIG_LP_ARCH_MOCK, pass FIRMWARE_ARCH=mock when building vboot fwlib, so that vboot's Makefile will append the correct flags to CFLAGS. BUG=none TEST=(depthcharge) make unit-tests -j BRANCH=none Cq-Depend: chromium:5182247 Change-Id: I9ead7f2f93eac5f5c3887074423fb9aa50a489c0 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79956 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Make sure to install into the right DESTDIRNico Huber2024-01-141-2/+2
| | | | | | | | | | | | | | A recent update broke installation of commonlib headers with a relative path in $(DESTDIR), which is the default. Make sure to install into the right location in case we changed the current directory. Change-Id: I61fa4aa0ecd0f81ee03ff89183e1b65e7875dea6 Signed-off-by: Nico Huber <nico.h@gmx.de> Fixes: ee53dfd07d3b (libpayload: Remove shell for loops in install Makefile target) Reviewed-on: https://review.coreboot.org/c/coreboot/+/79908 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Move back the ttb_buffer sectionYi Chou2024-01-112-4/+5
| | | | | | | | | | | | | | | | | | Moving it into the .ttb_buffer section will accidentally set the LOAD flag. So, move it back to .bss.ttb_buffer section to prevent the binary size bloating. BUG=b:248610274 TEST=Make sure the device is still bootable with this change. BRANCH=none Cq-Depend: chromium:5173448 Change-Id: I9bb08878dd4be01d9ed3f96933f774dd6296f76e Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79800 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Remove shell for loops in install Makefile targetPatrick Georgi2023-12-311-12/+5
| | | | | | | | | | | | | They always require special care so that line breaks and variable names are escaped properly. One loop can be removed entirely because install accepts multiple files to install in a target directories, the other loops were filled by find which can just call the commands on its own. Change-Id: I9f9dddfe3f3ceceb6a0510d6dd862351e4b10210 Signed-off-by: Patrick Georgi <patrick@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79523 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Add VBOOT_X86_RSA_ACCELERATION configJeremy Compostella2023-12-282-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `VBOOT_X86_RSA_ACCELERATION' Kconfig option to enable SSE2 instruction set implementation of modulus exponentiation which is part of the RSA signature verification process. This option is enabled on CHROMEOS. | modpow() function call | original on rex0 | SSE2 on rex0 | |------------------------+------------------+--------------| | depthcharge - step 1 | 0.547 | 0.288 | | depthcharge - step 2 | 0.152 | 0.081 | | depthcharge - step 3 | 0.164 | 0.079 | |------------------------+------------------+--------------| | Total (ms) | 0.863 | 0.448 | | modpow() function call | original on brya0 | SSE2 on rex0 | |------------------------+-------------------+--------------| | depthcharge - step 1 | 0.693 | 0.248 | | depthcharge - step 2 | 0.172 | 0.065 | | depthcharge - step 3 | 0.223 | 0.067 | |------------------------+-------------------+--------------| | Total (ms) | 1.088 | 0.38 | BUG=b:312709384 TEST=modular exponentiation is about twice faster on rex0 and brya0 Change-Id: I801ebd7839261c6bd07fb218e1e36a7108e219bf Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79290 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* treewide: Use show_notices target for warningsMartin Roth2023-12-201-1/+1
| | | | | | | | | | | This updates all warnings currently being printed under the files_added and build_complete targets to the show_notices target. Signed-off-by: Martin Roth <gaumless@gmail.com> Change-Id: Ia14d790dd377f2892f047059b6d24e5b5c5ea823 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79423 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload/arm64: Round fb_size up to a multiple of GRANULE_SIZEYidi Lin2023-12-111-2/+3
| | | | | | | | | | | | | If a framebuffer is already configured by coreboot, we need to ensure that the framebuffer size is a multiple of GRANULE_SIZE before passing to `mmu_add_memrange`. Otherwise, we would fail to allocate memory region due to `sanity_check`. Change-Id: Ia6a6400733ca10a61220087e87022f68c28e4789 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79451 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Fix the stack and data labelsYi Chou2023-12-016-15/+33
| | | | | | | | | | | | | | | | | We should make sure _stack/_estack and the other labels are consistent. And _data & _edata is also useful to clean up the sensitive data on the data section. BUG=b:248610274 TEST=emerge-cherry libpayload BRANCH=none Cq-Depend: chromium:5052462 Change-Id: I589040f4db60b35813ea9f4ba9503244bd7def00 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79144 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* libpayload/unit-tests: Rename ARCH_BIG_ENDIAN to ARCH_MOCK_BIG_ENDIANPatrick Georgi2023-11-251-1/+1
| | | | | | | | | | | | This fixes commit 12ae850dfc1 which used the wrong symbol, and previous versions of Kconfig didn't notice. Change-Id: I7145fd81a30a1455a6dd2c7f24564956a116d180 Signed-off-by: Patrick Georgi <patrick@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79263 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Move ttb_buffer to a standalone sectionYi Chou2023-11-232-1/+4
| | | | | | | | | | | | | | | | When cleaning the sensitive data in the memory, we will want to prevent zero out the content of tbb_buffer. Move the ttb_buffer to a standalone section will simplify the problem. BUG=b:248610274 TEST=emerge-cherry libpayload BRANCH=none Change-Id: I610276cbe30552263d791860c15e5ad9a201c744 Signed-off-by: Yi Chou <yich@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79078 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Add dma_allocator_range()Yi Chou2023-11-212-0/+13
| | | | | | | | | | | | | | | | | | | Some sensitive data may remain DMA buffer, we will want to zero out everything on the DMA buffer before we jump into the kernel to prevent leaking sensitive data into the kernel. To accomplish that, we will need this function to get the range of memory that can be allocated by the dma allocator. BUG=b:248610274 TEST=emerge-cherry libpayload BRANCH=none Signed-off-by: Yi Chou <yich@google.com> Change-Id: I8f3058dfd861ed44f716623967201b8cabe8d166 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78407 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* payloads/ipxe: Prefix iPXE options with "IPXE" instead "PXE"Felix Singer2023-11-113-18/+18
| | | | | | | | Change-Id: Ieef433e9d6745c6243b4823c9a7f250d3c53ebcb Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78926 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/ipxe/Kconfig: Properly guard iPXE optionsFelix Singer2023-11-111-24/+24
| | | | | | | | | | | | | | Guard multiple options depending on another with an if-block. It's not needed to repeat the condition for every option. This also cleans up the ordering of the options and groups all options related to iPXE. Change-Id: I9e74ab567f619a2d5c20c6c0282b37193d9ac01b Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78925 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Remove the warning about edk2/master not workingSean Rhodes2023-11-081-1/+3
| | | | | | | | | | | Since #c4fdec0a83d69bd0399b1b4351fa9c3af3c6fd65, edk2/master will work with coreboot without modification. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I8350f5114445d2608861ef6e807f958e598dfe07 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78636 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
* libpayload/libc/time: Fix possible overflow in multiplicationYidi Lin2023-11-075-9/+16
| | | | | | | | | | | | | | | | | | | | The value from raw_read_cntfrq_el0() could be large enough to cause overflow when multiplied by USECS_PER_SEC. To prevent this, both USECS_PER_SEC and hz can be reduced by dividing them by their GCD. This patch also modifies the return type of `timer_hz()` from `uint64_t` to `uint32_t`, assuming that in practice the timestamp counter should never be that fast. BUG=b:307790895 TEST=boot to kernel and check the timestamps from `cbmem` Change-Id: Ia55532490651fcf47128b83a8554751f050bcc89 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78888 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/ipxe/Makefile: Use sed more properlyFelix Singer2023-11-061-10/+6
| | | | | | | | | | | | | Instead of redirecting the output of sed into a temporary file and copying it to its target then, just tell sed to do the replacements in-place and don't let it create a backup of the original file. The overhead is not needed. Change-Id: I442616cd78098b653af5bd49bc7a4f021c99e081 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78924 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com>
* libpayload/libc/getopt_long: Use common GCDYidi Lin2023-11-042-20/+3
| | | | | | | | | | | TEST=emerge-geralt libpayload Change-Id: Ib9dd1d2f658d4411c36d0198774819690686a393 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78887 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/LinuxBoot: Add uImage to clean targetArthur Heymans2023-10-281-0/+1
| | | | | | | | | | | uImages are generated for non-x86 arch. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: Icb1184497087d66a7cc6fd27402365a028cc4eaf Reviewed-on: https://review.coreboot.org/c/coreboot/+/78643 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
* {commonlib, libpayload}: Add "has_external_display" in coreboot tableSubrata Banik2023-10-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a new coreboot table entry named "has_external_display" to understand if external display is attached. This information is useful to prevent graceful shutdown by payload when the LID is closed but an external display is present. This piece of the information will be gathered by coreboot and passed into the payload using this new entry aka external_display because payload (i.e., deptcharge) doesn't have any other way to determine if external display is available. BUG=b:299137940 TEST=Able to build and boot google/rex. w/o this patch: LID closed and external display attached (HDMI) in developer mode (GBB 0x39): > System is powered off by depthcharge w/ this patch: LID closed and external display attached (HDMI) in developer mode (GBB 0x39): > Booted to OS and device is alive/usable Change-Id: I0fa7eee4c5a50371a7a66c6ca1ac2c7d046d010b Signed-off-by: Subrata Banik <subratabanik@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77796 Reviewed-by: Eric Lai <ericllai@google.com> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Update default branch for MrChromebox repo to 2023-09Matt DeVillier2023-09-291-1/+1
| | | | | | | | | | | | | | | | | Update the default branch used for MrChromebox's edk2 fork from 2023-06 to 2023-09. This updated branch has been rebased on the latest upstream stable tag (edk2-stable202308), and fixes some USB detection issues, as well the coreboot Kconfig for prefering internal or external boot devices. TEST=build/boot google boards link, panther, lulu,reef, ampton, akemi, banshee, zork, frostflow with edk2 payload selected. Change-Id: I7c5f9ae1ca4edd8211f55f4ecf2b3b495f473a43 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78136 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* payloads/edk2: Move TPM disable to separate KconfigMatt DeVillier2023-09-293-2/+9
| | | | | | | | | | | | | | | | | | Disabling TPM support in edk2 can actually cause problems booting from USB on some Intel-based boards with a CR50 TPM when using the edk2 GOP driver option, so rather than disable the TPM for all CR50 boards, restrict the default to only AMD boards, where the boot hang with TPM enabled was originally observed. TEST=build/boot Win11, Linux from usb on google/fizz when built with edk2 payload and edk2 GOP driver option selected. Change-Id: I01509fea2dd42b741c00abcf9fb8b936e895b932 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78031 Reviewed-by: Sean Rhodes <sean@starlabs.systems> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* payloads/edk2/Makefile: Improve dirty repo check, sync submodulesMatt DeVillier2023-09-261-1/+2
| | | | | | | | | | | | | | | | | | Don't skip checking out the specified edk2 branch if the repo contains untracked files, which may be the case if the EDK2_GOP_DRIVER option is selected. Also ensure the submodule pointers are correct when checking out. TEST=build google/panther with GOP driver option and edk2 payload 2x, switching branches between builds and ensure the correct branch is used each time and submodules are synced with branch. Change-Id: If7040bd5c49209b37a4b308485bf59352197d3b6 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78030 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* payloads/edk2: Guard MrChromebox's build optionsSean Rhodes2023-09-262-10/+24
| | | | | | | | | | | | Several of the build commands passed by the Makefile only exist in MrChromebox's fork of edk2. Guard these, and the corresponding Kconfig options, against the selection of the MrChromebox repository. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I41d8d54e5b91990dd9fb88967fcd549a86cf6fe9 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78036 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload/libcbfs: Add VBOOT_CBFS_INTEGRATION supportJakub Czapiga2023-09-182-1/+11
| | | | | | | | | | | | | | | | If LP_VBOOT_CBFS_INTEGRATION is enabled, then libcbfs will reboot with vboot failure in non-recovery mode on CBFS file hash mismatch. BUg=b:197114807 TEST=Build with VBOOT_CBFS_INTEGRATION enabled and boot on google/ovis4es device Change-Id: Ic0f62212b7217b384e8c4cbd9535fe4243301f8c Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77726 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Add vboot and reboot utility functionsJakub Czapiga2023-09-184-0/+36
| | | | | | | | | | | | | | | | | | | | | Patch adds: - vboot_fail_and_reboot() for vboot failures handling. - reboot() weak implementation for payloads to implement, used by vboot_fail_and_reboot(). - vboot_recovery_mode_enabled() to check if recovery mode flag is set in vboot context. Implemented for future libcbfs implementation of VBOOT_CBFS_INTEGRATION in libpayload. BUG=b:197114807 TEST=none Change-Id: I53d1955573d54bc56d05f7780c18dcc8ac1fd399 Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77725 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
* libpayload/vboot: Add vboot context initialization and management codeJakub Czapiga2023-09-185-1/+58
| | | | | | | | | | | | | | | | | | | | | | To fully and easily implement fallback/recovery in libcbfs with vboot support the codebase requires access to vboot context. Moving context management to libpayload allows to avoid unnecessary overhead and code complication and still allows payloads to access it in a way it was designed. Access to this codebase will also allow implementation of e.g. vboot_fail_and_reboot() and other helpful utilities used by coreboot and depthcharge. BUG=b:197114807 TEST=make unit-tests TEST=Build and boot on google/ovis4es with CL:4839296 and VBOOT_CBFS_INTEGRATION enabled Change-Id: Id719be7c4f07251201424b7dc6c1125c6b5756d8 Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77635 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* libpayload/drivers/video: Add cursor movement support in consoleEran Mitrani2023-09-182-0/+8
| | | | | | | | | | | | | | Add support for moving the console cursor horizontally and vertically. BUG=b:300405745 TEST=Tested using firmware shell on Rex. Signed-off-by: Eran Mitrani <mitrani@google.com> Change-Id: I585add120b559396bc0e28aa972b0ae2a33f1fa8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77900 Reviewed-by: Kapil Porwal <kapilporwal@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
* LinuxBoot/Makefile: Add check if initramfs needs to be builtFrans Hendriks2023-09-071-0/+4
| | | | | | | | | | | | | | | initramfs is built always, ignoring CONFIG_LINUXBOOT_BUILD_INITRAMFS Built initramfs only is CONFIG_LINUXBOOT_BUILD_INITRAMFS is set BUG = N/A TEST = Built and boot facebook monolith Change-Id: I0d575ff7528fceb06b5394642527713bb071c8b3 Signed-off-by: Frans Hendriks <fhendriks@eltan.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77607 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Add after an if conditional on the next lineArthur Heymans2023-09-071-8/+16
| | | | | | | | | | Clang warns about this. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: I8bdd45a7ef47274b0253397fa8fd9409a70d2192 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77434 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com>
* payloads/libpayload: Don't use old style function definitionElyes Haouas2023-08-281-1/+1
| | | | | | | | | | Use "int foo(void)" instead of old-style "int foo()". Change-Id: Ic698dbbba74d579a21ff57005a7aa9bb8ce80253 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77485 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Fix clang fallthrough warningArthur Heymans2023-08-284-5/+7
| | | | | | | | | | | | | Clang does not recognize comments to indicate falltrough is intended behavior. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: Idcf7a24fc763b80863902702172b4ea950e132b8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77431 Reviewed-by: Martin L Roth <gaumless@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
* libpayload: Skip unknown arguments to clangArthur Heymans2023-08-261-0/+2
| | | | | | | | | | This compiler argument only exists on gcc. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: I10902517c86daedc9853e6f6cac8fcf513211bb2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77436 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Remove unnecessary bracketsArthur Heymans2023-08-261-1/+1
| | | | | | | | | | This fixes compilation with clang. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: I675056c8a15fe446bba81a144bfea64d106df293 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77435 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Fix untyped function argumentsArthur Heymans2023-08-261-1/+1
| | | | | | | | | | This is necessary with clang. Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Change-Id: Icc197fbd48b49bfa8770caf01727669b0ac59090 Reviewed-on: https://review.coreboot.org/c/coreboot/+/77433 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
* payloads/U-Boot: Use github mirror and latest versionSimon Glass2023-08-262-2/+2
| | | | | | | | | | | | | | | | | | Update the U-Boot version to the latest release. Also switch to github since it is typically much faster to download than the existing URL. Drop the 'experimental' tag since this payload is pretty stable. It is also tested regularly in U-Boot's CI. Change-Id: I082130539c3474593a82e4b21cb995380f4db168 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77149 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77463 Reviewed-by: Patrick Georgi <patrick@coreboot.org> Tested-by: Patrick Georgi <patrick@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
* payloads/external/LinuxBoot: Fix bootPatrick Rudolph2023-08-251-2/+2
| | | | | | | | | | | | | | | Fix regression introduced in I25e757108e0dd473969fe5a192ad0733f1fe6286 "payloads/external/LinuxBoot: Clean up". Include the initrd into the payload. Allows to actually use LinuxBoot. Change-Id: I5ab6b1a43a4100e83f4c188b9ea3451ab7b4ffe5 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77412 Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>