Commit Graph

55586 Commits

Author SHA1 Message Date
Jeremy Compostella ba07f95992 soc/intel/meteorlake: Fix SOC_PHYSICAL_ADDRESS_WIDTH to 42
Meteor Lake CPUs physical address size is 46 if TME is disabled, 42 if
TME is enabled but Meteor Lake SoC physical address size is always
42.

BUG=b:314886709
TEST=MTRR are aligned between coreboot and FSP

Change-Id: Ic63c93cb15d2998e13d49a872f32d425237f528a
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79666
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-22 12:27:09 +00:00
Jeremy Compostella ba757a71fe x86: Separate CPU and SoC physical address size
The physical address size of the System-on-Chip (SoC) can be different
from the CPU physical address size. These two different physical
address sizes should be used for settings of their respective field.

For instance, the physical address size related to the CPU should be
used for MTRR programming while the physical address size of the SoC
should be used for MMIO resource allocation.

Typically, on Meteor Lake, the CPUs physical address size is 46 if TME
is disabled and 42 if TME is enabled but Meteor Lake SoC physical
address size is always 42. As a result, MTRRs should reflect the TME
status while coreboot MMIO resource allocator should always use
42 bits.

This commit introduces `SOC_PHYSICAL_ADDRESS_WIDTH' Kconfig to set the
physical address size of the SoC for those SoCs.

BUG=b:314886709
TEST=MTRR are aligned between coreboot and FSP

Change-Id: Icb76242718581357e5c62c2465690cf489cb1375
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79665
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-22 12:26:59 +00:00
Jeremy Compostella 1cf942c18f Revert "cpu/intel/common: Define build time physical address reserved bits"
This reverts commit 6dff1fd7d5.

BUG=b:314886709

Change-Id: Ic63c93cb15d2998e13d49a872f32d425237f528b
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79663
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-12-22 12:26:42 +00:00
Jeremy Compostella 6fb386b939 Revert "soc/intel/meteorlake: Set build time physical address reserved bits"
This reverts commit 533efb2308.

BUG=b:314886709

Change-Id: Ic63c93cb15d2998e13d49a872f32d425237f528c
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79664
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-12-22 12:26:26 +00:00
Yunlong Jia dc02b1bf13 mb/google/nissa/var/gothrax: Add probe for Type-C Port C1 (DB)
Add probe DB_C_A_LTE/DB_C_A for Type-C Port C1 (daughter board).
DB_A is only used for skus without Type-C Port C1.

BUG=b:316048649
TEST=emerge-nissa coreboot

Signed-off-by: Yunlong Jia <yunlong.jia@ecs.corp-partner.google.com>
Change-Id: Ifb702c497740953144b43c56653da16fade1053f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79629
Reviewed-by: Kyle Lin <kylelinck@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Derek Huang <derekhuang@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-22 12:06:02 +00:00
Shelley Chen 5fc070a6e6 mb/google/brox: Fix config errors with 8 GPIOs
Some GPIOs were not configured correctly according to the HW
spreadsheet provided by the HW team.
* GPP_B5/GPP_B6 use NF1, not NF2
* GPP_B23 should use NF2, no GPI
* GPP_D11 should be set to NC
* GPP_E21/22 should be using NF (previous NC)
* GPP_F17 is a GPO
* GPP_F18 should be an interrupt, not a NF

BUG=b:300690448,b:316180020
BRANCH=NONE
TEST=emerge-brox coreboot

Change-Id: I9e1e62adb79bd7fdab935afdbf2d23f9061b88aa
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79705
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2023-12-22 00:48:48 +00:00
Shelley Chen 3ced071396 mb/google/brox: Align GPIO reset with HW spreadsheet
Did a pass through HW team's brox speadsheet and aligned the gpio.c
file with it.  The changes in this CL are to fix the pad's reset field
as needed.  See "Intel SoCs" section in
https://doc.coreboot.org/getting_started/gpio.html for reset
definitions.

BUG=b:300690448,b:316180020
BRANCH=NONE
TEST=emerge-brox coreboot

Change-Id: I4285136184c648adb9dc97748bd6b01cba3f8ddd
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79579
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2023-12-22 00:47:42 +00:00
Shelley Chen afa76c5ca0 mb/google/brox: Fix pulls as necessary
Did a pass through HW team's brox speadsheet and aligned the gpio.c
file with it.  The changes in this CL include fixing the pulls for
GPIOs as necessary, making sure that it matches what is in the HW
team's spreadsheet.

BUG=b:300690448
BRANCH=NONE
TEST=emerge-brox coreboot

Change-Id: Ie50cb3c6fc85f1633c1afd1330c0e040e04b0ec1
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79704
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-22 00:47:26 +00:00
Shelley Chen b98a33c9f8 mb/google/brox: Change unused GPIOs to NC
Did a pass through HW team's brox speadsheet and aligned the gpio.c
file with it.  The changes here include changing the pad config to NC
because it is not being used in ChromeOS.

BUG=b:300690448
BRANCH=NONE
TEST=emerge-brox coreboot

Change-Id: I15471e4d7ff25c858b05ef024f15ca7c0b9e598e
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79703
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-22 00:47:03 +00:00
Tyler Wang d635376067 drivers/spi/gigadevice.c: Add GD25LQ255E support
datasheet: https://www.gigadevice.com.cn/Public/Uploads/uploadfile/files/20221129/DS-00562-GD25LQ255E-Rev1.1.pdf

BUG=b:311336475
BRANCH=firmware-rex-15709.B
TEST=Build AP-firmware and test on karis, system can boot to OS.

Change-Id: Id952ba3a4a45a51571d3735cf6b5764cece2c5e4
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79087
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: YH Lin <yueherngl@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-21 04:29:40 +00:00
Tyler Wang d9b8894954 mb/google/rex/var/karis: Add HDMI/eDP GPIOs to early GPIO list
Add HDMI GPIO configuration to early GPIO list to support
VGA text o/p in Pre-RAM stage on HDMI.

BUG=b:316982707
TEST=Erase MRC cache and reboot, SOL text display on HDMI/eDP

Change-Id: Idb2af56baeb4d0ef9db5fc1c5dbcebecee6515e6
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79572
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com>
2023-12-21 04:26:17 +00:00
Wentao Qin 95acd31d30 mb/google/rex/var/screebo: Remove Camera EEPROM off timing
Since the camera sensor and camera eeprom share GPP_A12, remove
the off timing to avoid issue of camera sensor loss, but this
will increase system power by 5mW.
(Before root cause, this is a short term workaround to unblock
function test.)

BUG=b:298126852
TEST=1. Run coldreboot/warmreboot check see if the camera sensor lost.
     2. Run S0ix check to see if the camera function abnormal.

Change-Id: I49b6ecbfbf3dddd6575bdaaf9c8fd0ee6c09af25
Signed-off-by: Wentao Qin <qinwentao@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79647
Reviewed-by: Jason Z Chen <jason.z.chen@intel.corp-partner.google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
2023-12-21 04:26:12 +00:00
Kun Liu b80a420369 mb/google/rex/var/screebo: Configure slew rate to 1/8 for GT domain
set slew rate to 1/8 for GT domain.

BUG=b:312405633
BRANCH=none
TEST=Able to build and boot google/screebo

Change-Id: Ib5cb07b7effc4a51c2119183010a03e026f639f8
Signed-off-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79628
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com>
2023-12-21 04:24:06 +00:00
Mark Hasemeyer aef345bfd7 mb/google/{brya,brox,rex}: Update ec_sync wake capability
Some of the boards use the EC_SYNC pin to wake the AP but do not
advertise the pin as wake capable in the CREC _CRS resource.  Relevant
boards were determined through empirical testing and inspection of gpio
configuration.

Update the ACPI tables for rex, brya, and brox based boards to advertise
their EC_SYNC pin as wake capable.

BUG=b:243700486
TEST=-Dump ACPI and verify ExclusiveAndWake share type is set when
     EC_SYNC_IRQ_WAKE_CAPABLE is defined
     -Wake Aviko via keypress and verify chromeos-ec as wake source
     -Wake Screebo via lid open and verify chromeos-ec as wake source
Change-Id: I5828be7c9420cab6ae838272c8301c302a3e078c
Signed-off-by: Mark Hasemeyer <markhas@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79374
Reviewed-by: Eric Lai <ericllai@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-12-21 03:50:26 +00:00
Martin Roth 677d15e8a8 .editorconfig: Add indent style & size of 2 spaces for shell
This adds a default style for shell scripts. fmtsh now looks for this
when reformatting shell scripts.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I348f23badf302a48c851231a08c1ce4be94738a4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78830
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-20 22:30:33 +00:00
Felix Held e4b080ee56 mb/amd/onyx_poc/devicetree: enable UART0
UART0 is routed to a USB-serial converter chip on the Onyx board, so
also enable this UART in the devicetree, so that the OS will be able to
use this UART.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I7b2577d799fd82a0aa0c9b01324930237e204aa0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79651
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Varshit Pandya <pandyavarshit@gmail.com>
2023-12-20 21:58:41 +00:00
Ivy Jian 17295c8288 mb/google/brox: Enable FSP UPD LpDdrDqDqsReTraining
FSP default value for LpDdrDqDqsReTraining is 1. For boards
that didn't set LpDdrDqDqsReTraining to any value, 0 was being
assigned and it caused black screen issue.

BUG=b:311450057
BRANCH=NONE
TEST=emerge-brox coreboot

Change-Id: I4a009076e50408a4f7ff16ddc96a0f2e47b09470
Signed-off-by: Ivy Jian <ivy.jian@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79646
Reviewed-by: Shelley Chen <shchen@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-20 17:31:45 +00:00
Martin Roth fab89b34e7 device/i2c_bus.c: Check pointer for NULL before using it
Found-by: Coverity Scan #1489753
Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I4f3794cf17875cdb35010c79a6537a4c13a18224
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78615
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
2023-12-20 17:01:49 +00:00
Felix Held 9bcbdbf9e4 nb,sb/amd/pi/*/pci_devs: drop unused PCI device IDs
SATA_IDE_DEVID, AHCI_DEVID_MS and AHCI_DEVID_AMD are still kept even
though they're unused at the moment, but those might still be useful to
keep around, since the SATA controller can have different PCI device IDs
depending on in which mode it is in.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ia05683b732d9748d9198225acaecbd4dc196733a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79577
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-20 14:40:46 +00:00
Eran Mitrani 2dfce0fd94 mb/google/rex/variants/deku: correct GPIO configuration
GPP_B02 and GPP_B03 were set incorrectly previously.
This CL corrects these settings according to schematics.

BUG=b:305793886
TEST=Built FW image correctly.

Signed-off-by: Eran Mitrani <mitrani@google.com>
Change-Id: Id62f15f7a77ac43c72cc6b2645816d6c87133a0e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79457
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-12-20 14:14:02 +00:00
Tyler Wang 83775d151d mb/google/rex/var/karis: Add PANEL_PWRSEQ_EC_CONTROL in fw_config
Only EC will use field "PANEL_PWRSEQ_EC_CONTROL".
Add this field in coreboot for align fw_config settings.

BUG=b:314245238
TEST=emerge coreboot pass

Change-Id: Icecb44a338ddc28027e362332c6a69cc9fd268d5
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79570
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: YH Lin <yueherngl@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-20 14:13:39 +00:00
Tyler Wang a077ba53cb mb/google/rex/var/karis: Update fw_config FAN field
After confirm with thermal, only EC will reference FAN field in
fw_config.
Update the settings for align fw_config.

BUG=b:307822225
TEST=emerge coreboot pass

Change-Id: Id7c4cdba29c5500c06d0f2293495650bb14b9e9c
Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79573
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <czapiga@google.com>
Reviewed-by: YH Lin <yueherngl@google.com>
Reviewed-by: Eran Mitrani <mitrani@google.com>
2023-12-20 14:13:24 +00:00
Varshit Pandya 0f666f7f78 soc/amd/genoa_poc: select DEFAULT_X2APIC
Allow SoC code to set LAPIC access mode to X2APIC

Change-Id: I208cca35c328e1566a57aaaa8ee7809e0760261c
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79644
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2023-12-20 14:12:24 +00:00
Varshit Pandya f86375fd88 mb/amd/onyx_poc/devicetree: Enable UART1
UART1 is selected for debug uart in Kconfig, it also needs to enabled
in devicetree. With this serial output doesn't stop during the device
enable step.

TEST:Build onyx_poc board

Change-Id: I7c910301c6eca5d3057785607139ac03b344bc15
Signed-off-by: Varshit Pandya <pandyavarshit@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79643
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2023-12-20 14:12:16 +00:00
Felix Singer 68a4c2ae8d util/{cbfstool,nvramtool}: Use same indent levels for switch/case
Use same indent levels for switch/case in order to comply with the
linter.

Change-Id: I2dd0c2ccc4f4ae7af7dd815723adf757244d2005
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79448
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-20 08:35:03 +00:00
Felix Singer df98b8168f mainboard: Use same indent levels for switch/case
Use same indent levels for switch/case in order to comply with the
linter.

Change-Id: I602cf024ec84b15b783d36014c725826f9d6595e
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79418
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-20 08:34:50 +00:00
Felix Singer 6ff711c48f arch/riscv: Use same indent levels for switch/case
Use same indent levels for switch/case in order to comply with the
linter.

Change-Id: Icf41e823c42ffea7b73bdd9112081af4d1f94bc9
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79417
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-20 08:34:26 +00:00
Pratikkumar Prajapati 9963aa359a commonlib/bsd: Tag CBMEM IDs deprecated for crashlog
These IDs are not used as crashlog data is not stored in CBMEM now.
(Ref CL: I43bb61485b77d786647900ca284b7f492f412aee
Title: soc/intel/common,mtl: Refactor BERT generation flow for crashlog)

BUG=b:298234592
TEST=Able to build REX.

Change-Id: Ie38571dece89a995d582099d34f0a1dd57cb936f
Signed-off-by: Pratikkumar Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78259
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
2023-12-20 04:29:25 +00:00
Pratikkumar Prajapati 4db921317f soc/intel/common,mtl: Refactor BERT generation flow for crashlog
With earlier flow, a chunk of CBMEM region was allocated for each SRAM
e.g., PUNIT SRAM, SOC PMC SRAM and IOE PMC SRAM. Then entire SRAM
content was copied to dedicated CBMEM region. Later in acpi_bert.c, the
BERT table was getting created for each chunk of CBMEM. This flow was
not considering creating separate entries for each region of crashlog
records. It resulted in only the first entry getting decoded from each
SRAM.

New flow aims to fix this issue. With new flow, a simple singly linked
list is created to store each region of crashlog records from all
SRAMs. The crashlog data is not copied to CBMEM. The nodes are
allocated dynamically and then copied to ACPI BERT table and then
freed. This flow also makes the overall crashlog code much simpler.

BUG=b:298234592
TEST=With this change decoding crashlog show comprehensive details,
tested on REX.

Change-Id: I43bb61485b77d786647900ca284b7f492f412aee
Signed-off-by: Pratikkumar Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78257
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-20 04:29:12 +00:00
Sukumar Ghorai 9b3c5afc00 acpi: Reduce wait interval in delay loop for sleep
The optimization of sleep time in acpi code includes reducing the sleep
duration and increasing the polling frequency within the acpi _ON/_OFF
method. StorageD3Enable is activated in Google/Rex, and this
optimization results in a saving of approximately 25ms in D3cold resume
time, reducing it from around 160ms to 135ms.

BUG=b:296206467
BRANCH=firmware-rex-15709.B

TEST=boot test verified on google/rex
     verified _ON/_OFF Method in SSDT.
     verifid kernel log in s0ix test -
          0000:00:06.0: PM: pci_pm_resume_noirq

Change-Id: I7ba960cb78b42ff0108a48f00206b6df0c78ce7a
Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79414
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <czapiga@google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Jérémy Compostella <jeremy.compostella@intel.com>
2023-12-20 04:28:27 +00:00
Subrata Banik 20629b4e65 mb/google/rex/var/screebo: Configure Acoustic noise mitigation
Enable Acoustic noise mitigation for google/screebo and set slew rate
to 1/8 for IA domain and ignore the slew rate for SA domain.

BUG=b:312405633,
TEST=Able to build and boot google/screebo.

Before:

[SPEW ]   AcousticNoiseMitigation : 0x0
[SPEW ]   FastPkgCRampDisable for Index = 0 : 0x0
[SPEW ]   SlowSlewRate for Index = 0 : 0x0

After:

[SPEW ]   AcousticNoiseMitigation : 0x1
[SPEW ]   FastPkgCRampDisable for Index = 0 : 0x1
[SPEW ]   SlowSlewRate for Index = 0 : 0x2

Change-Id: Ib86939ab48c2c6e7d0491d7c1cb4a2c7c6a1b568
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79323
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: YH Lin <yueherngl@google.com>
2023-12-20 04:25:29 +00:00
Subrata Banik 26fdb062a7 soc/intel/meteorlake: Add Acoustic Noise Mitigation UPDs
This patch allows to override acoustic noise mitigation FSP UPDs:
- AcousticNoiseMitigation
- FastPkgCRampDisable
- SlowSlewRate

BUG=b:312405633
TEST=Able to override the acoustic noise UPDs.

Change-Id: I5295e6571121c92f363e6fd4bcb3c8335c4fedee
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79302
Reviewed-by: YH Lin <yueherngl@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
2023-12-20 04:25:18 +00:00
Subrata Banik 93902072e5 vc/intel/fsp/mtl: Add UPDs for Acoustic Noise Mitigation
Acoustic noise in PCBs is a common problem and be caused by a variety
of factors, including:

Mechanical vibrations, Electromagnetic interference (EMI) and/or Thermal
expansion.

This patch adds the UPDs to FSPM header file for mitigating the acoustic
noise.

FSPM:
1. AcousticNoiseMitigation
2. FastPkgCRampDisable
3. SlowSlewRate

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

Change-Id: Iea0bfa2f92bb82e722ffc1a0b2f1e374b32e4ebc
Signed-off-by: Subrata Banik <subratabanik@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79301
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: YH Lin <yueherngl@google.com>
2023-12-20 04:25:06 +00:00
Martin Roth 372503fba6 treewide: Use show_notices target for warnings
This updates all warnings currently being printed under the files_added
and build_complete targets to the show_notices target.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: Ia14d790dd377f2892f047059b6d24e5b5c5ea823
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79423
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-20 04:06:55 +00:00
Martin Roth 0cec2351e2 clang-format: Update configuration for version 16+
As we look at unifying the format of coreboot code (/src, excluding
src/vendorcode), we need a code-beautifier configuration that works
well with the coreboot style. This patch is an attempt to match the
existing code styles as much as possible.

There are going to be some trade-offs in any code formatter. Tables
which have been hand-formatted probably won't look as good. These
can be specifically marked to be excluded from the formatter, however
this should be the exception, not the rule.

Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I70341d77e167c145f447594b6b0bef628cea83c6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78832
Reviewed-by: Zebreus <lennarteichhorn@googlemail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-20 03:44:23 +00:00
Angel Pons b44923969c sb/intel/bd82x6x/pch.c: Extract common functions
PCH identification functions and `pch_iobp_update` are used in multiple
stages. Move them out of `pch.c` to drop some ugly preprocessor usage.
Subsequent commits will use `pch_iobp_update` in romstage as well.

Change-Id: I8d33338a4f74fd03c8f99f8fcece99b63c28adab
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79624
Reviewed-by: Naresh <naresh.solanki.2011@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 15:47:40 +00:00
Kun Liu f733703a61 mb/google/rex/var/screebo: Add delay 1ms after Main 3V3
when S0ix returns S0, PERST needs to delay until
Main 3V3 is stable and then pull up

BUG=b:313976507
TEST=emerge-rex coreboot,measurement waveform verify pass

Change-Id: I33a86e52fab3c5c8cba6ebed0cbdd1b88b6538b0
Signed-off-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79320
Reviewed-by: Rui Zhou <zhourui@huaqin.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 13:35:44 +00:00
Weimin Wu b8fd150da6 mb/google/nissa/var/anraggar: Use GPP_D15 to control AVDD and AFVDD
For EVT SCH:

1. Use GPP_D15 to control AVDD and AFVDD simultaneously for MIPI Camera.
2. Delay reset for 5ms when device power on.

BUG=b:312663347
TEST=1. Google Camera app working
     2. Passed EA verified

Change-Id: I880fb309fcef006090e2849fa6c3a0d472851851
Signed-off-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79623
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <ericllai@google.com>
2023-12-19 13:35:18 +00:00
Nico Huber 0f98655b37 device: Drop MULTIPLE_VGA_ADAPTERS Kconfig
This option is nowhere selected and there is only a single case left
where it's used. Guarding the check in pci_rom_load() seems like a
bad idea: As the code would be copying all VGA ROMs to the same
location, it would be only working by chance (if the last encoun-
tered ROM is the right one). Hence, drop the guard and always check
for the correct device.

Change-Id: Ib283bf0a65367b99099a3bfcbd27585d44235eb9
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79596
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 13:16:08 +00:00
Felix Held df4955297f nb/amd/pi: drop HW_MEM_HOLE_SIZEK Kconfig option
There's neither need to remove get_hw_mem_hole_info from the code if the
Kconfig option was set to 0 nor the actual value didn't make any
difference in the behavior of the code: When node_id has still its
initial value of -1, domain_read_resources won't use the value of
hole_startk, and when node_id is set to 0, get_hw_mem_hole_info also
sets hole_startk to the actual value that then gets used by
domain_read_resources.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ieffab695a3151ed7f6bf9d6c880bbb43eecf7893
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79609
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 13:15:39 +00:00
Felix Held 7a83ab7612 nb/amd/pi/00730F01/northbridge: use devicetree device pointers
This APU is always a single-node, so the nodeid parameter of
get_node_pci is always 0. Since this SoC has a chipset devicetree, we
can just use DEV_PTR(ht_X) instead of the pcidev_on_root call.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I1bf9d214b4c2e5d995976fb79fef6fe43a6e9fa0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79608
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 13:15:21 +00:00
Felix Held 3f234f85e2 nb/amd/pi/00730F01/northbridge: assume that there's DRAM
This APU is always a single-node and since we're in ramstage when
domain_read_resources gets called, there's DRAM on this node, so no need
to check for this. To be extra sure, also initialize basek and limitk
before calling get_dram_base_limit with pointers to those as arguments.
This won't be necessary for the code to work as intended, but will
probably keep the compiler from complaining. Also move the declaration
of basek, limitk and sizek to the beginning of the function.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I4ef8011eb57b16218b8f5fea295900b855c3014b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79611
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 13:14:49 +00:00
Felix Held dcbb1e8b61 nb/amd/pi/00730F01/northbridge: rework idx in domain_read_resources
Start with the resource index 0 and increment it after reporting each
resource.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I6fb59ff3d371b744b53093d17392d1c3510bef82
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79610
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2023-12-19 13:14:27 +00:00
Felix Held 3eaa850c6a nb/amd/pi/00730F01/northbridge: drop nodeid from get_dram_base_limit
This APU is always a single-node and also only has one DRAM controller,
so there is only one valid DRAM base and limit register. It's also worth
mentioning that the assumption made in get_dram_base_limit that the n-th
node is using the n-tn DRAM range register was valid for K8, but not
necessarily on newer generations than that.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Id0529c66e8d0e6c8eb42eec2c6d9d2e892287865
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79607
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-12-19 13:14:00 +00:00
Felix Held a880720ee1 nb/amd/pi/00730F01/northbridge: rework hw_mem_hole_info
This APU is always a single-node and also only has one DRAM controller,
so we don't need to loop over the different nodes to find the memory
hole below 4GB. We also don't need to check for the special case where
the memory hole is non-DRAM address space between the parts of the
address space decoded by different DRAM controllers.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I9793d911d2d496be49168c06d83ceb802bc2b647
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79606
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2023-12-19 13:13:46 +00:00
Felix Held ce8dfc51ec nb/amd/pi/00730F01/northbridge: simplify domain_read_resources
This APU is always a single-node, so domain_read_resources only needs to
handle exactly one node and doesn't need to loop over the nodes.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I4218077cb4e11b762ce0e8694a97bdec33eaa056
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79605
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-12-19 13:13:22 +00:00
Felix Held 606e5636c2 nb/amd/pi/00730F01/northbridge: remove get_fx_devs
This SoC only supports a single-node configuration, so all the code
related to multi-node support can be removed. In this commit only the
get_fx_devs function and related code are removed for better
reviewability. In f1_write_config32 it's no longer needed to loop over
the different devices of the different nodes, so only a single PCI
config space write remains.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I5dc7324d3fcd0d07ac7a3a246a740fd9e91c3840
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79604
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2023-12-19 13:12:48 +00:00
Felix Held aaceeae95a nb/amd/pi/00730F01/northbridge: always return 1 in get_node_nums
This APU is always a single-node system and bits 4..6 of the node ID
register D18F0x60 are also marked as reserved in BKDG #52740 Rev 3.05.
On an APU2 board with quad-core APU, this register reads back 0x00030000
which results in a value of 1 to be returned from get_node_nums, so this
patch doesn't change behavior, but stops using reserved bits.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I65ed1124c0ca8e7eba54ff53dc626d35cd5e2e58
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79603
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2023-12-19 13:12:32 +00:00
Felix Held b986e21a6d nb/amd/pi/00730F01/northbridge: drop create_vga_resource
This system only has one northbridge and amd_initcpuio has already set
up the routing of the legacy VGA IO and MMIO ranges to it. Since only
the pci_dev_set_resources call remains in nb_set_resources, use
pci_dev_set_resources directly as set_resources function.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ib3835db9fd83221ac2b8e34d998f938812d24413
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79582
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2023-12-19 13:12:12 +00:00
Felix Held dda7793e53 nb/amd/pi/00730F01: assign IOMMU ops in chipset devicetree
Since the IOMMU is always function 2 of device 0 on bus 0, the device
operations can be statically assigned in the devicetree and there's no
need to bind the IOMMU device operations to the PCI device during
runtime via a list of PCI IDs.

TEST=PC Engines APU2 still boots and doesn't show any new problems

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I84e949500ee86e0fcb2d15791502f5e3e7127703
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79105
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2023-12-19 13:11:53 +00:00