summaryrefslogtreecommitdiffstats
path: root/payloads
Commit message (Collapse)AuthorAgeFilesLines
* libpayload: strings.h: Use builtin __ffs instead of included oneThomas Heijligen2023-03-071-3/+1
| | | | | | | | | Change-Id: Ie4d0b1b19ce6524341449df8bfabc66bff7bd97e Signed-off-by: Thomas Heijligen <src@posteo.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70118 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* libpayload: bin/lpgcc allow to call without filesThomas Heijligen2023-03-071-1/+1
| | | | | | | | | | | | | | | When building libflashrom ontop of libpayload, meson calls the lpgcc wrapper with -xc but without a file to obtain information about the C compiler. To make this work guard $_LIBGCC with -xnone in the lpgcc wrapper. -xnone tells the compiler to interpret the following files of libpayload by their suffix, not the privious given -x option. Change-Id: I9e037ff44c0a6d0585d8a6f8aeabae6e651142e2 Signed-off-by: Thomas Heijligen <src@posteo.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70117 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* libpayload: Use __func__ instead of old __FUNCTION__Elyes Haouas2023-02-173-4/+4
| | | | | | | | Change-Id: Ic3c22ac101a2ff44f97b2ac3fe3c0a89391718de Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72380 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* payloads/Yabits: Remove deprecated Yabits PayloadElias Souza2023-02-175-126/+0
| | | | | | | | | | | | | Yabits is no longer maintained and git repo is archived. Yabits has not been maintained for a long time, the project is apparently closed. Change-Id: Ida0bb79342448510d2c309339fabbe8066eca73c Signed-off-by: Elias Souza <eliascontato@protonmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72463 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
* commonlib/bsd, libpayload: Do not include helpers.h in stddef.hThomas Heijligen2023-02-162-6/+5
| | | | | | | | | | | | `stddef.h` should only provide the definitions defined by ISO or Posix. The included `commonlib/bsd/helpers.h` provide a lot of non standard definitions that may interfere with definitions from the application. Change-Id: Ia71edbc3ffe6694ff4b971decf3a41f915264bc8 Signed-off-by: Thomas Heijligen <src@posteo.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70116 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload/string: add strndup() functionThomas Heijligen2023-02-162-0/+20
| | | | | | | | Change-Id: Ie509e49f21fb537692704ac6527efa09649164e3 Signed-off-by: Thomas Heijligen <src@posteo.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70115 Reviewed-by: Jakub Czapiga <jacz@semihalf.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Add VBOOT_SHA_ARMV8_CE configYidi Lin2023-02-162-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add Kconfig option for VBOOT_SHA_ARMV8_CE, which will use ARMv8 Crypto Extension for SHA256[1] instead of software implementation. [1] https://crrev.com/c/4170144 BUG=b:263514393 BRANCH=corsola TEST='vboot kernel verification' gets 111 msecs improvement on Tentacruel. Before: 1100:finished vboot kernel verification 905,150 (123,518) After: 1100:finished vboot kernel verification 787,277 (12,254) Cq-Depend: chromium:4170144, chromium:4242678 Change-Id: If92830830a0658dfad2a066e9efa624783865cf2 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72710 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
* payloads/external/LinuxBoot: Update u-root releases in Kconfigeliassouza2023-01-301-0/+16
| | | | | | | | | | | Building LinuxBoot with u-root newers releases can providing a better experience, Change-Id: Ie98f434c5296b7ba7c3750a766b244c747421baa Signed-off-by: eliassouza <eliascontato@protonmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72465 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/U-boot: Fix U-Boot cloning erroreliassouza2023-01-271-1/+1
| | | | | | | | | | | Renaming origin/master to just master fix error during cloning repo. Error: Remote branch origin/master not found in upstream origin Change-Id: Ib5d4bb0277076842f8a8400eb61da9ad23465b66 Signed-off-by: eliassouza <eliascontato@protonmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72464 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
* payloads/*/Kconfig.name: update documentation linkEvgeny Zinoviev2023-01-177-8/+8
| | | | | | | | | | | | | | | Old wiki is outdated for years but Kconfig help messages of some payloads still reference it. This commit changes those links to the corresponding page at doc.coreboot.org. Change-Id: I81653f1b010d8a3ac4dfc4c6ad4fa714ce5d59a1 Signed-off-by: Evgeny Zinoviev <me@ch1p.io> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71897 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
* payloads: Update GRUB2 stable version from 2.04 to 2.06Paul Menzel2023-01-042-3/+3
| | | | | | | | | | | | | GRUB2 was released on June 8th, 2021 [1]. [1]: https://lists.gnu.org/archive/html/grub-devel/2021-06/msg00022.html Change-Id: I050a78c769c3cd4c9ae627c7e3124a4894a018d7 Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/55343 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
* payloads/libpayload/arch/x86/rom_media.c: Change log level messageElyes Haouas2022-12-221-1/+1
| | | | | | | | | | | Move a warning message from BIOS_INFO to BIOS_WARNING log level. Change-Id: I4210901a183b54e47fa62a6146ce754c544aab2c Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71157 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
* payloads/seabios: Update stable from 1.16.0 to 1.16.1Elyes Haouas2022-12-212-2/+2
| | | | | | | | | | | | | Short summary: - virtio-blk.{mmio,pci} and virtio-scsi.{mmio,pci} improved. - Several fixes and code refactor pci_config_*() functions. - Improved AML parsing. Change-Id: I04b35d006a2bcd1621e28ac2f1b12b9af99b7552 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/71064 Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Fix compiler warningsThomas Heijligen2022-11-212-2/+2
| | | | | | | | | | | | | | | | | | | | | Following warnings occur when compiling with `i386-elf-gcc (coreboot toolchain v2022-09-18_c8870b1334) 11.2.0` drivers/serial/8250.c:75: [-Werror=unused-variable] Move variable declaration inside the `#if !CONFIG(LP_PL011_SERIAL_CONSOLE)` block drivers/udc/dwc2.c:505: [-Werror=format=] use `%zd` to match type `size_t` Change-Id: Id285c24cba790f181fa203f3117e5df35bed27c4 Signed-off-by: Thomas Heijligen <src@posteo.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/69764 Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Felix Singer <felixsinger@posteo.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* payloads: Make PAYLOAD_NONE a bool outside of the choiceMartin Roth2022-11-041-10/+11
| | | | | | | | | | | | | | Instead of having the config option PAYLOADS_NONE inside the choice of payloads, make that a separate choice that enables the payload menu. If the no_payload option is selected, this hides the other options and keeps them out of the saved config file and config.h Signed-off-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Change-Id: I932c65630261a5b39809abf4dfbda5bf932c6684 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68595 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
* payloads/grub: Work around entry point issueArthur Heymans2022-11-021-1/+1
| | | | | | | | | | | | | | | | | | | | With -Os grub-mkimage does not create an elf with the correct entry point because some parts of the elf images are placed in .text.unlikely. The linker does not know where to place that and places it below .text, hence messing up the entry point. To avoid this use the compiler flag -fno-reorder-functions. Change-Id: Ic4a12f45d30b781870faa38575e8b2c10e0a42e8 Resolves: https://ticket.coreboot.org/issues/343 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64235 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Hackware <human@hackware.cl> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/LinuxBoot: Fix Linuxboot kernel fetching for v6.xArthur Heymans2022-10-261-0/+2
| | | | | | | | Change-Id: Ic1d407eab8ec4569e02729afb5c71f39ce174401 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/68815 Reviewed-by: Christian Walter <christian.walter@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* coreboot_tables: Drop uart PCI addrArthur Heymans2022-10-261-8/+0
| | | | | | | | | | | | | | | Only edk2 used this to fill in a different struct but even there the entries go unused, so removing this struct element from coreboot has no side effects. Change-Id: Iadd2678c4e01d30471eac43017392d256adda341 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/68767 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Bill XIE <persmule@hardenedlinux.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Add the declaration for OBJCOPYSean Rhodes2022-10-251-0/+2
| | | | | | | | | | | The Shimlayer recipe requires OBJCOPY, so declare it at the top of the Makefile so this recipe works as intended. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I2e04dfe18df6252261836dcdf98f7e8de65287b5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68744 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Disable the CPU Timer Lib unless supportedSean Rhodes2022-10-223-0/+24
| | | | | | | | | | | | | | | | | | For recent X86 CPUs, the 0x15 CPUID instruction will return Time Stamp Counter Frequence. For CPUs that do not support this instruction, EDK2 must include a different library which is the reason why this must be configured at build time. If this is enabled, and the CPU doesn't support 0x15, it will fail to boot. If is not enabled, and the CPU does support 0x15, it will still boot but without support for the leaf. Consequently, disabled it by default. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I4f0f43ce50c4f6f7eb03063fff34d015468f6daa Reviewed-on: https://review.coreboot.org/c/coreboot/+/65950 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Add the recipes to assemble UniversalPayloadSean Rhodes2022-10-222-1/+44
| | | | | | | | Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Id6363c92f8155007e05c682694d7413fd4630b6d Reviewed-on: https://review.coreboot.org/c/coreboot/+/65932 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads,src: Replace ALIGN(x, a) by ALIGN_UP(x, a) for clarityElyes Haouas2022-10-131-1/+1
| | | | | | | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: I80f3d2c90c58daa62651f6fd635c043b1ce38b84 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68255 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* payloads/edk2: Add a recipe to build the ShimLayerSean Rhodes2022-10-121-0/+15
| | | | | | | | | | | The ShimLayer is required to start the Universal Payload. It will build the required HOBs and pass them accordingly. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I043271994f40813d9059a89420d4311d9d5802b1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/64485 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Add a recipe to build UniversalPayload.elfSean Rhodes2022-10-111-0/+12
| | | | | | | | | | | Add a recipe to build UniversalPayload.elf, which uses a wrapper for the UniversalPayloadBuild.py that is hosted in the edk2 repository. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I2aa318513244f576e07e72713fad3b4f7bd7c22e Reviewed-on: https://review.coreboot.org/c/coreboot/+/68183 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Guard the build targetSean Rhodes2022-10-101-0/+2
| | | | | | | | | | | Specifying a build target only applies to UefiPayloadPkg, so guard it against the relevant Kconfig option. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ia4597b5ed76616e39cec45f8a69be9f1ccd72d4c Reviewed-on: https://review.coreboot.org/c/coreboot/+/68182 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Guard the silent switchSean Rhodes2022-10-101-1/+4
| | | | | | | | | | | | The silent switch, `-s`, only works for building UefiPayloadPkg. Guard it against the relevant Kconfig option so that it doesn't cause problems with other targets. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I5a5df636e6484a435c849c6d19c7cb61e8e62ee6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/68181 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Add note that upstream edk2 does not workSean Rhodes2022-10-081-0/+2
| | | | | | | | | | | Upstream edk2 doesn't work, but we still have the option for it for testing. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I6ec9f4746640baa030762650ab7b83d85ab8c1e1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67780 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/edk2: Add an option for verbose buildsSean Rhodes2022-10-083-0/+10
| | | | | | | | | | | | Add EDK2_VERBOSE_BUILD which removes the `-q` and `-s` switches so the build log becomes verbose. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Iaf1e96657f43edddfa4de0d3e00f3b24e7eb855b Reviewed-on: https://review.coreboot.org/c/coreboot/+/67677 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>
* payloads/edk2: Separate the build target and repositorySean Rhodes2022-10-082-20/+26
| | | | | | | | | | | | | | | | | Until recently, there were two options to build edk2, UefiPayloadPkg and CorebootPayloadPkg. Now, there is only one, UefiPayloadPkg but soon, there will be Universal Payload. It makes more sense, as the official edk2 repository doesn't work with coreboot, to have the build target and repository separate. That will allow for building either UefiPayloadPkg or Universal Payload from the official repository, MrChromebox' fork or a custom repository. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: If7f12423058ef69838741f384495ca766ccea083 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66080 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/external/skiboot/Makefile: fix output on `make clean`Sergii Dmytruk2022-09-281-1/+2
| | | | | | | | | | | | | | skiboot's Makefile always executes $(CC) to determine whether its clang or GCC and not setting CROSS for clean target results in this annoying output (assuming `powerpc64-linux-gcc` isn't available): make[2]: powerpc64-linux-gcc: No such file or directory Change-Id: I242b2d7c1bdf1bbd70fd4e4e0605341fe8301ca5 Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/67053 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
* tests: Add support for tests build failures detectionJakub Czapiga2022-09-211-5/+47
| | | | | | | | | | | | This patch introduces new target: junit.xml-unit-tests, which builds and runs unit-tests. It also creates build log containing build logs. This feature allows for one to see build failures in Jenkins dashboard. Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I94184379dcc2ac10f1a47f4a9d205cacbeb640fe Reviewed-on: https://review.coreboot.org/c/coreboot/+/67372 Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* cbfs/vboot: Adapt to new vb2_digest APIJulius Werner2022-09-023-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | CL:3825558 changes all vb2_digest and vb2_hash functions to take a new hwcrypto_allowed argument, to potentially let them try to call the vb2ex_hwcrypto API for hash calculation. This change will open hardware crypto acceleration up to all hash calculations in coreboot (most notably CBFS verification). As part of this change, the vb2_digest_buffer() function has been removed, so replace existing instances in coreboot with the newer vb2_hash_calculate() API. Due to the circular dependency of these changes with vboot, this patch also needs to update the vboot submodule: Updating from commit id 18cb85b5: 2load_kernel.c: Expose load kernel as vb2_api to commit id b827ddb9: tests: Ensure auxfw sync runs after EC sync This brings in 15 new commits. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I287d8dac3c49ad7ea3e18a015874ce8d610ec67e Reviewed-on: https://review.coreboot.org/c/coreboot/+/66561 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
* x86/cache.c: Implement dcache_*Hsin-Te Yuan2022-09-015-10/+169
| | | | | | | | | | | | | | | | | | | | | | | | A new ChromeOS automated test will be introduced to check the cbmem log of diagnostic boot mode. Because the diagnostic boot does not allow booting into kernel, the test must perform AP reset and then check the cbmem log afterwards. However, the memory content might not be written back to memory (from CPU cache) during AP reset because of the cache snooping mechanism on x86. Hence, some API to flush cache is needed. Implement dcache_* to allow flushing cache proactively in x86. To avoid unnecessary flush, check dma_coherent before calling dcache_* functions, which will be always true in x86. Therefore, this change won't affect the original functionality. BUG=b:190026346 TEST=FW_NAME=primus emerge-brya libpayload Cq-Depend: chromium:3841252 Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I622d8b1cc652cbe477954a900885d12e6494d94d Reviewed-on: https://review.coreboot.org/c/coreboot/+/66578 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* payloads/edk2: Remove architecture from build stringSean Rhodes2022-09-011-4/+5
| | | | | | | | | | | | | | | Whilst UefiPayloadPkg is always built with support for 32-bit and 64-bit, this is not the case for all edk2 targets. Move this to the build command so they can be specified on each target. Also add the `-s` switch, which stands for quiet to suppress edk2 printing War and Peace whilst building. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: If94abd4e28917718c76ad5945966e7be668c8f61 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66364 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Rename the update recipeSean Rhodes2022-09-011-4/+4
| | | | | | | | | | | | | Rename the update recipe, which updates the edk2 repository, to $(EDK2_PATH). There is no functional change here. This recipe must be phony so it runs every time. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I30fedbee7459b79a85a23678e0075368eda95da0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66363 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Clone edk2 and its submodules in parallelSean Rhodes2022-09-011-1/+1
| | | | | | | | | | | When cloning edk2, download the submodules at the same time. There is no functional change here, just a minor speed improvement. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ieeb481346093588bd8d237857966001dc81460b1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66362 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Adjust the WORKSPACE targetSean Rhodes2022-09-011-3/+1
| | | | | | | | | | | | | | First, remove the `-p` flag; as it's a file target it's not needed in this case. Second, remove the clone as this is handled in the update recipe. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I3829a3151be2d05a067a160fa770e5eb7ad4aad4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66361 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Convert UefiPayloadPkg to a file targetSean Rhodes2022-09-012-9/+18
| | | | | | | | | | | | | | Convert UefiPayloadPkg (UEFIPAYLOAD.fd) to a file target. There is no functional change here, it just avoids it being copied out of the build dir, into an output directory and then into build. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Iff097f6f1e715c697c33c50c395d7c1b88cc6280 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66360 Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Separate the tasks required to build edk2Sean Rhodes2022-08-241-3/+7
| | | | | | | | | | | | | | | Separate the tasks that are required to be completed prior to building edk2 into a prep recipe. This allows this to be used for building different targets. This also ensures that the COREBOOT toolchain is used. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ic4ae8ac4118a5747f38297d0fbf4cb53aa3b6d6d Reviewed-on: https://review.coreboot.org/c/coreboot/+/66359 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
* payloads/edk2: Separate the Release String variableSean Rhodes2022-08-241-4/+6
| | | | | | | | | | | Separate the Release String from the Build String. This allows the makefile to locate built files more precisely. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Id98674f0bbf485b2bfdbf5784d325c5ac89ad076 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66358 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: Add const for dma_coherent argumentYu-Ping Wu2022-08-242-2/+2
| | | | | | | | | | | | | | | | Add the const modifier for the ptr argument of dma_coherent to avoid unnecessary type casting in payloads. BUG=none TEST=emerge-corsola libpayload BRANCH=none Change-Id: Ic4bb1d8318c7e83fd3ab3054aa0333cb27afe588 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66961 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hsin-Te Yuan <yuanhsinte@google.com>
* payloads/edk2: Move building to directory called workspaceSean Rhodes2022-08-243-24/+24
| | | | | | | | | | | | | | | The current edk2 makefile will work in a directory that's name is derived from the repository, such as `mrchromebox` or `starlabsltd`. Move this under a directory, so that it can be ignored by git and so that the makefile can be adjusted to use file targets, rather than phony recipes with wildcards. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: If0c80dbc59130f229b78cab9578115e14172301d Reviewed-on: https://review.coreboot.org/c/coreboot/+/66356 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Move the restoration of the logoSean Rhodes2022-08-141-1/+1
| | | | | | | | | | | | | | | Logo.bmp is overwritten with a custom one from coreboot. This needs to be restored before the branch is updated otherwise git will report that the repository is dirty. Move this to the update recipe so that will always be done for any recipe that needs to update the branch. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I85bf753a47d9e70d6555dec9a539e8ed7395bead Reviewed-on: https://review.coreboot.org/c/coreboot/+/66355 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* payloads/edk2: Move printing the build options to a separate recipeSean Rhodes2022-08-131-2/+6
| | | | | | | | | | | | | | Move the code that prints the edk2 build options to it's own recipe so that it can be called for different targets. This change also fixes the print, as it accounts for recent switches such as `--pcd` and `-s`. Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: Ie797ca26cd28eab0f633bd8dee5ec19634fcea99 Reviewed-on: https://review.coreboot.org/c/coreboot/+/66354 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
* payloads/tianocore: Rename TianoCore to edk2Sean Rhodes2022-08-137-112/+111
| | | | | | | | | | | | | | | | | | | | | | coreboot uses TianoCore interchangeably with EDK II, and whilst the meaning is generally clear, it's not the payload it uses. EDK II is commonly written as edk2. coreboot builds edk2 directly from the edk2 repository. Whilst it can build some components from edk2-platforms, the target is still edk2. [1] tianocore.org - "Welcome to TianoCore, the community supporting" [2] tianocore.org - "EDK II is a modern, feature-rich, cross-platform firmware development environment for the UEFI and UEFI Platform Initialization (PI) specifications." Signed-off-by: Sean Rhodes <sean@starlabs.systems> Change-Id: I4de125d92ae38ff8dfd0c4c06806c2d2921945ab Reviewed-on: https://review.coreboot.org/c/coreboot/+/65820 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
* libpayload: usb: Fix spacing issuesYidi Lin2022-08-1224-623/+623
| | | | | | | | | | | | Found by: find payloads/libpayload/drivers/usb -type f -name "*.[ch]" | xargs \ util/lint/checkpatch.pl --types SPACING -q --fix-inplace -f Change-Id: Id23e2e573e475c6d795812a4b2df9aeffbcaaaf4 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66596 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* libpayload: usbmsc: Prevent usbdisk_remove() from being called twiceYidi Lin2022-08-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | When removing SD card from USB card reader, the USB MSC stack does not detach the device immediately. Instead, the USB MSC stack calls usbdisk_remove() and calls usb_msc_destroy() after several pollings. It results in usbdisk_remove() being called twice. Since the usbmsc_inst_t instance is freed after first usbdisk_remove() call, the second call invokes an invalid usbmsc_inst_t instance and causes exception in CPU. This patch prevents usbdisk_remove() from being called twice by setting usbdisk_created to zero. BUG=b:239492347 TEST=insert an empty SD card into the USB card reader then remove the SD card. AP firmware does not crash. Change-Id: I0675e9fde3e770d63dd0047928356a204245ef18 Signed-off-by: Yidi Lin <yidilin@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66449 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* 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>