Commit Graph

5532 Commits

Author SHA1 Message Date
Michał Żygowski d9adcee3c7 util/amdfwtool/amdfwtool.c: Add missing PMU files
Include new PMU firmware file in the PSP BIOS directories that
are available on Turin SOC.

Upstream-Status: Pending
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-05-26 15:43:10 +02:00
Michał Żygowski 348b462794 util/amdfwtool/amdfwtool.c: Avoid adding APOB NV or BIOS NV without size
Avoid adding APOB NV or BIOS NV is size is not specified. Otherwise,
the PSP BIOS directory may end up with BIOS NV of base 0 and size 0.

Upstream-Status: Pending
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-05-26 15:41:47 +02:00
Michał Żygowski 8c336283c1 util/amdfwtool: Add support for generating PSP FW SBOM
Add new parameter to pass the SBOM directory path where the SBOM JSON
files should be placed. If the path is not NULL, generate the SBOM
JSON file for each unique AMD PSP and BIOS directory entry processed
by the amdfwtool.

Upstream-Status: Pending
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-29 11:21:46 +02:00
Michał Żygowski 0b596b13be util/amdtool: Implement AHCI dumping
Dump AHCI registers that are relevant to the board porting.

Upstream-Status: Pending
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-23 17:25:58 +02:00
Patrick Rudolph cf9f0849ed amdfwtool: Allow to set bios entry 0x6d (AMD_BIOS_NV_ST)
Allow the build system to specify the variable store position in flash
and update BIOS entry 0x6d when set.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I3888810570897ea509a49fd4bc38d875d7d8be0c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91701
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Upstream-Status: Backport [CB:91701]
2026-04-08 18:05:43 +02:00
Patrick Rudolph d7d337bb1f amdfwtool: mark AMD_BIOS_APOB_NV BIOS directory entry as writable
When using ROM Armor, the AMD_BIOS_APOB_NV BIOS directory table
entry needs to be marked as writable. Add support for marking
BIOS directory table entries as writable and set all BIOS directory
files to RO, except for AMD_BIOS_APOB_NV (type 0x63), which is
written at end of coreboot based on the FMAP.

TEST=ROM Armor 3 enabled system can write APOB through PSP mailbox
     interface. When the writable bit is not set cannot write APOB
     through mailbox interface.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: Idce7f4afbdd2246a5c0fc96d27c3c721e4a5b03a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91700
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Upstream-Status: Backport [CB:91700]
2026-04-08 18:05:42 +02:00
Patrick Rudolph ace7e5737e amdfwtool: Make NVRAM regions writeable
When ROM Armor is enabled and PSP is not in "capsule update mode",
the PSP can only write to PSP directory entries that have the writable
bit set. As the fTPM PSP trustlet must write to NVRAM regions as part
of the fTPM operation, set the writable bit on such regions.

Fixes crash on PSP side when using ROM Armor and fTPM.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Change-Id: I5668976d687e5f9aa3fc62e91adf6bde5cadb5b8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/91699
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Upstream-Status: Backport [CB:91699]
2026-04-08 18:05:42 +02:00
Michał Żygowski f5cb35fa69 util/amdfwtool/amdfwread.c: Fix building the utility
Upstream-Status: Pending
Change-Id: I7f2c1fc7d1bf3c514d5f40804cec6fca5fc14dd7
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:05:40 +02:00
Michał Żygowski 93436c7a21 util/amdfwtool: Remove AMD_FW_GFXIMU_2 entry
AMD_FW_GFXIMU_2 entry has the same type value as AMD_FW_SRAM_FW_EXT.
The tool may integrate one of these blobs incorrectly, because
it searches for the first entry of given type in the amd_psp_fw_table.

AMD_FW_GFXIMU_2 could have been added by mistake, because there is no
board that actually defines PSP_GFX_IMMU_FILE_2 in fw.cfg file.

Change-Id: I7e1f38c77156d06e9e6d801bdfa9b9eefcbb374e
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90388
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Upstream-Status: Backport [CB:90388]
2026-04-08 18:05:40 +02:00
Patrick Rudolph 496b15cead amdfwread: Parse and print directory sizes
Parse the directory table size field and print along walking
the PSP directory tables.

Example output:
Table: FW   Offset     Size
PSPL1: Dir  [0x00b10000-0x00b12000)
+-->PSPL1: 0x48 0x00b30000 0x00010000
    +-->PSPL2: Dir  [0x00030000-0x00081000)
        +-->PSPL2: 0x00 0x00040000 0x00000440

Change-Id: I355c301c83af25524353a2e980066ce78b01fc37
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90329
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alicja Michalska <ahplka19@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Upstream-Status: Backport [CB:90329]
2026-04-08 18:05:40 +02:00
Michał Kopeć 257e862877 util/cbfstool/ifittool.c: Use relative addresses when adding FIT entries
This is needed to properly set addresses of objects located in the Top
Swap region of the flash, when Top Swap-based redundancy is enabled.

Upstream-Status: Pending
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:05:31 +02:00
Filip Gołaś a7e51c994b CBFS verification: support Top Swap redundancy
Separating the bootblock into two copies (in BOOTBLOCK and TOPSWAP fmap
regions) breaks the CBFS verification as TSPI CRTM knows nothing about
the new regions and looks for bootblock in a hard-coded COREBOOT fmap
region.

Introduce and use cbfs_unverified_area_type_alloc() which is an
extension of cbfs_unverified_area_alloc(), very similar to how
cbfs_ro_type_map() is an extension of cbfs_ro_map().  This allows to
specify a region of the bootblock file and skip verification because
bootblock serves as a container of hashes and is not verified itself.

The branching is done on the state of RTC BUC to always use the current
bootblock.  Somewhat confusingly, the measurement always uses BOOTBLOCK
region because with active Top Swap that's the way to access a
memory-mapped TOPSWAP region.

Makefile.mk now verifies both COREBOOT and COREBOOT_TS regions.
cbfstool needed a few updates as well:
 - recognize both "BOOTBLOCK" and "TOPSWAP" regions
 - recognize both "COREBOOT" and "COREBOOT_TS" regions
 - reset metadata cache before processing each region as cache may now
   be invalid

SMM doesn't link with vboot functions, so cbfs_file_hash_mismatch() has
to skip verification in SMM due to the use of CMOS options backend.

This is a part of the bootblock redundancy feature proposed
on the mailing list:
https://mail.coreboot.org/archives/list/coreboot@coreboot.org/thread/C6JN2PB7K7D67EG7OIKB6BBERZU5YV35/

Tested by successfully booting into Protectli VP6670 with Top Swap and
CBFS Verification features enabled and Top Swap state being toggled.

Change-Id: Ia75e714ae84d8c0ae09b27495e3056313b109999
Upstream-Status: Backport [CB:8961]
Signed-off-by: Filip Gołaś <filip.golas@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89691
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:05:28 +02:00
Krystian Hebel 353cf69892 util/smmstoretool: allow for writing raw type variables from file
Some variables can't be described using any of the predefined types.
Allow passing their values from a file.

Upstream-Status: Pending
Change-Id: Idb03e8dbdbdd446cc16cae584640cf1641ecc2c1
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:45 +02:00
Krystian Hebel 66dfd8bc70 util/smmstore_debug: add tool for low-level interactions with SMMSTORE
Commands and parameters are passed as raw numbers, but that's the point,
we want to test it with something more than normal SMMSTORE interface.

Upstream-Status: Pending
Change-Id: Ib3a32f0bdef038e4ccc2fb2bb8a6c98ae6d0cfbd
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:45 +02:00
Sergii Dmytruk 029a7d8c21 util/lint/kconfig_lint: fix negation of a match
This fixes the following Perl error (which prevents pre-commit hook from
succeeding):

    Possible precedence problem between ! and pattern match (m//)

`!$filename =~ /~$/` was apparently interpreted as
`(!$filename) =~ /~$/`.  Fix that by wrapping `=~` expression in
parenthesis.

Upstream-Status: Pending
Change-Id: If63a4b6981e5b562a9af7f2f8ac64947fad7f7b0
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:44 +02:00
Krystian Hebel 9046a46f82 util/dasharo/tag-with-changelog: try to reuse existing edk2 repository
If the script is run in the directory that was used to build coreboot,
chances are that edk2 repository is already cloned in the payloads
subdirectory. It is passed as '--reference-if-able' option, which
reduces the number of objects to be downloaded, even when it is checked
out on older revision. If that path doesn't exist, the repo gets cloned
as usual.

Upstream-Status: Inappropriate [Dasharo downstream]
Change-Id: I11eae8a7d87923a469ac7ba927103395ceb979f4
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:37 +02:00
Krystian Hebel 22cf3985a6 util/dasharo/tag-with-changelog: list edk2 and submodules commits
Other payloads aren't supported.

Both submodules and edk2 commits are nested one level deeper that the
main log. This is a compromise between enough information (previously
just the number of commit added in a submodule was printed) and clear
grouping between categories.

Changelog for edk2 is limited in history, it starts with the first
commit pointed to by common Kconfig default. For releases made before
this commit, a warning about a possibly incomplete edk2 changelog
will be shown in the comment just above the changelog. The changelog
will be complete only if older tag is made after this commit, in most
cases this will be two releases (or release candidates) from now, for
each platform separately.

Upstream-Status: Inappropriate [Dasharo downstream]
Change-Id: I9db19340b25ba8fe3c8382217e777c9dbe901d04
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:37 +02:00
Krystian Hebel aeb56261d7 util/dasharo/tag-with-changelog: dedupe Dasharo boards and build system
Protectli and NovaCustom aren't split to dedicated groups for single
boards, since new platforms are added often for those vendors.

Upstream-Status: Inappropriate [Dasharo downstream]
Change-Id: I2385ec18605f3095580857fdcac0f0e726446794
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:36 +02:00
Krystian Hebel 380f55f067 util/dasharo/tag-with-changelog: create a tag with changelog as a message
Apart for new comments for handling the tags, the format of log file
was adjusted so that all informational lines that are not expected in
the final tag description are written as comments. The changelog file
now starts with the instructions for the committer.

This commit also changes the logic checking for clean git tree - the
script no longer requires running from the main branch.

Upstream-Status: Inappropriate [Dasharo downstream]
Change-Id: I9c9b5712fc346a59e9ad0bf7969ee0be1f473a61
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:36 +02:00
Krystian Hebel 987382871f util/dasharo/tag-with-changelog: remove unnecessary parts
This includes:
- tool check - it is assumed that git is installed, and other tools are
  no longer required
- lines of code calculations - not required for a changelog
- list of added or removed mainboards, SOCs, CPUs etc.
- number of commits by author and list of new authors

Upstream-Status: Inappropriate [Dasharo downstream]
Change-Id: I17ef764516cd4ca3467e96f39ac0c81b28b8e06a
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:36 +02:00
Krystian Hebel b93392a217 util/dasharo/tag-with-changelog: add new file
This is an exact copy of util/release/genrelnotes as of 50e8579bfd
("util/release: Remove makefile.inc references from genrelnotes").
It will be modified for a new role in following commits.

Upstream-Status: Inappropriate [Dasharo downstream]
Change-Id: I32f3d2cb5ad57a52f4b20791f31f2b8ebdfcdd4a
Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 18:04:36 +02:00
Michał Żygowski 408d9b14b3 util/cbmem/cbmem.c: Avoid overflwos when parsing TCG TPM logs
The utility assumed that TCG TPM log area is zeroed and then filled
with events but it does not have to be true. If there is garbage
after the last valid event entry, the utility will most likely
access data outside of the cbmem area containing the logs. Relevant
issue: https://github.com/linuxboot/heads/issues/1608

TEST=Dump TCG TPM1.2 event log on Dell OptiPlex 7010 and see
"Invalid TPM1.2 log entry overflowing cbmem area" error is printed.

Upstream-Status: Submitted [CB:84926]
Change-Id: I7e057db3378b701d046d4e578272b10f294142a7
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 17:41:10 +02:00
Michał Żygowski 94bd3867ee util/txesbmantool: Add utility to generate TXE SB manifests
Print key hashes when displaying manifests as it may be useful when
obtaining information from binary about the used keys and what hash
should be provisioned in TXE.

Change-Id: I288fbb3db6b42e231977683145ce67e8fbd98dfc
Upstream-Status: Pending
Co-authored-by: Krystian Hebel <krystian.hebel@3mdeb.com>
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 17:41:00 +02:00
Michał Żygowski c6dc33a188 util/msi: Allow to include ROMHOLE as CBFS file
Change-Id: I3871236dccf128fb9038e98977629613d28b7121
Upstream-Status: Pending
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 17:40:31 +02:00
Michał Żygowski 5e32122975 util/ifdtool/ifdtool.c: Print current HAP state for all platforms
Change-Id: Id36e05e9d5668b7c4167bd41846d9ddee40ffea6
Upstream-Status: Pending
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2026-04-08 17:40:29 +02:00