Commit Graph

1794 Commits

Author SHA1 Message Date
Selma Bensaid 4bc425c521 payloads/depthcharge: enable LP_CHROMEOS in depthcharge
Fix standslone build failure after depthcharge patch
https://crrev.com/c/3461454 merge.

BUG=chrome-os-partner:226438207
TEST=Compiled brya and redrix in standalone mode.

Signed-off-by: Selma Bensaid <selma.bensaid@intel.com>
Change-Id: Ib2bb2ce42a314e05ef22ea7b8abc067d6361d511
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63240
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
2022-04-19 13:03:00 +00:00
Jianjun Wang b2537bdad5 coreboot_tables: Replace 'struct lb_uint64' with lb_uint64_t
Replace 'struct lb_uint64' with 'typedef __aligned(4) uint64_t
lb_uint64_t', and remove unpack_lb64/pack_lb64 functions since it's no
longer needed.

Also replace 'struct cbuint64' with 'cb_uint64_t' and remove
'cb_unpack64' in libpayload for compatible with lb_uint64_t.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Change-Id: If6b037e4403a8000625f4a5fb8d20311fe76200a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63494
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-04-14 22:27:50 +00:00
Arthur Heymans c73440844d payloads/LinuxBoot: Fix u-root branch
It looks like the u-root 'master' branch was renamed to 'main'.

Change-Id: I384ba66289a49bf226b505615bd16bdf85612c1a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62590
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-04-13 14:30:37 +00:00
Sean Rhodes f2d162efca payloads/tianocore: Don't declare tools directory twice
EDK_TOOLS_PATH is set on lines 85 and 137. Remove the instance
on 85. edk2 still builds correctly.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I0c837f14693941afec194b140c93d786ea784e53
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63180
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-04-11 13:59:29 +00:00
Jakub Czapiga 9760264a96 commonlib/bsd/helpers: Remove redundancy with libpayload defines
Move STRINGIFY() from coreboot string.h to commonlib/bsd/helpers.h
Remove redundant defines from libpayload.h and libpayloads' standard
headers.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I3263b2aa7657759207bf6ffda750d839e741f99c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62921
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-03-30 21:21:47 +00:00
Arthur Heymans cddba4528d libpayload: Parse the ACPI RSDP table entry
Change-Id: I583cda63c3f0b58f8d198ed5ecea7c4619c7a897
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62576
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-03-30 00:03:28 +00:00
Jakub Czapiga 3068d562ae libpayload/vboot: Fix include paths fixup macro
Include paths fixup macro for vboot was broken and was adding
unnecessary prefix to paths from $(coreboottop). This patch adds correct
filters to fix this behavior.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I264e715fa879a4e56b6e5f5423916298e8780a2b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63002
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-03-25 19:25:36 +00:00
Michał Żygowski 8a47a14a2f payloads/iPXE: Update stable version from 2019.3 to to 2022.1
Update iPXE stable from commit id ebf2eaf515:
Mar 18 10:24:08 2019 +0000
[intel] Add PCI ID for I219-V and -LM 6 to 9

to commit id 6ba671acd9:
Jan 17 16:17:17 2022 +0000
[efi] Attempt to fetch autoexec script via TFTP

This brings in 424 new commits and fixes the build with coreboot-sdk
2021-09-23_b0d87f753c.

TEST=Build PC Engines apu2 board and boot it over network with the
iPXE

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: Ide12a3a3082f9ea027e180518a80e6c0772b1232
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62289
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-03-22 21:02:59 +00:00
Sean Rhodes e8c186cdef payloads/tianocore: Add missing CONFIG_
Add missing CONFIG_ to the Boot Timeout parameter.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I88f4aa0286a77f6c94b5e5ec97a0034ea7594b4f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62920
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-03-21 21:39:43 +00:00
Ravi Kumar Bokka 42fcb2a8f4 libpayload: Parse DDR Information using coreboot tables
BUG=b:182963902,b:177917361
TEST=Validated on qualcomm sc7280 development board

Signed-off-by: Ravi Kumar Bokka <rbokka@codeaurora.org>
Change-Id: Ieca7e9fc0e1a018fcb2e9315aebee088edac858e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59193
Reviewed-by: Shelley Chen <shchen@google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-03-16 01:21:44 +00:00
Felix Singer cf4a3472b9 payloads/seabios: Update stable version to 1.16.0
SeaBIOS 1.16.0 was released on March 2nd. Thus, update the stable
version from 1.14.0 to 1.16.0.

Change-Id: I475a9be47171bfbe3b3c2d4d1d14bb753d8575a8
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62575
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2022-03-14 18:18:42 +00:00
Sean Rhodes 63c6d814ce payloads/tianocore: Add prompt for Boot Timeout
Add prompt to Boot Timeout so that it can be easily configured
from a config file.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I62b8f0a9b5bc0796506b991199a457d6b34ae494
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62558
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2022-03-09 14:20:30 +00:00
Julius Werner 69cc557cfb commonlib/bsd: Remove cb_err_t
cb_err_t was meant to be used in place of `enum cb_err` in all
situations, but the choice to use a typedef here seems to be
controversial. We should not be arbitrarily using two different
identifiers for the same thing across the codebase, so since there are
no use cases for serializing enum cb_err at the moment (which would be
the primary reason to typedef a fixed-width integer instead), remove
cb_err_t again for now.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Iaec36210d129db26d51f0a105d3de070c03b686b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62600
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-03-09 02:18:21 +00:00
Julius Werner 2c423441c0 libpayload: cbmem_console: Drop loglevel markers from snapshot
coreboot recently introduced non-printable loglevel markers in the CBMEM
console. Payloads were generally unaffected since they don't use log
levels and it is still legal to append lines without a marker to the
log. However, payloads using cbmem_console_snapshot() to display
existing logs from coreboot have started seeing '?' characters in place
of the markers. This patch fixes the issue by filtering out marker
characters.

BUG=b:221909874

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I4a9e5d464508320cf43ea572d62896d38c2a128d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62506
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2022-03-04 16:04:10 +00:00
Jakub Czapiga 49fff57a09 libpayload/bin/lpgcc: Make lpgcc provide TPM configuration for vboot
TPM1_MODE and TPM2_MODE defines have to be added to vboot and payload
cflags to make them build correctly without requiring payloads to provide
defines.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I567a9f04d7089699840dc7e0a063cf3030fb934b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62516
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-03-03 22:38:59 +00:00
Sean Rhodes 9f091608b2 payloads/tianocore: Convert BMP at build time
Convert BMP to the correct format at build time, which removes the
requirement for any runtime checks.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I4f1e9c8df2ca7d66f362f9fa5688d6cb443c2581
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61918
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2022-02-25 20:45:02 +00:00
Sean Rhodes 4a9be9f321 payloads/tianocore: Pass SD_MMC_TIMEOUT build option
By default, edk2 allows 1000000μs for SD Card Readers and eMMC to
initialize which is excessive and causes a boot delay. This makes
the value configurable and uses a default of 1000μs which is sufficient
for the majority of readers. The value of 1000μs was hardcoded in
MrChromeBox's fork for around 2 years with no reported issues.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I873bcddf6f37a9eaae5c84991b3996d51fb460d3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61902
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2022-02-25 20:44:42 +00:00
Sean Rhodes 3f3a3eeca7 payloads/tianocore: Add option for to prioritize internal devices
Add TIANOCORE_PRIORITIZE_INTERNAL which, when enabled, will build edk2
with boot from internal devices before external devices.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ib1f73c8f3f2f2376cdc197b58d259446dc5f0138
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61797
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2022-02-24 00:29:44 +00:00
Sean Rhodes 4600c25346 payloads/tianocore: Add option for PS/2 keyboard support
Add TIANOCORE_PS2_SUPPORT which, when enabled, will build edk2
with PS/2 keyboard support.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ibabce6ac1ac68ab958610d42c77f3c2c494528ef
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61760
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2022-02-24 00:29:29 +00:00
Sean Rhodes f33ddb3959 payloads/tianocore: Add option to include EFI Shell
Add TIANOCORE_HAVE_EFI_SHELL, which when enabled, will build edk2
with the EFI Shell binary.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I1272f514e3f5becfe1fddd58ca0d820c5d1c1b54
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61759
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2022-02-24 00:29:14 +00:00
Sean Rhodes 14d67b3515 payloads/tianocore: Add option to use follow BGRT spec
Adds TIANOCORE_FOLLOW_BGRT_SPEC which, when enabled, will follow
the BGRT Specification implemented by Microsoft and the Boot Logo
will be vertically centered 38.2% from the top of the display.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: If508166fe657d1cc032dd09a0fa231c7b60d9846
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61758
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2022-02-24 00:29:01 +00:00
Sean Rhodes c8decce31c payloads/tianocore: Add option to use Escape for Boot Manager
Add TIANOCORE_BOOT_MANAGER_ESCAPE which, when enabled, will use
Escape as the hot-key to access the Boot Manager. This replaces
the default key of F2.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I1e60d116367542f55f0ffa241a6132e4faabe446
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61757
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2022-02-24 00:28:47 +00:00
Nico Huber 47722cfe55 libpayload/lpgcc: Add `--gc-sections` linker argument
To be able to link libcbfs without vboot, we need garbage
collection now.

Change-Id: Id9a9fe7efb9fb4409a43ae8357f4f683618805d2
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62247
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-23 22:47:24 +00:00
Nico Huber 4fa9f2ae8b libpayload/x86: Fix boot_device_read() and hook it up
Casts from integer to pointer are usually a case for phys_to_virt().

Change-Id: I861d435ff2361cdc26a2abd46d43b9346fa67ccc
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62246
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-23 22:47:09 +00:00
Sean Rhodes 0884f21042 payloads/tianocore: Rework Makefile
Rework edkii makefile so that the various build options are
unified between CorebootPayloadPkg, uefipayload_202107 and
upstream.

This sets the project directory based on the git repository name
i.e. https://github.com/mrchromebox/edk2 becomes mrchomebox

Also builds to $(obj)/UEFIPAYLOAD.fd and allows using a commit
ID without a branch.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I3cc274e7385dd71c2aae315162cc48444b7eaa5f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61620
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Martin Roth - Personal <martinroth@google.com>
2022-02-22 18:53:17 +00:00
Jakub Czapiga 0ac5ed4490 libpayload/vboot: Enable vboot and x86 SHA extension for ChromeOS
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ia63d44de5440b87cedb35ff92edaa0f35ccd75a4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62122
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-21 15:18:55 +00:00
Jakub Czapiga b17f1cebcb libpayload/vboot: Add missing quotes enclosing values
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I1a72ea63a46dedd1fc2e1e53bf7714ad70ebc5e1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62171
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-21 15:18:38 +00:00
Jakub Czapiga 7f663ab3e6 libpayload/vboot/Makefile.inc: Add strip to kconfig-to-binary macro
Lack of strip made it required to pass arguments to the
kconfig-to-binary macro without spaces. Strip fixed invalid behavior of
this macro.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I9889b45f773b9675fae287086d324c180c505a4b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62133
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-21 15:18:24 +00:00
Jakub Czapiga e904d9ad67 libpayload/cbfs: Add missing new line at the end of error messages
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: Ieec281e4f1c67e40976892b3dd1780d2f3802df4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62125
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-21 15:15:37 +00:00
Sergii Dmytruk a816c29882 payloads/external: add skiboot (for QEMU/Power9)
Add an option to build skiboot as a payload. This makes QEMU Power9
board simpler to use as skiboot is necessary anyway.

Change-Id: I0b49ea7464c97cc2ff0d5030629deed549851372
Signed-off-by: Igor Bagnucki <igor.bagnucki@3mdeb.com>
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58656
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2022-02-16 15:39:19 +00:00
Jakub Czapiga 5b76ae9611 libpayload/libc/coreboot: Fix CBFS MCache size
CBFS MCache size was assigned a value of the coreboot tables entry size
instead of the MCache size.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I8a8c3a10c6032121b4c5246d53d2643742968c09
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61714
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-02-10 12:49:14 +00:00
Patrick Georgi 49f0f9a422 libpayload: Refer to vboot source consistently
Don't assume that libpayload is built from a fully checked
out coreboot tree.
There's already an override when building vboot, so reuse
that override when referring to its header files.

Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Change-Id: I503c69a593dd68b3a974fbdbb64d7bb25d6c7f63
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61427
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2022-01-28 14:47:38 +00:00
Paul Menzel bf52cdbca1 Revert "SeaBIOS: Update stable release to 1.15.0"
This reverts commit 2a8de6dafb.

SeaBIOS 1.15.0 regresses on systems with NVMe devices [1]:

> Greetings! Was this patch set tested on bare metal hardware? I'm
> seeing "GRUB loading: Read Error" when attempting to boot from NVMe on
> various Purism Librem devices (Intel Skylake thru Cometlake hardware).
> Reverting this series resolves the issue.

So, revert back to SeaBIOS 1.14.0.

[1]: https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/message/SRECAGH4NE3XPDWJ2YI526L5LPSJWENJ/

Change-Id: If2ec738d478f11b203f499eaa28197357de6630d
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61179
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-01-24 18:18:21 +00:00
Jakub Czapiga 28a97a2ae5 libpayload/Makefile.inc: Fix ar calls to support llvm-ar
llvm-ar does not support "open" script command, and fails with an error.
This patch fixes it by removing lines `$(AR) rc <object-files>` and
it puts them as "addmod" commands. This way all object files and
archives can be packed into one archive.

Change-Id: I0c53d1d613b5edc321e268d1d996fac3146680f8
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61182
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-01-20 09:22:26 +00:00
Jakub Czapiga 395f5b3129 libpayload: Install vboot headers and add include paths to lpgcc
New CBFS API uses commonlib/bsd/cbfs_serialized.h, which includes
vboot's vb2_sha.h. And, because vboot's includes are not available
in libpayload's installation directory nor in lpgcc paths, it was
causing compilation errors. This patch fixes this issue.

lpgcc will look for `vboot` directory like it is doing for `include`
directory to create correct paths. However, if payload will be built
using libpayload's build dir as a base, then vboot headers from
3rdparty/vboot will be used, as there is no way to pass VBOOT_SOURCE
from makefile to lpgcc.

Moreover, this patch moves VBOOT_SOURCE to the main Makefile to
make it available for installation target, to install headers from
vboot directory provided by caller.

Change-Id: I68dd7e1545cfcaf24547d8a9fe289447c79da222
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reported-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61032
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-01-15 00:22:41 +00:00
Julius Werner db29b3765b libpayload: Fix legacy CBFS code after recent refactoring
The goal when adding the new CBFS API in CB:59497 was that the old CBFS
code would be left completely untouched and just moved to the side a
bit, so that it could continue to work for the payloads that use it
until they all have time to transition to the new CBFS API.
Unfortunately, between the different iterations of the patch something
went wrong with that and the final committed version of cbfs_legacy.c
does differ in some parts from the original code, including a changed
macro definition that breaks decompression support. This patch restores
all the legacy CBFS files to exactly what they used to be (other than
the necessary changes in cbfs_core.h to avoid double definition
clashes).

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ic7fd428acb03d3830f66f807cd1d7cdbd652f409
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61061
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
2022-01-14 00:41:13 +00:00
Jakub Czapiga a2f51f2225 libpayload/libcbfs/Kconfig: Make CBFS_VERIFICATION depend on VBOOT_LIB
CBFS_VERIFICATION was depending on the VBOOT instead of on VBOOT_LIB,
which made enabling CBFS_VERIFICATION impossible. VBOOT is not
available, like in the main coreboot, but is was changed to VBOOT_LIB,
and was not correctly adjusted in patch instroducing CBFS_VERIFICAITON
option.

Change-Id: Ie23bad5f0ed3faf17a2ed7a3ad99310ee803edd2
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61031
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-01-14 00:30:41 +00:00
Jakub Czapiga ad45f681aa libpayload/libcbfs: Add unverified_area APIs
This patch introduces equivalents of unverified_area CBFS access
functions added to the main coreboot tree in CB:59678

Change-Id: Ibadfd2a5cb6ad037ef1222b0a4301f90a79a127b
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60714
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-01-12 16:15:59 +00:00
Jakub Czapiga 63e54275f6 libpayload: Implement new CBFS access API
This commit adds new CBFS API, which is based on the one available in
the main coreboot source tree. Libpayload implementation supports RO/RW
file lookups and file contents verification.

Change-Id: I00da0658dbac0cddf92ad55611def947932d23c7
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59497
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-01-10 14:30:04 +00:00
Jakub Czapiga 1fa3da4d9b libpayload: Enable vboot integration
This patch introduces building and linking of 3rdparty/vboot with
libpayload. VBoot can be enabled by setting CONFIG_LP_VBOOT_LIB.
Moreover it can be configured to use either TPM or TPM 2.0 mode,
and whether to use SHA256 processor extension instructions on x86.

Change-Id: I2d9d766a461edaa0081041c020ecf580fd2ca64e
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60080
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2022-01-10 14:29:50 +00:00
Nicholas Chin 15d4b95cc6 payloads/Makefile.inc: Add warning for image built with no payload
Writing a coreboot image without a payload to a board's flash chip will
result in a non-bootable system, so warn the user if this is the case.

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Change-Id: I15ae9548a45e9f566c84db41e8e171c6bc179057
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60025
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-23 14:39:57 +00:00
Jakub Czapiga 8fac662f30 libpayload/libc/fmap: Implement new FlashMap API
This patch introduces new FlashMap API, the fmap_locate_area().
It works on cached FlashMap provided in lib_sysinfo.fmap_cache.

Change-Id: Idbf9016ce73aa58e17f3ee19920ab83dc6c25abb
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59494
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-12-23 14:37:42 +00:00
Jakub Czapiga e7006fb414 libpayload: Add commonlib/bsd include path to lpgcc
coreinfo and nvramcui are using libpayload/bin/lpgcc and libpayload
build directory as a base, instead of installing it first. This caused
include errors, because commonlib/bsd is not present there. This patch
introduces comonlib/bsd include path to lpgcc CFLAGS if it is being
built using libpayload build directory as a base.

Change-Id: I7d1fe9e5dc3e7c1c1ba825a1bf19972722b42778
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60171
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-12-23 14:37:04 +00:00
Jakub Czapiga f490d48b5c libpayload: Add -Wno-address-of-packed-member for ARCH_MOCK
When compiling libpayload using x86_64 toolchain for ARCH_MOCK compiler
reports an error about gerring address of packed member. Until now it
had to be disabled by passing -Wno-address-of-packed-member to
EXTRA_CFLAGS. This patch disables this warning.

Change-Id: I9a948fabe66f7297632ecaca8ec1bfa5c842b750
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60169
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-12-20 17:47:50 +00:00
Bill XIE d85cee8310 payloads/U-Boot: Fix various build errors
1. Fix the inconsistence of the target path of U-Boot payload
   between Kconfig and Makefile.inc.

2. Perform full clone (to the destined commit) in order to get
   tags.

3. Move stable commit id of U-Boot payload from Makefile to
   Kconfig, and make prompt consistent with it.

Change-Id: Ic0f11c16274456a452a0422e19fab0c61d8b5d5b
Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60028
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-12-14 16:13:06 +00:00
Jianjun Wang 8bb59ca2fa lib: Add __fls() (Find Last Set)
Implement __fls() as an alias for log2(), and remove the duplicate
definitions in commonlib/storage/sdhci.c.

Signed-off-by: Jianjun Wang <jianjun.wang@mediatek.com>
Change-Id: Ib458abfec7e03b2979569a8440a6e69b0285ac32
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59738
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-12-13 02:57:07 +00:00
Jakub Czapiga f7d6eb2fef libpayload: Add boot_device_read() function
This patch adds a new way of implementing flash access for libpayload.
Until now all reads had to be performed using cbfs_media, which is
obsolete. From now on all reads should be performed using
boot_device_read().

This patch also provides a default implementation of boot_device_read()
for x86 architecture.

Change-Id: I1babd2a8414ed9de3ca49903fcb4f036997b5ff3
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59492
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-12-10 17:56:34 +00:00
Martin Roth 2a8de6dafb SeaBIOS: Update stable release to 1.15.0
SeaBIOS 1.15.0 was released on December 2nd.  This updates the stable
version from 1.14.0 to 1.15.0

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ibc526fbddf8a13e7b00e963f9c2e73a9863c9daa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59957
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
2021-12-09 12:19:11 +00:00
Jakub Czapiga 289e2f6a64 libpayload/Makefile: Improve object files list creation
This patch ports some parts of main coreboot Makefile to the libpayload
Makefile in order to improve object files creation.

Moreover, the coreboot source files are now accessible an will be
correctly compiled under libpayload build directory.

Change-Id: If1280c0a3f7e99aad2ecf8a0379a98af31ccefc3
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59843
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
2021-12-08 14:42:25 +00:00
Jakub Czapiga 0b25e00ab1 libpayload: Add include/commonlib/bsd to installed headers
Copy header files from the main commonlib/bsd to libpayload output
installation directory.

Change-Id: Idc7175240f3077ec98280331f9a952310aae4341
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59916
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
2021-12-08 14:42:02 +00:00