5248 Commits

Author SHA1 Message Date
Zheng Bao
e80d06284f amdfwtool: Move linking BHD2 to PSP2 from main to link funcion
Move the complexity from main to function, so the main flow is easy to
understand.

TEST=Identical test on all AMD SOC platform

Change-Id: Ia549a0d08c2a60b8858440543ac8d8b5259017dd
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81334
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-21 20:37:10 +00:00
Sergii Dmytruk
b2d86f1f05 util/smmstoretool/fv.c: fix 3 formatting issues
Change-Id: If27218df40e58f249769b3d84c0cd4c299e2282b
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81173
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2024-03-21 16:14:57 +00:00
Nicholas Chin
c8575728b5 util/docker/: Drop recommonmark pip module
The documentation is now built using MyST Parser, so Recommonmark can be
dropped.

Change-Id: I7f6810c9429573c0c51d3d72b36e9fc2ae2185f5
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80313
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-21 16:12:32 +00:00
Nicholas Chin
9203e25a35 util/docker: Update Dockerfiles for building documentation
Update all pip packages related to coreboot's documentation to their
latest available version, and update the doc.coreboot.org base image
to Alpine 3.19.1. Add myst-parser in preparation to switch from
Recommonmark to MyST Parser.

TEST: The documentation builds and renders properly when built using
the updated container.

Change-Id: I8df4aadabc49c0201a836333745fe138184595ac
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80312
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-21 16:11:37 +00:00
Nicholas Chin
af68bf25aa docker/doc.coreboot.org: Install pip modules into virtual env
Currently, pip modules are installed system-wide, which may cause
conflicts with modules installed using the package manager. Newer
versions of the Alpine base image also mark its system wide Python
installation as an externally managed environment, which will cause
pip to return an error as per recent Python recommendations [1].

TEST:
- `make -C util/docker doc.coreboot.org` builds the container
  successfully
- `make -C util/docker docker-build-docs` builds the documentation
  successfully

[1] https://peps.python.org/pep-0668/

Change-Id: Idd9cc5e6fb28b42ef8e4fa5db01eb9ef192ba0ec
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80311
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2024-03-21 16:10:44 +00:00
Zheng Bao
b91f421118 amdfwtool: Check sanity before filling the data array
Change-Id: I8284c35a0124ba4588d199024e28d3445c681896
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>wq
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78763
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-20 13:44:57 +00:00
Zheng Bao
b81b7da92f amdfwtool: Set the cookie when the table header is created
When the table is created, the cookie is known.
When the packing going on, the cookie in header can be checked to see
where we are.

TEST=Identical test on all AMD SOC platform

Change-Id: I300e30292c68a14b44c637b26a13b308dc9c0388
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81254
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-20 13:36:14 +00:00
Zheng Bao
eea834bcfd amdfwtool: Move the header creation into integration function
Before every integration there is a header creation. We can put them
together. And the parameters for PSP/BIOS tables are useless.

TEST=Identical test on all AMD SOC platform

Change-Id: Ia9d78bb8145855203048208fcd67f8b9cd9d3199
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81253
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-20 13:35:19 +00:00
Zheng Bao
f360095d93 amdfwtool: Add functions to link all the tables
The purpose of integration function is to pack the FWs into table. We
need to remove other process. Create a dedicate function to link all
the tables together. And this linking function is only called when
both the level 1 and level 2 directory are created. This simplifies
the main function and logic.

TEST=Identical test on all AMD SOC platform

Change-Id: Ieaf97208e943c79d7b76ea62eea9355138c220b9
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81252
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-20 13:34:57 +00:00
Zheng Bao
e4214b7939 amdfwtool: Move the address of tables to the context
Instead of being local variables. This can be easier to find all
the tables anywhere.

TEST=Identical test on all AMD SOC platform

Change-Id: I98b7d01e32c75b4f13e23d496cd3de3da900678d
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81225
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-20 13:34:32 +00:00
Zheng Bao
18cf3f7966 amdfwtool: Compact the parameter transfering
Remove redundant parameter "debug" from open_process_config().

Change-Id: Ib91a505838d7be4980d6b4f1e95fb8601fbbfd16
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81201
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-18 14:56:29 +00:00
Zheng Bao
d22c2c8772 amdfwtool: Remove the dissociated combo BIOS table for recovery A/B
For recovery A/B mode, the BIOS tables level 2 are traced by PSP table
instead of ROMSIG. There should not be a dedicated BIOS table, nor a
combo BIOS table.

Change-Id: I8735bd91b32bc9a0e4fc70d293e8d836d5e9c36b
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81137
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-18 14:55:08 +00:00
Nico Huber
3e4b517265 genbuild_h: Fix and harden major/minor version parsing
Our major version is suddenly two digits long to represent the year.
This can't be parsed with the current sed scripts. To make sure that
no unparsed data ends up in our major/minor versions,  we'll run sed
with `-n' and only print the extracted numbers if anything. Also, to
allow us to use the version numbers in C code, we strip leading zeros
(a leading 0 identifies octal numbers, so for instance 08 for August
is not a valid number).

This can result in empty major/minor version strings, so we move the
default `0' to the final variable expansion.

As a bonus, this makes an explicit check if the numbers can be parsed
unnecessary.

Change-Id: Ie39381a8ef4b971556168b6996efeefe6adf2b14
Reported-by: Christoph Zechner <christophz@vrvis.at>
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81290
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 20:08:56 +00:00
Mate Kukri
5c769ab711 util/intelmetool: Print the address in map_physical errors in hex
Previously the incorrect 'd' format specifier was used despite the '0x'
prefix implying hex to the user.

Change-Id: Ib97bd86ee0e0c8fe8c3785e22a4d9f6def3cae61
Signed-off-by: Mate Kukri <kukri.mate@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81191
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-03-17 19:08:48 +00:00
Zheng Bao
e079379576 amdfwtool: Set the level based on cookie
It was complicated and weird to check both the cookie and whether one
table is a null pointer. Just checking the cookie is enough.

TEST=Identical test on all AMD SOC platform

Change-Id: Icab74714990f74e11fd5e899661e4e2d41230541
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81208
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 16:58:04 +00:00
Zheng Bao
07e050804f amdfwtool: Set the table size only for FWs
The entry in the table has two categaries, file and pointer. For the
pointer, it does not take table space. The ISH, PSP level 2, BIOS
table are all the pointer type. So integration function only packs FWs
located in folder amd_blobs. And only FWs increase the table size.

So the table size is only set once. Later calls only update the count
and fletcher. The table has a header at least, so the size can not be
0.

The fill_dir_header can take the parameter count as 0, such PSP level
1 only with ISH-A and ISH-B. It doesn't have any file type entries.

This actually reverts
  https://review.coreboot.org/c/coreboot/+/78274
and adds other changes.

TEST=Identical test on all AMD SOC platform

Change-Id: I5dfbbb55912c8e37243c351427a8df89c12e5da8
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81255
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 16:56:43 +00:00
Martin Roth
bbf884ddbd util/lint/lint: Fix shellcheck errors in getopt support for darwin
Posix shell doesn't support '=='

Change-Id: Icbdc4204f4c07d806e721fa39f96694c4df00e8d
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81285
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 08:26:00 +00:00
Crabtux
b94022525d util/nixshell: Add a dev shell for i386 arch
Add a Nix shell file to provide a simple environment for coreboot
development of i386 architecture. Currently, this environment is
capable of completing Tutorial Part 1 in https://doc.coreboot.org.

The Nix shell can be used by running the following command:

  $ nix-shell --pure util/nixshell/devshell-i386.nix

The `--pure` parameter is optional.

In Nixpkgs, there is a package called 'coreboot-toolchain'. It
fetches the source code of coreboot, build crossgcc, and export
it as output. With the binary cache mechanism of Nix, crossgcc
can be directly downloaded and used without compiling on user's
machine.

This Nix shell has been tested on a NixOS laptop and a Debian 12
server, and they both work fine.

Change-Id: Idcfe10be214e9bca590a62b8a207267493a4861f
Signed-off-by: Crabtux <crabtux@mail.ustc.edu.cn>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80644
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-03-14 18:15:51 +00:00
Julius Werner
06e3dcac45 cbfs: Remove broken remnants of PAYLOAD_INFO feature
PAYLOAD_INFO is a very old feature that can add a key/value information
section to a payload file. It seems to have only ever been generated by
coreinfo and never really read by anything.

Since CB:1721 in 2012, the feature has been inadvertently broken in
practice since the `.note.pinfo` sections that contain the information
get discarded from the payload before cbfstool gets to see them. Since
CB:28647 in 2018, support for the section in the SELF loader was
(inadvertently?) dropped, so if someone actually fed cbfstool a payload
ELF that did have a `.note.pinfo` section, modern coreboot would refuse
to boot the payload entirely (which is probably not a good state to
leave things in).

This patch removes the code to generate PAYLOAD_INFO entries entirely,
but leaves the support to parse and extract those sections from old
payloads in place in cbfstool.

Change-Id: I40d8e9b76a171ebcdaa2eae02d54a1ca5e592c85
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81087
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-03-13 18:51:11 +00:00
Brandon Weeks
7ee7b137a7 util/inteltool: Add support for Alder Lake-N
Reference: Intel Processor and Intel Core i3 N-Series Datasheet,
Volume 1 of 2 (#759603)

Change-Id: Ib3225088fa08fb7e5a60c87d0f1f6b3001f5b562
Signed-off-by: Brandon Weeks <me@brandonweeks.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79732
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2024-03-13 13:59:31 +00:00
Nicholas Chin
56c3444d85 util/docker/Makefile: Create Documentation/_build for docker-build-docs
If the host directory of a bind mount does not exist, Docker will create
it. However, the newly created directory will be owned by root due to
the Docker service running within a root context. The docker command in
the recipe for docker-build-docs binds Documentation/_build to /data-out
within the container, so if it doesn't already exist, the documentation
builder will be unable to copy the HTML output into /data-out since it
runs with the same UID and GID as the host user.

By creating, if necessary, the _build directory before the `docker run`
command, there should always be an existing directory owned by the host
user for docker to bind /data-out to (ignoring the case of an existing
_build directory the current user does not have permission to write to),
avoiding the issue where it cannot write the output.

TEST: make -C util/docker docker-build-docs completes without issues
with and without an existing Documentation/_build directory

Change-Id: I6be9bc1fdca48f4d924f5c07cc261189ab6862fd
Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81127
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2024-03-09 23:46:00 +00:00
Sergii Dmytruk
89e056bdf1 util/smmstoretool: support processing ROMs
Input file is parsed for FMAP and SMMSTORE region which is used if
found.  Otherwise, the whole file is assumed to be the region.  Passing
an image with FMAP that lacks SMMSTORER is an error.

Change-Id: Ieab555d7bbcfa4dadf6a5070d1297acd737440fb
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80903
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2024-03-09 23:26:41 +00:00
Sergii Dmytruk
04bd965143 util: add smmstoretool for editing SMMSTORE
Offline SMMSTORE variable modification tool.  Can be used to
pre-configure ROM image or debug EFI state stored in a dump.

Change-Id: I6c1c06f1d0c39c13b5be76a3070f09b715aca6e0
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79080
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2024-03-09 23:22:55 +00:00
Jeremy Compostella
1879b6a34a drivers/intel/fsp2_0: Add limited to 32-bits FSP 2.4 support
Intel Firmware Support Package 2.4 specification (document 736809)
brings some significant changes compared to version 2.3 (document
644852):

1. It supports FSP-M multi-phase init. Some fields have been added to
   the FSP header data structure for this purpose.

2. The `FSPM_ARCH2_UPD' and `FSPS_ARCH2_UPD' data structures must be
   used in place of `FSPM_ARCH_UPD' and `FSPS_ARCH_UPD' respectively.

3. It support 64-bits FSP but 64-bits support will be provided by
   subsequent patch.

Note that similarly to what is done for silicon initialization,
timestamps and post-codes are used during the memory initialization
multi-phase.

[736809]
https://cdrdv2-public.intel.com/736809/736809_FSP_EAS_v2.4_Errata_A.pdf

[644852]
https://cdrdv2-public.intel.com/644852/644852_2.3_Firmware-Support-Package-External-Architecture-Specification.pdf

TEST=verified on Lunar Lake RVP board (lnlrvp)

Change-Id: I1c24d26e105c3dcbd9cca0e7197ab1362344aa97
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80275
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
2024-03-08 16:59:25 +00:00
Zheng Bao
a640b123f5 amdfwtool: Change&Record the current table in integration function
Align with the function integrating PSP FWs. And it is the integration
function's responsibility.

TEST=Identical test on all AMD platforms

Change-Id: I1a98614f3a5756a462b01085e9565b52cf9a9343
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78280
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-06 11:05:43 +00:00
Zheng Bao
e35c502a57 amdfwtool: Move code related to getting options to a new file
Cleanup the messy code. The code left in main is all about filling
tables.

To help to do this,
1. Some local variables are put into global struct.
2. Add some functions. Set some functions to global.

TEST=Identical test on all AMD platforms

Change-Id: Ia25c3fd5de7ae48054359f0f6551d91d7a4f6828
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78311
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-06 11:05:07 +00:00
Zheng Bao
fc3fcf2103 amdfwtool: Set the table size for L1 separately
The space defined by size of the L1 table can not overlap with ISH
header. For other cases, the size defines the directory and its
content.

The PSP spec does not say it quite clearly. This change is partly
based on guess and can make extraction tool work so far.

Change-Id: Id4fbc6d57d7ea070a9478649a96af92be9441289
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78274
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-06 11:04:20 +00:00
Maximilian Brune
ee1cb8f463 mb/emulation/qemu-riscv: Change to -bios option
This changes the virt target so that it can be run with the -bios option
and a pflash backend for the flash. QEMU can now be run as follows:

qemu -M virt -m 1G -nographic -bios build/coreboot.rom \
        -drive if=pflash,file=./build/coreboot.rom,format=raw

coreboot will start in DRAM, but still have a flash to put CBFS onto and
to load subsequent stages and payload from.

Tested bootflow:
coreboot -> OpenSBI -> Linux -> u-root

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I009d97fa3e13068b91c604e987e50a65e525407d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80746
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: ron minnich <rminnich@gmail.com>
Reviewed-by: Philipp Hug <philipp@hug.cx>
2024-03-05 18:57:29 +00:00
Zheng Bao
92a9d93144 amdfwtool: Move the functions to handle_file.c
Change-Id: I4cfec13cbc2a86dc352758541cce915a838e0d0f
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78305
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-04 14:50:53 +00:00
Zheng Bao
80b853e626 amdfwtool: Remove the function's dependency to ctx
This is for next CL to move the write_body to another source,
handle_file.c.
https://review.coreboot.org/c/coreboot/+/78305

Removing amdfwtool_cleanup in write_body will not change the
result. Write_body returns to main and amdfwtool_cleanup still ends up
getting called.

Change-Id: I639828498fa45911f430500735e90ddc198b6af5
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78304
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-04 14:50:44 +00:00
Stefan Reinauer
98ecb1612c lint: Make lint work on Darwin
Darwin's getopt does not support the same parameters as the
util-linux version and so it is not possible to commit any
changes because lint fails.

Change-Id: Ife26083d2de080af9ed3d509945720051ca14bd7
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80436
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-02 03:55:01 +00:00
Martin Roth
10291e800c amdfwtool: Use Makefile.mk for Makefile settings
When updating the Makefiles, to keep from having to update two files at
the same time, import Makefile.mk into the external Makefile. This
allows the bulk of the settings to be in a single location.

While I'm here, I adjusted the print statements to match the rest of
coreboot.

Change-Id: Id5b869f49b34b22e6a02fc086e7b42975141a87e
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80715
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-02-29 02:24:09 +00:00
Arthur Heymans
55b3c0466c docker/coreboot-sdk: Add meson
This is needed to build opensil. With meson and ninja added to the
coreboot-sdk image there is no need have them in the jenkins node image.

Change-Id: I36188ae895f2a770f1dc4528f332c09bf386db73
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80736
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-02-26 17:25:00 +00:00
Martin Roth
5ff6bf30d8 util/amdfwtool: build amdfwtool only for all tools or AMD CPUs
When we're building non-AMD processors, don't bother building amdfwtool
unless we're specifically building all of the tools like for abuild.

Change-Id: I9021674a06d65a79e24020790d317ab947c505fe
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80714
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-26 14:50:18 +00:00
Elyes Haouas
04d6eb1eae crossgcc: Upgrade CMake from 3.27.7 to version 3.28.3
Change-Id: I17758e23da25d610a0b462dfd388c53b89315242
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80648
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-02-24 22:26:11 +00:00
Philipp Hug
1d3838b623 riscv/mb/qemu: fix qemu invocation comment
Change-Id: I773fb39801f180fead584942dfb385fcde9d2680
Signed-off-by: Philipp Hug <philipp@hug.cx>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80262
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
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>
Reviewed-by: ron minnich <rminnich@gmail.com>
2024-02-22 22:34:57 +00:00
Felix Singer
52b51db1d9 util/crossgcc: Update LLVM from 16.0.6 to 17.0.6
Change-Id: Ifed410f4b7fdc358535f01850328c642d19ff1f6
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78884
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-02-20 10:38:23 +00:00
Elyes Haouas
824ba49a0b crossgcc: Upgrade binutils from 2.41 to 2.42
Change-Id: I6e9b2dac6fed702e8e353290971699cb9ee05dfc
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80606
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2024-02-20 10:37:46 +00:00
Felix Singer
17e48e8530 util/liveiso/nixos: Install lm_sensors package
Change-Id: I6b027ed39d3ee81878e069142c2d7212f3dc0a6f
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80545
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
2024-02-19 14:46:34 +00:00
Patrick Georgi
7691e96ab1 cbfstool: Support 64bit addresses for flat images
SELF has the fields wired up for 64bit, but adding flat images cuts the
upper half.

Change-Id: I3b48b8face921e942fb0e01eace791ad3e1669a0
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80576
Reviewed-by: ron minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-18 21:36:08 +00:00
Maximilian Brune
732134932b util/crossgcc/buildgcc: Compile RISC-V GCC with medany
currently the HiFive Unmatched mainboard produces the following error:
```
util/crossgcc/xgcc/lib/gcc/riscv64-elf/13.2.0/rv64imafdc/lp64d/libgcc.a
(_clzsi2.o): in function `__clzdi2':
util/crossgcc/gcc-13.2.0/libgcc/libgcc2.c:690:(.text+0x1e): relocation
truncated to fit: R_RISCV_HI20 against symbol `__clz_tab' defined in
.rodata section in util/crossgcc/xgcc/lib/gcc/riscv64-elf/13.2.0/
rv64imafdc/lp64d/libgcc.a(_clz.o)
```

This is due to the fact that the libgcc.a library is compiled with the
medlow code model but the mainboards are compiled with the medany code
model.

Changing the code model of the GCC libraries to the medany code model
fixes the issue.

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: If5f07ce034686dd7fec160ea76838507c0ba7fa0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80139
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: ron minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-18 07:53:09 +00:00
Patrick Rudolph
7d4155e6e6 util/cbfstool/linux_trampoline: Support more e820 entries
Since linux commit f9ba70535dc12d9eb57d466a2ecd749e16eca866
"[PATCH] Increase number of e820 entries hard limit from 32 to 128"
made in 2005 the number of e820 entries passed from the bootloader
is 128. Use the boot protocol version to check for support of
128 entries and use them if necessary.

Tested on IBM/SBP1:
Fixes booting a Linux payload when more than 32 entries are present
in the memory table, which can easily happen on a 4 socket platform.

Change-Id: Iec0a832fff091b6c3ae7050ef63e743a30618f25
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80544
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marvin Drees <marvin.drees@9elements.com>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2024-02-18 07:50:28 +00:00
Martin Roth
be08c1d6dc Treewide: Fix incorrect SPDX license strings
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>
2024-02-18 01:55:57 +00:00
Vojtech Vesely
21af211807 util/ifdtool.c: Fix long_options for platform
Platform has argument, but has_arg was mistakenly set to 0.

Change-Id: I7d5c31c2b1da544cb73d9e213d463332fcdba7df
Signed-off-by: Vojtech Vesely <vojtech.vesely@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80432
Reviewed-by: Jan Samek <jan.samek@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marvin Drees <marvin.drees@9elements.com>
2024-02-15 09:27:21 +00:00
Felix Held
7c31352a47 util/showdevicetree: drop unmaintained tool
This tool doesn't have a makefile, when trying to compile it manually
with the given instructions it even fails to compile after fixing the
paths in the given command, and it references the non-existing
PCI_BUS_SEGN_BITS Kconfig symbol, so just drop this.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I8ca75db281a215bf3f194ab72a107f666dc0694e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79934
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-14 22:07:56 +00:00
Nicholas Sudsgaard
60a68295b8 util/intelmetool: Add Intel Union Point support
The device IDs were taken from the 200 series datasheet (page 24).

Change-Id: I34b5cb61dd7b561778cc8506858cd436e6f04f9a
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80419
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-12 04:47:24 +00:00
Stefan Reinauer
a295ac1d44 crossgcc: Add buildgcc support for Apple M1/M2 devices
GMP and IASL don't compile with the default compiler and linker flags:
- GMP's check for the MacOS architecture hard coded x86_64 but it also
  needs to know about arm64.
- iasl does some trickery on pointer alignment to save space(?), so we
  need to tell clang about it.

Change-Id: If4cca9d3e55051a6121d992e5320bee1df17af9f
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80435
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-12 04:45:03 +00:00
Patrick Georgi
3e397ddacb util/kconfig: Uprev to Linux 6.7's kconfig
Just a memory leak fix in Linux 6.7.

Change-Id: I1ff302dafa01e78429a30ff18e21ffe0b45ce46e
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80263
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-02-05 06:29:11 +00:00
Julius Werner
c228beff19 util/cbmem: Use commonlib ipchksum() algorithm
This patch switches the cbmem utility from its own IP checksum
implementation to the commonlib version (which is good because the old
one had a couple of bugs: doesn't work on odd sizes and may overflow
its carry accumulator with input larger than 64K).

Change-Id: I0bef2c85c37ddd3438b7ac6389e9daa3e4955b31
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80256
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Yidi Lin <yidilin@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-02-02 22:49:23 +00:00
Subrata Banik
5fe229744d util/ifdtool: Add a new switch -E to protect GPR0
This patch adds support for the new command-line option `-E` to
the ifdtool, which enables users (primarily factory users) to
protect GPR0.

Additionally, this patch refactors some code while adding support for
enabling GPR0 protection.

For more information on the scope of GPR0 (General Protection Range 0),
please refer to the Intel Meteor Lake-U Type 4 Client Platform SPI
Programming Guide, Document Number 768150.

BUG=b:270275115
TEST=Able to test GPR0 protection on google/rex and google/yahiko.

> ifdtool -p mtl -E image.bin -O image.bin_lock
...
Value at GPRD offset (64) is 0x83220004
--------- GPR0 Protected Range --------------
Start address = 0x00004000
End address = 0x00322fff
...
GPR0 protection is now enabled

Change-Id: I27c533ae4109c79299f4e7ff75e750d7cc64280f
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80235
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
2024-02-02 05:18:32 +00:00