Commit Graph

47950 Commits

Author SHA1 Message Date
Julius Werner 23d2465720 commonlib: Clean up compiler.h
This patch contains several minor cleanups related to compiler.h:

- Replace __always_unused() (which is a Linux-specific concept that
  doesn't make sense without also having __maybe_unused(), and had zero
  uses in the codebase) with __unused() which moves here from helpers.h

- Add __underscores__ to the names of all attributes in the compiler
  attribute shorthand macros. This is necessary to make them work in
  files where the same name was already used for an identifier (e.g.
  cbfstool/cbfs.h's `unused` array of file types).

- Remove libpayload's own copy of compiler.h and make it directly pull
  in the commonlib/bsd copy.

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: I9644da594bb69133843c6b7f12ce50b2e45fd24b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64737
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2022-06-07 12:34:35 +00:00
Subrata Banik 6876f49b7e soc/intel/meteorlake: Refactor bootblock SoC programming code
This patch ensures the IP initialization being done as part of MTL
bootblock code is able to complete the bootblock phase without any
visible hang.

The re-ordering in the MTL bootblock SoC programming is required to
ensure the SA early initialization is taking place prior to
performing any PCI Read/Write operation (like P2SB bar enabling for
IOE die etc.).

Additionally, Fast SPI init takes place prior to enabling ROM caching
etc.

BUG=b:224325352
TEST= Able to build and start booting the MTL simics.
Without this change, the code execution is stuck as below:

[NOTE ]  coreboot-4.16-1236-g856464f162-dirty Sun May 29 15:32:20 UTC 2022 bootblock starting (log level: 8)
[DEBUG]  CPU: Intel(R) Core(TM) i7 CPU (server)     @ 2.00GHz
[DEBUG]  CPU: ID a06a0, MeteorLake A0, ucode: 80000018
[DEBUG]  CPU: AES supported, TXT supported, VT supported
[DEBUG]  MCH: device id 7d02 (rev 00) is MeteorLake P
[DEBUG]  PCH: device id 7e01 (rev 00) is MeteorLake SOC
[DEBUG]  IGD: device id ffff (rev ff) is Unknown
[INFO ]  PMC: Using default GPE route.
[INFO ]  VBNV: CMOS invalid, restoring from flash
[ERROR]  init_vbnv: failed to locate NVRAM
[EMERG]  Cannot locate primary CBFS

Able to detect the Flash and reading the SPI flash layout in proper
with this change as below:
[NOTE ]  coreboot-4.16-1236-g856464f162-dirty Sun May 29 15:32:20 UTC 2022 bootblock starting (log level: 8)
[DEBUG]  CPU: Intel(R) Core(TM) i7 CPU (server)     @ 2.00GHz
[DEBUG]  CPU: ID a06a0, MeteorLake A0, ucode: 80000018
[DEBUG]  CPU: AES supported, TXT supported, VT supported
[DEBUG]  MCH: device id 7d02 (rev 00) is MeteorLake P
[DEBUG]  PCH: device id 7e01 (rev 00) is MeteorLake SOC␛␛[DEBUG]  IGD: device id ffff (rev ff) is Unknown
[INFO ]  PMC: Using default GPE route.
[INFO ]  VBNV: CMOS invalid, restoring from flash
[DEBUG]  FMAP: Found "FLASH" version 1.1 at 0x1804000.
[DEBUG]  FMAP: base = 0x0 size = 0x2000000 #areas = 33
[DEBUG]  FMAP: area RW_NVRAM found @ 112b000 (24576 bytes)
[INFO ]  SF: Detected 00 0000 with sector size 0x1000, total 0x2000000

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I8485b195f77225d8870589ff2e4d3dbdc8931f0a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64793
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
2022-06-06 17:52:32 +00:00
Subrata Banik ea4f8c28fd soc/intel/meteorlake: Increase PRERAM_CBMEM_CONSOLE_SIZE to 8KB
This patch increases PRERAM_CBMEM_CONSOLE_SIZE from 5KB to 8KB to fix
cbmem buffer overflow issue.

Test=Boot MTL simics and check cbmem -c | grep 'CBFS: Found'
lists all stages.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I5dc5d5b99003b59b2262bd1e4eb5ccb11d721195
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64791
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
2022-06-06 17:52:03 +00:00
Ravi Sarawadi b8224f48fe soc/intel/mtl: Do initial Meteor Lake SoC commit till bootblock
Base code is based of Intel Alder Lake SOC code.

List of changes:

1. Add required Meteor Lake SoC programming till bootblock
2. Include only required headers into include/soc
3. Include MTL-P related DID, BDF
4. Ref: Processor EDS documents
	vol1 #621483, vol2 #640858

TEST= Build 'util/abuild/abuild -p none -t google/rex -a -c max'.

Signed-off-by: Ravi Sarawadi <ravishankar.sarawadi@intel.com>
Change-Id: I26479fcc3a3f9c6f8ebf5f198ab0809f0b4a2cc4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62772
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-06 17:51:31 +00:00
Tim Wawrzynczak 3d79f7f13e mb/google/brya/acpi: Add support for NVPCF _DSM subfunction
The Nvidia GPU kernel driver supports another _DSM subfunction which
is known as NVPCF (Nvidia Platform and Control Framework). The
subfunction informs the kernel driver about Dynamic Boost parameters,
which is done at init time, but can also be changed dynamically.

BUG=b:214581372
TEST=build

Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I7887bfc2e8e1cae606e12502a9eda3a7954c8d7a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64535
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2022-06-06 16:18:43 +00:00
Arthur Heymans b97a303fa6 cpu/amd/agesa: Use common MRC_CACHE code to save S3 data
Use the common code to save data for fast boot or S3 resume.
An notable improvement that comes with this, is that the same 4K page
is not rewritten all the time. This prolongs the hardware's life.

TESTED on pcengines/apu1 and lenovo/g505s: S3 resume works fine.

Change-Id: I0f4f36dcead52a6c550fb5e606772e0a99029872
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44295
Reviewed-by: Mike Banon <mikebdp2@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2022-06-06 08:58:30 +00:00
Arthur Heymans 750d57ff5d drivers/amd/agesa: Don't save regular boot MTRR to flash
Save the regular boot MTRRs that are restored on the S3 path during
the CPU init in cbmem instead of storing them to the SPI flash.

This was probably done because historically this code run with late
cbmem init (in ramstage).

TESTED on pcengines/apu1 and lenovo/g505s: S3 resume works fine.

Change-Id: Ia58e7cd1afb785ba0c379ba75ef6090b56cb9dc6
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44294
Reviewed-by: Mike Banon <mikebdp2@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2022-06-06 08:57:09 +00:00
Arthur Heymans df3d97e821 drivers/amd/agesa/s3_mtrr.c: Save MSR for S3 using an array
The size of the data used is fixed in this function so there is no
need for this aritmetic.

The function signature will be changed in a followup commit.

The cache_disable call is dropped as all the codepaths calling the
restore_mtrr function do this already.

TESTED on pcengines/apu1 and lenovo/g505s: S3 resume works fine.

Change-Id: I3c6df8951d39695cddd4635360d6407d4d001b0a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44293
Reviewed-by: Mike Banon <mikebdp2@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2022-06-06 08:56:32 +00:00
Dtrain Hsu 0b917bde36 mb/google/brya/var/kinox: Set power limit based on charger type
Set different power limit values using host command to detect charger
type from ec.

Scenario:
1. With 90W customized adapter, set to baseline.
2. With 170W customized adapter, set to performance.
3. With above 90W barrel jack/type-c adapter, set to performance.
4. With below 90W barrel jack/type-c adapter, set to baseline.

BUG=b:231911918
TEST=Build and boot to Chrome OS

Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Change-Id: I9c8a5a7de8249e61468e277ec55348b660253c5d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64490
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: John Su <john_su@compal.corp-partner.google.com>
Reviewed-by: Ian Feng <ian_feng@compal.corp-partner.google.com>
Reviewed-by: Frank Wu <frank_wu@compal.corp-partner.google.com>
2022-06-06 06:57:21 +00:00
Lean Sheng Tan 0cc82d6e41 mb/prodrive/atlas: Increase CBFS size to 8MB
Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: I7c50f770c3a7ab261d6ea41f945e2239ba53fd09
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64944
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-06-05 21:07:59 +00:00
Lean Sheng Tan 37a407fead MAINTAINERS: Add Maintainers for Intel Elkhart Lake SoC
Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: I165dc152af305b8df2d5e0c9396e11087004b3c1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64946
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-06-05 21:07:26 +00:00
Lean Sheng Tan a29452af47 MAINTAINERS: Add Maintainers for Prodrive Atlas Mainboard
Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: I5a8681a207149c11402aa51df1878746560c5b6f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64945
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-06-05 21:07:03 +00:00
Lean Sheng Tan cb14e86dd4 mb/prodrive/atlas: Add data.vbt for 4 DPs support
Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: Ia5b6c5c72a1eafe1118e92e4579decb4f4abc9e5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64943
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2022-06-05 20:02:33 +00:00
Matt DeVillier 08617e3f61 mb/google/octopus: Demote NHLT log messages from error to info
Change-Id: Ib2d0c6a23b66e6e61cc8ea09a443e19a4b37c66d
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63287
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2022-06-05 20:00:10 +00:00
Lean Sheng Tan de498a2fff mb/prodrive/atlas: Update pcie config for i225
Enable clk 1, LTR & AER for PCIe-to-i225 bridge.

Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: I9593f5d0b70f3d231fd1a8f4758b924645392d63
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64902
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-06-05 19:57:00 +00:00
Lean Sheng Tan e4998d1cd2 mb/prodrive/atlas: Fix FSP debug boot hang
When device tcss_xhci is disabled, boot hang occurs at FSP-S
TcssInit(): "IomReadyCheck Failed!"

Enabling this device fixes the issue.

Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: Ie001bd56b403d511c397737fbc214ed64956910d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64901
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-06-05 19:53:31 +00:00
Lean Sheng Tan 391de94314 mb/prodrive/atlas: Add display configs for 4 DisplayPorts
Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: Iea5312055305bc3354755607a7bfafa7980c6d21
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64900
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@tutanota.com>
2022-06-05 19:52:37 +00:00
Lean Sheng Tan a1b3b62583 soc/intel/elkhartlake: Remove board related vboot kconfigs from soc
Since the non-volatile storage as it handles VBNV storage in either
flash or CMOS, is chosen based on board design, removing VBOOT_VBNV_CMOS
& VBOOT_VBNV_CMOS_BACKUP_TO_FLASH from EHL soc kconfig.
Will add the option to EHL CRB mainboard kconfig later.

Signed-off-by: Lean Sheng Tan <sheng.tan@9elements.com>
Change-Id: I97fb7017bff7751d64571d1a8ee7c8b9e2771731
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64473
Reviewed-by: Praveen HP <praveen.hodagatta.pranesh@intel.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2022-06-05 19:45:11 +00:00
Dtrain Hsu 14b8e51487 mb/google/brya/var/kinox: Update gpio configuration
Follow GPIO_Table_0527.xlsx to update gpio configuration.
- Set GPP_A15 to NC.
- Set GPP_A20 to TCP_DP1_HPD (native function1).

BUG=b:225384873
TEST=Build and boot to Chrome OS.

Signed-off-by: Dtrain Hsu <dtrain_hsu@compal.corp-partner.google.com>
Change-Id: I1c7a211c3bef1f1fe4f94345186c33363a90e11f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64786
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Ricky Chang <rickytlchang@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2022-06-05 19:40:21 +00:00
Martin Roth c07b88c052 docs/releases: Update the 4.17 release notes to final version
Now that the release has been tagged, update the release notes with the
final data and statistics.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: If4c9d6befd82e9a134ee645e97111b4489adacc0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64955
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
2022-06-05 07:48:49 +00:00
Subrata Banik 5790956f37 soc/intel/cmn/cse: Fix return type for `devfn`
This patch fixes the return type for `devfn` variable inside
heci_set_to_d0i3(). `PCI_DEVFN` macro returns `unsigned int`
instead of `pci_devfn_t`.

TEST=Able to build and boot to ChromeOS without any failure.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: Ib3a575aa7d71cbe6932e823917b57c5558387433
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64877
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2022-06-04 14:44:23 +00:00
Subrata Banik 0b92aa618f soc/intel: Rename heci_init to cse_init
This patch renames heci_init() to cse_init() as HECI initialization
should have a bigger scope than just initializing the CSE
(a.k.a HECI1 alone).

BUG=none
TEST=Able to build and boot google/taeko.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: Ic7edd55ccdcd70b244615fa06f81803a0ae6ce80
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64854
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2022-06-04 14:44:04 +00:00
Michał Żygowski de91780c30 inteltool/gpio_names/tigerlake.h: Fix HVMOS pad count
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Change-Id: I344fd2db9d53ad5e82240aaa2b766ac0d8a2045d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64464
Reviewed-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
2022-06-03 20:06:01 +00:00
Caveh Jalali afc80bcdd5 spd/lp5: Add SPD for Micron MT62F1G32D4DS
This adds support for Micron "MT62F1G32D4DS-031 WT:B" LP5 chips.

generatd SPD data with:
 util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5

BRANCH=none
BUG=b:233822309

Change-Id: Idd7fb074c4747a705a1870cd3d4393867289923b
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64733
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2022-06-03 19:46:09 +00:00
Patrick Georgi 7310789085 util/scripts/cross-repo-cherrypick: Modify output format
As far as I know the Chromium OS team is the only user of this script,
so align its output with that of other tools used there:

- Replace "Original-Commit-Id" with "GitOrigin-RevId"
- Reuse Change-Id instead of moving it to the Original- prefix, which
  leads to the creation of a new Change ID.

Change-Id: I8c39c512901c83a64f00aa48a539e6621f827242
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60979
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2022-06-03 18:44:51 +00:00
Arthur Heymans 0effeb576e cpu/x86/smm_module_loader: Use struct region in cpu map
We use a region later on so we might as well use a region from the
start. This simplifies the computations too.

Change-Id: Iffa36ccb89c36401d3856b24364216e83ca35f91
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64609
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2022-06-03 15:31:54 +00:00
Arthur Heymans af04f3cefa cpu/x86/smm: Use struct region to check overlapping sections
This allows for some runtime checks on all SMM elements and removes
the need for manual checks.

We can drop completely separate codepaths on SMM_TSEG & SMM_ASEG as the
only difference is where permanent handler gets placed.

TESTED on prodrive/hermes and qemu with SSM_ASEG with 4 cores & SMM_TSEG
with 128 cores. This code figured out quite some problems with
overlapping regions so I think this is the right approach.

Change-Id: Ib7e2e3ae16c223ecfd8d5bce6ff6c17c53496925
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63602
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2022-06-03 15:30:24 +00:00
Felix Singer 0e6f7a23e4 ec/google/chromeec/acpi: Replace LGreater(a,b) with ASL 2.0 syntax
Replace `LGreater(a, b)` with `a > b`.

Change-Id: Ie6238ead464d79b3576846f3b5b92b658972eec8
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60682
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:29:36 +00:00
Subrata Banik 510a55d4ee drivers/wifi: Move MTL Magnetar CNVi DIDs from SoC to generic driver
This patch removes the MTL CNVi DIDs macros from IA common code and is
added into the generic wifi driver.

As per Intel Connectivity Platform BIOS Guide, Connectivity Controller
IP for MTL-P is `Magnetar` and supported CRF is `Typhoon Peak 2`.

Previously Garfield Peak DIDs for Alder Lake SoC also added similarly
to generic wifi drivers.

BUG=b:224325352
TEST=Able to build and boot on MTL emulator.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: Ib98762749c71f63df3e8d03be910539469359c68
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64592
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Wonkyu Kim <wonkyu.kim@intel.com>
2022-06-03 15:28:12 +00:00
Abel Briggs c3bfbafda5 ec/acpi: Rework to reduce code duplication
- Move EC send/receive polling code to their own functions
- Add named constants for poll timeouts and delay interval
- Use human-readable timeout values
- Add `send`/`recv` functions which support custom timeouts
- Remove extra 10us delays between polling and performing a given
  transaction
- Use constants from `ec.h` for standard EC command opcodes

Tested on a Lenovo Edge E530, which takes similar code paths to
the Lenovo Twist S230u.

Change-Id: Ifda5c030ff81f1046be58aa1fcafdcf71a27cd41
Signed-off-by: Abel Briggs <abelbriggs1@hotmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64012
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2022-06-03 15:28:00 +00:00
John Su 1f52edb093 mb/google/brya/var/mithrax: Update DPTF parameters for Mithrax
Follow thermal table from thermal team.

Chang list:
1. Update TEMP_PCT of Active Policy for TSR1.

BUG=b:230829301
TEST=emerge-brya coreboot

Signed-off-by: John Su <john_su@compal.corp-partner.google.com>
Change-Id: I2a3fbdbe0dbb00597d5785c90c6e4d6ace54f13c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64856
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Frank Wu <frank_wu@compal.corp-partner.google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2022-06-03 15:27:35 +00:00
Rex-BC Chen f0604afa02 soc/mediatek: Rename mtk_wdt_preinit() to mtk_wdt_set_req()
To simplify the calling sequence for mtk_wdt_preinit() and we always
adjust request setting in mtk_wdt_preinit(), we rename
mtk_wdt_preinit() to mtk_wdt_set_req() and call it in mtk_wdt_init().

From this modification, we can also enable thermal hardware reset
feature (CB:64676, CB:64675) in MT8192 and MT8195.

BUG=none
TEST=build pass

Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Change-Id: I1904ff9387f7677a077068f2c3df923bd642ea3d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64861
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2022-06-03 15:27:26 +00:00
Maulik V Vaghela cdc1de7e92 intelblocks/gpio.c: Handle NULL return values from child functions
gpio_configure_pad function gets called for most of the GPIO
configuration for all the boards. This function is not handling NULL
pointers properly which can cause exception in CPU.

This patch fixes the handling and function is able to return early
in case the NULL pointer is passed or any subsequent child function
calls return NULL.

BUG=None
BRANCH=None
TEST=Compilation works fine for all Alder Lake boards.

Change-Id: I97fad72cdd92f70c7c5e6fdd23fbecf535a6e388
Signed-off-by: Maulik V Vaghela <maulik.v.vaghela@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64857
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
2022-06-03 15:27:16 +00:00
Vidya Gopalakrishnan 295a7508b8 mb/google/brya/variants/nereid: Add DPTF passive and critical policies for Nereid
BUG=b:233030505
BRANCH=None
TEST=Build FW and test on Nereid board.
Verified thermal throttling successfully when participant reaches temp
threshold as per Passive Policy.
Also, verified system shutdown when Temperature of participants are
reaching threshold as per Critical policy.

Signed-off-by: Vidya Gopalakrishnan <vidya.gopalakrishnan@intel.com>
Change-Id: I195f4b507ee57948751f0119735d8350dfce984b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64468
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-by: Jesper Lin <jesper_lin@wistron.corp-partner.google.com>
2022-06-03 15:27:07 +00:00
Felix Singer 89818d1da7 ec/google/chromeec/acpi: Replace Multiply(a,b,c) with ASL 2.0 syntax
Replace `Multiply (a, b, c)` with `c = a * b`.

Change-Id: Iea86e77df6c76756ed336f57a906ac0757aef1cf
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60647
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:26:15 +00:00
Felix Singer 81623fbd96 ec/google/chromeec/acpi: Replace Divide(a,b,,c) with ASL 2.0 syntax
Replace `Divide (a, b, , c)` with `c = a / b`.

Change-Id: I26117087c09109cfc480cbe01d3761a02a12c61b
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60655
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:26:04 +00:00
Felix Singer 3c799fa311 ec/google/chromeec/acpi: Replace LEqual(a,b) with ASL 2.0 syntax
Replace `LEqual(a, b)` with `a == b`.

Change-Id: I4d79080ecfe457766983b20a0217ccadcd188fcf
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60662
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:25:56 +00:00
Felix Singer 29821febc3 ec/google/chromeec/acpi: Replace LLess(a,b) with ASL 2.0 syntax
Replace `LLess(a, b)` with `a < b`.

Change-Id: I65225a890f9085574a2295e6ccd2cdc3e84f71e0
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60670
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:25:47 +00:00
Felix Singer 362de0654c arch/x86/acpi: Replace LGreater(a,b) with ASL 2.0 syntax
Replace `LGreater(a, b)` with `a > b`.

Change-Id: I0cabf4f69191fe345fd72619847db384db2e0e87
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60687
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:25:40 +00:00
Felix Singer 9b13bfc6c9 ec/google/chromeec/acpi: Replace LGreaterEqual(a,b) with ASL 2.0 syntax
Replace `LGreaterEqual(a, b)` with `a >= b`.

Change-Id: I72875f68e143f9384c91588cd453d2987fda526d
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60690
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2022-06-03 15:25:34 +00:00
Arthur Heymans 68d765b732 cpu/x86/smm_module_loader: Update logging
Some logging is superfluous and logging that code is being copied is
'SPEW' level.

Change-Id: I84d49a394cc53d78f1e1d3936502ac16810daf9f
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63481
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2022-06-03 15:23:51 +00:00
Tyler Wang 322aa801d2 mb/google/nissa/craask: Configure the external V1p05/Vnn/VnnSx
This patch configures external V1p05/Vnn/VnnSx rails for Craask
to achieve the better power savings.
* Enable the external V1p05, Vnn, VnnSx rails in S0i1, S0i2, S0i3, S3,
  S4, S5 , S0 states.
* Set the supported voltage states.
* Set the voltage for v1p05 and vnn.
* Set the ICC max for v1p05 and vnn.

BUG=b:233717182
TEST=emerge-nissa coreboot

Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Change-Id: I95d24c0836f3ee02006868341ccc72d762c155d3
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64632
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
2022-06-03 15:23:22 +00:00
Uwe Poeche 954af5293f soc/intel/elkhartlake: Select SOC_INTEL_RAPL_DISABLE_VIA_MCHBAR
Since of moving RAPL disabling to common code a config switch is
available to select that RAPL disabling has to be done via MCHBAR.
This patch selects the switch for EHL.

Test: Boot mc_ehl1 and ensure that relevant bits in MCHBAR are the same
as before the patch.

Change-Id: I1d0b7f650aa3ccf89c5c35d9b60a83a1ce48c74f
Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64661
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2022-06-03 15:22:49 +00:00
Reka Norman 9b1fc309ed mb/google/nissa/var/nivviks: Enable ISH when UFS is present
In order to enable the UFS controller (PCI device 12.7), the PCI
specification says that the device at function 0 in the same slot must
also be enabled, which is the ISH. Therefore, enable ISH when UFS is
present.

For more context on why this is necessary, see CB:62662 which enabled
UFS and ISH for adlrvp_n.

BUG=b:234136500
TEST=Build test. Will test that UFS works once we have hardware.

Signed-off-by: Reka Norman <rekanorman@chromium.org>
Change-Id: Ib60d44322cfbd8f82c33ecac7598881dfb1d0c3c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64845
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Daniil Lunev <dlunev@chromium.org>
2022-06-03 15:22:36 +00:00
Arthur Heymans 272eac4929 amdblocks/smm.h: Add header guards
Change-Id: I5d01c36fa4695ee42d18701a90d1b96bceb5045f
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64864
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
2022-06-03 15:22:28 +00:00
Uwe Poeche d2d9021543 intel/common/block: move RAPL disabling to common code
This patch brings the feature of disabling RAPL to common code. It
replaces the current solution for APL and EHL.
For special case if RAPL disabling is only working via changes in MCHBAR
a new config switch was introduced.

Test: Boot mc_apl4/5 with this patch and ensure that the
relevant bits in MSR 0x610 are the same as before the
patch.

Change-Id: I2098ddcd2f19e3ebd87ef00c544e1427674f5e84
Signed-off-by: Uwe Poeche <uwe.poeche@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64596
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
2022-06-03 15:22:17 +00:00
Martin Roth 8da4bfe5b5 util/release/build-release: Use short git hash for .coreboot-version
Builds were suddenly failing when the release was done, because the
coreboot version was overflowing a 64 character limit.  We don't need
or use the full hash in other places, so limit the hash to just what's
needed to identify the commit.

Change-Id: I57c535ca251792cae2c9a9c951e6b44bb61e4e78
Signed-off-by: Martin Roth <martin@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64923
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2022-06-03 03:10:05 +00:00
Terry Chen 5f9e2ded9f spd/lp5: Add new LP5 part H58G56AK6BX069
Hynix H58G56AK6BX069 will be used by the brya variant crota. Add
it to the LP5 parts list and regenerate the SPDs using spd_gen.

BUG=b:233830713
TEST=util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5

Signed-off-by: Terry Chen <terry_chen@wistron.corp-partner.google.com>
Change-Id: I6136e17706c6248598886f8f9bd8fdd7efff4dab
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64662
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Reka Norman <rekanorman@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2022-06-02 20:30:48 +00:00
Matt DeVillier 88698b4a83 mb/purism/librem_mini: Hide Linux GPIO LED from Windows
Hide the Linux gpio-led ACPI device from Windows by setting the device
status (_STA) to 0xB (enabled, hidden) so Windows doesn't show an
unknown device/missing drivers in Device Manger. Linux doesn't care
about the _STA value.

Test: build/boot Windows (10/11) and Linux (PureOS 10) on a Librem Mini
v2, verify LED works under Linux, is ignored under Windows

Change-Id: If3ee0db685a2f7dab505602afa98c3c2d5adf5d3
Signed-off-by: Matt DeVillier <matt.devillier@puri.sm>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64710
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
2022-06-02 19:45:18 +00:00
Nick Vaccaro 4c8f7785f9 mb/google/brya: Add new skolas baseboard
This commit adds the skolas baseboard, which is basically the brya
baseboard, but using an Intel Raptor Lake-P SoC instead of an Alder
Lake SoC.

This commit also adds the skolas baseboard variant skolas4es.

Since this baseboard is identical to the brya baseboard with the
exception of the SoC used, the new baseboard and the new baseboard's
first variant will be a copy of the current brya baseboard and brya0
variant.

For now, the skolas baseboard and skolas4es variant will continue to
use ADL-P.  This allows for two benefits:
  1. software to be proven out on existing hardware prior to RPL SoC
	support landing, and
  2. allows us not to have to wait for RPL SoC changes prior to getting
	the mainboard changes in place

Once the RPL SoC code has merged, I will update the skolas baseboard and
skolas4es variant to use RPL instead of ADL.

BUG=b:229134437
TEST=util/abuild/abuild -p none -t google/brya -x -a -c max

Change-Id: Iec100306dca2320eaf2432797f3acc31db2543d3
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63891
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2022-06-02 19:14:41 +00:00