Commit Graph

45365 Commits

Author SHA1 Message Date
Angel Pons 0071e6b528 lib/Makefile.inc: Remove effect-free line
Because of a typo, `bootblcok-y += rtc.c` does nothing. Drop it.

Change-Id: Ife2ee152ab32ef23df5986c47bec490db592ab60
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56216
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-12-23 12:14:17 +00:00
Subrata Banik f78a4b9f86 mb/intel/{adlrvp,sm}: Remove unused header `helpers.h`
This patch removes unused header inclusion as <commonlib/helpers.h>
from several mainboard gpio definition files.

Change-Id: I36758089a4981bba916f4d9cf485f64fca2f81ae
Signed-off-by: subratabanik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60305
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
2021-12-23 04:17:11 +00:00
Tim Wawrzynczak 235a2a11b3 mb/google/brya/var/taeko: Enable Bayhub LV2 driver
Some SKUs of google/taeko have a Bayhub LV2 card reader chip,
therefore enable the corresponding driver for the mainboard.

BUG=b:204343849

Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I738af7e77a3c076742a3d6c6f48fad29dfc978ac
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60017
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-12-22 18:41:51 +00:00
Tim Wawrzynczak 3ee9bb012d drivers/generic/bayhub_lv2: Work around known errata
The Bayhub LV2 has a known errata wherein PCI config registers at
offsets 0x234, 0x238, and 0x24C will only correctly accept writes
when they are addressed via a DWORD (32-bit) wide write operation
on the PCIe bus. Offset 0x234 is the LTR max snoop and max no-snoop
latency register, therefore add a finalize callback to this driver
which will program the LTR max-snoop/no-snoop register with a 32-bit
write using the values from pciexp_get_ltr_max_latencies().

BUG=b:204343849
TEST=verified the PCI config space writes took effect on google/taeko

Change-Id: I1813f798faa534fb212cb1a074bc7bcadd17a517
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60016
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-12-22 18:41:39 +00:00
Tim Wawrzynczak a62cb5693b device: Make pciexp_get_ltr_max_latencies a public function
Some device drivers may need to get access to the LTR values for their
respective devices, therefore export this function instead of marking it
static.

BUG=b:204343849

Change-Id: Id372600e8adec0d55d3483726bb9353139685774
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60015
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2021-12-22 18:14:47 +00:00
Mark Hsieh d27dd97e17 mb/google/brya/var/gimble: Configure GPIO to release PERST# earlier
This change in power sequencing appears to fix issues with power
consumption of the SD card controller. Possibly this change
ensures the device has enough time to properly initialize itself
after reset is deasserted but before it is accessed.

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

Signed-off-by: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com>
Change-Id: I90e5dd074ceda365283fe7e1f43dfd8c692d7338
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60279
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: YH Lin <yueherngl@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-22 15:40:48 +00:00
Scott Chao baf027d50c soc/intel/alderlake: remove SOC_INTEL_COMMON_BLOCK_SMM_LOCK_GPIO_PADS
This causes the I2C touchpad device to stop working after warm reboot.

BUG=b:210701402
BRANCH=none
TEST=after warm reboot, the touchpad still works.

Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
Change-Id: I106ddc96c3185656d3f1fbcd45f198d2d46f3f4d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60126
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-12-22 15:40:25 +00:00
Joey Peng 82a283dad9 mb/google/brya/variant/taniks: Add devicetree settings
Based on schematic G570_MB_CHROME_1207_1630_ADC and gpio table of
taniks, generate overridetree.cb settings for taniks.

BUG=b:209926534
TEST=FW_NAME=taniks emerge-brya coreboot chromeos-bootimage

Signed-off-by: Joey Peng <joey.peng@lcfc.corp-partner.google.com>
Change-Id: Ib333150117832480f70fbe13bdbdf2982a7f70e6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59998
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-21 23:23:29 +00:00
Bill XIE f0215b4cae arch/x86: Init firmware pointer for EC SMSC KBC1098/KBC1126 at build time
According to util/kbc1126/README.md, for these ECs to work, the
address and size of their two firmware should be written to $s-0x100`
(`$s` means the image size, done with kbc1126_ec_insert), which means
that every existing section (especially those used to store code)
should not overlap this address, otherwise the bootblock will get
damaged when inserting firmwares of the EC.

In this commit, ecfw_ptr is a structure initialized at build time
according to CONFIG_KBC1126_FW1_OFFSET and CONFIG_KBC1126_FW2_OFFSET
(to do so, they should be redefined as hex), and linked to
CONFIG_ECFW_PTR_ADDR within bootblock, so kbc1126_ec_insert is not
needed at build time any more.

Test passed on Elitebook Folio 9470m.

Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Change-Id: I4f0de0c4d7283e630242fbe84a46e0547783c49e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/51671
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-12-21 18:13:45 +00:00
Nick Vaccaro a4dddfc3a3 Revert "vendorcode/intel/fsp: Add Alder Lake FSP headers for FSP v2471_02"
This reverts commit ae0ea32c52.
This change should not have merged until the 2471_02 FSP change is ready
for merge.

BUG=b:211481222
TEST='emerge-brya coreboot chromeos-bootimage', flash and boot brya0
to kernel.

Change-Id: Iae5b0c53ace196053e1e155efd2e08f438979ba7
Signed-off-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60262
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Zhuohao Lee <zhuohao@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-21 05:49:40 +00:00
Felix Singer b5ff51719d mb/google/reef: Move selects from Kconfig.name to Kconfig
Move selects from Kconfig.name to Kconfig so that the configuration is
at one place and not distributed over two files.

Change-Id: Id71c63556da73a09c5a6d3e844686ddc3e113ea7
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60148
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 22:11:50 +00:00
Felix Singer 02031018e1 mb/google/reef: Restore alphabetical order on Kconfig selects
Change-Id: I9578dd7cd4766b4b2ce8fb14992b1ef4701d9878
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60147
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 22:10:18 +00:00
Felix Singer d22d692a19 mb/google/poppy: Select board-specific options per board
Move board-specific selects out of common configuration and add them to
each board where necessary.

Change-Id: I5bda94b20da4c9184cef2a39598e25a214c044b1
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60146
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 22:09:08 +00:00
Felix Singer 01c06d7ba5 mb/google/poppy: Drop unnecessary Kconfig options
These variant-specific options are only selected by their board options
and are not used for anything else. Thus, merge their selects into the
board options and drop them.

Change-Id: I0eb3fdc4fd7306e76d5479494e3ab80bbdb984fe
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60189
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 22:06:51 +00:00
Felix Singer ae69f518b6 mb/google/poppy: Move selects from Kconfig.name to Kconfig
Move selects from Kconfig.name to Kconfig so that the configuration is
at one place and not distributed over two files.

Change-Id: I462426f2ef4a0ff62c0a7c1eb2a4946fba68c4a9
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60188
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 22:04:09 +00:00
Felix Singer ec9de74d2d mb/google/poppy: Restore alphabetical order on Kconfig selects
Change-Id: If5cb98712767e2acab8955931d4f342c8f3d7824
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60144
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 22:03:29 +00:00
Rob Barnes 4b75b44bd8 mb/google/guybrush: Enable PSP_S0I3_RESUME_VERSTAGE
Enable PSP_S0I3_RESUME_VERSTAGE for all guybrush based boards. This will
cause verstage to run during s0i3 resume. The TPM will be reinitialized
in verstage during s0i3 resume. This is necessary on guybrush boards
because the TPM_RST_L pin is asserted by the SOC in S0i3.

BUG=b:200578885
BRANCH=None
TEST=TPM initialized after s0i3

Change-Id: I9d64fe92ffc67a421be6d5e013e636332ce86dd5
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60139
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-12-20 17:53:10 +00:00
Rob Barnes 4454c9af3c soc/amd/cezanne: Correct S0i3 verstage softfuse bit
PSP_S0I3_RESUME_VERSTAGE softfuse bit is 58, not 40.

BUG=b:202397678
BRANCH=None
TEST=Boot guybrush, ensure S0i3 verstage runs with latest PSP.

Change-Id: Ia27f6e48e345aac0d5f6579d663a6b655688239a
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60214
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2021-12-20 17:52:50 +00:00
Angel Pons 57af68fec9 configs: Add config for Prodrive Hermes
Build-test the configuration Prodrive uses to build coreboot for their
Hermes mainboard.

Change-Id: I62e79d3143851bf14dfdbe70e60c60f13dd06c3f
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57168
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Justin van Son <justin.van.son@prodrive-technologies.com>
2021-12-20 17:51:52 +00:00
Sridhar Siricilla aff2457723 commonlib: Add new TS for CSE firmware Sync
The patch defines new TS for CSE firmware synchronization.
Also, removes unused TS_FIT_UCODE_LOADED TS.

TEST=Build the code for Brya

Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Change-Id: I9ed82c5358eb94b5e7c91b9fd783c5e09189b77a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59668
Reviewed-by: Maulik V Vaghela <maulik.v.vaghela@intel.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-12-20 17:51:27 +00:00
Rory Liu 58ce8b7db0 mb/google/brya/var/brask: Add wake-on-lan function
Add a wake-on-lan GPIO in devicetree for RTL8125.
Modify GPIO A7 for wake-on-lan.

BUG=b:204289108
TEST=emerge-brask coreboot chromeos-bootimage

Signed-off-by: Rory Liu <rory.liu@quanta.corp-partner.google.com>
Change-Id: Ic40301888a138df4a67398485f2a484d69b83fc9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60132
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 17:50:17 +00:00
Curtis Chen b89c798ddc soc/intel/common: Do not trigger crashlog on all resets by default
Crashlog has error records and PMC reset records two parts. When we
send ipc cmd "PMC_IPC_CMD_ID_CRASHLOG_ON_RESET", PMC reset record is
enabled. At each warm/cold/global reset, crashlog would be triggered.
The cause of this crash would be "TRIGGER_ON_ALL_RESETS", it is used to
catch unknown reset reason. At the same time, we would see [Hardware
Error] in the kernel log.

If we default enable TRIGGER_ON_ALL_RESETS, we would have too many false
alarm. Now we disable PMC reset records part by default. And we could
enable it when we need it for the debug purpose.

The generated bert dump is under /var/spool/crash/, we could check this
path to verify this CONFIG disable/enable status.

BUG=b:202737385
TEST=No new bert dump after a warm reset.

Signed-off-by: Curtis Chen <curtis.chen@intel.com>
Change-Id: I3ec4ff3c8a3799156de030f4556fe6ce61305139
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59951
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 17:49:53 +00:00
Shon Wang b39f2a9066 mb/google/brya/var/vell: update memory settings
DQ/DQS info from Intel_Platform_DQ_DQS_RCOMP_Info_Utility
GPIO_MEN_CONFIG_0	GPP_E11 to GPP_E3
GPIO_MEN_CONFIG_3	GPP_E12 to GPP_E7
GPIO_MEM_CH_SEL_GPP_E5  GPP_E13 to GPP_E5

BUG=b:205908918
TEST=emerge-brya coreboot

Change-Id: Ic0bbac5eaebc77639be6c1bc399658ac90e72fbb
Signed-off-by: Shon Wang <shon.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59334
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 17:48:54 +00:00
Kevin Chiu 1a7afb8363 mb/google/brya/var/vell: update gpio override
Configure GPIOs according to schematics

BUG=b:205908918
TEST=emerge-brya coreboot

Change-Id: Icc91866f7555c294af7eed9e5d1550e73d8059d0
Signed-off-by: Kevin Chiu <Kevin.Chiu@quantatw.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59305
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 17:48:14 +00:00
Jakub Czapiga f490d48b5c libpayload: Add -Wno-address-of-packed-member for ARCH_MOCK
When compiling libpayload using x86_64 toolchain for ARCH_MOCK compiler
reports an error about gerring address of packed member. Until now it
had to be disabled by passing -Wno-address-of-packed-member to
EXTRA_CFLAGS. This patch disables this warning.

Change-Id: I9a948fabe66f7297632ecaca8ec1bfa5c842b750
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60169
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-12-20 17:47:50 +00:00
Tim Wawrzynczak a7e85d43c8 mb/google/brya/var/*: Add disable_gpio_export_in_crs to all devicetrees
None of the touchscreens used in the brya program (any brya board)
should require exporting of GPIOs in the ACPI _CRS method for any i2c
device. This can cause i2c devices to malfunction or cause timing
sequence violations if:

1) ACPI exports a PowerResource for the device that uses GPIOs that are
   also exported in _CRS
2) The kernel driver for the device uses the GPIOs exported in _CRS for
   its own purposes. This means the state of the pin is out of sync
   between platform firmware and the kernel. The Linux ELAN I2C
   touchcsreen driver (https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/kernel/upstream/drivers/input/touchscreen/elants_i2c.c;l=1429)
   is one example of this.

Therefore, add disable_gpio_export_in_crs to all brya variants that use
the drivers/i2c/generic or drivers/i2c/hid chip drivers.

Change-Id: Ib4475bd0dc885e230911de6298fd95baa868ef29
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60175
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-12-20 17:47:24 +00:00
Ariel_Fang 8140691742 mb/google/brya/var/primus: Update thermal table for primus
- Because primus have five sensors,we need to define 5 sensors.

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

Signed-off-by: Ariel_Fang <ariel_fang@wistron.corp-partner.google.com>
Change-Id: I02fb8eee644f9999d9c5d48e3a056499d968f85d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60101
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-20 17:45:48 +00:00
Zhuohao Lee fba3668f5a mb/google/brya/variants/brask: Disable autonomous GPIO power management
We experienced the `Cr50 i2c TPM IRQ timeout!` error when the device
executed the reboot test even though we have updated the Cr50 firmware
to the latest version 0.6.70. Besides, we also experienced the device
failed with the IRQ timeout when using the 0.3.22 Cr50 firmware in the
factory. In order to fix these issues, we disable the gpio power
management from the devicetree.

BUG=b:210540890
TEST=reboot 100 cycles without the error message.

Change-Id: I5f18fea5bc28493107c6d4951805de640a0b8ae5
Signed-off-by: Zhuohao Lee <zhuohao@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60100
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2021-12-20 17:45:28 +00:00
Felix Held aed38a94e3 soc/amd/common/lpc/espi_util: use enum cb_err type for return values
Use enum cb_err as return type of all remaining functions that only
return success or failure.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I6cff8480d99641fdfb613bb3e4edc4055ad5efc6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60208
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:40:52 +00:00
Felix Held 4b4114f709 soc/amd/common/lpc/espi_util: use enum cb_err type for return values
Use enum cb_err as return type of all functions that aren't exposed
outside of this compilation unit. The checks if a function has returned
a failure are replaced with checks if the return value isn't CB_SUCCESS
which is equivalent if only those two values are used, but also detects
a failure if any unexpected value would be returned.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: If8c703f62babac31948d0878e91bd31b31bebc01
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60207
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:40:32 +00:00
Felix Held 9e830540ec soc/amd/common/lpc/espi_util: simplify espi_configure_decodes
The intermediate ret variable isn't needed. espi_open_generic_io_window
only returns 0 or -1, so if ret is != 0, it has to be -1. This is a
preparation to use the enum cb_err type for the return values.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ia6c7f4cedf8c2defadcf4c4da1697a97c7b401f2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60206
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:40:07 +00:00
Felix Held d992aa6111 soc/amd/common/lpc/espi_util: simplify espi_get_general_configuration
The intermediate ret variable isn't needed.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I4e6747cf468c5ba8da6c1a3b20022851e32ad951
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60205
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:39:46 +00:00
Felix Held bad64c8b9b soc/amd/cezanne/fch: disable 48MHz output in S0i3
S0i3 is a low power state which reduces the power consumption to about
the level of the S3 suspend state where the DRAM is kept in a self-
refresh state and most of the rest of the system is powered down. So
everything that can be switched off in the S0i3 state should be switched
off in order to maximize the standby time.

BUG=b:210722314

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: If445f5825dc7b795c95d73c061156cc485421ada
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60125
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-12-20 17:39:29 +00:00
Felix Held ea6ee07f43 soc/amd/stoneyridge/fch: add GNVS-related TODOs
The AOAC device states shouldn't be stored in GNVS, but be read from the
AOAC registers during runtime. Same for the EHCI controller's BAR0. The
location and size of the XHCI firmware can either be statically
determined at build-time or have coreboot generate ACPI objects that
contain the needed addresses. Since I can't easily test changes that
require booting to a desktop on Stoneyridge at the moment, only add
TODOs for now.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Suggested-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Change-Id: I3691b05606b9430cb60923780a6131993a9887d4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60196
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:38:54 +00:00
Felix Held 2d020e1cc3 soc/amd/stoneyridge: split southbridge code
Split the southbridge code into a bootblock and a ramstage part to align
it more with Picasso and Cezanne. Also move the implementation of
fch_clk_output_48Mhz to the end of early_fch.c since it's not really
related to the functions that were previously around it.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ib660fbef8dc25ba0fab803ccd82b3408878d1588
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60142
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:38:43 +00:00
Felix Held 25aa5606c2 soc/amd/stoneyridge: factor out AGESA-wrapper related FCH functions
Split the code that gets called from the AGESA wrapper from the rest of
the FCH/southbridge code that directly interacts with the hardware.
Since the remaining parts of southbridge.c aren't used in romstage,
drop it from the list of build targets for romstage.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I6197add0e1396a82545735653110e1e17bf9c303
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60141
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:38:12 +00:00
Felix Held fbfb906081 soc/amd/stoneyridge: factor out early AOAC initialization
Factor out enable_aoac_devices out of southbridge.c to aoac.c to align
Stoneyridge more with Picasso and Cezanne.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ied4d821138507639cad1794f6c5017b5873b761f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60140
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-12-20 17:37:59 +00:00
Angel Pons 4b9ac2c993 mb/starlabs/labtop: Add enum for `power_profile`
Introduce and use an enum for the `power_profile` CMOS option. Add a
helper function that converts CMOS values into enum values. Using an
enum allows GCC to warn about switch statements using enum types for
their control expressions not handling all possible enum values, and
also improves readability.

Change-Id: I47a453ea12d164d26908a9944a89a481757e753c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60212
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sean Rhodes <admin@starlabs.systems>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-12-20 12:18:14 +00:00
Angel Pons a2c10a2539 mb/starlabs/labtop: Rename some files
Rename `mainboard.c` to `smbios.c` as it only contains SMBIOS functions.
Rename `ramstage.c` to `mainboard.c` as it contains the mainboard chip
operations struct.

Change-Id: I9548ca72a7583de98f5b154e3381825bba00d5cf
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60211
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sean Rhodes <admin@starlabs.systems>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-12-20 12:18:01 +00:00
Felix Held 6d84c08fbf soc/amd: remove root of SoC directory from include path
We shouldn't be providing -I include paths to the root of the soc
specific directory. It allows for lazy includes that can collide,
but there's no way of knowing the winning path since the winning
path is determined by Makefile.inc parsing order.

This is taken from CB:41355

Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I45ed219e4e0cccf3d4f04cc70dc1ef77c518afff
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60201
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-20 09:51:49 +00:00
Felix Held 1ea1e9d13a mb/google/zork: use full path of SoC's chip.h
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I50d8c45e711dc62afe6f80e0f66422bcc9924dfd
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60202
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-20 09:51:33 +00:00
Felix Held 2bfc6c6a42 mb/amd/bilby,mandolin: use full path of SoC's chip.h
This is taken from CB:41355

Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iba1948ae2332788b7e0ec9b4e3cea35c6608b152
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60200
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-20 09:51:22 +00:00
Felix Held 20f27da2b0 soc/amd/stoneyridge/include/southbridge: remove unneeded chip.h include
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I9b37efc89e505c2de99536b59e7d7e2bb1d54bff
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60199
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-20 09:51:07 +00:00
Felix Held 907cc5ab01 mb/amd/gardenia,padmelon;mb/google/kahlee: use full path of SoC's chip.h
This is taken from CB:41355

Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I10a18efb92ac0c3cad31044156e32aa6afe1d4d1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60198
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-20 09:50:57 +00:00
Felix Held 1a811bcb3b mb/amd/gardenia,padmelon;mb/google/kahlee: add missing soc/gpio includes
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ie716633bd7602d5e4a7e186aa9e444b7f70dab56
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60197
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-20 09:50:36 +00:00
Angel Pons 6ebb3b60a4 mainboard: Fix comment about early GPIOs
These boards program the early GPIO table in bootblock, not romstage.

Change-Id: Iae9353d106483f30cefa2d035d96e63e4c127261
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/60210
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
Reviewed-by: Sean Rhodes <admin@starlabs.systems>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2021-12-19 22:52:13 +00:00
Felix Singer 52ad866939 mb/siemens/chili: Reuse options from Kconfig.name
Reuse the options from Kconfig.name for variant-specific selects.

Change-Id: I35f51756180882d019a3ea8c555ccd18cd588f44
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57761
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-18 22:17:40 +00:00
Felix Singer 03ab722f54 mb/kontron/bsl6: Reuse options from Kconfig.name
Reuse the options from Kconfig.name for variant-specific selects.

Change-Id: I29ce7ef6f5137c1cf43726faed6081a04c83dea6
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57760
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-12-18 22:17:35 +00:00
Angel Pons 55405a3ddd sb/intel/lynxpoint: Update `intel_me_status()` signature
Update the parameter types of `intel_me_status()` to not be pointers.

Change-Id: I0fd577c49bec7a581c340fc2fcadcadd50b1a638
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59625
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-12-18 12:55:20 +00:00
Angel Pons 310d3271e4 sb/intel/lynxpoint/me.c: Refactor MEI CSR functions
Change the signature of MEI CSR functions to reduce pointer usage.

Change-Id: I1e4885daf8b3e11056421e663e67c8f360699a98
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59624
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-12-18 12:51:26 +00:00