56704 Commits

Author SHA1 Message Date
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
Julius Werner
caa50f30b7 commonlib: list: Include <stdint.h>
The list macros use uintptr_t, so they need to include the header that
declares it.

Change-Id: I56b2a988bb11d40c8761717bcd02a8199c077046
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81288
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 16:53:30 +00:00
Julius Werner
c00c14077d libpayload: Make GPL commonlib includes available to payloads and tests
CB:77968 made some non-BSD commonlib files part of libpayload when
CONFIG_LP_GPL is set. This patch exports those headers to the payload
(again only when CONFIG_LP_GPL is set) so that payloads can also call
the functions in them directly.

Also make those includes available to tests so that their functions can
be tested. There's no menuconfig for unit tests, so they are included
unconditionally, but this should be fine since the tests are standalone
and won't have to link with any proprietary third-party code.

Change-Id: Ifc3e52ee5c3e51520f7b7d44b483bfcb0e8380f8
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81287
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
2024-03-17 16:53:06 +00:00
Martin Roth
614fb7a51c drivers/spi: Add support for GD25LR512ME flash rom
This device is used on the AMD BirmanPlus board.

Change-Id: Iadb819e89a349d074e5ae9f4b62a06176f1f8f64
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81284
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-17 16:50:25 +00:00
Sean Rhodes
b668f41cce payloads/edk2: Set the EDK2 repository to custom for UPL
UPL requires the Shim Layer, and those patches exist in the
`starlabsltd` fork.

Set the repository to custom, to allow this fork and branch to
be selected correctly.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ieca72498bde51a184d689670449b66ccc78d658a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81277
Reviewed-by: Benjamin Doron <benjamin.doron00@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2024-03-17 16:50:06 +00:00
Jianeng Ceng
25e308b79a mb/google/nissa/var/anraggar: Add pen insert/remove for wakeup
Currently, inserting the pen does not wake the system, only removing
the pen does. This is caused by the wake event configuration being
DEASSERTED, so change it to ANY.

BUG=b:328351027
TEST=insert and remove pen can wakes system up.

Change-Id: Icdea995c2be04ea459e985f79269e49faf88248d
Signed-off-by: Jianeng Ceng <cengjianeng@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81102
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Shou-Chieh Hsu <shouchieh@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Derek Huang <derekhuang@google.com>
Reviewed-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com>
2024-03-17 16:43:51 +00:00
Shon Wang
deb54cc0b2 mb/google/brya: Create bujia variant
Create the bujia variant of the brask reference board by copying
the template files to a new directory named for the variant.

(Auto-Generated by create_coreboot_variant.sh version 4.5.0).

BUG=b:327549688
BRANCH=None
TEST=util/abuild/abuild -p none -t google/brya -x -a
make sure the build includes GOOGLE_BUJIA

Change-Id: I453a50f1aa64f8d4119bf0f860d928aa3e00a144
Signed-off-by: Shon Wang <shon.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81198
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kevin Chiu <kevin.chiu.17802@gmail.com>
2024-03-17 16:43:01 +00:00
Arthur Heymans
58d3090a97 src/Kconfig: Make it possible to override CCACHE in site-local
The value for CCACHE in site-local/Kconfig gets overridden by the
default in src/Kconfig. Remove the default to make overrides possible.

Change-Id: I6b9dbbb31caa3ef09afd7ecb355c01bd53807b39
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81267
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-03-17 16:37:54 +00:00
Marshall Dawson
7765f4d43b vc/amd/opensil: don't use source path when using stub
Add a 'depends on' statement so that path/to/opensil/source is only
active when the stub is not built.

Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Change-Id: Ic050ff0fa3f428e6adff3357f476fcd8a88cdf7e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81189
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Varshit Pandya <pandyavarshit@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 16:36:10 +00:00
Marshall Dawson
ee01de8034 soc/amd/phoenix: make openSIL stub optional
Convert the 'select SOC_AMD_OPENSIL_STUB' statement to a config option
and give it a prompt.  This allows for internal development of openSIL
and corresponding coreboot source, and controllable using a defconfig.

Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Change-Id: I2b48e2bbf71cd94ac7ecec13834ba36aa6c241ce
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81188
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2024-03-17 16:35:56 +00:00
Subrata Banik
4866712b04 soc/intel/mtl: Enable RAMTOP caching at SoC level for MTL devices
This patch enables the `SOC_INTEL_COMMON_BASECODE_RAMTOP` configuration
at the SoC level for all MTL devices. This change streamlines the
configuration process, avoiding redundant selections on individual
mainboards.

BUG=b:306677879
BRANCH=firmware-rex-15709.B
TEST=Verified boot functionality on google/ovis and google/rex.

Change-Id: I3aa3a83c190d0a0e93c267222a9dca0ac7651f9c
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81271
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2024-03-17 11:55:29 +00:00
Subrata Banik
aaacd5083a mb/google/rex: Reland RAMTOP caching for Ovis
This patch ensures Ovis baseboard can select RAMTOP caching to improve
the boot time w/o any runtime hang.

BUG=b:306677879
BRANCH=firmware-rex-15709.B
TEST=Verified boot on google/ovis with ~30ms savings in boot time.

Change-Id: Ic0b73eb8fb9cd6ca70d3d7168b79dfd0fbc550e3
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81270
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2024-03-17 11:55:18 +00:00
Subrata Banik
9355f318fa soc/intel/cmn/ramtop: Refactor MTRR handling for RAMTOP range
This patch refactors RAMTOP MTRR type selection to address a critical
NEM logic bug on SoCs with non-power-of-two cache sets. This bug can
cause runtime hangs when Write Back (WB) caching is enabled.

Workaround: Force MTRR type to WC (Write Combining) on affected SoCs
when the cache set count is not a power of two.

BUG=b:306677879
BRANCH=firmware-rex-15709.B
TEST=Verified boot on google/ovis and google/rex (including Ovis with
non-power-of-two cache configuration).

Change-Id: Ia9a8f0d37d581b05c19ea7f9b1a07933caa956d4
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81269
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 11:55:08 +00:00
Subrata Banik
a4c91e15f8 arch/x86: Add API to check if cache sets are power-of-two
Introduce a function to determine whether the number of cache sets is
a power of two. This aligns with common cache design practices that
favor power-of-two counts for efficient indexing and addressing.

BUG=b:306677879
BRANCH=firmware-rex-15709.B
TEST=Verified functionality on google/ovis and google/rex (including
a non-power-of-two Ovis configuration).

Change-Id: I819e0d1aeb4c1dbe1cdf3115b2e172588a6e8da5
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81268
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-17 11:54:58 +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
Nicholas Sudsgaard
a46dd5cd4b ec/hp/kbc1126/acpi: Drop unnecessary _STA methods
_STA unconditionally returning 0xF is pretty much the default[1] and
should be removed to reduce some noise.

[1] https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/06_Device_Configuration/Device_Configuration.html#sta-device-status

Change-Id: I0390767aa866e322c762038c12116a15b280af1a
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81206
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-03-16 15:20:04 +00:00
Nicholas Sudsgaard
f77a28ac1f ec/hp/kbc1126/acpi: Drop unnecessary method arguments
Method(..., 0, NotSerialized) is the default[1] and can be reduced to
Method(...) which reduces some noise.

TEST=Timeless build produces the same binary

[1] https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/19_ASL_Reference/ACPI_Source_Language_Reference.html#method-declare-control-method

Change-Id: Ic24e004500a7fa2a5a5b38a3f6f0e13e4ce7dfac
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81205
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com>
2024-03-16 15:19:29 +00:00
Felix Singer
99b069baa6 3rdparty/intel-microcode: Update submodule to upstream main
Updating from commit id ece0d29:
2023-11-14 10:19:09 -0600 - (microcode-20231114 Release)

to commit id 41af345:
2024-03-11 19:11:14 -0600 - (microcode-20240312 Release)

This brings in 1 new commits:
41af345 microcode-20240312 Release

Change-Id: Iaea865100661776c5331cba6c92ef51dfd410159
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81272
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-03-15 12:11:23 +00:00
Seunghwan Kim
3588243177 mb/google/brya/var/xol: Modify clkreq to clksrc mapping for NVMe
NVMe using clk_src[0] and clk_req[1] mapping to hardware design,
Due to inconsistency between PMC firmware and FSP, we need to set
clk_src to clk_req number, not same as hardware mapping in coreboot.
Then swap correct setting to clk_src=0,clk_req=1 in mFIT.

BUG=b:328318578
TEST=build firmware and veirfy suspend function on NVMe SKU DUT.

Cq-Depend: chrome-internal:7063434
Change-Id: I1777310782a0f4417bd1bb21287bec5852be966e
Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81230
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-03-15 12:11:11 +00:00
Yuval Peress
3ac72f8cf2 brox: ish: Add Kconfigs for ISH
Modeled after the Rex Kconfigs for ISH.

Change-Id: Ic670d550a9aaad64e52489d895b8aac2aee4b5ed
Signed-off-by: Yuval Peress <peress@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81050
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-15 12:10:39 +00:00
Maximilian Brune
b3e336c51d treewide: Move stdlib.h to commonlib
This patch moves commonlib/stdlib.h -> commonlib/bsd/stdlib.h, since
all code is BSD licensed anyway.
It also moves some code from libpayloads stdlib.h to
commonlib/bsd/stdlib.h so that it can be shared with coreboot. This is
useful for a subsequent commit that adds devicetree.c into commonlib.

Also we don't support DMA on arm platforms in coreboot (only libpayload)
therefore `dma_malloc()` has been removed and `dma_coherent()` has been
moved to architecture specific functions. Any architecture that tries to
use `dma_coherent()` now will get a compile time error. In order to not
break current platforms like mb/google/herobrine which make use of the
commonlib/storage/sdhci.c controller which in turn uses `dma_coherent` a
stub has been added to arch/arm64/dma.c.

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I3a7ab0d1ddcc7ce9af121a61b4d4eafc9e563a8a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77969
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2024-03-15 10:09:43 +00:00
Shuo Liu
8627112424 soc/intel/xeon_sp: Rewrite acpi_fill_dmar
Rewrite the function by iterating IOMMU (Input/Output Memory
Management Unit) devices instead of iterating socket and stacks,
which is more aligned to coreboot infrastructure.

TEST=intel/archercity CRB

coreboot DRHD generation is compared, the order of sections are
changed as expected but the content is kept equvalient.

Change-Id: I700513e05181303cf3f4effc793a872eb23340cb
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81228
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-14 20:15:27 +00:00
Shuo Liu
6747acb917 soc/intel/xeon_sp: Rewrite acpi_create_drhd
Obtain IOMMU (Input/Output Memory Management Unit) info and
enumerate devices using device utils instead of FSP HOB interface,
which might change across SoC generations and no ambiguity across
multiple PCIe segments.

TEST=intel/archercity CRB

coreboot DRHD generation log no changes before and after

Change-Id: Ic5c404899172a0e4fba2721b8e8ca6c1f0856698
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81227
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-14 20:12:59 +00:00
Gang Chen
07781e8268 intelblocks/pmc: Assign initial values to pmc_gpe_init variables
pmc_gpe_init uses soc_get_gpi_gpe_configs to initialize dw0, dw1
and dw2. dw0, dw1 and dw2 are uninitialized before calling
soc_get_gpi_gpe_configs. This is error prone for some soc
implementations where soc_get_gpi_gpe_configs does nothing.

This patch is simple, just to assign zero values to dw0, dw1 and
dw0, to enhance the code robustness.

TEST=intel/archercity CRB

Signed-off-by: Gang Chen <gang.c.chen@intel.com>
Change-Id: I8a710a2ac1482eed8c11977d51b187d834122d26
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81210
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-14 20:02:49 +00:00
Ronald G Minnich
72298ae964 arch/riscv: support physical memory protection (PMP) registers
PMP (Physical Memory Protection) is a feature of the RISC-V
Privileged Architecture spec, that allows defining region(s) of
the address space to be protected in a variety of ways: ranges
for M mode can be protected against access from lower privilege
levels, and M mode can be locked out of accessig to memory
reserved for lower privilege levels. Limits on Read, Write, and
Execute are allowed. In coreboot, we protect against Write and
Execute of PMP code from lower levels, but allow Reading, so as
to ease data structure access. PMP is not a security boundary,
it is an accident prevention device.

PMP is used here to protect persistent ramstage code that is
used to support SBI, e.g. printk and some data structures. It
also protects the SBI stacks. Note that there is one stack per
hart. There are 512- and 1024-hart SoC's being built today, so
the stack should be kept small.

PMP is not a general purpose protection mechanism and it is easy
to get around it. For example, S mode can stage a DMA that
overwrites all the M mode code. PMP is, rather, a way to avoid
simple accidents. It is understood that PMP depends on proper OS
behavior to implement true SBI security (personal conversation
with a RISC-V architect). Think of PMP as "Protection Minus
Protection".

PMP is also a very limited resource, as defined in the
architecture. This language is instructive: "PMP entries are
described by an 8-bit configuration register and one XLEN-bit
address register. Some PMP settings additionally use the address
register associated with the preceding PMP entry. Up to 16 PMP
entries are supported. If any PMP entries are implemented, then
all PMP CSRs must be implemented, but all PMP CSR fields are
WARL and may be hardwired to zero. PMP CSRs are only accessible
to M-mode."

In other words if you implement PMP even a little, you have to
impelement it all; but you can implement it in part by simply
returning 0 for a pmpcfg. Also, PMP address registers (pmpaddr)
don't have to implement all the bits. On a SiFive FU740, for
example, PMP only implements bits 33:0, i.e. a 34 bit address.

PMPs are just packed with all kinds of special cases. There are
no requirements that you read back what you wrote to the pmpaddr
registers. The earlier PMP code would die if the read did not
match the write, but, since pmpaddr are WARL, that was not
correct. An SoC can just decide it only does 4096-byte
granularity, on TOR PMP types, and that is your problem if you
wanted finer granulatiry. SoC's don't have to implement all the
high order bits either.

And, to reiterate, there is no requirement about which of the pmpcfg
are implemented. Implementing just pmpcfg15 is allowed.

The coreboot SBI code was written before PMP existed. In order
for coreboot SBI code to work, this patch is necessary.

With this change, a simple S-mode payload that calls SBI putchar
works:

1:
li a7, 1
li a0, 48
ecall
j 1b

Without this change, it will not work.

Getting this to build on RV32 required changes to the API,
as it was incorrect. In RV32, PMP entries are 34 bits.
Hence, the setup_pmp needed to accept u64. So,
uinptr_t can not be used, as on 32 bits they are
only 32 bit numbers. The internal API uses uintptr_t,
but the exported API uses u64, so external code
does not have to think about right shifts on base
and size.

Errors are detected: an error in base and size will result
in a BIOS_EMERG print, but not a panic.
Boots not bricks if possible.

There are small changes to the internal API to reduce
stack pressure: there's no need to have two pmpcfg_t
on the stack when one will do.

TEST: Linux now boots partly on the SiFive unmatched. There are
changes in flight on the coreboot SBI that will allow Linux to
boot further, but they are out of scope for this patch.
Currently, clk_ignore_unused is required, this requires a
separate patch.

Change-Id: I6edce139d340783148cbb446cde004ba96e67944
Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81153
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Hug <philipp@hug.cx>
2024-03-14 19:33:01 +00:00
Shuo Liu
091fb05312 soc/intel/xeon_sp: Add utils to detect domain0 and stack0
In Xeon-SP, the domain0, which is located at stack0, usually needs
special handling due to the compatible devices on it (HEPT, IO-APIC
and legacy IOs). This patch adds util function detect whether a
give domain or stack is with such a role.

TEST=intel/archercity CRB

Change-Id: I2f26b4ac54091c24c554f17964502c364288aa40
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81199
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2024-03-14 18:59:51 +00:00
Shuo Liu
e0c935b0dc soc/intel/xeon_sp: Add domain role checking utils
For Xeon-SP, there are 4 main domain roles (PCIe/CXL/IOAT/UBOX).
This patch adds util function to check whether a given domain
belongs to one of these roles, or a give device belongs to
a domain of the specific role.

TEST=intel/archercity CRB

Change-Id: I6b31c29564c774c27e86f55749ca9eca057a0cfe
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81046
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2024-03-14 18:58:32 +00:00
Patrick Rudolph
e357ac3321 soc/intel/xeon_sp: Use common _CRS code generation
Drop SoC specific code and use generic implementation provided
by pci_domain_fill_ssdt.

TEST=Booted on IBM/SBP1 to Ubuntu 22.04.
TEST=intel/archercity CRB

Change-Id: I8b0bc2eb02569b5d74f8521d79e0af8fee880c80
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80796
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-03-14 18:56:43 +00:00
Patrick Rudolph
abc274474a soc/intel/xeon_sp: Drop IIO_UDS argument
Use CONFIG_MAX_SOCKET instead of the IIO_UDS hob.
Allows to drop the argument in Xeon-SP common layer.

TEST=intel/archercity CRB

Change-Id: I05ec127f2bf84d3c242c3b0bca9709a0a7a4b52b
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Signed-off-by: Jincheng Li <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81181
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-03-14 18:55:29 +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
Nicholas Sudsgaard
78b634a766 ec/hp/kbc1126: Use ec/acpi/ec.h instead of its own implementation
This also does some light cleaning up:
 - Place spaces in function names to make it easier to read.
 - Adds a newline to a console message.

TEST=Tested to work on HP ProBook 450 G3

Change-Id: I73e60c5baa9db6874e480ecef41cf1006150e081
Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81204
Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-14 15:53:48 +00:00
Arthur Heymans
d045074b91 vendorcode/edk2-stable202302: Remove wchar_t asserts
Remove those MSVC compiler defaults checks so that the GCC defaults for
wchar_t can be used. The FSP interface does not depend on wchar_t.

TEST: the resulting binaries are the same for intel/mtlrvp

Change-Id: I0ee1abc7e9ba46665838b63a6cfe0f4aa300114c
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81192
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Reviewed-by: Ronak Kanabar <ronak.kanabar@intel.com>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
2024-03-14 15:53:09 +00:00
Frank Chu
2fd6a6758b mb/google/nissa/var/glassway: Add 2nd touchscreen via SSFC config
Define SSFC bit 0-1 in coreboot for add 2nd BOE G7500 touchscreen.

BUG=b:329339069
BRANCH=firmware-nissa-15217.B
TEST=Check touchscreen can detect and function work.
[INFO ]  input: GTCH7503:00 2A94:A804 as /devices/pci0000:00/0000:00:15.1/i2c_designware.1/i2c-10/i2c-GTCH7503:00/0014

Change-Id: I85688919864e3cac1beb2442ef3e23fe9d5f916c
Signed-off-by: Frank Chu <frank_chu@pegatron.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81217
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2024-03-14 15:38:57 +00:00
Felix Singer
f8df905e7b 3rdparty/fsp: Update submodule to upstream master
Updating from commit id dd98487:
2024-02-16 17:16:05 -0800 - (Fix EagleStreamFspBinPkg Path)

to commit id cc6399e:
2024-03-04 15:40:41 +0800 - (IoT MTL-UH & MTL-PS PV (3471_49) FSP)

This brings in 8 new commits:
cc6399e IoT MTL-UH & MTL-PS PV (3471_49) FSP
193dfbe Merge branch 'master' of https://github.com/intel/FSP
c89f32a IoT ADL-S MR7 (4445_05) FSP
bd31c89 IoT ADL-P MR6 (4445_04) FSP
738e498 Copy TGL FirmwareVersionInfoHob.h
9e7be91 IoT ADL-S MR7 (4445_05) FSP
56fb36c IoT ADL-P MR6 (4445_04) FSP
4707bc7 Elkhart Lake IPU2024.2 FSP

Change-Id: Ifa21950d6088b561f923587ca0f797de2983b67d
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81119
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-03-14 10:17:09 +00:00
Shelley Chen
860202a317 mb/google/brox: Enable EC SW Sync
Now that EC software sync has been verified to work on Brox, we can
enable it by default.

BUG=b:326152804
BRANCH=None
TEST=Verify that SW sync occurs

Change-Id: I3d356c006fc448125605761f7328d1f1e203a7c4
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81211
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-13 22:34:02 +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
Martin L Roth
092a1398f6 Revert "soc/intel/xeon_sp: Rewrite acpi_create_drhd"
This reverts commit 6995efbd1b986d0426ca513fd2e56771dd489f16.

Reason for revert: Submitted out of order and broke the coreboot build:

src/soc/intel/xeon_sp/uncore_acpi.c:275:6: error: call to undeclared function 'is_dev_on_domain0'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  275 |         if (is_dev_on_domain0(iommu)) {
      |             ^
src/soc/intel/xeon_sp/uncore_acpi.c:343:35: error: call to undeclared function 'is_dev_on_ioat_domain'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  343 |         if (CONFIG(HAVE_IOAT_DOMAINS) && is_dev_on_ioat_domain(iommu)) {
      |                                          ^
src/soc/intel/xeon_sp/uncore_acpi.c:423:4: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  423 |                         assert(vtd_mmio_cap != 0xffffffffffffffff);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^~~~~~~~~~~~~~~~~
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^~~~~~~~~~~~~~~~
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^~~~~~~~~~~~~~~~~~~~~
src/soc/intel/xeon_sp/uncore_acpi.c:423:4: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^
src/soc/intel/xeon_sp/uncore_acpi.c:455:3: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  455 |                 assert(ptr);
      |                 ^~~~~~~~~~~
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^~~~~~~~~~~~~~~~~
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^~~~~~~~~~~~~~~~
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^~~~~~~~~~~~~~~~~~~~~
src/soc/intel/xeon_sp/uncore_acpi.c:455:3: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^
src/soc/intel/xeon_sp/uncore_acpi.c:540:7: error: call to undeclared function 'is_domain0'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  540 |                 if (is_domain0(dev_get_pci_domain(dev))) {
      |                     ^
src/soc/intel/xeon_sp/uncore_acpi.c:546:2: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  546 |         assert(iommu0);
      |         ^~~~~~~~~~~~~~
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^~~~~~~~~~~~~~~~~
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^~~~~~~~~~~~~~~~
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^~~~~~~~~~~~~~~~~~~~~
src/soc/intel/xeon_sp/uncore_acpi.c:546:2: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^

Change-Id: I8b66177119ea5f55913a16aae06a3dcb807c2c64
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81233
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2024-03-13 18:02:03 +00:00
Martin L Roth
014ec7c704 Revert "soc/intel/xeon_sp: Rewrite acpi_fill_dmar"
This reverts commit 6833e8c01afc2827f150135f3805dc71820ddaa4.

Reason for revert: Submitted out of order and broke the coreboot build.

src/soc/intel/xeon_sp/uncore_acpi.c:275:6: error: call to undeclared function 'is_dev_on_domain0'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  275 |         if (is_dev_on_domain0(iommu)) {
      |             ^
src/soc/intel/xeon_sp/uncore_acpi.c:343:35: error: call to undeclared function 'is_dev_on_ioat_domain'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  343 |         if (CONFIG(HAVE_IOAT_DOMAINS) && is_dev_on_ioat_domain(iommu)) {
      |                                          ^
src/soc/intel/xeon_sp/uncore_acpi.c:423:4: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  423 |                         assert(vtd_mmio_cap != 0xffffffffffffffff);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^~~~~~~~~~~~~~~~~
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^~~~~~~~~~~~~~~~
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^~~~~~~~~~~~~~~~~~~~~
src/soc/intel/xeon_sp/uncore_acpi.c:423:4: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^
src/soc/intel/xeon_sp/uncore_acpi.c:455:3: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  455 |                 assert(ptr);
      |                 ^~~~~~~~~~~
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^~~~~~~~~~~~~~~~~
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^~~~~~~~~~~~~~~~
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^~~~~~~~~~~~~~~~~~~~~
src/soc/intel/xeon_sp/uncore_acpi.c:455:3: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^
src/soc/intel/xeon_sp/uncore_acpi.c:540:7: error: call to undeclared function 'is_domain0'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  540 |                 if (is_domain0(dev_get_pci_domain(dev))) {
      |                     ^
src/soc/intel/xeon_sp/uncore_acpi.c:546:2: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  546 |         assert(iommu0);
      |         ^~~~~~~~~~~~~~
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^~~~~~~~~~~~~~~~~
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^~~~~~~~~~~~~~~~~~~~~~
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^~~~~~~~~~~~~~~~
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^~~~~~~~~~~~~~~~~~~~~
src/soc/intel/xeon_sp/uncore_acpi.c:546:2: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
src/include/assert.h:85:27: note: expanded from macro 'assert'
   85 | #define assert(statement)       ASSERT(statement)
      |                                 ^
src/include/assert.h:56:7: note: expanded from macro 'ASSERT'
   56 |         if (!__build_time_assert(x) && !(x)) {                          \
      |              ^
src/include/assert.h:27:40: note: expanded from macro '__build_time_assert'
   27 |         (__builtin_constant_p(x) ? ((x) ? 1 : dead_code_t(int)) : 0)
      |                                               ^
src/include/assert.h:105:2: note: expanded from macro 'dead_code_t'
  105 |         *(type *)(uintptr_t)0; \
      |         ^

Change-Id: If919d6fa578a82fbb6bc5e1fd2adf4e9f59cab95
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81232
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-03-13 18:01:53 +00:00
Ronald G Minnich
e1ea9656cd payloads: allow selecting a file for FLAT_BINARY
085c97363ed6477c64b61263a59d7e9642e05cda introduced a bug in that we
could not select a file to use, and, in fact, the payload was never
installed into the image in this case.

Add FLAT_BINARY to the predicate enabling a file selection dialog.

Change-Id: I8174b656b1e6ebb3663172f473e4070b30f19126
Signed-off-by: Ronald G Minnich <rminnich@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81183
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Philipp Hug <philipp@hug.cx>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-13 17:09:20 +00:00
Jamie Chen
186907c4f7 mb/google/brya/var/omniknight: Pull down USI_REPORT_EN in romstage
Pull down USI_REPORT_EN(GPP_C6) in romstage to solve
an abnormal peek pull high before BL_EN.

Because power sequence no meet spec, pre #comment36,
it may have ghost touch.

BUG=b:326337003
TEST=FW_NAME=omnigul emerge-brya coreboot, measurement of HW and test
touch detection by evtest

Change-Id: I66f4a7915f135927fbc0a16254dece202dfc23a2
Signed-off-by: Jamie Chen <jamie_chen@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80769
Reviewed-by: Derek Huang <derekhuang@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2024-03-13 14:50:59 +00:00
Shuo Liu
6833e8c01a soc/intel/xeon_sp: Rewrite acpi_fill_dmar
Rewrite the function by iterating IOMMU (Input/Output Memory
Management Unit) devices instead of iterating socket and stacks,
which is more aligned to coreboot infrastructure.

TEST=intel/archercity CRB

coreboot DRHD generation is compared, the order of sections are
changed as expected but the content is kept equvalient.

Change-Id: I4c1cbf8d8fc93f746640efc3a82c539dcb3fdee2
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81200
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
2024-03-13 14:39:23 +00:00
Shuo Liu
6995efbd1b soc/intel/xeon_sp: Rewrite acpi_create_drhd
Obtain IOMMU (Input/Output Memory Management Unit) info and
enumerate devices using device utils instead of FSP HOB interface,
which might change across SoC generations and no ambiguity across
multiple PCIe segments.

TEST=intel/archercity CRB

coreboot DRHD generation log no changes before and after

Change-Id: Idcfa899c764ffe51db5ed202ead07ad7b6868864
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81048
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-13 14:39:13 +00:00
Tyler Wang
785a7aab14 soc/intel/mtl: Improve functions in soc_info.c
Remove debug message since it's static information.
Remove additional uint_8 varience and return below settings
directly:
1. CONFIG_SOC_INTEL_USB2_DEV_MAX
2. CONFIG_SOC_INTEL_USB3_DEV_MAX
3. MAX_TYPE_C_PORTS
4. CONFIG_MAX_TBT_ROOT_PORTS
5. CONFIG_MAX_ROOT_PORTS
6. CONFIG_MAX_PCIE_CLOCK_SRC
7. CONFIG_SOC_INTEL_UART_DEV_MAX
8. CONFIG_SOC_INTEL_I2C_DEV_MAX
9. CONFIG_SOC_INTEL_COMMON_BLOCK_GSPI_MAX

BUG=none
TEST=Build and test on rex/karis, system can boot to OS

Change-Id: I26e882d2d9dcbef84718924aaab3864d89c58f39
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81111
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Dinesh Gehlot <digehlot@google.com>
2024-03-13 14:00:22 +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
Martin Roth
30bd24fd26 Docs: Update gerrit guidelines for -1 reviews
The -1 review authority has been moved from all registered users to
users in the "reviewers" category. The reviewers group is for people
who have submitted patches to coreboot.

This change is taking the project back to how it was before 2016, and
is not due to any issues that we're seeing. The reason it was initially
changed was that in 2016, before we required all comments to be resolved
so the patch could be merged, it was easy to overlook comments that
should have been addressed. Now that the process has changed, the -1
right is no longer needed for all users simply to bring attention to
the comment.

The feeling in the leadership meeting was that since it's relatively
easy to get to reviewer status, this should not be an undue burden on
anyone.

Change-Id: I0b7f3dcc80b9122b0f923e6703da73391654d26c
Signed-off-by: Martin Roth <gaumless@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81177
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-03-13 13:58:36 +00:00
Shuo Liu
7f92210485 soc/intel/xeon_sp: Add device find utils
For Xeon-SP, it's common pattern to find devices under specific
socket, stack and domain. This patch adds util function for
these operations.

TEST=intel/archercity CRB

Change-Id: I163eacae363334919fd66d571b7e0415e77bd52d
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81043
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2024-03-13 08:42:30 +00:00
Anand Vaikar
873112ac34 mb/amd/birman_plus: Update glinda DXIO descriptors per schematics
glinda FP8 SOC PCIe lanes are updated per the Birman+ schematics 
document 105-D99700-00C revision 1.0. 

Change-Id: If22e57fc57b4824550f2dfa8b843a7809c85dbb6
Signed-off-by: Anand Vaikar <a.vaikar2021@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81036
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-03-12 14:47:11 +00:00