Commit Graph

54863 Commits

Author SHA1 Message Date
Jeremy Compostella 621ccf8a97 cbfstool: Skip relocation entries pointing to undefined symbol
The linker can make relocation entries of a symbol which has a value
of zero point to the undefined symbol entry.  It is permitted since
when the symbol value is zero as the documentation of the relocation
entry `r_info' field states:

"If the index is STN_UNDEF, the undefined symbol index, the relocation
 uses 0 as the symbol value."

The ELF binary does not really have any missing symbols.  It is an
optimization as the symbol points to the undefined symbol because its
value is zero.

A typical way to hit this cbfstool limitation is to define an empty
region using the REGION macro in the linker script.  Here is an
example if we assume `CONFIG_MY_REGION' is set to 0:

    .car.data {
            [...]
	    REGION(my_region, CONFIG_MY_REGION_SIZE)
	    [...]
    }

A region is defined as follow:

    #define REGION_SIZE(name) ((size_t)_##name##_size)

    #define DECLARE_REGION(name)	\
            extern u8 _##name[];	\
            extern u8 _e##name[];	\
            extern u8 _##name##_size[];

So the size of the region is actually the address of the
`_##name##_size' symbol.  Therefore, the `_my_region_size' symbol
address is zero and the linker can make the relocation entry of this
symbol point to the undefined symbol index.

In such a situation, cbfstool hits a segmentation fault when it
attempts to relocate the symbol in `parse_elf_to_xip_stage()'
function.  We resolves this issue by making cbfstool skips relocation
entries pointing to the undefined symbol similarly to the way it skips
relocation relative to absolute symbols.  A symbol which value is zero
can be considered an absolute symbol and therefore should not be
relocated.

Of course, we could argue that we could just prevent the declaration
of an empty region as illustrated in the following example:

    .car.data {
            [...]
	    #if CONFIG_MY_REGION_SIZE > 0
            REGION(my_region, CONFIG_MY_REGION_SIZE)
	    #endif
	    [...]
    }

However, this is not a satisfying solution because:

1. It requires to add unnecessary code in the linker script as an empty
   region is a valid declaration.  Such a workaround requires the code
   using it to mark the region symbols as weak symbols to handle the
   situation where the region is not defined.

2. There could be other situations which have yet to be uncovered which
   would lead the same cbfstool crash.

3. A binary with an empty region is a valid ELF file and cbfstool
   should not crash when it is asked to create an eXecute-In-Place stage
   out of it.

Change-Id: I2803fd3e96e7ff7a0b22d72d50bfbce7acaeb941
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77699
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-10-20 14:32:20 +00:00
Arthur Heymans 7f1f2973c5 soc/cavium/cn81xx/bootblock_custom.S: Specify arch
This fixes assembling with clang which complains about fpu instructions.

TEST: BUILD_TIMELESS=1 remains the same.

Change-Id: I175b8e749fafde5fb7ffb8101fc0dc892d9b4e0d
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74539
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:30:54 +00:00
Kapil Porwal 55b7dee278 mb/google/rex: Enable sending EOP from payload
Enable sending EOP from payload

BUG=b:279184514
TEST=Verify sending EOP from depthcharge on google/rex

Signed-off-by: Kapil Porwal <kapilporwal@google.com>
Change-Id: I5eda0a5c6d4c34cfcc2de898adde0b005d6edc1e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74768
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:29:56 +00:00
Morris Hsu 9bf0dee146 mb/google/brya/var/dochi: Enable EC keyboard backlight
Enable EC keyboard backlight for dochi.

BUG=b:299284564
TEST=FW_NAME=dochi emerge-brya coreboot chromeos-bootimage

Change-Id: I1b640c576fcdd368110b88cba6f969f10dfc15f1
Signed-off-by: Morris Hsu <morris-hsu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78395
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Bob Moragues <moragues@google.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 14:29:37 +00:00
Varshit Pandya 9acc572caa soc/amd/genoa: Add Global NVS
Change-Id: I8d64236fc81e848503535db6f52e93328a60404c
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78391
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:29:17 +00:00
Arthur Heymans c5122f9f1c soc/amd/genoa: Hook up IOMMU ops
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I2419feed1a76ec1cb04cb9640689b8758fa1d3f8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76527
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:28:57 +00:00
Varshit Pandya 0a2d2a9744 soc/amd/genoa: Add SMU header file and SMU Kconfig
Change-Id: Ief56bff2a1b8825d6e65aeb5f7ed9e8f432e465b
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78390
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
2023-10-20 14:28:48 +00:00
Arthur Heymans 49bbe34829 soc/amd/genoa: Hook up LPC ops
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I068fcbbcb0641cddce8fa85e2a64ab44d91d6bcf
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76526
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:28:13 +00:00
Varshit Pandya a775958938 soc/amd/genoa: Add MAX_CPUS
As per PPR, Genoa supports up to 96 core, that is 192 threads.
It also supports dual socket.

Change-Id: I817fea7c41477f476794e9e5c16451037d01f912
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78402
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:28:00 +00:00
Tyler Wang 6856f56be5 mb/google/rex/var/karis: Remove I2C2 "on" settings
GPP_H04/GPP_H05 doesn't use for I2C usage, remove I2C2 "on" settings.

BUG=b:294155897
TEST=Check ap firmware log, i2c2 is disabled

Change-Id: I0124fd108fbbd87507d252e9caab4dfc16aceddb
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78339
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eran Mitrani <mitrani@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:27:29 +00:00
Bora Guvendik cfec7a26c6 mb/google/rex: Set frequency and gears for SaGv points
Update SaGv gears and frequency values as per recommendation
from power and performance team. This change doesn't cause
negative impact on firmware boot time performance.

BUG=b:274137879
TEST=Verified the settings on google/rex using debug FSP logs.

Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Change-Id: Ie8a81c05f25b1cdab1008d09c606d1debea6e6e4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78268
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-20 14:27:04 +00:00
Karthikeyan Ramasubramanian 204a4e6d9f soc/amd/common/psp_verstage: Add PSP_VERSTACK_STACK_IS_MAPPED config
Crypto Engine in PSP prefers the buffer from Static RAM (SRAM). Hence if
a buffer comes from within SRAM address range, then it is passed
directly to Crypto Engine. Otherwise a bounce bufer from the stack is
used. But on SoCs like Picasso where PSP Verstage stack is mapped to a
virtual address space this check fails causing a bounce buffer to be
used and hence a stack overflow. Fix this issue by assuming that the
buffer comes from the SRAM always in such SoCs and pass the buffer
directly to crypto engine.

BUG=b:259649666
TEST=Build and boot to OS in Dalboz with unsigned PSP verstage.

Change-Id: I2161c8f0720c770efa5c05aece9584c3cbe7712a
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78426
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
2023-10-20 14:26:25 +00:00
CoolStar 64ba070fd1 drivers/generic/bayhub: Add ACPI for BH720
The Bayhub BH720 eMMC bridge is a fixed internal device, and needs to
me marked as non-removable in order for Windows to properly recognize/
utilize the device. Add the necessary ACPI to be generated at runtime.

TEST=build/boot/install Win11 on google/kahlee (liara)

Change-Id: I0815abf1d2dc5cfe785dc04670ab91f2a6a1af23
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78403
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 14:26:11 +00:00
CoolStar f2e14fbb40 mb/google/kahlee: Hide Linux machine audio devices from Windows
Windows does not use these devices for audio. Hide these so they don't
clutter device manager.

Change-Id: Ic85eff7f7ff68e25cc005bbb822bf99374c96532
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78418
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:25:32 +00:00
Arthur Heymans 0b0113f243 device/device.h: Rename pci_domain_scan_bus
On all targets the domain works as a host bridge. Xeon-sp code intends
to feature multiple host bridges below a domain, hence rename the
function to pci_host_bridge_scan_bus.

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I4e65fdbaf0b42c5f4f62297a60d818d299d76f73
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78326
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-by: Yidi Lin <yidilin@google.com>
2023-10-20 14:24:57 +00:00
CoolStar ce84a347bf acpi: Reserve hardware ID for custom AMD ACP driver
AMD Audio CoProcessor handles I2S audio on AMD SoC's. Prior to AMD
Ryzen platforms (e.g. STONEY) it is located on the Integrated GFX
device. As the proprietary AMD driver does not support accessing this
easily, reserve a custom ACPI ID from the coreboot namespace so that
another driver can be attached in Windows device manager.

Change-Id: I855b81908ed9ad0587b6367b052c726c36350208
Signed-off-by: CoolStar <coolstarorganization@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78405
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:23:55 +00:00
Tyler Wang ef68e98ff4 mb/google/rex/var/karis: Use 2 gpio for stylus detect/wake
Use 2 gpio for stylus detect and wake function.
GPP_E04 is the IRQ source, and GPP_E09 is the wake source.

BUG=b:304680060
TEST=Build and test on karis, stylus detect function works

Change-Id: I7a83326f76932c8e501e6369bb845fc7236291b4
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78336
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:23:40 +00:00
Rex Chou 69892eedf6 mb/google/nissa/var/craaskov: Use runtime detection for touchscreens
Use runtime detection for touchscreens.

BUG=b:289962599
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot

Change-Id: Ia43ada8b3b6dbee95dbadacc353106e0f8f37549
Signed-off-by: Rex Chou <rex_chou@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78338
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-20 14:23:17 +00:00
Sean Rhodes 8d730224ac mb/starlabs: Set POWER_STATE_OFF_AFTER_FAILURE
This Kconfig option is used as a failback when `get_uint_option`
fails. It will fail after coreboot is flashed, as the cfr code has
not yet setup the options.

Change the default to OFF, so when it does fallback, it's the correct
behaviour.

Change-Id: I5d06047fe23322520e9c84ded8f1941f6d716a51
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78223
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:22:50 +00:00
Sean Rhodes 34b4a2efd3 mb/starlabs/starbook: Include ACPI for GNA scoring accelerator
Change-Id: Id42d07aabfd08c6c7a38515f9cf4b749750deecd
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78202
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:22:42 +00:00
Sean Rhodes 8ef072cf14 mb/starlabs/starbook/adl: Enable PchHdaSdiEnable
This is required for the HDA device to work.

Change-Id: I5fd3617c4cb1e69b7e0ecf6cddf4c143da99b927
Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78201
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:22:23 +00:00
Jonathon Hall a86704aa10 mb/purism/librem_jsl: Add support for Librem 11
This adds support for the Librem 11 tablet, using the ME 13.50.15.1436
binary from the original BIOS (version 28.D8.E1.021) and FSP binaries
from a Jasper Lake Chromebook.

The following features were tested with PureOS:
* Audio (speakers, microphone, headset jack)
* Cameras
* Display
* Touchscreen and pen
* Keyboard cover, with tablet/laptop mode switch indicated via ACPI
* Power and volume buttons
* USB-C ports (USB 2/3, DP alt mode, PD charging)
* SD card reader
* WLAN
* Bluetooth
* NVMe SSD (socketed)
* Battery state information from EC
* Accelerometer

A UART is accessible with soldering via test points on the mainboard,
documented in the mainboard Kconfig with a toggle to enable it for
coreboot logging.

Change-Id: I545994889ddfb41f56de09b3a42840bccbd7c4aa
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78343
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:22:07 +00:00
Rex Chou 24502f4cb0 mb/google/nissa/var/craaskov: Remove TOF function
Based on schematics and confirm with EE to remove TOF function.

BUG=b:290891557
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot

Change-Id: I1ae6a6562d87f8da5f41691a7606a1aa10989443
Signed-off-by: Rex Chou <rex_chou@compal.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78147
Reviewed-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:21:46 +00:00
Jonathon Hall 484b24234c mb/purism/librem_cnl: Add ALC269 and adjust GPIOs for Librem 14 v1-02
The next board revision of Librem 14 (v1-02) has replaced the ALC256
codec with ALC269.  Add verbs for it.

Two GPIOs were changed from SMBus native functions to NC for this
revision.  They are not used on either revision, change to NC.

Change-Id: I43b6265d2f502c05d5539ff3abf53ade0da6d706
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78347
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-20 14:20:30 +00:00
Jonathon Hall 960209e7ee mb/purism/librem_cnl: Support Comet Lake v1 and v2 for Librem 14
New Librem 14s have a newer CPU stepping, which changes them from CML
v1 to v2.  The product is not significantly different and remains v1,
specifically "v1-02".

Select SOC_INTEL_COMETLAKE_1_2 to support all CPU steppings.

Change-Id: Iab37208b81e973714a2c088d2346eda518bf1214
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78346
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2023-10-20 14:20:21 +00:00
Jonathon Hall 4dfa90613c soc/intel/cannonlake: Support Comet Lake v1 and v2 in one build
Define SOC_INTEL_COMETLAKE_1_2, which creates a build supporting both
Comet Lake v1 and v2 by including both sets of FSP binaries and
selecting one based on the CPUID.

A mainboard can select this instead of SOC_INTEL_COMETLAKE_1 or ..._2
to support all CML-U steppings in one build.

Change-Id: Ic8bf444560fd6b57064c47faf038643fabde010e
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78345
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
2023-10-20 14:20:08 +00:00
Jonathon Hall eb834d9d13 drivers/intel/fsp2_0: Support embedding a second FSP-M/FSP-S
Support embedding a second FSP-M/FSP-S binary for an SoC that can
select one at runtime.

Comet Lake v1 and v2 are different steppings of the same SKUs, but they
require different FSP binaries.  Supporting both in a single build
requires embedding both FSPs and selecting one at runtime based on the
CPUID.  This is desirable for a product that may have different CPU
steppings but is not otherwise differentiated enough for a separate
firmware build.

An SoC can select PLATFORM_USES_SECOND_FSP to indicate that two FSP-M/
FSP-S binaries are required.  Implement soc_select_fsp_m_cbfs() and
soc_select_fsp_s_cbfs() to choose one based on platform-specific
criteria.  For Comet Lake, the first FSP is CML v1 and the second is
CML v2, but in principle a platform could define any meaning for the
first and second FSP.

FSP-T is not affected, only one FSP-T can be embedded if FSP_CAR is
used.

Only one set of FSP headers is used, which is sufficient for Comet Lake
v1/v2; their headers are equivalent.

ADD_FSP_BINARIES, FSP_USE_REPO, and FSP_FULL_FD are supported for both
sets of FSP-S/FSP-M but cannot be configured separately, both use the
same configuration.

Change-Id: Ied4c6c49a6bdf278238272edd47a2006258be8e5
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78344
Reviewed-by: Michał Kopeć <michal.kopec@3mdeb.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-10-20 14:19:52 +00:00
Felix Singer 4ed3ea668c util/liveiso/nixos: Drop XFS package
XFS is barely used. In order to save some space, drop it from the
package list.

Change-Id: Ic1cc567eb3f555bdf5567f3d036c84ce58691128
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78400
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-19 21:01:56 +00:00
Felix Singer 2282ed7c71 util/liveiso/nixos: Bump to 23.05
Bump to 23.05 and also rename settings in order to compliant with newest
namespaces and names.

Change-Id: I4a23466bef5c45ebb82d92038ec2595103c984d3
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78399
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
2023-10-19 21:01:50 +00:00
Ravi Sarawadi 180c702bb9 soc/intel/meteorlake: Update TBT PCIe Reg Map offsets for QS
Within TBT PCIe, following register offsets have been updated for
production silicon. Update ASL with new offsets.
1. MPC - Miscellaneous Port Configuration Register
2. RPPGEN - Root Port Power Gating Enable
3. SMSCS - SMI/SCI Status Register

BUG=306026121
TEST= Check TBT PCIe Tunnel creation and device enumration.
Change-Id: I0497f7108ef5046c2694aece232263582514a0c5
Signed-off-by: Ravi Sarawadi <ravishankar.sarawadi@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78163
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Jamie Ryu <jamie.m.ryu@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-19 16:19:31 +00:00
Jeremy Compostella 74f5a3e8a0 soc/intel: Improve CONFIG_ACPI_SOC_INTEL_SLP_S0_FREQ_HZ use
Commit bd9c562a9e ("acpi: Configure
slp-s0 residency counter frequency in LPIT table") led to jenkins
reporting the following error:

    !!!!! Error: defined(CONFIG_ACPI_SOC_INTEL_SLP_S0_FREQ_HZ)
          used at src/include/acpi/acpi.h:457.  Symbols of type 'hex'
	  are always defined.

Since hex Kconfig are always defined there is no need to test it being
defined but also no need to handle zero or non-zero values.

In addition:

1. This config was defined in Meteor Lake specific Kconfig file while
   it should actually be define closer to where it is being used (here
   soc/intel/common/block/acpi/Kconfig) and only set by the SoC Kconfig.

2. Once moved and under control of `SOC_INTEL_COMMON_BLOCK_ACPI_LPIT'
   gating (lpit.c), the Kconfig name needed to be adjusted to better fit
   its use.

3. Make Meteor Lake Kconfig sets the config but does not define it
   anymore.

TEST=LPIT ACPI table Counter Frequency field is set to 0x2005 on rex

Change-Id: I2083c9209e61be6180cca2c9f74097e2f4b4ce9a
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78458
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2023-10-19 16:17:20 +00:00
Michał Żygowski 7357f2a0ff soc/intel/alderlake: Fix incorrect microcode comments
The microcode for RPL-S C0 and H0 is actually available, however, the
name of the file contained a typo: 06-b7-05 vs 06-bf-05. Fix the typos
in the comments.

Moreover, the ADL-S C0/H0 microcode file 06-97-05 has the same sha256
sum as the equivalent RPL-S C0/H0 microcode file 06-bf-05. The sha256
sum of ADL-S/RPL-S C0/H0 microcode on intel-microcode tag
microcode-20230808:

5d8d4a4d5456c43b7cc04937c80aec094ccbf3bd89f34ffa5182913ef944a9f9

Update the comments to correctly indicate supported CPU steppings.

Change-Id: I4c848e0dfc40f6c8e26a9b31e7c4cf4c5a09128f
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78413
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-19 09:44:32 +00:00
Michał Żygowski fa78ecacec superio/smsc/sch5545/acpi/superio.asl: Clear PME status bits on SCI
The SCI handler for the GPE associated with the Super I/O did not clear
the respective PME status bits resulting in the SCI reoccurring
endlessly. The /proc/interrupts reported millions of ACPI interrupts
generated in just a few minutes of uptime. The flood of interrupts
caused some units to be unusable in extreme cases once attempted to
boot Qubes OS for example. On systems like Qubes OS it had a huge
impact on performance due to many IPCs the SCIs caused under Xen.

Clear the PME bits of devices that report a PME event. Then clear
the global PME status bit at the end of SCI handler to prevent the SCI
from asserting again until a new event occurrs. With this change
the number of ACPI interrupts generated in the first minutes of uptime
settles at a few thousands.

TEST=Boot Qubes OS R4.1.2 on Dell OptiPlex 9010 SFF and check
/proc/interrupts in dom0 if the number of ACPI interrupts is only
a few thousands.

Change-Id: I64e03d268138a62b46084be41343ef7fb089dfc3
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78351
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Krystian Hebel <krystian.hebel@3mdeb.com>
2023-10-19 07:45:02 +00:00
Nick Vaccaro 55606625bb vc/intel/raptorlake: Use FSP v4301.01 headers for Google
Remove the existing FSP 4221.00 headers subdirectory called
4221.00_google, and have Google vendor devices use FSP 4301.01.

BUG=b:306181828
TEST=`emerge-brya coreboot chromeos-bootimage`, flash and boot skolas to kernel.

Change-Id: Ic64b3aec62f0d6302278393bf06d090f43c0d592
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78444
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: <srinivas.kulkarni@intel.com>
Reviewed-by: Bora Guvendik <bora.guvendik@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-19 04:50:26 +00:00
Sukumar Ghorai 5596a351e6 mb/intel/mtlrvp: Disable package C-state auto demotion
Package C-state auto demotion feature allows hardware to determine lower
C-state as per platform policy. Since platform sets performance policy
to balanced from hardware, auto demotion can be disabled without
performance impact.

Also, disabling this feature results soc to enter below PC8 state and
additional power savings ~30mW in Local-Video-Playback scenario.

Change-Id: I6ff408280178a24686180f72f79522d2741607a1
Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78278
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-18 06:24:45 +00:00
Sukumar Ghorai 814bfc792c soc/intel/mtl: Set slp-s0 counter frequency
System sleep time (SLP_S0 signal asserted) is measured in ticks, for
Meteor Lake soc in 122us (i.e. ~8197Hz) granularity/ticks.

Change-Id: I1e95cd69e941d4d72d5c36a07660ca07ee2499ba
Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78277
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-18 06:24:15 +00:00
Sukumar Ghorai bd9c562a9e acpi: Configure slp-s0 residency counter frequency in LPIT table
Intel platforms use Low Power Idle Table (LPIT) to enumerate platform
Low Power Idle states. There are two types of low power residencies
 a) CPU PKG C10 - read via MSR (Function fixed hardware interface)
 b) Platform Controller Hub (PCH) SLP_S0 - read via memory mapped
Ref. https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_Idle.pdf

System sleep time (SLP_S0 signal asserted) is measured in ticks,
varies in every platform and based on PMC clock.

BUG=b:300440936
TEST=check kernel cpuidle sysfs for non-zero residency after s0ix cycle
and both must match
 cat /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us
 cat /sys/kernel/debug/pmc_core/slp_s0_residency_usec

Change-Id: I401dd4a09a67d81a9ea3a56cd22f1a681e2a9349
Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78164
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-18 06:23:57 +00:00
Subrata Banik 93ca15cc83 soc/intel/{adl, mtl}: Avoid redundant display init by joining to MBUS
This patch ensures that the IGD joins the MBUS when the firmware splash
screen feature is enabled (aka BMP_LOGO config is enabled).

For ChromeOS platform, it prevents the i915 driver from reinitializing
the display, which can save up to 75ms-80ms of boot time and eliminate
a brief period of blank screen between the firmware splash screen and
the OS login prompt.

BUG=b:284799726
TEST=Able to build and boot google/rex.

Change-Id: I36af167afa902053a987602d494a8830ad9b1b1a
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78387
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2023-10-18 05:47:24 +00:00
Subrata Banik 205f30bdfc soc/intel/cmn/graphics: Implement API for IGD to join the MBUS
This patch implements `.final` hooks for the IGD device to perform the
required operations before handing the control to the payload or OS.

The MBUS (Memory Bus) is a high-speed interface that connects the
graphics controller to the system memory. It provides a dedicated data
path for graphics data, which helps to improve graphics performance.

The MBUS is a key technology that helps to make the Intel i915 driver
powerful and versatile graphics drivers available. It provides the
high-speed data transfer capabilities that are essential for smooth
and responsive graphics performance.

Enable this config to ensure that the Intel GFX controller joins the
MBUS before the i915 driver is loaded. This is necessary to prevent
the i915 driver from re-initializing the display if the firmware has
already initialized it. Without this config, the i915 driver will
initialize the display to bring up the login screen although the
firmware has initialized the display using the GFX MMIO registers and
framebuffer.

Kernel graphics driver can avoid redundant display init by firmware,
which can optimize boot time by ~15ms-30ms.

Ensures hashing mode is 1x4 to enable a single pipe between Pipe A or B.
Typically, internal display is on Pipe-A, so 1x4 restricts MBUS joining
to internal display alone.

BUG=b:284799726
TEST=Able to build and boot google/rex

Change-Id: I60ae76dc783383e027e66edbcdeeb535472caeb1
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78385
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-18 05:47:18 +00:00
YH Lin 3f20973558 mb/google/rex: enable WIFI_SAR for all variants
Enabling support of WiFi SAR table for all rex variants by
setting the option at baseboard level.

BUG=b:290689824
TEST=emerge-rex coreboot

Change-Id: I17709cb5d75b56c6c1f386ab527c5c8730011bed
Signed-off-by: YH Lin <yueherngl@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78308
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
2023-10-18 05:46:54 +00:00
YH Lin 75ea925855 mb/google/rex/var/karis: sync CBI FW_CONFIG definitions
Sync'ing Karis' FW_CONFIG definitions stored in CBI,

```
_FW_MASKS = struct(
    DB_USB = 0x00000003,  # bit1~bit0
    STYLUS = 0x00000004,  # bit2
    AMP = 0x00000038,  # bit5~bit3
    FAN = 0x000000C0,  # bit7~bit6
    MIPI_CAM = 0x00000300,  # bit9 ~ bit8
    FP_MCU = 0x00000C00,  # bit11 ~ bit10
    KB_TYPE = 0x00001000,  # bit12
    WIFI_TYPE = 0x00002000,  # bit13
)

_FW_CONFIGS = struct(
    DB_USB_UNKNOWN = hw_topo.make_fw_config(_FW_MASKS.DB_USB, 0),
    DB_USB4_ANX7452 = hw_topo.make_fw_config(_FW_MASKS.DB_USB, 1),
    STYLUS_ABSENT = hw_topo.make_fw_config(_FW_MASKS.STYLUS, 0),
    STYLUS_PRESENT = hw_topo.make_fw_config(_FW_MASKS.STYLUS, 1),
    AUDIO_ALC5650 = hw_topo.make_fw_config(_FW_MASKS.AMP, 0),
    FP_MCU_ABSENT = hw_topo.make_fw_config(_FW_MASKS.FP_MCU, 0),
    FP_MCU_NUVOTON = hw_topo.make_fw_config(_FW_MASKS.FP_MCU, 1),
    FP_MCU_ELAN = hw_topo.make_fw_config(_FW_MASKS.FP_MCU, 2),
    WIFI_TYPE_CNVI = hw_topo.make_fw_config(_FW_MASKS.WIFI_TYPE, 0),
    WIFI_TYPE_PCIE = hw_topo.make_fw_config(_FW_MASKS.WIFI_TYPE, 1),
    MIPI_UF_CAM_HI556 = hw_topo.make_fw_config(_FW_MASKS.MIPI_CAM, 0),
)
```

BUG=b:290689824
TEST=emerge-rex coreboot

Change-Id: I1e4965c009edc595f24c04ac82d81aa0e723bbf3
Signed-off-by: YH Lin <yueherngl@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78261
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-10-18 05:46:46 +00:00
YH Lin b5b79c8ea9 mb/google/rex/var/karis: add hook for WiFi SAR table
WiFi SAR table for karis will be place into the CBFS later on and
as a result adding the hook in coreboot to make use of the SAR
table once the table is available.

BUG=b:290689824
TEST=emerge-rex coreboot

Change-Id: Ic989024ab9eb0fc439fc701c335a85986c4cfec5
Signed-off-by: YH Lin <yueherngl@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78260
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-18 05:46:34 +00:00
Tyler Wang 6e620c27b9 mb/google/rex/var/karis: Add FAN field in fw_config
Update default fan settings(FAN_SETTING_1) in FAN field.

Bit 6-7, FAN, 0 --> FAN_SETTING_1

BUG=b:290689824, b:294155897
TEST=Dump ssdt table and check fan settings is existed

Change-Id: Id69ec67202b5d769cd3a9a68344a6d8913ebd78b
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78216
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-18 05:46:24 +00:00
Felix Singer fd0f681229 mb/google/brox/Kconfig: Don't redefine config option
Commit 9b230ae295 introduced a redefinition of the config option
`BOARD_GOOGLE_BROX`, which is already defined in Kconfig.name
accordingly and thus causing a Kconfig warning. Fix that by removing the
type redefinition.

Change-Id: Iea6219a686a23d8d48a0bfb6ac642efd482fded9
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78394
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-18 04:24:08 +00:00
Morris Hsu d7022e3248 mb/google/brya/var/dochi: update gpio settings
Configure GPIOs according to schematics revision 20231013.

BUG=b:299284564, b:298328847, b:299570339
TEST=emerge-brya coreboot

Change-Id: I1ccab46b9f622fb98920d316c31800f39dc8ff95
Signed-off-by: Morris Hsu <morris-hsu@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78384
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Bob Moragues <moragues@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2023-10-18 02:11:03 +00:00
wuweimin 94f3866dad mb/google/brya: Create anraggar variant
Create the anraggar variant of the nissa 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:304920262
BRANCH=None
TEST=util/abuild/abuild -p none -t google/brya -x -a
make sure the build includes GOOGLE_ANRAGGAR

Change-Id: I95e72188679fc825c94c4043ed02b0aad310c6a3
Signed-off-by: wuweimin <wuweimin@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78363
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-10-17 07:18:30 +00:00
Bora Guvendik d353d7e724 soc/intel/alderlake: Add config for Client RPL FSP support
For Raptor Lake, select Raptor Lake's .fd file and header.

TEST=Boot to OS on Google Brya board with RPL silicon.

Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Change-Id: Ib3172b06b23e19be453142af764dd027bfe8043d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78014
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2023-10-16 22:19:52 +00:00
Robert Chen 76a3d77f32 mb/google/nissa/var/quandiso: Update SD card GPIO settings
Disable SD card GPIO with fw_config for quandiso units without SD
card and pull GPP_H12 to high to match the spec.

BUG=b:296506936
BRANCH=firmware-nissa-15217.B
TEST=emerge-nissa coreboot

Change-Id: Iad6789d42b9a3f9b979fd481a88cc7d69db2dcfe
Signed-off-by: Robert Chen <robert.chen@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78253
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Shawn Ku <shawnku@google.com>
2023-10-16 18:55:31 +00:00
Martin Roth db02f11c04 util/scripts: Add a script to find new users' commits on gerrit
This script lists all new commits from users with few merged commits.
By default, it looks at the last week, and considers anyone with fewer
than 5 commits merged to be a new user.

Currently the only command line argument that's accepted is the gerrit
username of the person running the query. To modify any of the other
options, the values hard-coded into the script need to be updated.

To keep down the number of repeated queries, the script saves lists of
users considered to be experienced, as well as the commits from new
users that it lists.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: Ic698798f3fddc77900c8c4e6f8427991bda3f2d1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78184
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
2023-10-16 18:53:26 +00:00
Subrata Banik 8da57ba0e7 soc/intel/cmn/gfx: Detect dual display (eDP + HDMI)
This patch adds support for detecting dual displays (eDP and HDMI) on
Intel platforms. This information is useful for setting the
`lb_framebuffer.has_external_display` variable, which is used to
determine whether depthchage should avoid shutting down when an
extended display is present.

TEST= Able to build and boot google/rex, where depthchage now
successfully avoids shutting down when both eDP and HDMI displays
are attached.

w/o this patch:
  with eDP and HDMI attached: .has_external_display=0
  with eDP attached: .has_external_display=0
  with HDMI attached: .has_external_display=1

w/ this patch:
  with eDP and HDMI attached: .has_external_display = 1
  with eDP attached: .has_external_display=0
  with HDMI attached: .has_external_display=1

Change-Id: Ie39d48da75a21e3508a1fbcf09da31caedaa1c0a
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78383
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-10-16 15:20:58 +00:00