Commit Graph

44913 Commits

Author SHA1 Message Date
Raul E Rangel a3811fe5e7 device/pci_rom: Add vga_oprom_preload
This method will allow preloading the VGA_BIOS_FILE. By preloading the
file, into cbfs_cache we reduce boot time. In the future we can also add
support for loading the second VGA_BIOS_FILE and the DGPU VGA_BIOS_FILE.

BUG=b:179699789
TEST=Boot guybrush to OS and verify 12 ms reduction in boot time

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Icb54fe3a942e9507ff6f1173ba5620a8f4ce6549
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56581
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-15 16:16:02 +00:00
Raul E Rangel b5811c0b48 lib/hardwaremain: Run timers more frequently
This change makes it so the timers run after each boot state callback,
and after each boot state. This gives coop threads the opportunity to
run more frequently and predictably.

BUG=b:179699789
TEST=Boot guybrush to OS, see SPI transactions progress faster.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I9508e7777d52fe934cc09d486abc0dab5cf7dad8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58955
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-15 16:15:32 +00:00
Hsuan-ting Chen 642508aa9c Reland "vboot_logic: Set VB2_CONTEXT_EC_TRUSTED in verstage_main"
This reverts commit adb393bdd6.
This relands commit 6260bf712a.

Reason for revert:
The original CL did not handle some devices correctly.
With the fixes:
* commit 36721a4 (mb/google/brya: Add GPIO_IN_RW to all variants'
early GPIO tables)
* commit 3bfe46c (mb/google/guybrush: Add GPIO EC in RW to early
GPIO tables)
* commit 3a30cf9 (mb/google/guybrush: Build chromeos.c in verstage

This CL also fix the following platforms:
* Change to always trusted: cyan.
* Add to early GPIO table: dedede, eve, fizz, glados, hatch, octopus,
			   poppy, reef, volteer.
* Add to both Makefile and early GPIO table: zork.

For mb/intel:
* adlrvp: Add support for get_ec_is_trusted().
* glkrvp: Add support for get_ec_is_trusted() with always trusted.
* kblrvp: Add support for get_ec_is_trusted() with always trusted.
* kunimitsu: Add support for get_ec_is_trusted() and initialize it as
	     early GPIO.
* shadowmountain: Add support for get_ec_is_trusted() and initialize
	     it as early GPIO.
* tglrvp: Add support for get_ec_is_trusted() with always trusted.

For qemu-q35: Add support for get_ec_is_trusted() with always trusted.

We could attempt another land.

Change-Id: I66b8b99d6e6bf259b18573f9f6010f9254357bf9
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58253
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 12:00:12 +00:00
Mario Scheithauer 436eac827a mb/siemens/mc_ehl2: Adjust PCIe clock source settings in devicetree
With latest hardware revision all clock outputs will be used on this
mainboard. For this reason set all clock source mappings to
'PCIE_CLK_FREE' to have a free running clock.

Change-Id: Ic3f6fb4e24128742ed72dade7a4555c39fb722ae
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59259
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-15 11:19:50 +00:00
Mario Scheithauer ed784bc0a7 mb/siemens/mc_ehl: Disable HECI #2 device
HECI #2 is not used for CSE communication. Therefore, it is not
necessary to set the parameter 'Heci2Enable' in devicetree.

Change-Id: I7012e4d877a464699727ca775af3f9965e0602e9
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58940
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-15 11:12:22 +00:00
Meera Ravindranath 3b03798953 soc/intel/alderlake: Disable VT-d for early silicons
VT-d needs to disabled for early silicons as it results in a
CPU hard hang.

BUG=b:197177091
Test=Boot brya to OS with no hang

Signed-off-by: Meera Ravindranath <meera.ravindranath@intel.com>
Change-Id: I0b9b76b6527d8b80777cb7588ce6b12282af7882
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59191
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
2021-11-15 10:34:44 +00:00
Eric Lai f005c34172 mb/google/brya/var/felwinter: Disable PCIE port 6
PCIE port 6 is empty as per schematics.

BUG=b:206047996
TEST=PCIE port 6 is disabled.

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: I30fa897c9310c44545e3df670895639a5144e1de
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59243
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 10:08:32 +00:00
Eric Lai fb02f0a55e mb/google/brya/var/felwinter: Remove USB2 port 0
USB2 port 0 is empty as per schematics.

BUG=b:206047996
TEST=USB2 port 0 is disabled.

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: I45d467a80c23d82dc33dcbed176430a758eea403
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59236
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 10:08:12 +00:00
Eric Lai 91c3ace5af mb/google/brya/var/felwinter: Enable garage pen detection
Enable garage pen detection.

BUG=b:197912223
TEST=Check evtest can trigger event when toggling the switch.

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: Ib5929c876d1a0da34dadd7997a61ab8e75acbbb6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59234
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 10:07:29 +00:00
Zheng Bao 6bc300d8d5 amdfwtool: Set soc name for Stoneyridge
For the stoneyridge, soc_name is not set in Makefile, so set_efs_table
is not called. Keep it unchanged.

Change-Id: I0e82188ce64733420a578446e22a077ef789be92
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58555
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-15 10:06:39 +00:00
Felix Held cbbb02777c soc/amd/stoneyridge/include/pci_devs: remove unused DEVID defines
None of the *_DEVID defines was used in the code, so drop those. The SoC
code uses the PCI ID defines from include/device/pci_ids.h instead.
Since it might still be useful to have the PCI device IDs as a reference
in the SoC's pci_devs.h, add those as comments instead.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I7c77d648dac57b15b56f631bd8b2494676c00a8b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59268
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-15 10:04:29 +00:00
Malik_Hsu 434fa6367f mb/google/brya/variants/primus: enable RTD3 for PCIe-eMMC bridge
Enable RTD3 driver for PCIe-eMMC bridge, If the board version is less
than 1, do not enable RTD3 driver.

BUG=b:204469567
TEST=Boot into eMMC storage and perform suspend stress 100 cycle passed

Signed-off-by: Malik_Hsu <malik_hsu@wistron.corp-partner.google.com>
Change-Id: I5836d65cedfe3907af2c4c33de7a396c4bb8b727
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59135
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 10:03:06 +00:00
Matt Chen 07e6b5f67d drivers/wifi/generic: fix package_size to align with WLAN driver
Change to use MAX_DSAR_SET_COUNT which WLAN driver always expects 3
no matter what the revision is for EWRD.
It will pass the WLAN driver check then to retrieve the data properly.

BUG=b:204414616
TEST= tested on brya with DRTU tool to verify if SAR table is
read properly or not.

Change-Id: I18e7d5f658bbf42b7eeed3da330508f14b86c0f8
Signed-off-by: Matt Chen <matt.chen@intel.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58951
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kane Chen <kane.chen@intel.corp-partner.google.com>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 09:59:44 +00:00
Sumeet Pawnikar f1d0c828d7 mb/google/brya/variants/gimble: Update PL1 min value
Update PL1 minimum value from 3W to 12W as per the thermal design
discussed in this bug 203371203 comment #10.

BUG=b:203371203
BRANCH=None
TEST=Build and boot the gimble system

Change-Id: Id66cfb6f6dc0217bd4d83eae1d66ad867a1bdb46
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58650
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 09:58:50 +00:00
Ronak Kanabar a2610581a5 vendorcode/intel/fsp: Add Alder Lake FSP headers for FSP v2422_01
The headers added are generated as per FSP v2422_01.
Previous FSP version was v2374_01.
Changes Include:
- Add CnviDdrRfim UPD in FspmUpd.h
- UPDs description update in FspmUpd.h

BUG=b:205512463
BRANCH=None
TEST=Build and boot brya

Change-Id: Id25f7199ffd08a4a74585ea1269d927efa733b8c
Signed-off-by: Ronak Kanabar <ronak.kanabar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59013
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 09:57:35 +00:00
David Wu 53075c720b mb/google/brya/var/kano: Add thermal sensor settings
Kano has 3 thermal sensors, so add the missing sensor settings.

BUG=b:205648035
TEST=build pass

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: I0da25f142149f94c83fdf7b2ba2cb8694cddb412
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59089
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com>
2021-11-15 09:46:30 +00:00
Shon Wang b8f0539d2d mb/google/brya: Create vell variant
Create the vell variant of the brya0 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:205908918
BRANCH=None
TEST=util/abuild/abuild -p none -t google/brya -x -a
make sure the build includes GOOGLE_VELL

Signed-off-by: Shon Wang <shon.wang@quanta.corp-partner.google.com>
Change-Id: Ide8ba1c0dd9b5d9ad90556053abf2a597136a10c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59242
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 04:45:03 +00:00
Sean Rhodes 5622666396 soc/intel/tigerlake: Add config option for S3 ACPI
Add Kconfig option `SOC_INTEL_TIGERLAKE_S3` which will adjust
the ACPI to not offer D3Cold when using S3.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ieb1cc3d6a03cb452ff38ae393a993e881d9b5ff4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59024
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-15 04:37:44 +00:00
Sean Rhodes e72e857168 soc/intel/tigerlake/apci: Only use SCM for ChromeOS
Software Connection Manager doesn't work with Linux 5.13 or later and
results in TBT ports timing out. Not advertising this results in
Firmware Connection Manager being used and TBT works correctly.

Linux patch:
c6da62a219

Tested on:
* StarBook Mk V
* System76 Oryx Pro 8

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ib947c3c9cd843e54d4664509c15336178c0bc99e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58798
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Tim Crawford <tcrawford@system76.com>
2021-11-15 04:37:25 +00:00
Rex-BC Chen 66bed5495b mb/google/corsola: Add VMCH and VMC for regulator interface
Add VMCH and VMC for providing power of SDCard.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I50fc87415086eb22ff35d157dba38cfd7594cc40
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59255
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:08:00 +00:00
Rex-BC Chen dc4c2b95f4 soc/mediatek/mt8186: Add support for regulator VMCH and VMC
Add support for VMCH and VMC of MT6366.

TEST=measure voltage 3.3V for VMCH and VMC
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Id8d98b6d827abd4713ee5c216941a9621422c7eb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59254
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:07:48 +00:00
Guodong Liu a10bc29dd2 soc/mediatek/mt8186: Add AUXADC driver support
Add AUXADC controller driver code.

TEST=build pass
BUG=b:202871018

Signed-off-by: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com>
Change-Id: I9fb7fd4903d67a2804c31ff404bc0486983c742f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59253
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:07:36 +00:00
Rex-BC Chen b9f95db1dc soc/mediatek/mt8186: add GIC pre-initialization function
GIC (generic interrupt controller) defines architectural requirements
for handling all interrupt sources and common interrupt controller
programming interface.
GIC needs to be pre-initialized on MT8186, so we add this initialize
function.

TEST=build pass
BUG=b:202871018

Change-Id: I6bf439d0d9e1ca7130a69b9006b957afca8b133c
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59252
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-15 03:07:23 +00:00
Rex-BC Chen 2f9e5b9e34 soc/mediatek/mt8186: add USB support
1. Enable and setup USB drivers.
2. Pull up to a weak resistor for USB3_HUB_RST_L and we reset
   the hub via GPIO149.

TEST=boot kernel from USB ok
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Ifcc11d51b0c1e495477957111e6021ef8275f629
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59251
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:07:15 +00:00
Rex-BC Chen ea0b13205a mb/google/corsola: Implement regulator interface
Use regulator interface to use regulator more easily.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Ied43cba51036c62a120df2afffeb63b5d73f012b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59250
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:07:08 +00:00
Rex-BC Chen fb06ca0aa7 mb/google/corsola: add configuration for kingler and krabby
The 'corsola' reference design will include two implementations
with different BOM selections - 'krabby' and 'kingler'.

TEST=none
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Iaf9c6af1a395030937a9a5c00e95d7246ddcb6eb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59249
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:07:00 +00:00
Rex-BC Chen 93b4145aff soc/mediatek/mt8186: add SPM register definitions
Add SPM register definitions so that other drivers can use them.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Iec2b493e464be9d617226cc8a9875ee3ddb759de
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59248
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:06:54 +00:00
Rex-BC Chen f8eed65e4c soc/mediatek/mt8186: Enable mmu operation for L2C SRAM and DMA
1. Turn off L2C SRAM and reconfigure as L2 cache
   Mediatek SoC uses part of the L2 cache as SRAM before DRAM is ready.
   After DRAM is ready, we should invoke disable_l2c_sram to reconfigure
   the L2C SRAM as L2 cache.

2. Configure DMA buffer in DRAM
   Set DRAM DMA to be non-cacheable to load blob correctly.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: If56d29cdd7d9dfaed05e129754aa1f887a581482
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59247
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:06:45 +00:00
Rex-BC Chen 7d9bd1757e soc/mediatek: move functions of mmu operation to common folder
Move mtk_soc_disable_l2c_sram and mtk_soc_after_dram to common folder
which are the same between MT8192, MT8195 and MT8186.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I8f49214b932a8d28ed2ca0d764dc745fa8ad330d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59246
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:06:35 +00:00
James Lo 1e0765d85c soc/mediatek/mt8186: Add support for PMIC MT6366
Add basic support for VCORE/VDRAM1/VDDQ of MT6366.

TEST=build pass
BUG=b:202871018

Signed-off-by: James Lo <james.lo@mediatek.corp-partner.google.com>
Change-Id: I22e30421560a32f4a9e15899e8150376b1414494
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59245
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-15 03:06:25 +00:00
Rex-BC Chen 1327f0bf07 soc/mediatek: change help text of FLASH_DUAL_READ
Change help text to "dual IO read mode" to reduce noun confusion.
Suggestion from this comment:
https://review.coreboot.org/c/coreboot/+/58837/comment/40a98af1_dce6bb2b/

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I54b81cdeba3b693451f66e003fb470c9f8c19ad9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59244
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-15 03:06:18 +00:00
Martin Roth 93e6bbad3c util/docker/coreboot-sdk: Add bsdextrautils & lcov
Add lcov for coverage calculations.
Add bsdextrautils for hexdump.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I421c59ce2d0d08bf5142dbc378eeea45b8b1d5b5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59019
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <patrick@coreboot.org>
2021-11-14 04:21:10 +00:00
Kyösti Mälkki 04c3228a5d Add ENV_STAGE_SUPPORTS_SMP to clean up spinlock stubs
CONFIG(SMP) was an invalid condition to use in cases where one
stage requires spinlocks and another one does not. The
stage not requiring spinlock still required <smp/spinlock.h>
to be implemented with no-op stubs.

This reverts commit 037ee4b556
  soc/amd/picasso: Add dummy spinlock for psp_verstage

Change-Id: Iba52febdeee78294f916775ee9ce8a82d6203570
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59094
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-13 22:26:53 +00:00
Rob Barnes f6e421ffc9 mb/google/guybrush: Add variant_espi_gpio_table
Add separate gpio table for early eSPI bus init. Remove espi GPIO from
early_gpio_table. This allows for initializing eSPI separately from
other GPIOs. Simplify verstage_mainboard_early_init.

BUG=b:200578885
BRANCH=None
TEST=Build and boot guybrush

Change-Id: I0cd439f207df7c27575ae363b207293d40485bf8
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59082
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Kangheui Won <khwon@chromium.org>
2021-11-13 00:54:21 +00:00
Raul E Rangel 2bcf99fcc4 sod/amd/cezanne: Use LZ4 for FSP-M when using SPI DMA
This change adds about 30 KiB to FSP-M. When not using the SPI DMA
controller, this change actually has a ~7 ms boot time penalty. When
we use the DMA engine, we end up with about a 5 ms decrease. Once we
switch to 100 MHz SPI this will help even more since we have effectively
eliminated the decompression time.

BUG=b:179699789
TEST=Boot nipperkin to OS and take boot time measurements
fspm.bin                       0x2efc0    fsp             90953 LZMA (233472 decompressed)
fspm.bin                       0x2cfc0    fsp            121156 LZ4  (233472 decompressed)

- FSP-M / no async -
| 508 - finished loading body                         | 177.019   | 179.384   Δ(  2.36,    0.16%) |
...
| 970 - loading FSP-M                                 | 0.346     | 0.346     Δ(  0.00,    0.00%) |
| 17 - starting LZ4 decompress (ignore for x86)       | 0.009     | 0.01      Δ(  0.00,    0.00%) |
| 18 - finished LZ4 decompress (ignore for x86)       | 53.916    | 59.475    Δ(  5.56,    0.37%) |

- FSP-M / async -
| 508 - finished loading body                         | 177.185   | 179.689   Δ(  2.50,    0.18%) |
...
| 970 - loading FSP-M                                 | 0.989     | 0.99      Δ(  0.00,    0.00%) |
| 17 - starting LZ4 decompress (ignore for x86)       | 9.483     | 12.877    Δ(  3.39,    0.24%) |
| 18 - finished LZ4 decompress (ignore for x86)       | 10.833    | 0.312     Δ(-10.52,   -0.75%) |

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I7d0363d27d98d4ed3afc6f802a13ff7986391921
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59029
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-13 00:20:21 +00:00
Marc Jones c6076ef1bc Kconfig: Show console DEBUG_FUNC if OVERRIDE_LOGLEVEL is set
Show the DEBUG_FUNC option if COSOLE_OVERRIDE_LOGLEVEL is set, or it
will never be available for some mainboards.

This was missed in commit cf3dcd6d29

Change-Id: Id2ef287fb39989007f28fc6475209eda0a63c792
Signed-off-by: Marc Jones <marcjones@sysproconsulting.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59196
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
2021-11-13 00:20:11 +00:00
Rob Barnes c30a1fade8 soc/amd/psp_verstage: Reboot on verstage_soc_early_init fail
Calling reboot_into_recovery with NULL context fails. Initializing ctx
early also fails because the cmos is not ready until after
verstage_soc_early_init. So just reboot and hope for the best.

BUG=None
TEST=Boot guybrush, suspend/resume guybrush
BRANCH=None

Change-Id: I7267a14ab048781b8998d3a6f4220de10e7df250
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59017
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-13 00:19:52 +00:00
David Wu 999f9e3487 Revert "mb/google/brask: Correct GPIO GPP_R6 and GPP_R7 setting"
This reverts commit ba6fdc892d.

Reason for revert: Refer to intel doc #627075 (Intel_600_Series Chipset_Family_PCH_GPIO_Impl_Sumry_ Rev1p5p1), GPP_R6 ~ GPP_R7 should be NF3 for dmic.

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: I460fd99b4ad4b9c470f692032ff7ea2b51cad388
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59149
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-13 00:19:33 +00:00
Paul Menzel a1aca1e656 soc/intel/xeon_sp: Fix size_t type mismatch in print statement
The 64-bit compiler x86_64-linux-gnu-gcc-10 aborts the build with the format
warning below:

        CC         romstage/soc/intel/xeon_sp/memmap.o
    src/soc/intel/xeon_sp/memmap.c: In function 'fill_postcar_frame':
    src/soc/intel/xeon_sp/memmap.c:39:62: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
       39 |         printk(BIOS_DEBUG, "cbmem base_ptr: 0x%lx, size: 0x%lx\n", cbmem_base, cbmem_size);
          |                                                            ~~^                 ~~~~~~~~~~
          |                                                              |                 |
          |                                                              long unsigned int size_t {aka unsigned int}
          |                                                            %x

As `cbmem_size` is of type `size_t` use the appropriate length modifier
`z`.

Change-Id: I1ca77de1ce33ce1e97d7c8895c6e75424f0769f5
Found-by: gcc (Debian 11.2.0-10) 11.2.0
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59054
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Lance Zhao
2021-11-13 00:18:59 +00:00
Kyösti Mälkki d1598991a3 google/stout: Remove duplicate recovery mode switch entry
Change-Id: I6e742b9d5256da2b7edcca0efda4faf999207465
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59192
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-12 19:30:13 +00:00
Kyösti Mälkki 071d1787fd google/butterfly: Refactor get_recovery_mode_switch()
Do not place console output in low-level GPIO functions.

The caller of get_recovery_mode_switch() is in vboot_logic.c
that is linked in romstage. So presumably recovery mode
is broken and is not fixed with this commit either.

Change-Id: I2a0fdbb370d54898c72adb29a0e9b990a5fc0ce1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59003
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-12 19:29:23 +00:00
Zanxi Chen 4f021e554f mb/google/trogdor: Modify BOE panel_id for mrbland
Modify BOE panel_id for mrbland due to hardware changes.

BUG=b:205166230,b:198548221
BRANCH=trogdor
TEST=emerge-strongbad coreboot

Change-Id: I65fecd854c4e3443edc07a44a1d43572d5030e4c
Signed-off-by: Zanxi Chen <chenzanxi@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58995
Reviewed-by: xuxinxiong <xuxinxiong@huaqin.corp-partner.google.com>
Reviewed-by: Bob Moragues <moragues@google.com>
Reviewed-by: Shelley Chen <shchen@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-12 17:20:51 +00:00
Tracy Wu 4eb17f8e20 soc/intel/common/block/pcie: Add ADL-P CPU PCIe Device IDs
List of changes:
1. Add PEG60/10/62 IDs (0x464d/0x460d/0x463d) into device/pci_ids.h
2. Add these new IDs into pcie_device_ids[] in pcie.c

BUG=b:205668996
TEST=Build and check fsp log to confirm the settings are set properly.

Signed-off-by: Tracy Wu <tracy.wu@intel.corp-partner.google.com>
Change-Id: Idc8a09b0579e1e6053ed2e35b7556a180a5f0088
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59081
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kane Chen <kane.chen@intel.corp-partner.google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
2021-11-12 16:46:56 +00:00
Flora Fu ff182cb237 soc/mediatek/mt8195: Add APU device apc driver
Add APU device apc driver and set up permissions.
APU has its own device apc for control access by domains.

For Domain 0, the access to the following slaves are restricted to
security read and write:
apusys_ao-2, apusys_ao-4, apusys_ao-5, apu_sctrl_reviser,
apu_iommu0_r1 apu_iommu0_r2, apu_iommu0_r3, apu_iommu0_r4
apu_iommu1_r1, apu_iommu1_r2, apu_iommu1_r3,apu_iommu1_r4

For VPU, D0/D5 are set as no protection, other domains are forbidden.
For other slaves, the D0 is no protection, other domains are forbidden.

BUG=b:203145462
BRANCH=cherry
TEST=boot cherry, check dump log and test permissions
Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: If92d3b02ac4966332315b85d68e0f48c6a9fce85
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58969
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-12 14:57:22 +00:00
Raul E Rangel dc63bbde9d soc/amd/cezanne: Use LZ4 for FSP-S
This change increases the fsps.bin by 20 KiB, but it decreases
decompression time. When not using preloading we save about 4 ms, when
using preloading we save about 6.

BUG=b:179699789
TEST=Boot nipperkin to OS
fsps.bin                       0x4afc0    fsp             66253 LZMA (200704 decompressed)
fsps.bin                       0x45fc0    fsp             87157 LZ4  (200704 decompressed)

- FSP-S / no async -

| 505 - starting to verify keyblock/preamble (RSA)    | 9.36      | 11.012    Δ(  1.65,    0.11%) |
...
| 971 - loading FSP-S                                 | 7.095     | 6.141     Δ( -0.95,   -0.07%) |
| 17 - starting LZ4 decompress (ignore for x86)       | 0.009     | 0.008     Δ( -0.00,   -0.00%) |
| 18 - finished LZ4 decompress (ignore for x86)       | 15.149    | 8.98      Δ( -6.17,   -0.42%) |
| 954 - calling FspSiliconInit                        | 0.038     | 0.037     Δ( -0.00,   -0.00%) |

- FSP-S / async -

| 508 - finished loading body                         | 177.978   | 179.689   Δ(  1.71,    0.12%) |
...
| 971 - loading FSP-S                                 | 6.928     | 7.225     Δ(  0.30,    0.02%) |
| 17 - starting LZ4 decompress (ignore for x86)       | 0.011     | 0.01      Δ( -0.00,   -0.00%) |
| 18 - finished LZ4 decompress (ignore for x86)       | 8.312     | 0.241     Δ( -8.07,   -0.58%) |
| 954 - calling FspSiliconInit                        | 0.091     | 0.09      Δ( -0.00,   -0.00%) |

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ib0479ed3c92158799ea2b023bd2ce4c5c09757dd
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59026
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-12 14:56:11 +00:00
Raul E Rangel 36c5daad33 soc/amd/cezanne: Preload FSP-S
FSP-S is normally memmapped and then decompressed. There are about 7 ms
between starting ramstage, and loading FSP-S. By preloading we can
ensure the fsps.bin is already in RAM by the time we need it. This
reduces boot time by about 7 ms.

BUG=b:
TEST=Boot nipperkin and see ~7ms reduction in boot time
| 10 - start of ramstage                              | 0.044     | 0.044     Δ(  0.00,    0.00%) |
| 30 - device enumeration                             | 1.899     | 2.073     Δ(  0.17,    0.01%) |
| 971 - loading FSP-S                                 | 6.645     | 6.628     Δ( -0.02,   -0.00%) |
| 15 - starting LZMA decompress (ignore for x86)      | 0.016     | 0.01      Δ( -0.01,   -0.00%) |
| 16 - finished LZMA decompress (ignore for x86)      | 15.266    | 8.316     Δ( -6.95,   -0.47%) |
| 954 - calling FspSiliconInit                        | 0.08      | 0.09      Δ(  0.01,    0.00%) |

CBFS DEBUG: _cbfs_alloc(name='fsps.bin', alloc=0xc9761e5c(0xc97a3f0c), force_ro=false, type=-1)
CBFS: Found 'fsps.bin' @0x1a1fc0 size 0x102cd in mcache @0xc97dd208
waiting for thread
took 1 us <-- fsps.bin was preloaded
CBFS DEBUG: get_preload_rdev(name='fsps.bin') preload successful

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I5a728047b8ad92d70bba8485017579aa3df48d95
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59025
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-12 14:55:45 +00:00
Raul E Rangel c0025c25f3 soc/amd/common/block/lpc: Set FSP-S/M alignment to 64 when using SPI DMA
This will enable reading FSP-S/M using the SPI DMA controller.

BUG=B:179699789
TEST=Build guybrush with SPI DMA enabled and verify alignment is set

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I282b9989d8e95c93603c6f69616a8f236a4e2e35
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59130
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-12 14:55:29 +00:00
Casper Chang b139e6b2a3 mb/google/brya/var/primus: Disable autonomous GPIO power management
Used H1 firmware where the last version number is 0.0.22, 0.3.22 or
less to production that will need to disable autonomous GPIO power
management and then can get H1 version by gsctool -a -f -M

BUG=b:201054849
TEST=USE="project_primus emerge-brya coreboot" and verify it builds
without error.

Change-Id: If5a99a96e5d4b84be3f2c1165283ce249ca75d58
Signed-off-by: Casper Chang <casper_chang@wistron.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59079
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-12 14:55:15 +00:00
Kyösti Mälkki 09a66ace7e google/deltaur,drallion,sarien: Refactor ChromeOS GPIOs
Low-level GPIOs should not depend on late cros_gpios that
should be guarded with CHROMEOS and implemented for the
purpose of ACPI \OIPG package generation.

Change-Id: Ibe708330504bc819e312eddaf5dfe4016cda21a1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59004
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-12 11:24:58 +00:00
Kyösti Mälkki 4bcc275d71 mb/google,intel: Add ChromeOS GPIOs to onboard.h
Change-Id: Ia473596e3c9a75587cd1288c8816bfef66bef82e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59000
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-12 11:23:00 +00:00