Compare commits

..

255 Commits

Author SHA1 Message Date
2d743165e7 drivers/gfx/nvidia: acpi: Skeleton code for NBCI
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Change-Id: I5fbc8e1480670457586885c6099c19d73ca06c45
2021-12-21 13:32:33 -07:00
75468a84c0 drivers/gfx/nvidia: Misc fixes, some debugging
Change-Id: I072cd3db5859331a036ce7963a3607a56f53f37b
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 12:10:57 -07:00
865292a883 [WIP] drivers/gfx/nvidia: ACPI rewrite
Begin rewriting the ACPI support according to the Design Guide.
Partially implements Low Power States and GPU Boost methods.

Change-Id: I119f3206685ad337dcbb73d55cc807d00d5659fb
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-21 12:10:57 -07:00
87aaef8d1a submodules: Use absolute paths
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Change-Id: If03415f80a6028e263e76a9e3cc10df0cde5cc3c
2021-12-21 10:31:30 -07:00
182adc61a2 mb/system76/addw1: Increase max CPUs to 16
The addw1 supports an i9-9980HK and the addw2 uses an i7-10875H.
These CPUs have 8 cores and 16 threads. Fixes booting on addw2.

Change-Id: I4639b40c3ab9c6d6ad5abbbb3618c750c7d40695
Fixes: 6a93a45242 ("mb/system76/addw1: Add System76 Adder Workstation 1")
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-07 16:21:39 -07:00
1b49402e33 src/mb/system76/*: Shrink CMOS option table 1 byte
The option table is shrunk 1 byte to force coreboot to invalid the table
and write the new defaults. This will ensure the IME is in the correct
mode on the next update.

Change-Id: I805c53fee55fea69fa3363fea0609858cc88f2d3
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-07 16:21:39 -07:00
8138513b35 mb/system76/*: Disable IME by CMOS option
Add CMOS option to set IME mode. Default to "Disable" for CNL and TGL-H,
and "Enable" for TGL-U. Not set for KBL, which uses ME_CLEANER.

The HECI device must be enabled in devicetree for switching modes to
function correctly.

Change-Id: I3163dcb0a4af020c2cf6f94f2bb26380f17c253e
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-07 16:21:39 -07:00
ba0100f010 soc/intel: Allow enable/disable ME via CMOS
Add .enable method that will set the CSME state. The state is based on
the new CMOS option me_state, with values of 0 and 1. The method is very
stable when switching between different firmware platforms.

This method should not be used in combination with USE_ME_CLEANER.

State 1 will result in:
ME: Current Working State   : 4
ME: Current Operation State : 1
ME: Current Operation Mode  : 3
ME: Error Code              : 2

State 0 will result in:
ME: Current Working State   : 5
ME: Current Operation State : 1
ME: Current Operation Mode  : 0
ME: Error Code              : 0

Tested on:
KBL-R: i7-8550u
CML: i3-10110u, i7-10710u
TGL: i3-1110G4, i7-1165G7

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: I374db3b7c0ded71cdc18f27970252fec7220cc20
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52800
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Crawford <tcrawford@system76.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-12-07 16:21:39 -07:00
72cd47f9ba mb/system76: TGL-H: Disable D3cold for TCSS
Change-Id: Ib4362783546aa01f0f8f5baaad817ee76be9c39c
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-07 16:21:39 -07:00
8b8a831699 mb/system76/lemp9: Fix TPM error message
Change-Id: Id5456c0d6abee6d79761fae0bed78cc6def351f3
2021-12-07 16:21:38 -07:00
fb352b86fc mb/system76: select TPM_RDRESP_NEED_DELAY
Change-Id: I7909b05e9203ce9ad07c8e87a847bc46cf281b34
2021-12-07 16:21:38 -07:00
084e54522a soc/intel: Add Cometlake-H/S Q0 (10+2) CPU
Change-Id: Id1da42aa93ab3440ae743d943a00713b7df3f453
2021-12-07 16:21:38 -07:00
8d28bd2c9f intel/block/pcie/rtd3: Also implement _PR3
Change-Id: Id7f4373989dffe8c3bc68a034f59a94d2160dd15
Signed-off-by: Jeremy Soller <jeremy@system76.com>
2021-12-07 16:21:38 -07:00
9747417290 intel/block/pcie/rtd3: ACPI debug messages
Change-Id: Icc4a882ff73f62a134b92f1afb0dc298ea809189
2021-12-07 16:21:38 -07:00
2a0ab9f8cf soc/intel/tigerlake: Remove write to IOP TCSS_IN_D3
Change-Id: Ibbf6b5e0bf627536d10c8dee2f632e66da427151
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-07 16:21:38 -07:00
5ff2a1548f mb/system76/*: Add dGPU fan/temp reporting
Change-Id: I360e1c96b4893997efa003910937b03fafcc3b91
2021-12-07 16:21:38 -07:00
ad3eee8f83 mb/system76/*: Enable dGPUs
Change-Id: Ib5bab02801407c8bf05e6028bf8f9fa7ccc5ecd0
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-12-07 16:21:38 -07:00
90176c56f4 drivers/gfx/nvidia: Add driver for NVIDIA Optimus
Add a driver for systems with NVIDIA Optimus (hybrid) graphics using
GC6 3.0. The driver provides ACPI support for dynamically powering on
and off the GPU, and a function for enabling the GPU power in romstage.

Tested on system76/gaze15.

Change-Id: I2dec7aa2c8db7994f78a7cc1220502676e248465
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-15 05:12:21 -07:00
cb8a72cace mb/system76/*: Apply custom backlight levels
Change-Id: Ibea37f19acca0d718211fc41706019a92a240c70
Signed-off-by: Tim Crawford <tcrawford@system76.com>
2021-11-15 04:10:58 -07:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
4cdac3c7b3 Documentation/releases: Update index.md
Fix date for 4.16 release.

Change-Id: I6ff5849cb4b7bd3bc6c1d91637536b6e94d92a1a
Signed-off-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59058
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
2021-11-12 02:54:25 +00:00
b0b12dd1d6 drivers/amd/agesa/romstage.c: Remove lapic_id check
The APs don't execute this codepath but ap_romstage_main().

Change-Id: If884001bc8c5363efbbf00422a9a700896318f7b
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55065
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-12 00:14:51 +00:00
d4c7735930 mb/google/brya/var/felwinter: Enable SaGv
Enable SaGv.

BUG=b:198235324
TEST=Boot into without issues.

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: I3cbff8d28bb5b5bfdad323f348b9f880245d049d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59095
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 22:46:03 +00:00
8065c6d729 mb/system76/gaze16: Add System76 Gazelle 16
https://tech-docs.system76.com/models/gaze16/README.html

The gaze16 comes in 3 variants due to differences in the discrete GPU
and network controller used.

- NVIDIA RTX 3050, using Realtek Ethernet controller
- NVIDIA RTX 3060, using Realtek Ethernet controller
- NVIDIA RTX 3060, using onboard Intel I219-V Ethernet controller

Tested on the 3050 variant.
Tested with TianoCore (UefiPayloadPkg).

Working:

- PS/2 keyboard, touchpad
- Both DIMM slots
- M.2 NVMe SSD
- M.2 SATA SSD
- 2.5" SSD
- All USB ports
- SD card reader
- Webcam
- Ethernet
- WiFi/Bluetooth
- Integrated graphics using Intel GOP driver
- HDMI output
- Internal microphone
- Internal speakers
- Combined headphone + mic 3.5mm audio*
- 3.5mm microphone input*
- S3 suspend/resume
- Booting to Pop!_OS Linux 21.04 and Windows 10 20H2
- Flashing with flashrom

Not working:

- Discrete/Hybrid graphics
- Mini DisplayPort output (requires NVIDIA GPU)
- 3.5mm audio input/output detection on Windows

Change-Id: Ifb90f9b73a10abf53a21738e2c466d539df9a37c
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56956
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:45:55 +00:00
bfc4d8ef1c mb/google/brya/var/kano: Configure USB2 and USB3 port
Disable unused USB2 and USB3 port

BUG=b:192370253
TEST=build pass

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: Ia2fa10fb21e0a42e51728bc3d78163ca213f8d91
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59084
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 22:45:42 +00:00
4f8aea0594 lynxpoint/broadwell: Use azalia_codecs_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: Id25d2797a91b05264b1a76fa8faec0533dd5ac78
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59120
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:45:11 +00:00
aae6b55b2d device/azalia_device: Drop unused function parameter
The `dev` parameter of the `azalia_codecs_init()` function is not used.
Remove it, and update all call sites accordingly.

Change-Id: Idbe4a6ee5e81d5a7fd451fb83e0fe91bd0c09f0e
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59119
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:45:04 +00:00
94b3735ce1 haswell/lynxpoint/broadwell: Use azalia_codec_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: I83cf1a3a1a3854c9283ccac5e254357a32638dda
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59118
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:44:54 +00:00
86dfd3c083 device/azalia_device: Adapt and export codec_init()
Make the `codec_init()` function non-static so that it can be used in
other places. Rename it to `azalia_codec_init()` for consistency with
the other functions of the API.

Also, update the function's signature to make it more flexible. Remove
the unused `dev` parameter and allow callers to pass the verb table to
use. Update the original call site to preserve behavior.

Change-Id: I5343796242065b5fedc78cd95bcf010c9e2623dd
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59117
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:44:45 +00:00
5300b0327e lynxpoint/broadwell: Use azalia_program_verb_table()
Use the `azalia_program_verb_table()` function in preparation to
deduplicate Azalia init code.

Change-Id: I22cfee41e001c9ecf4fbac37aadbd12f43ac8aaf
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59116
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:44:37 +00:00
1297b9c74d azalia_device: Report if codec verb loading failed
Handle the return value of `azalia_program_verb_table()` and print
different messages accordingly.

Change-Id: I99e9e1416217c5e67c529944736affb31f9c7d2f
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59115
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:44:18 +00:00
b7a6a1e4ac sb/intel/bd82x6x: Use azalia_codecs_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: I982c1725d5affe95a20aa6713a246cd6b1ad270c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59114
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 22:44:06 +00:00
992c8603f0 sb/intel/ibexpeak: Use azalia_codecs_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: Ib3b40e5788c6315cad02b670346997c9179e5fab
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59113
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:43:57 +00:00
c359c6accb sb/intel/i82801jx: Use azalia_codecs_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: Idc8d272d76a031c6835baf952eca03fc2e306525
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59112
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:43:45 +00:00
12f2bb6211 sb/intel/i82801ix: Use azalia_codecs_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: I53d993ff74e7952c34fbe94d49d3ebf2489dd414
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59111
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:43:37 +00:00
4e94822a5c sb/intel/i82801gx: Use azalia_codecs_init()
Use the functionally-equivalent common Azalia code to get rid of
redundant code.

Change-Id: Icc435dd0c7cef1b458c877b5a64e6dba1d10524c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59110
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:43:21 +00:00
ed9b350478 sb/intel/i82801{ix,jx}: Initialise all codecs
These southbridges support four external codecs, not three.

Change-Id: I3f352451d16dceefa0f3fabf413a0e57aa498df5
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59109
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:42:53 +00:00
42552ca902 device/azalia_device: Export codecs_init()
Make the `codecs_init()` function non-static so that it can be used in
other places. Rename it to `azalia_codecs_init()` to avoid name clashes
with static definitions in southbridge code (which will be removed in
subsequent commits).

Change-Id: I080a73102b0c4f9f8a283cd93bba9b3b23169be0
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59108
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:42:42 +00:00
18d616a8fe sb/intel/bd82x6x: Remove unused typedef
Change-Id: If725a369e7a12fbddd7b108e557d34a13bc78c09
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59107
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:42:31 +00:00
67e4ad8eda sb/intel/i82801gx: Program PC BEEP verbs
For consistency with other Intel southbridges, program PC BEEP verbs.
None of the boards in the tree using this southbridge provide PC BEEP
verbs, so this change makes no difference.

Change-Id: I94d24999af819cf3951510586fd4864d1ed3f2f1
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59106
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:42:18 +00:00
d0f053eb9d sb/intel: Use azalia_program_verb_table() function
Use the `azalia_program_verb_table()` function in preparation to
deduplicate Azalia init code.

With this change, the "Azalia: verb loaded." message is now printed when
programming the verbs failed. This will be addressed once `codec_init()`
has been deduplicated.

Change-Id: I5d9e0f19429620166f2a6ef48ec7c963ee64b59c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59105
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-11 22:42:10 +00:00
6db243acd0 mb/google/brya/var/kano: Add gpio-keys ACPI node for PENH
Use gpio_keys driver to add ACPI node for pen eject event.  Also
setting gpio wake pin for wake events.

BUG=b:192415743
TEST=build pass

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: Ia36119678cfd5c65a62685d3312537d9aa21e83b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59035
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2021-11-11 22:40:20 +00:00
cfa59206a8 soc/intel: move SGX ACPI code to block/acpi
Move SGX ACPI code to block/acpi. Also move the register definitions
there, since they are misplaced in intelblocks/msr.h and are used only
once anyways.

Change-Id: I089d0ee97c37df2be060b5996183201bfa9b49ca
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58925
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 19:29:21 +00:00
7c088b70ab Doc/releases/coreboot-4.16-relnotes.md: Fix typo
Change-Id: I7189ac62d5ec826cf0377712941ba227362c1e09
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59122
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 18:27:43 +00:00
ab89ba0003 Doc/releases: Fix coreboot 4.15 release notes
coreboot 4.15 has just been released, so it's neither "upcoming" nor
"planned" anymore.

Change-Id: I287e40deec5877764e511885e3268b606caff597
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59121
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
Reviewed-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 18:27:18 +00:00
f8fe39baca mb/google/guybrush: Define ACPI Power Resources for FPMCU
Currently all the power sequencing for FPMCU is done explicitly in
different stages of coreboot. This can all be done by adding ACPI power
resources for FPMCU and clean up the unused code. Here is the expected
power sequence:
PowerUp  : Assert EN_PWR_FP -> 3 ms delay -> De-assert FPMCU_RST_ODL
Shutdown : De-assert EN_PWR_FP -> Assert FPMCU_RST_ODL
Reboot   : Shutdown -> 200 ms delay -> PowerUp

BUG=None
TEST=Build and boot to OS in Guybrush. Ensure that the FP is able to
unlock the system after the first login attempt. Ensure that the FP is
able to wakeup the system. Observed that the power resource is added
correctly in the FPMCU ACPI object
            Name (_PR0, Package (0x01)  // _PR0: Power Resources for D0
            {
                PR01
            })
            Name (_PR3, Package (0x01)  // _PR3: Power Resources for D3hot
            {
                PR01
            })
            PowerResource (PR01, 0x00, 0x0000)
            {
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x01)
                }

                Method (_ON, 0, Serialized)  // _ON_: Power On
                {
                    \_SB.CTXS (0x0B)
                    \_SB.STXS (0x20)
                    \_SB.STXS (0x0B)
                }

                Method (_OFF, 0, Serialized)  // _OFF: Power Off
                {
                     \_SB.CTXS (0x0B)
                     \_SB.CTXS (0x20)
                }
            }

Change-Id: I52322eaecf6961ff9a196ca9ab2d58b7d4599d4f
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58705
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-11 18:05:12 +00:00
7bca1e474c mb/google/brya/var/taeko: Enable CPU PCIE RP 1
Modify settings to enable CPU PCIE RP 1 according to schematics.

BUG=b:205504257
TEST=emerge-brya coreboot and can successfully boot with ssd and emmc.

Signed-off-by: Joey Peng <joey.peng@lcfc.corp-partner.google.com>
Change-Id: I0f817c860f2b295c6aa84fa1999d374d99f817f6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59080
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 16:18:01 +00:00
ca69152579 mb/google/guybrush/dewatt: update dewatt config
copy config from guybrush reference board.

BUG=b:204151079
BRANCH=guybrush
TEST=emerge-guybrush coreboot chromeos-bootimage

Signed-off-by: Chris.Wang <chris.wang@amd.corp-partner.google.com>
Change-Id: Ide9e002390e59725dc0e45f83280db2a78270993
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59092
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-11 16:01:15 +00:00
03c3d5d68e mb/google/brya/var/gimble: Improve USB2 eye diagram of DB Type-C port
- Set MAX OC1 to USB2_C1

BUG=b:205676803
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: Idcf13ad072ae5d7a897f54adb19e6b2b068609dc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59100
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Zhuohao Lee <zhuohao@google.com>
2021-11-11 15:50:42 +00:00
5164e4b03f amdfwtool: Pack out-of-bounds check into a function and move
Need to check the FWs number limit several times. So pack the
duplicated steps into a function. And do it before access the new
entry.

Change-Id: I71117d1c817c0b6ddaea4ea47aea91672cc6d55a
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58764
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-11 14:40:45 +00:00
66f2cbb195 soc/mediatek/mt8195: fix apusys coding defects
Use size_t for count variables.
Reduce debug log level and fix typo.
Fix commit: https://review.coreboot.org/c/coreboot/+/58794

BUG=b:203145462
BRANCH=cherry
TEST=boot cherry correctly

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: Ic03f71b7a9038edb5877ebd9b6aed5e9bd63c918
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59038
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 14:34:44 +00:00
67b91b9344 mb/google/brya/var/felwinter: Update typeC EC mux port
We need to put USB setting in mux order.

BUG=b:204230406
TEST=Type C mux configuration is correct.
Wrong:
added type-c port0 info to cbmem: usb2:2 usb3:2 sbu:0 data:0
added type-c port1 info to cbmem: usb2:3 usb3:3 sbu:0 data:0
Correct:
added type-c port0 info to cbmem: usb2:3 usb3:3 sbu:0 data:0
added type-c port1 info to cbmem: usb2:2 usb3:2 sbu:0 data:0

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: I19338e162db6145dbeb5830de1a372cf98f779a0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59012
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
2021-11-11 14:33:39 +00:00
b11de6fa09 mb/google/brya/variants/gimble: Update audio setting for SmartAMP
Divide dsm_param_file_name into dsm_param_R and dsm_param_L

BUG=b:205684021
TEST=build and check SSDT

Signed-off-by: Mark Hsieh <mark_hsieh@wistron.corp-partner.google.com>
Change-Id: Ie2db709a63152c1ccee2f7d594284e366ada8a01
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59046
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-11 14:33:12 +00:00
fb05b820eb mb/google/dedede/var/galtic: update Wifi SAR for convertibles
Add wifi sar for galtic/galtic360/galith360
Using convertible mode of SKU ID to load wifi table.

Each Project and SKU ID correspond as below
galtic (sku id:0x120000)
galith (sku id:0x130000)
gallop (sku id:0x150000)
galtic360 (sku id:0x260000)
galith360 (sku id:0x270000)

BUG=b:203741126
TEST=emerge-dedede coreboot chromeos-bootimage \
     coreboot-private-files-baseboard-dedede
     verify the SAR table is correct in each project

Signed-off-by: FrankChu <frank_chu@pegatron.corp-partner.google.com>
Change-Id: If4203d176dd717fa62c88d9b4fab8a53847213fe
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58734
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marco Chen <marcochen@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-11 14:32:57 +00:00
5554226426 Spell Intel Cooper Lake-SP with a space
Use the official spelling. [1]

[1]: https://ark.intel.com/content/www/us/en/ark/products/codename/189143/products-formerly-cooper-lake.html

Change-Id: I7dbd332600caa7c04fc4f6bac53880e832e97bda
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59036
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
2021-11-11 14:28:13 +00:00
4b6ad4efe3 samsung/lumpy,stumpy: Add get_power_switch()
Change-Id: I75c2e86e64943eb241db48482746317ed9ba47af
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59002
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-11 13:28:41 +00:00
51df45f0f9 samsung/lumpy: Add get_lid_switch()
Change-Id: Ib360a6fa00d0ebda4635b96f1b671a66c1ca11c1
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59001
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-11 13:27:41 +00:00
8355e6e723 google/beltino,jecht: Refactor ChromeOS GPIOs
Change-Id: I4052baca2d8041b2a6d6fd410fcf99248662d7a5
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58998
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-11 13:18:09 +00:00
0cb116647e samsung/lumpy,stumpy: Refactor ChromeOS GPIOs
Change-Id: Ic8b189dd82c412aa439694e200d530ae7e71d7e2
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58997
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-11 13:17:38 +00:00
6de8b42482 arch/x86: Refactor the SMBIOS type 17 write function
List of changes:
1. Create Module Type macros as per Memory Type
(i.e. DDR2/DDR3/DDR4/DDR5/LPDDR4/LPDDR5) and fix compilation
issue due to renaming of existing macros due to scoping the Memory
Type.
2. Use dedicated Memory Type and Module type for `Form Factor`
and `TypeDetail` conversion using `get_spd_info()` function.
3. Create a new API (convert_form_factor_to_module_type()) for
`Form Factor` to 'Module type' conversion as per `Memory Type`.
4. Add new argument as `Memory Type` to
smbios_form_factor_to_spd_mod_type() so that it can internally
call convert_form_factor_to_module_type() for `Module Type`
conversion.
5. Update `test_smbios_form_factor_to_spd_mod_type()` to
accommodate different memory types.
6. Skip fixed module type to form factor conversion using DDR2 SPD4
specification (inside dimm_info_fill()).

Refer to datasheet SPD4.1.2.M-1 for LPDDRx and SPD4.1.2.L-3 for DDRx.

BUG=b:194659789
TEST=Refer to dmidecode -t 17 output as below:
Without this code change:

Handle 0x0012, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 16 bits
        Data Width: 16 bits
        Size: 2048 MB
        Form Factor: Unknown
        ....

With this code change:

Handle 0x0012, DMI type 17, 40 bytes
Memory Device
        Array Handle: 0x000A
        Error Information Handle: Not Provided
        Total Width: 16 bits
        Data Width: 16 bits
        Size: 2048 MB
        Form Factor: Row Of Chips
        ....

Change-Id: Ia337ac8f50b61ae78d86a07c7a86aa9c248bad50
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56628
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 09:10:10 +00:00
9a3bde0581 ChromeOS: Replace with or add <types.h>
It's commented in <types.h> that it shall provide <commonlib/helpers.h>.

Fix for ARRAY_SIZE() in bulk, followup works will reduce the number
of other includes these files have.

Change-Id: I2572aaa2cf4254f0dea6698cba627de12725200f
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58996
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 06:25:12 +00:00
bc94d60924 intel/strago: Fix some CHROMEOS guards
MAINBOARD_HAS_CHROMEOS always evaluates true for this board.

The commentary about get_write_protect_state() was wrong, it's
currently only called in ramstage.

Change-Id: I0d5f1520a180ae6762c07dca7284894d9cf661b4
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58924
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-11 06:22:19 +00:00
6df98f066b mb/google/brya: Enable thermal control functionality for tpch
Enable DPTF based thermal control functionality for tpch device
on brya device.

BUG=b:198582766
BRANCH=None
TEST=Build FW and test on brya0 board

Change-Id: I6a35a101599bb811fcddaabab5296f8c6c12af31
Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57098
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-11 04:32:20 +00:00
575f1ec111 soc/amd/cezanne/fsp_m_parameters: add curly braces around else block
Since the if block contains multiple statements, it uses curly braces
around them, so also add curly braces around the else block even though
it only contains one statement.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ia8d6b45ec16916ff77078446414de259cffa1475
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59070
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-10 23:19:35 +00:00
fae525f547 lib/thread: Start stopwatch after printk
We are currently counting how long it takes to print the waiting
message, in addition to the actual time we spent waiting. This results
in inflating the measurement by 1.7ms when the serial console is
enabled. This CL makes it so the print happens before the stopwatch
starts.

BUG=b:179699789
TEST=No longer see printk time taken into account on serial console

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ib48e37c1b2cb462d634141bf767673936aa2dd26
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58960
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-10 21:17:28 +00:00
4e9bb3308e Rename ECAM-specific MMCONF Kconfigs
Currently, the MMCONF Kconfigs only support the Enhanced Configuration
Access mechanism (ECAM) method for accessing the PCI config address
space.  Some platforms have a different way of mapping the PCI config
space to memory.  This patch renames the following configs to
make it clear that these configs are ECAM-specific:

- NO_MMCONF_SUPPORT --> NO_ECAM_MMCONF_SUPPORT
- MMCONF_SUPPORT --> ECAM_MMCONF_SUPPORT
- MMCONF_BASE_ADDRESS --> ECAM_MMCONF_BASE_ADDRESS
- MMCONF_BUS_NUMBER --> ECAM_MMCONF_BUS_NUMBER
- MMCONF_LENGTH --> ECAM_MMCONF_LENGTH

Please refer to CB:57861 "Proposed coreboot Changes" for more
details.

BUG=b:181098581
BRANCH=None
TEST=./util/abuild/abuild -p none -t GOOGLE_KOHAKU -x -a -c max
     Make sure Jenkins verifies that builds on other boards

Change-Id: I1e196a1ed52d131a71f00cba1d93a23e54aca3e2
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57333
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-10 17:24:16 +00:00
5c163bb869 soc/amd/cezanne,picasso/include/southbridge: use bitwise or in defines
Use bitwise or instead of additions to build bit masks with multiple
bits set.

TEST=Timeless build results in identical image on amd/mandolin.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I42cc6686d8fa3f694a46ba4ca801a822ef1db1d7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59030
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-10 00:13:56 +00:00
e6a1ebe55b util/spd_tools: Document adding support for a new memory technology
Add documentation describing how to add support for a new memory
technology to spd_tools:
- Add a section to the README.
- Document the memTech interface in spd_gen.go.

BUG=b:191776301
TEST=None

Signed-off-by: Reka Norman <rekanorman@google.com>
Change-Id: Ie710c1c686ddf5288db35cf43e5f1ac9b1974305
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59005
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-09 23:45:26 +00:00
b455dd3486 soc/amd/cezanne,picasso/include/southbridge: fix typo in define
In both the Picasso PPR (rev 3.16) and the Cezanne PPR (rev 3.03) bit 16
of the misc I2C pad control registers is defined as BiasCrtEn, so rename
I2C_PAD_CTRL_BIOS_CRT_EN to I2C_PAD_CTRL_BIAS_CRT_EN.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: If39ac17a433cb90c944fdde038cd246a995e193a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59028
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-09 23:20:55 +00:00
90d79a751b mb/google/brya/var/redrix: Set RFI Spread Spectrum to 6%
Set RFI Spread Spectrum to 6% for Redrix as RF team request.
The default of Spread Spectrum in FSP is 1.5%, and set 1.5% in baseboard
as default.

BUG=b:200886627
TEST=build

Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com>
Change-Id: Id0b42446e9e46ef629b5ca8d5d29faf2d771348d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58880
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-09 20:48:26 +00:00
d0cef2ac6b soc/intel/alderlake: Enable Intel FIVR RFI settings
Add RFI UPD settings to mitigate RFI noise issues  and exporting
these UPDs to override via board devicetree.

BUG=b:200886627
TEST=build

Change-Id: I37bfef295fcd886d4f01abd40f9467a0791e9e34
Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58878
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-09 20:21:39 +00:00
6d27905e03 mb/intel/adlrvp: Set same size for CSE_RW and ME_RW_A/B
During CSE firmware updates, the CSE RW firmware from ME_RW_A/B is
copied to CSE_RW, so the sizes of these regions need to match.

BUG=b:189177538
TEST=emerge-brya coreboot chromeos-bootimage

Signed-off-by: Reka Norman <rekanorman@google.com>
Change-Id: I94e0615088349af34020fb8a126fce9e72df9ee2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59006
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Subrata Banik <subrata.banik@intel.com>
2021-11-09 19:19:51 +00:00
ba2b1139f1 google/trogdor: Update the power on sequence of ps8640
For the Qualcomm PBL configuration of GPIO, we need to initial the
GPIOs for VDD33# and RST# at the beginning of coreboot. According to
the pa8640 latest spec v1.4, update the sequence of VDD33# and PD#.

BUG=b:204637643
BRANCH=trogdor
TEST=verified the waveform of ps8640 at coreboot phase.

Signed-off-by: xuxinxiong <xuxinxiong@huaqin.corp-partner.google.com>
Change-Id: Ia378aafa49ec462c990501ce48721e330d9648b0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58994
Reviewed-by: Wentao Qin <qinwentao@huaqin.corp-partner.google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-09 18:42:33 +00:00
a003c33aa1 mb/google/dedede/var/metaknight: Probe and enable amplifier operation mode
Probe the fw_config for RT1015 speaker amplifier operation mode and
enable it accordingly in the device tree.

BUG=none
BRANCH=dedede
TEST=build pass

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: I2de1487b7f4767e9ba6432174c39feeb25f9534c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58931
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-09 18:41:40 +00:00
8fbfc080fc mb/google/dedede/var/bugzzy: Adjust I2C speed
This change adjusts all I2C speed to lower then 400KHz. The rise_time_ns
and fall_time_ns values for each port are capured by a scope.

BUG=None
BRANCH=dedede
TEST=built and verified adjusted I2C speed < 400KHz

Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com>
Change-Id: I9504608dd8d9a5f5a3848ef34691557942c21023
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58965
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-09 18:40:59 +00:00
e9654a857f mb/google/dedede/var/magolor: Enable ELAN touchscreen for magneto
Add ELAN touchscreen support for magneto.

BUG=b:203122673
TEST=Build and verify that touchscreen works.

Signed-off-by: Tyler Wang <tyler.wang@quanta.corp-partner.google.com>
Change-Id: Ie86692901113e952c597fcfc6c58e7ee0fc172fa
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58967
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-09 18:40:44 +00:00
8295cddfd2 mb/google/dedede/var/bugzzy: Update charger performance control table
Update charger performance control table of DPTF for bugzzy.
Since the EC change chromium:197776876 modified maximum charging current
to reduce skin temperature, this change adjusts the charging performance
table with the modified value.

BUG=b:197776876
BRANCH=dedede
TEST=emerge-dedede coreboot

Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com>
Change-Id: I33e176fcf5d380b315ff352c6c65af3b8b93c4b9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58840
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-09 18:40:32 +00:00
1d63714dae mb/google/dedede/var/bugzzy: Enable Wifi SAR
BUG=None
BRANCH=dedede
TEST=enable CHROMEOS_WIFI_SAR in config of coreboot,
     emerge-dedede coreboot chromeos-bootimage

Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com>
Change-Id: Ie967ef7fbc19886c631e634a0b0c3f2cf1e490af
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58845
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Henry Sun <henrysun@google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-09 18:40:13 +00:00
b48caadad5 soc/intel: generate SSDT instead of using GNVS for SGX
GNVS should not be used for values that are static at runtime. Thus,
use SSDT for the SGX fields.

Change-Id: Icf9f035e0c2b8617eef82fb043293bcb913e3012
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58394
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-11-09 16:02:19 +00:00
cc66b56c80 Documentation/security/vboot: Update 4.15 vboot supported boards
Update list of boards that support vboot.

Change-Id: Id5d4d18202bf85c5ba407efd690eee5cba88a8a7
Signed-off-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58975
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-09 15:49:46 +00:00
bbb57db484 Documentation/releases: Update 4.16 target date and cadence information
Change-Id: I6c8327a7cf47217d32359b304b21e806c10dcc62
Signed-off-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59022
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
2021-11-09 15:42:33 +00:00
4b92db88f9 Documentation/releases: Update 4.15 release notes
Update details for upcoming 4.15 release

Change-Id: Ie4d47456cce38e7ec4329f8cb839167017c7e26b
Signed-off-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58974
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: Matt DeVillier <matt.devillier@gmail.com>
2021-11-09 15:41:08 +00:00
085fdd8559 emulation/qemu-i440fx,q35: Split chromeos.c
This drops VBOOT_NO_BOARD_SUPPORT.

There is little impact of always having recovery_mode_switch()
implemented in bootmode.c. A weak write_protect_state() is not
necessary as there is no BOOT_DEVICE_SPI_FLASH with the emulation.
Call to fill_lb_gpios() is already guarded with CONFIG(CHROMEOS)
so the weak implementation would not be referenced.

Change-Id: I3c00b30c5233ae3556b7622f97c3166668c8ab12
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58946
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-09 14:55:01 +00:00
a7648f2b27 util/lint/kconfig_lint: Fix off by one error that missed last line
This error prevented the last line of the Kconfig tree from being
printed or added to the output file.  This is a significant problem if
you try to use the generated file as the kconfig source, because it
changes CONFIG_HAVE_RAMSTAGE from defaulting to yes to defaulting to
NO.  This causes the build to stop working.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: I3ec11f1ac59533a078fd3bd4d0dbee9df825a97a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58992
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-11-09 14:14:46 +00:00
f9ae172b6f amd/sata: Remove the weak function
BUG=b:140165023

Change-Id: I1908f727a7be1e33cbfd273b7261cbd989a414fe
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58644
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-09 14:13:08 +00:00
f4f365fdd0 pci_mmio_cfg: Always use pci_s_* functions
When MMIO functions are available, the pci_s_* functions do exactly
the same thing. Drop the redundant pci_mmio_* versions.

Change-Id: I1043cbb9a1823ef94bcbb42169cb7edf282f560b
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58333
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shelley Chen <shchen@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2021-11-09 11:05:33 +00:00
e01e25d4fc pci_mmio_cfg: Gather everything MMCONF (ECAM) related
To ease code sharing with other MMIO-based configuration mechanisms,
move everything MMCONF (more specifically ECAM) related to one spot
and guard it.

Change-Id: Idda2320c331499dabbee7447f1ad3e81340f2a25
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58332
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shelley Chen <shchen@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2021-11-09 11:04:35 +00:00
afe1898607 pci_mmio_cfg: Move guard around pci_s_* functions to x86
There is no platform in our tree that requires the PCI MMIO ops but
doesn't want the pci_s_* definitions. The only case where we include
the `pci_mmio_cfg.h` header but don't want the pci_s_* functions to
use MMIO is on older x86 platforms, so move the guard there.

Change-Id: Iaeed6ab43ad61b7c0e14572b12bf4ec06b6a26af
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58331
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Shelley Chen <shchen@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
2021-11-09 11:04:10 +00:00
91c077f6e2 ChromeOS: Fix <vc/google/chromeos/chromeos.h>
Change-Id: Ibbdd589119bbccd3516737c8ee9f90c4bef17c1e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58923
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-09 00:14:46 +00:00
f40a25bb11 soc/nvidia,qualcomm: Fix indirect includes
Avoid indirect <vc/google/chromeos/chromeos.h> as the
files really only need <security/vboot/vboot_common.h>.

Change-Id: Ic02bd5dcdde0bb5c8be0e2c52c20048ed0d4ad94
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58949
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-09 00:13:25 +00:00
586b1beb9c soc/intel: drop Kconfig PM_ACPI_TIMER_OPTIONAL
Technically, it's not depending on the hardware but on the software
(OS/payload), if the PM Timer is optional. OSes with ACPI >= 5.0A
support disabling of the PM Timer, when the respective FADT flag is
unset. Thus, drop this guard.

For platforms without hardware PM Timer (Apollo Lake, Gemini Lake) the
Kconfig `USE_PM_ACPI_TIMER` depends on `!NO_PM_ACPI_TIMER`.

As of this change, new platforms must either implement code for
disabling the hardware PM timer or select `NO_PM_ACPI_TIMER` if no such
is present.

Change-Id: I973ad418ba43cbd80b023abf94d3548edc53a561
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58017
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Lance Zhao
2021-11-08 21:11:05 +00:00
159284606a drivers/intel/fsp2_0: Add preload_fspm and preload_fsps
In the non-XIP world, FSP is normally memmapped and then decompressed.
The AMD SPI DMA controller can actually read faster than mmap. So by
reading the contents into a buffer and then decompressing we reduce boot
time.

BUG=b:179699789
TEST=Boot guybrush and see 30ms reduction in boot time

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I28d7530ae9e50f743e3d6c86a5a29b1fa85cacb6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58987
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-08 20:20:01 +00:00
82897c9c4f drivers/intel/fsp2_0: Add FSP_ALIGNMENT_FSP_X option
This option will allow setting the FSP alignment in CBFS.

BUG=b:179699789
TEST=Boot with and without the option set and verify -a option was
passed.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I4533f6c9d56bea6520aa3aa87dd49f2144a23850
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58986
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-08 19:59:17 +00:00
6fd23cb2d2 soc/amd/{cezanne,picasso}: Stop passing base for fspm.bin
We no longer need to do this since we relocate at runtime.

BUG=b:179699789
TEST=Boot guybrush to OS

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ibef849d5b3f0290cb7b7c5ff18aabe002bf53344
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58985
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-08 19:58:57 +00:00
4911dc7ca9 drivers/intel/fsp2_0: Allow FSP-M to be relocated
AMD platforms pass in the base address to cbfs tool:
    fspm.bin-options: -b $(CONFIG_FSP_M_ADDR)

There is no technical reason not to allow FSP-M to be relocated when
!XIP. By allowing this, we no longer need to pass in the base address
into cbfstool when adding fspm.bin. This enables passing in the
`--alignment` argument to cbfs tool instead. cbfstool currently has a
check that prevents both `-b` and `-a` from being passed in.

BUG=b:179699789
TEST=Boot guybrush to OS

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I797fb319333c53ad0bbf7340924f7d07dfc7de30
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58984
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-08 19:58:46 +00:00
a3b290732d lib/thread: Switch to using types.h
thread_mutex uses bool.

BUG=b:179699789
TEST=Build guybrush

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Id26b37d3e38852d72fcb6ff07ed578b0879e55dd
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58990
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Rob Barnes <robbarnes@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-08 15:11:35 +00:00
dcd8114359 soc/amd/cezanne: Enable CBFS_PRELOAD
The follow up CLs will use CBFS_PRELOAD. The default CBFS_CACHE_SIZE was
derived by examining the `cbfstool print` output and summing the files
we intend to preload.

BUG=b:179699789
TEST=Boot guybrush to OS

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I208067e6ceec6ffb602a87bee3bf99a0a75c822d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58961
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-11-08 14:50:07 +00:00
cb902fd6bb spd: Add new LP5 parts and generate SPDs
Add the parts below which will be used by the brya variant Vell. Add
the parts to memory_parts.json and generate the SPDs using spd_gen.

Micron MT62F512M32D2DR-031 WT:B
Micron MT62F1G32D4DR-031 WT:B
Hynix  H9JCNNNCP3MLYR-N6E

Generated using:
util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5

BUG=b:204284866
TEST=None

Change-Id: Ifbcadfb78281b2b78a61a9b61180c421748193a0
Signed-off-by: Reka Norman <rekanorman@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58929
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-08 14:48:49 +00:00
6ea0311469 soc/amd/picasso/include/southbridge: drop unused aoac_devs struct
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ida8d767a5b56bdf59747362ddf68372436573895
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58972
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-08 14:48:27 +00:00
43e269239e src/lib: Add FW_CONFIG_SOURCE_VPD
Read fw_config value from VPD.
This new option can be used where chrome EC is not supported like
pre-silicon platform and fw_config can be updated by VPD tool in OS.

TEST= boot to OS and read fw_config from vpd
1. Boot to OS
2. Write "fw_config" in VPD
   ex) vpd -i "RW_VPD" -s "fw_config"="1"
3. reboot and check fw_config value from coreboot log

Signed-off-by: Wonkyu Kim <wonkyu.kim@intel.com>
Change-Id: I4df7d5612e18957416a40ab854fa63c8b11b4216
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58839
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-08 14:48:05 +00:00
3864973a09 src/lib/fw_config: Change fw_config sources priority
Request fw_config values from various sources (as enabled via Kconfig)
until a valid value has been read.
With this change, Chrome EC CBI takes precedence over CBFS fw_config.

TEST=select both configs and check fallback behavior.
1. select both FW_CONFIG_SOURCE_CHROMEEC_CBI and FW_CONFIG_SOURCE_CBFS
2. check log for reading fw_config from CBI and CBFS

Signed-off-by: Wonkyu Kim <wonkyu.kim@intel.com>
Change-Id: I215c13a4fcb9dc3b94f73c770e704d4e353e9cff
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58833
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-08 14:46:57 +00:00
dc45951e88 drivers/elog/elog: Add timestamps to elog_init
elog init requires doing a lot of SPI transactions. This change makes it
clear how long we spend initializing elog.

BUG=b:179699789
TEST=Boot guybrush and see elog init timestamps
 114:started elog init                                3,029,116 (88)
 115:finished elog init                               3,071,281 (42,165)

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ia92372dd76535e06eb3b8a08b53e80ddb38b7a8f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58957
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-08 14:46:40 +00:00
61c9cd9890 soc/amd/cezanne: Add ASYNC_FILE_LOADING
This gives us a knob that can be controlled via a .config to
enable/disable file preloading. I left the option disabled because
there is currently a race condition that can cause data corruption when
using the SPI DMA controller. The fix will actually introduce a
boot time regression because the preloads are happening at the same time
as the elog init. I want to keep preloading disabled for now until
I get all the sequencing worked out.

BUG=b:179699789
TEST=Boot guybrush and verify no preloading happens.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ie839e54fa38b81a5d18715f190c0c92467bd9371
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58861
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-11-08 14:46:15 +00:00
7842755d46 3rdparty/amd_blobs: advance submodule pointer
This adds the following commits from the submodule:
* cezanne: Upgrade blobs to 1.0.0.5
* cezanne: Upgrade ABL to ver. 0x19036070
* cezanne: Upgrade SMU FW to 64.52.0
* cezanne: Upgrade SMU to 64.57.0
* cezanne: Update ABLs to 0x1A296070

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Id7b3f5d38d34c2714548dff92b7b83fb2628e936
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58989
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-08 14:46:01 +00:00
0480a19d4c soc/mediatek/mt8186: Add SPI driver support
Add SPI controller drivers.

TEST=build pass
BUG=b:202871018

Signed-off-by: Ruwen Liu <ot_ruwen.liu@mediatek.com>
Change-Id: I59a885c4fa31b6e2921698eaa3b97dbdc3144946
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58966
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-08 09:02:47 +00:00
381860454f google/guybrush: Move SPI speed override
SPI speed override is not related to ChromeOS, thus the
location in chromeos.c was poor choice.

Change-Id: Ie3db89f252af1f44e9539497c05bdf965565a191
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58945
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-06 10:46:01 +00:00
402b69ea58 Documentation/releases/4.15: Add more System76 boards
Most of the System76 boards have now been merged.

Change-Id: I0353b28c1df3da8be961cb43225dcf9e30b47d16
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58868
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
2021-11-05 22:43:16 +00:00
e14f363d3b soc/amd/*/include/smi: move NUMBER_SMITYPES definition to the top
Since all other defines for the number of certain things are at the top
of the file, move NUMBER_SMITYPES there as well to keep things
consistent.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Idfb599531d6cc382ab258bd1eae89e7b35fa9e79
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58953
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-05 16:25:09 +00:00
996808e52a soc/amd/*/include/smi: fix off-by-one in SCIMAPS defines
SCIMAPS is the total number of SCI to GEVENT mappings. configure_scimap
returns early when the scimap is greater or equal than SCIMAPS, so for
SMITYPE_ACDC_TIMER it returned early without doing what was expected
from it to do despite that being a valid value, so fix this off-by-one.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ibaf8c5618ddbf0b8d4cd612a7f1347d8562bbfcb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58952
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-05 16:24:59 +00:00
be7692a20c mb/google,intel: Fix indirect include bootmode.h
Change-Id: I9e7200d60db4333551e34a615433fa21c3135db6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58921
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-05 15:39:54 +00:00
d16d00b71a mb/emulation/qemu-i440fx: Refactor fw_cfg_max_cpus()
Return 0 instead of -1 in case of error. Both values indicate an error
has happened. Adapt `cpu_bus_scan()` accordingly.

Change-Id: I0f83fdc41c20ed3aae80829432fc84024f5b9b47
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58918
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 15:31:26 +00:00
04c497a6ba cpu/intel: Use unsigned types in get_cpu_count()
Change-Id: Id95e45a3eba384a61c02016b7663ec71c3ae1865
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58917
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 15:30:34 +00:00
ac07b03634 soc/mediatek/mt8186: Enable and initialize EINT
EINT event mask register is used to mask EINT wakeup source.
All wakeup sources are masked by default. Since most MediaTek SoCs do
not have this design, we can't modify the kernel EINT upstream driver to
solve the issue 'Can't wake using power button (cros_ec) or touchpad'.
So we add a driver here to unmask all wakeup sources.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I84946c2c74dd233419cb94f013a42c734363baf7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58938
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-05 13:03:51 +00:00
a74f443d51 soc/mediatek/mt8186: Add timer support
Add timer drivers to use timer function.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I6524e4dec4cbe7f7eb75a7940c329416559a03c8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58937
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-05 13:03:28 +00:00
76e0b9d710 soc/mediatek/mt8186: Add PLL and clock init support
Add PLL and clock init code, frequency meter and APIs for
raising little CPU/CCI frequency.

TEST=build pass
BUG=b:202871018

Signed-off-by: Chun-Jie Chen <chun-jie.chen@mediatek.com>
Change-Id: Id46d0708e7ba0c1a4043a5dce33ef69421cb59c5
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58936
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-05 13:03:10 +00:00
f1226963a1 mb/google: Fix indirect include bootmode.h
Change-Id: I882c567e6bca0982a0d3d44c742777c4d7bd5439
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58920
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-05 13:00:52 +00:00
c4db2db3bf mb/google/corsola: Add NOR-Flash support
Add NOR-Flash drivers to pass verification of flash at verstage.

TEST=boot to romstage
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Iee3dd336632b0cf998f5f7c1d118e01e8270e815
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58838
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-05 13:00:07 +00:00
0d50892e84 soc/mediatek/mt8186: add NOR-Flash GPIO setting in soc folder
The NOR-Flash can be configured on SPI0 or TDM-RX GPIOs so we have to
provide an init function in SoC for the mainboard to select right
configuration.

TEST=boot to romstage
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I285ec64ace8b72a48ef1d481d366bd67cb9b0337
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58935
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-05 12:59:42 +00:00
3aa61136cc spd: Add lp5 directory with empty memory_parts file
Add spd/lp5/memory_parts.json with an empty parts list, then run spd_gen
to generate the manifests and empty SPD.

Generated using:
util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5

BUG=b:204284866
TEST=None

Change-Id: I0314314130a1ccc58fb5a0416b110e7a86338fd0
Signed-off-by: Reka Norman <rekanorman@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58928
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-05 12:58:32 +00:00
70701eba8d mb/google/taeko: Update the FIVR configurations
This patch sets the enable the external voltage rails since taeko
board have V1p05 and Vnn bypass rails.

BRANCH=None
BUG=b:204832954
TEST=FW_NAME=Check in FSP log and run PLT test

Signed-off-by: Kevin Chang <kevin.chang@lcfc.corp-partner.google.com>
Change-Id: I20ff310d48d3e7073fe5e94d03d29cc55a46d1f9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58943
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-05 12:57:42 +00:00
d74f6f5a5d mb/google/brya/var/felwinter: Correct typeC EC mux port
Type C port2 uses EC mux port0 as per schematics.

BUG=b:204230406
TEST=No error message in depthahrge.
update_port_state: port C2: get_usb_pd_mux_info failed

Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com>
Change-Id: I85218c81018b248c41a2cdaf9360a86e2a7d4d7a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58930
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-05 12:57:25 +00:00
ba3af5e2ff amdfwtool: Change the flag value to type bool
Change-Id: I8bb87e6b16b323b26dd5b411e0063e2e9e333d05
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58942
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:56:19 +00:00
edd1e360f4 amdfwtool: Fix the parameter point to NULL instead of integer
Change-Id: Iaeeec7a7e2de7847bfcefa5b7ff3f259f86533d4
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58941
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:55:35 +00:00
33351336f8 amdfwtool: Change the definition of level to a bitwise form
Change-Id: Icca393f0d69519cc1c3cb852a11dd7006cf72061
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58765
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:55:29 +00:00
615ab90db3 Documentation/acpi/gpio.md: Update implementation details
The weak functions were removed in bce7458 "acpi/acpigen.c: Remove weak gpio definition".

Change-Id: Ia6e51698d6209fbf4f59b7fbc988a1aa696e366f
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58933
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-05 12:40:47 +00:00
81beeae960 soc/intel/denverton_ns: Refactor detect_num_cpus_via_cpuid()
Rewrite level type check and use unsigned types. In addition, also use
unsigned types in the `get_cpu_count()` function.

Change-Id: I63f236f0f94f9412ec03ae25781befe619cf7c1f
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58913
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:39:12 +00:00
d453da268d soc/intel/xeon_sp: Refactor get_threads_per_package()
Reduce the visibility of the `get_threads_per_package()` function and
retype its return value to `unsigned int`.

Change-Id: Ie71730d9a89eb7c4bb82d09d140fbcec7a6fe5f3
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58914
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:39:09 +00:00
39bfb1e0e3 soc/intel/braswell: Make num_cpus unsigned
Change-Id: Iff6da3dc9c744a3dae3f4dd4ac37a91f348450a3
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58915
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:39:04 +00:00
dc4f46e776 soc/intel/baytrail: Make num_cpus unsigned
Change-Id: I9ab0106c27a834d5d2ac1cb8023f4400a8ad91cd
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58916
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 12:38:55 +00:00
abe5632b67 nb/intel/haswell/northbridge.c: Drop stale comment
This can now be controlled with the `MMCONF_BUS_NUMBER` Kconfig option.

Change-Id: If0fdefc5b4339acc843443c551892b397ed39c2e
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58922
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-05 05:57:16 +00:00
5d4f0838d6 util/testing: add code coverage to jenkins
Add COV=1 and the `coverage-report` target to unit test build rules
in `what-jenkins-does` so that we get code coverage data from the
coreboot and libpayload unit tests.

Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
Change-Id: I96669c47d1a48e9ab678a4b9cb1d0c8032d727f0
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58634
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2021-11-04 20:34:53 +00:00
32d09be655 treewide: Replace bad uses of find_resource
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.

Change-Id: I329efcb42a444b097794fde4f40acf5ececaea8c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58910
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Lance Zhao
2021-11-04 17:37:13 +00:00
c167b74868 superio: Replace bad uses of find_resource
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.

Change-Id: Ic6e28add78f686fc9ab4556eddbedf7828fba9ef
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58909
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-04 17:36:32 +00:00
e058841913 drivers: Replace bad uses of find_resource
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.

Change-Id: Ia9a4b62c857f7362d67aee4f9de3bb2da1838394
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58908
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-04 17:34:56 +00:00
c1bfbe03a2 soc/intel: Replace bad uses of find_resource
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.

Change-Id: I2a57ea1c2f5b156afd0724829e5b1880246f351f
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58907
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-04 17:34:30 +00:00
536d36a748 nb/intel: Replace bad uses of find_resource
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.

Change-Id: I617fea8a09049e9a87130640835ea6c3e2faec60
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58906
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-04 17:32:36 +00:00
f32ae10f0d sb/intel: Replace bad uses of find_resource
The `find_resource` function will never return null (will die instead).
In cases where the existing code already accounts for null pointers, it
is better to use `probe_resource` instead, which returns a null pointer
instead of dying.

Change-Id: I13c7ebeba2e5a896d46231b5e176e5470da97343
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58905
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-04 17:32:06 +00:00
5065ad1f69 soc/amd/common/block/spi: Add prompt to SOC_AMD_COMMON_BLOCK_SPI_DEBUG
Makes it so I can enable SPI debugging without modifying the source.

BUG=b:179699789
TEST=Add CONFIG_SOC_AMD_COMMON_BLOCK_SPI_DEBUG=y to my .config

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Ie3815e0398b5268874039196a625fc29dd3dc3d9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58927
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-04 17:19:03 +00:00
199c45c979 Kconfig,soc/amd/cezanne: Make COOP_MULTITASKING select TIMER_QUEUE
This reduces the number of selects required in the SOC_SPECIFIC_OPTIONS.

BUG=b:179699789
TEST=Build guybrush

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I7f1364fc269ea5ec17982bf750a164a3290adb0e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58860
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-04 17:18:48 +00:00
4cfb862fb2 lib/cbfs: Add cbfs_preload()
This API will hide all the complexity of preloading a CBFS file. It
makes it so the callers simply specify the file to preload and CBFS
takes care of the rest. It will start a new thread to read the file into
the cbfs_cache. When the file is actually required (i.e., cbfs_load,
etc) it will wait for the preload thread to complete (if it hasn't
already) and perform verification/decompression using the preloaded
buffer. This design allows decompression/verification to happen in the
main BSP thread so that timestamps are correctly reflected.

BUG=b:179699789
TEST=Test with whole CL chain, verify VGA bios was preloaded and boot
time was reduced by 12ms.

Logs:
Preloading VGA ROM
CBFS DEBUG: _cbfs_preload(name='pci1002,1638.rom', force_ro=false)
CBFS: Found 'pci1002,1638.rom' @0x20ac40 size 0xd800 in mcache @0xcb7dd0f0
spi_dma_readat_dma: start: dest: 0x021c0000, source: 0x51cc80, size: 55296
took 0 us to acquire mutex
start_spi_dma_transaction: dest: 0x021c0000, source: 0x51cc80, remaining: 55296
...
spi_dma_readat_dma: end: dest: 0x021c0000, source: 0x51cc80, remaining: 0
...
CBFS DEBUG: _cbfs_alloc(name='pci1002,1638.rom', alloc=0x00000000(0x00000000), force_ro=false, type=-1)
CBFS: Found 'pci1002,1638.rom' @0x20ac40 size 0xd800 in mcache @0xcb7dd0f0
waiting for thread
took 0 us
CBFS DEBUG: get_preload_rdev(name='pci1002,1638.rom', force_ro=false) preload successful
In CBFS, ROM address for PCI: 03:00.0 = 0x021c0000
PCI expansion ROM, signature 0xaa55, INIT size 0xd800, data ptr 0x01b0
PCI ROM image, vendor ID 1002, device ID 1638,
PCI ROM image, Class Code 030000, Code Type 00
Copying VGA ROM Image from 0x021c0000 to 0xc0000, 0xd800 bytes

$ cbmem
  ...
  40:device configuration                              5,399,404 (8,575)
  65:Option ROM initialization                         5,403,474 (4,070)
  66:Option ROM copy done                              5,403,488 (14)
  ...

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I879fc1316f97417a4b82483d353abdbd02b98a31
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56491
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-04 17:10:31 +00:00
58618c26a1 lib/thread: Use __func__ instead of repeating function name
This cleans up the warning message:

    WARNING: Prefer using '"%s...", __func__' to using 'thread_run', this function's name, in a string

BUG=b:179699789
TEST=boot guybrush

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I85bacb7b2d9ebec40b6b05edc2ecf0ca1fc8ceee
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58867
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-04 17:04:26 +00:00
ba51e29953 lib/thread: Add ERROR prefix to error messages
This makes it easier to grep for errors.

BUG=b:179699789
TEST=Boot guybrush

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I7eecdfed6046b7d609069e7427f6883a4e9e521d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58866
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-04 17:04:21 +00:00
111de557ee tests: Move x86 I/O functions to include/mock/arch/io.h
Move th x86 I/O functions declarations from tests mocks to the mock
architecture io.h. This will make x86 I/O-dependent tests simpler,
because the x86_io.h from mocks will not have to be included manually.

Change-Id: Ie7f06c992be306d2523f2079bc90adf114b93946
Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58881
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-04 15:07:38 +00:00
19b16a089e mb/google/sarien: Add OEM product names
Add OEM product names from public sources.

Change-Id: Ic051aa9c8afabd47e7e9f6ac878190d9904ef757
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58911
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-04 14:13:21 +00:00
9f7e018f0f mb/siemens/mc_ehl: Disable PMC low power modes
All the mainboard variants of mc_ehl do not use the external switches
for the bypass rails. Disable the matching UPDs and all the low power
modes of the PMC.

Change-Id: I08f4effe5c4d5845bed01dfe1bd1251c58012b7f
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58895
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-04 11:05:03 +00:00
9916eb400f mb/siemens/mc_ehl: Disable all P-States
In order to get a reliable real-time performance disable all P-States
for all mc_ehl based mainboard.

Change-Id: I22857cc0f1476483ca82c1c872e4519e4b350ea9
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58894
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
2021-11-04 11:04:46 +00:00
2d04693640 mb/siemens/mc_ehl: Disable C-States for CPU and package
Disable all C-states other than C0/C1 for CPU and package.

Change-Id: I2c163f859dab4b0dc02896c70122e993cdd3db72
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58893
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
2021-11-04 11:04:27 +00:00
2c439adb51 util/spd_tools: Add LP5 support for ADL
Add LP5 support to spd_tools. Currently, only Intel Alder Lake (ADL) is
supported.

The SPDs are generated based on a combination of:
- The LPDDR5 spec JESD209-5B.
- The SPD spec SPD4.1.2.M-2 (the LPDDR3/4 spec is used since JEDEC has
  not released an SPD spec for LPDDR5).
- Intel recommendations in advisory #616599.

BUG=b:201234943, b:198704251
TEST=Generate the SPD and manifests for a test part, and check that the
SPD matches Intel's expectation. More details in CB:58680.

Change-Id: Ic1e68d44f7c0ad64aa9904b7e1297d24bd5db56e
Signed-off-by: Reka Norman <rekanorman@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58679
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-04 10:46:07 +00:00
e5be13e46b mb/siemens/mc_ehl2: Clean up devicetree
There are a bunch of devices in the devicetree that are disabled in
FSP-S and not used on this board. Having them around in the devicetree,
even if disabled, is not necessary and leads to a message in the log
(left over static devices...check your devicetree).

This commit cleans up devicetree.cb and removes all unused and disabled
devices.

Change-Id: I7486f9ba362c80b43b6c888a3b40a4c947218299
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58887
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-04 10:41:51 +00:00
ba6eca3bab lib: Add list.c to all stages
This will be used in cbfs.c which is used in all stages.

BUG=b:179699789
TEST=Build guybrush

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I0713ae766c0ac9e43de702690ad0ba961d636d18
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58804
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-04 10:35:48 +00:00
90cec2df13 arch/x86/Makefile: Align VGA_BIOS to 64 bytes when using AMD LPC SPI DMA
AMD platforms require the SPI contents to be 64 byte aligned in order to
use the SPI DMA controller.

BUG=b:179699789
TEST=Build guybrush and verify cbfs was invoked with -a 64

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I842c85288acd8f7ac99b127c94b1cf235e264ea2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56579
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-04 10:35:10 +00:00
cf17cd81d3 soc/amd/common/block/lpc: Set CBFS_CACHE_ALIGN to 64 when using SPI DMA
AMD platforms require the destination buffer to be 64 byte aligned
when using the SPI DMA controller.

BUG=b:179699789
TEST=gdb -ex 'p cbfs_cache' /tmp/coreboot/guybrush/cbfs/fallback/ramstage.debug
$1 = {buf = 0x0, size = 0, alignment = 64, last_alloc = 0x0, second_to_last_alloc = 0x0, free_offset = 0}

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I228372ff19f958c8e9cf5e51dcc3d37d9f92abec
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58707
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-04 10:34:34 +00:00
6938f353ca lib/cbfs: Add CBFS_CACHE_ALIGN Kconfig option
This option will allow platforms to set the alignment of the cbfs_cache
buffers.

BUG=b:179699789
TEST=gdb -ex 'p cbfs_cache' /tmp/coreboot/guybrush/cbfs/fallback/ramstage.debug
$1 = {buf = 0x0, size = 0, alignment = 8, last_alloc = 0x0, second_to_last_alloc = 0x0, free_offset = 0}

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I74598d4bcbca9a01cc8c65012d7e4ae341d052b1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58706
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-04 10:34:19 +00:00
5ac82dcc20 commonlib/mem_pool: Allow configuring the alignment
AMD platforms require the destination to be 64 byte aligned in order to
use the SPI DMA controller. This is enforced by the destination address
register because the first 6 bits are marked as reserved.

This change adds an option to the mem_pool so the alignment can be
configured.

BUG=b:179699789
TEST=Boot guybrush to OS

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I8d77ffe4411f86c54450305320c9f52ab41a3075
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56580
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-04 10:33:52 +00:00
533fc4dfb1 amd/i2c: Remove the weak function
BUG=b:140165023

Change-Id: Ieedd6c9f3abeed9839892e5d07127862cd47d57f
Signed-off-by: Zheng Bao <fishbaozi@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58771
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-04 10:31:37 +00:00
7d6b4e3ae5 mb/google/guybrush: Set Gen3 default for all PCIe devices
Currently link_speed_capability is not specified within the DXIO
descriptors sent to FSP. This value specifies the maximum speed that
a PCIe device should train up to. The only device on Monkey Island that
is not currently running at full speed is the NVME but this may not
always be the case.

BUG=b:204791296
TEST=Boot to OS and check link speed with LSPCI to verify
NVME link speed goes from 2.5 GT/s to 5 GT/s

Change-Id: Ibeac4b9e6a60567fb513e157d854399f5d12aee9
Signed-off-by: Matt Papageorge <matthewpapa07@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58799
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
2021-11-04 10:31:27 +00:00
a3260fde92 mb/google/brya/var/kano: Update GPIO table for speak and dmic
Refer to intel doc #627075 (Intel_600_Series Chipset_Family_PCH_GPIO_Impl_Sumry_ Rev1p5p1)
Set GPIO GPP_S0 ~ GPP_S3 to NF4 and GPP_R6 ~ GPP_R7 to NF3.

BUG=b:204844177 b:202913826
TEST=build pass

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: Iafe52ec3a6deead1d2fc5ada0f2842cf2a9f41a4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58877
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: CT Lin <ctlin0@nuvoton.corp-partner.google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-04 10:30:18 +00:00
663a61ed91 mb/google: Add OEM product names for various boards
All of these names came from public sources.

Signed-off-by: Martin Roth <martin@coreboot.org>
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Change-Id: I1ed9cc0c1ff63dc415e0cc63fa9d2dcd429a093b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57392
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-04 10:29:41 +00:00
437da71d0a SMBIOS/SCONFIG: Allow devtree-defined Type 41 entries
Introduce the `smbios_dev_info` devicetree keyword to specify the
instance ID and RefDes (Reference Designation) of onboard devices.

Example syntax:

 device pci 1c.0 on	# PCIe Port #1
 	device pci 00.0 on
 		smbios_dev_info 6
 	end
 end
 device pci 1c.1 on	# PCIe Port #2
 	device pci 00.0 on
 		smbios_dev_info 42 "PCIe-PCI Time Machine"
 	end
 end

The `SMBIOS_TYPE41_PROVIDED_BY_DEVTREE` Kconfig option enables using
this syntax to control the generated Type 41 entries. When this option
is enabled, Type 41 entries are only autogenerated for devices with a
defined instance ID. This avoids having to keep track of which instance
IDs have been used for every device class.

Using `smbios_dev_info` when `SMBIOS_TYPE41_PROVIDED_BY_DEVTREE` is not
enabled will result in a build-time error, as the syntax is meaningless
in this case. This is done with preprocessor guards around the Type 41
members in `struct device` and the code which uses the guarded members.
Although the preprocessor usage isn't particularly elegant, adjusting
the devicetree syntax and/or grammar depending on a Kconfig option is
probably even worse.

Change-Id: Iecca9ada6ee1000674cb5dd7afd5c309d8e1a64b
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57370
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2021-11-04 10:25:09 +00:00
bb03e763de mb/siemens/mc_ehl: Enable Row-Hammer prevention
As a prevention of Row-Hammer attacks enable the FSP-M parameter
'RhPrevention'.

Change-Id: I52f68525e882aee26822d9b3c488639c00f27d17
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58856
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-04 10:22:37 +00:00
5c65ec1ee5 mb/siemens/mc_ehl2: Configure SD card detect pin in devicetree
This configures GPIO GPP_G5 as an input pin for SD card detect.

Change-Id: I708eb112fa054f2f88857001c409fb62493b6206
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58855
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-04 10:22:30 +00:00
8aac54d43a mb/siemens/mc_ehl2: Clean up PCIe root port settings in devicetree
PCIe root ports #4 (00:1c.3) and #6 (00:1c.5) are currently not used on
this mainboard and are not routed either, so remove them from the
devicetree completely. PCIe root port #7 (00:1c.6) is connected and
used. Add the missing settings for L1 substates and latency reporting to
disable these features for this port as well.

Change-Id: I47e8528bea993ed527a0aecdbc93b94bbd9a7a49
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58853
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2021-11-04 10:22:20 +00:00
17641208f5 mb/siemens/mc_ehl2: Adjust PCIe clock settings in devicetree
On mc_ehl2 there are currently four of the six PCIe clocks used to drive
PCIe devices. None of the used clock output is dedicated to a special
device. Therefore do not use a port mapping of the clocks to avoid a
stopping clock once a device is missing and the matching root port is
disabled. Instead set the mapping to 'PCIE_CLK_FREE' to have a free
running clock.

In addition, use the defined constant 'PCIE_CLK_NOTUSED' instead of the
value 0xFF to disable the CLKREQ-feature and unused clocks.

Change-Id: I81419887b7f463a937917b971465245c1cb46b94
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58852
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-11-04 10:22:07 +00:00
f9014bbb60 mb/google/guybrush/bootblock: add comment on selecting eSPI interface
Setting the PM_ESPI_CS_USE_DATA2 bit in PM_SPI_PAD_PU_PD results in the
eSPI transactions being sent via the SPI2 pins instead of the SPI1 pins.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Iad8e3a48496a52c14c936ab77c75dc1b403f47bb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58876
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-04 04:51:37 +00:00
26806aed5c soc/amd/cezanne/include/gpio: fix GPIO 106 native function names
The name looked a bit odd and the Cezanne PPR #56569 Rev 3.03 confirmed
that the native function names don't have the EMMC_ prefix.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I917c74afd98f2e2133e160d352f11f08c19a3ec6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58874
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-04 03:50:45 +00:00
371cc15a89 soc/amd/cezanne/include/cppc: use AMD_CEZANNE_CPPC_H as include guard
This makes this header file consistent with the rest.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ice2872b4a24032d3a65777795943602cd2595de7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58864
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-04 03:50:22 +00:00
c3ced8fa4e mb/system76/*: Enable HECI device
The HECI device needs to be enabled to send the commands to have the
CSME change between Soft Temporary Disable mode and Normal mode.

Change-Id: I668507e3b522137bcc827aa615dab1fccd1709a0
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58670
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
2021-11-04 01:58:07 +00:00
a6b3af927c soc/mediatek/mt8186: Add NOR-Flash support
Add NOR-Flash drivers to pass verification of flash at verstage.

TEST=boot to romstage
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: If51d765e1fd4895f97898710ec6fa1374e1048fb
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58837
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-04 01:56:32 +00:00
ca6e95ce55 mb/purism/librem_skl: Clean up hda_verb.c
Use the `AZALIA_RESET` macro, write hex values in lowercase and remove
redundant comments. Also express verb length in decimal.

Tested with BUILD_TIMELESS=1, Purism Librem 15 v4 remains identical.

Change-Id: Id9f5ff9614a8f8c0b7f3a3c633a1dcdda8c5876c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58903
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-04 00:24:53 +00:00
e13d3548d8 mb/purism/librem_bdw/hda_verb.c: Rewrite using macros
Rewrite the HDA configuration using macros for clarity.

Tested with BUILD_TIMELESS=1, Purism Librem 13 v1 remains identical.

Change-Id: I987a41329425a5c8c7169a7fa66a34de5742532e
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58902
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
2021-11-04 00:24:15 +00:00
05c4dcbae3 device/azalia_device.h: Rewrite verb macros
Introduce the `AZALIA_VERB_12B` macro to encode HDA commands with 12-bit
verb identifiers and rewrite existing helper macros to use it.

Tested with BUILD_TIMELESS=1, Purism Librem Mini remains identical.

Change-Id: I5b2418f6d2faf6d5ab424949d18784ca6d519799
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58901
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-04 00:23:45 +00:00
779d0c66df device/azalia_device.h: Guard macro parameters
Add parentheses around macro parameters to avoid operation order issues.

Change-Id: Ic984a82da5eb31fc2921cff3265ac5ea2be098c7
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58900
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
2021-11-04 00:22:46 +00:00
09cbb064fc soc/mediatek/mt8186: Add GPIO drivers
Add GPIO drivers to let other module control GPIOs.

TEST=build pass
BUG=b:202871018

Signed-off-by: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com>
Change-Id: Ice342ab94397db8bc0fbbeb8fb5ee7e19de871ee
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58836
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 18:57:27 +00:00
b8fa1d389a mb/google/trogdor: Mark kingoftown as supporting Parade PS84640
BUG=b:204272905
BRANCH=master
TEST=emerge-trogdor coreboot

Signed-off-by: Kevin Chiu <kevin.chiu@quantatw.com>
Change-Id: Ie13ddfef6adfd53adb0a0d3a98995fb00b8a45e6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58789
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philip Chen <philipchen@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-03 18:56:29 +00:00
5db9fa7433 soc/mediatek/mt8186: Initialize watchdog
MT8186 requires writing speical value to mode register to clear
status register. The flow of clear status is different from other
platforms, so we override mtk_wdt_clr_status() for MT8186.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I290b69573a8e58db76814e16b5c17c23413f1108
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58835
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 18:52:23 +00:00
a23d76a8bc soc/mediatek: Add an overridable function for WDT clear status
mtk_wdt_clr_status is different for MT8186 and MT8195,
so we move this function to soc folder.

TEST=build pass
BUG=b:202871018

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: Ia8697ffdca1e2d1443f2259713c4ab6fdf1b1a9e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58834
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 18:51:24 +00:00
9559c68b3c soc/amd/cezanne/include/aoac_defs: drop leading newline
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I8458fbee7edd19117a207f39ac8f9575b1374fbc
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58863
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-03 18:38:02 +00:00
5807da4729 soc/amd/cezanne/include: replace PICASSO with CEZANNE in include guards
Somehow missed renaming those when creating the coreboot support for
Cezanne.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I13c28f67d32ba987987cfc2b45e248d535ccdca9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58862
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-03 18:37:53 +00:00
28a0a14b5b soc/amd/*/cpu: handle mp_init_with_smm failure
When the mp_init_with_smm call returns a failure, coreboot can't just
continue with the initialization and boot process due to the system
being in a bad state. Ignoring the failure here would just cause the
boot process failing elsewhere where it may not be obvious that the
failed multi-processor initialization step was the root cause of that.
I'm not 100% sure if calling do_cold_reset or calling die_with_post_code
is the better option here. Calling do_cold_reset likely here would
likely result in a boot-failure loop, so I call die_with_post_code here.

BUG=b:193809448

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ifeadffb3bae749c4bbd7ad2f3f395201e67d9e28
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58859
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-03 18:37:28 +00:00
c435038c55 cpu/amd/mtrr: Remove topmem global variables
The comments are not correct anymore. With AGESA there is no need to
synchronize TOM_MEMx msr's between AP's. It's also not the best place
to do so anyway.

Change-Id: Iecbe1553035680b7c3780338070b852606d74d15
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58693
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-03 18:36:15 +00:00
b0db82dd24 cpu/x86/Kconfig: Remove unused CPU_ADDR_BITS
Change-Id: I88f62c18b814ac0ddd356944359e727d6e3bba5a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58688
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Mariusz Szafrański <mariuszx.szafranski@intel.com>
2021-11-03 18:34:46 +00:00
ca87532a07 cpu/amd/mtrr/amd_mtrr.c: Remove unused functions
AGESA sets up MTRRs so these functions are now unused.

Change-Id: Ic2bb36d72944ac86c75c163e130f1eb762a7ca37
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58689
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-03 18:32:49 +00:00
0a36178fa4 soc/amd/stoneyridge/cpu: remove unneeded line break in get_cpu_count
The line length is no longer limited to 80 characters, so there's no
need for that line break any more.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I7a8fb472f00e039f25a71ee526a3dd0bc6c754f6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58858
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-03 16:55:15 +00:00
6b93866f5e soc/intel/xeon_sp: disable PM ACPI timer if chosen
Disable the PM ACPI timer during PMC init, when `USE_PM_ACPI_TIMER` is
disabled. This is done to bring SKL, CNL, DNV in line with the other
platforms, in order to transition handling of the PM timer from FSP to
coreboot in the follow-up changes.

Disabling is done in `finalize` since FSP makes use of the PMtimer.
Without PM Timer emulation disabling it too early would block.

Change-Id: If85c64ba578991a1b112ceac7dd10276b58b0900
Signed-off-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58389
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lance Zhao
2021-11-03 09:33:47 +00:00
f6f1258673 soc/intel/alderlake: Allow devicetree override to leave some VR settings as default
Allow devicetree override to leave ac_loadline, dc_loadline and icc_max as default.

Test=Boot to OS

Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Change-Id: I715345d5ea83aed9ee929b2a4e13921c9d8895b1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58807
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-03 09:33:12 +00:00
7e27202441 cpu/amd: Always fetch CPU addr bits at runtime
All supported AMD CPUs support getting the physical address size from cpuid so
there is no need for a Kconfig default value.

Change-Id: If6f9234e091f44a2a03012e7e14c380aefbe717e
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58686
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-03 09:03:35 +00:00
4c8c8442ab lib/list: Add list_append
This method will add a node to the end of the list.

BUG=b:179699789
TEST=Boot guybrush to the OS

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I1792e40f789e3ef16ceca65ce4cae946e08583d1
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58805
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-03 08:29:16 +00:00
74a0629660 mb/google/corsola: Add MediaTek MT8186 reference board
Add mainboard folder and drivers for new reference board 'Corsola'.

TEST=build pass
BUG=b:200134633

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I2d701c03c97d3253effb6e93a2d55dcf6cf02db6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58648
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
2021-11-03 08:26:28 +00:00
73e6b8e3eb soc/mediatek/mt8186: Add a stub implementation of the MT8186 SoC
Add new folder and basic drivers for Mediatek SoC 'MT8186'.

Difference of modules including in this patch between MT8186 and existing SoCs:
Timer:
	Similar to MT8195, MT8186 uses v2 timer.
EMI/PLL/SPI:
	Different from existing SoCs.

TEST=boot from SPI-NOR and show uart log on MT8186 EVB
BUG=b:200134633

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I579f79c15f4bf5e1daf6b35c70cfd00a985a0b81
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58640
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 08:26:17 +00:00
f50bf60bff soc/mediatek/mt8195: move timer enum variables to timer_v2.h
Some enum variables of timer v2 are the same between MT8195 and MT8186,
so we move them to common timer_v2.h.

TEST=emerge-cherry coreboot
BUG=b:200134633

Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com>
Change-Id: I89891a19e622aa24783025e73c38c4ffa43aa166
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58829
Reviewed-by: Rex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 08:26:07 +00:00
5826c591bf device/include: Fix potential build error
Add include guard for usbc_mux.h

BUG=none
BRANCH=none
TEST=Build Pass

Signed-off-by: Alan Huang <alan-huang@quanta.corp-partner.google.com>
Change-Id: I47988edee84d17f0a15cfda1ac6f0187326bd331
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58832
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-03 08:24:15 +00:00
940953e823 tests/Makefile: Remove ./ prefix when running tests
If ran with obj=/absolute path, then tests were failing to execute
because the recipe tried running `.//absolutepath/...run`.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I9c3638b1af7531dbe8e956dcbe168250a235ead4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58806
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jakub Czapiga <jacz@semihalf.com>
2021-11-03 08:22:12 +00:00
e4b2d7da4f mb/siemens/mc_ehl1: Adjust PCIe clock settings in devicetree
On mc_ehl1 there are three of the 6 PCIe clocks used to drive PCIe
devices. None of the used clock output is dedicated to a special device
(CLK0 drives several devices on the mainboard, CLK1 and CLK2 are
connected to a PCIe switch). Therefore do not use a port mapping of the
clocks to avoid a stopping clock once a device is missing and the
matching root port is disabled. Instead set the mapping to
'PCIE_CLK_FREE' to have a free running clock.

In addition, use the defined constant 'PCIE_CLK_NOTUSED' instead of the
value 0xFF to disable the CLKREQ-feature and unused clocks.

Change-Id: I2beea76ff8fefd79f476bef343d13495b45cdfcf
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58740
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 08:22:05 +00:00
5cd1871929 soc/mediatek/mt8195: add apusys init flow
Set up APU mbox's functional configuration registers.

BUG=b:203145462
BRANCH=cherry
TEST=boot cherry correctly

Signed-off-by: Flora Fu <flora.fu@mediatek.com>
Change-Id: I5053d5e1f1c2286c9dce280ff83e8b8611b573b9
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58794
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-03 03:31:03 +00:00
b44202b29a mb/system76/oryp8: Add System76 Oryx Pro 8
https://tech-docs.system76.com/models/oryp8/README.html

Tested with TianoCore (UeifPayloadPkg).

Working:

- PS/2 keyboard, touchpad
- Both DIMM slots
- Both M.2 SSD slots
- All USB ports
- Webcam
- Ethernet
- WiFi/Bluetooth
- Integrated graphics using Intel GOP driver
- Internal microphone
- Internal speakers
- Combined 3.5mm headphone & microphone jack
- Combined 3.5mm microphone & S/PDIF jack*
- S3 suspend/resume
- Booting to Pop!_OS Linux 21.10 and Windows 10 20H2
- Flashing with flashrom

Not working:

- Discrete/Hybrid graphics

Not tested:

- Thunderbolt functionality
- S/PDIF output

Change-Id: Iabc8e273f997d7f5852ddec63e0c1bf0c9434acb
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57652
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 20:48:37 +00:00
fdaccd875d mb/system76/bonw14: Add System76 Bonobo Workstation 14
Change-Id: I55a827f8d6a5421c36f77049935630f4db4ba04d
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49173
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 20:48:29 +00:00
f74e42a542 mb/system76/kbl-u: Add Galago Pro 2 as a variant
Change-Id: Ia277b3ad50c9f821ab3e1dcb8327314ba955fa79
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52219
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-02 20:31:12 +00:00
be43b13543 mb/system76/kbl-u: Add Galago Pro 3 as a variant
Change-Id: Ie203883cc9418585da4f9c7acd89e7624234caf1
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52218
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-02 20:30:03 +00:00
9037f0a831 mb/system76/kbl-u: Add System76 Galago Pro 3 Rev B
Change-Id: I25464d3a2dd02e613a8392db90b1eaf0f9b3ca70
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52217
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 19:23:15 +00:00
e747bdda1b mb/system76/gaze15: Add Gazelle 14 as a variant
Change-Id: Ib455951d1d26ddfa010d4eb579905235bd1385a9
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52295
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 19:22:26 +00:00
0893b871c6 mb/system76/gaze15: Convert to variant setup
Change-Id: I6d8a97d71ff3b4408f5e11230ed3ff00357f7123
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58675
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 19:22:05 +00:00
c840bc4e32 mb/system76/oryp6: Add Oryx Pro 7 as a variant
Change-Id: Id00a45a6a6acf0880934c55f1a3f18e63f2aed43
Signed-off-by: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52296
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 19:21:41 +00:00
c1481e0863 mb/system76/oryp6: Convert to variant setup
The Oryx Pro 6 has the same board layout as the next model in series,
Oryx Pro 7. The primary difference between the two is the dGPU (20
series to 30 series). Convert oryp6 to a variant setup in preparation
for adding the oryp7.

Change-Id: I976750c7724d23b303d0012f2d83c21a459e5eed
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57786
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2021-11-02 19:21:27 +00:00
6dad77d64a util/crossgcc/Makefile: Clean up .PHONY definitions
Order functionally:
 * first "all" and build-$tools
 * followed by clean
 * followed by the architecture targets

The order was chosen this way because the architecture targets are
the mostly likely to continue to grow.

While at it, also fix the build_nasm mention (it was build-nasm)
and add build_make.

Change-Id: Id58338a512d44111b41503d4c14c08be50d51cde
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58796
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-02 17:36:23 +00:00
ba15a598b0 soc/intel/denverton_ns: Fetch addr bits at runtime
Change-Id: Ic46a7d56cbaf45724ebc2a1911f5096af2fe461a
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58687
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mariusz Szafrański <mariuszx.szafranski@intel.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-11-02 16:03:29 +00:00
67d62fdfed Revert "mb/google/brya/var/kano: disabled autonomous GPIO power management"
This reverts commit 287cc02c00.

Reason for revert: it will break s0ix.

BUG=b:201266532
TEST=build pass

Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com>
Change-Id: I393077b26e2cdeae055d8eea1030754602e94ada
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58809
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-02 16:02:54 +00:00
43cf27d3a7 include/device/pci_ids,soc/amd/common/block/lpc: drop duplicate PCI IDs
PCI_DEVICE_ID_AMD_FAM17H_LPC and PCI_DEVICE_ID_AMD_FAM17H_SMBUS redefine
the same values that are already defined by PCI_DEVICE_ID_AMD_CZ_LPC and
PCI_DEVICE_ID_AMD_CZ_SMBUS, so drop PCI_DEVICE_ID_AMD_FAM17H_LPC and
PCI_DEVICE_ID_AMD_FAM17H_SMBUS. Also add some comments to the places in
the code where the defines are used to clarify which ID is used on which
hardware generation.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Id0b3d7b5a886ccc76d82ada6be4145e85fd51ede
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58696
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jason Glenesk <jason.glenesk@gmail.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
2021-11-02 15:50:03 +00:00
0d7e2a461a mb/google/volteer: allow MKBP devices and disable TBMC device
Enable MKBP (Matrix Keyboard Protocol) interface for all volteer family
to use for buttons and switches. Disable TBMC (Tablet Mode Switch
device), as it is not needed anymore.

BUG=b:171365305
TEST=manual test on Volteer:
Volume Up/Down and Power buttons, Tablet Mode switch

Signed-off-by: FrankChu <frank_chu@pegatron.corp-partner.google.com>
Change-Id: I2bb2e895af17fa4280113e57e2b0ca780af8840e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58741
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-02 08:22:39 +00:00
49ebce6777 mb/intel/adlrvp: Configure EC in RW GPIO
EC_IN_RW signal from EC GPIO is connected to GPIO E7 of SOC. This GPIO
can be used to check EC status
trusted (LOW: in RO) or untrusted (HIGH: in RW).

Branch=none
Bug=none
Test=Issue manual recovery and confirm DUT is entering recovery mode on
ADL-M RVP.

Signed-off-by: Anil Kumar <anil.kumar.k@intel.com>
Change-Id: I20804db450ab0b3ebe19c51ba2b294a0137d81a7
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58099
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-02 08:22:10 +00:00
c47835d599 mb/google/guybrush: Update STT coefficients
Update guybrush STT (Skin Temperature Tracking) configuration settings
to values provided by power team after tuning.

BUG=b:203123658

Change-Id: I14c69dbe044e4f3f2711be96e5ea80db0686b3eb
Signed-off-by: Jason Glenesk <jason.glenesk@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58674
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-02 08:21:51 +00:00
dd30f4b112 mb/system76/*: CMOS: Drop power_on_after_fail option
Our boards do not boot if power_on_after_fail=Disable. Drop the option
and use the default of powering on.

Change-Id: Ia1857e52f838337048f79f8ca5c12d669cae321a
Signed-off-by: Tim Crawford <tcrawford@system76.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58673
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jeremy Soller <jeremy@system76.com>
2021-11-02 08:20:54 +00:00
55fea11f2f soc/amd/common/block/cpu: Add support for cbfs_cache region
This change adds the cbfs_cache region into the x86 memlayout. The SoC
or mainboard can decide how big the region should be by specifying
CBFS_CACHE_SIZE.

BUG=b:179699789
TEST=Build guybrush and verify cbfs_cache region wasn't added.

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I268b6bc10906932ee94f795684a28cfac247a68c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56578
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-11-02 08:18:29 +00:00
fab6e44a95 psp_verstage: convert relative address in EFS2
Addresses in AMD fw table with EFS gen2 are relative addresses, but
PSP doesn't accept relative addresses in update_psp_bios_dir().

Check for EFS gen2 and convert them as needed.

BUG=b:194263115
TEST=build and boot on guybrush and shuboz

Signed-off-by: Kangheui Won <khwon@chromium.org>
Change-Id: I95813beba7278480e6640599fcf7445923259361
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58316
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
2021-11-02 08:17:32 +00:00
cb3745c407 google/trogdor: Add backlight support for Parade ps8640
Add backlight support in ps8640 through the AUX channel using eDP
DPCD registers.

BUG=b:202966352
BRANCH=trogdor
TEST=verified firmware screen works on homestar rev4

Change-Id: Ief1bf56c89c8215427dcbddfc67e8bcd4c3607d2
Signed-off-by: xuxinxiong <xuxinxiong@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58624
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
2021-11-02 08:17:21 +00:00
73161c644e mb/google/brya: Correct AT24 NVM address size
Currently, the address size field of AT24 NVM is incorrect, and
Linux v5.10 kernel logs the message below:

	at24 i2c-PRP0001:01: Bad "address-width" property: 14

The valid size of the AT24 NVM is 16 bits so modify the value from
0x0E to 0x10.

TEST=Boot brya and check the kernel log and see "Bad address-width"
error message is not shown.

Signed-off-by: Varshit B Pandya <varshit.b.pandya@intel.com>
Change-Id: I6c1ed5334396e0ca09ea0078426a7b5039ae4e8b
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58769
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
2021-11-02 08:16:30 +00:00
fe3189dc91 mb/google/brask: add the mkbp device
In order to let the ec passing the key event like recovery and power key
to the OS, we need to include EC_ENABLE_MKBP_DEVICE to generate the MKBP
device.

BUG=b:204519353, b:204512547
BRANCH=None
TEST=pressed recovery key and power button in the OS and checked the UI
     behavior.

Change-Id: Ia1d0b9b301994ad9a0f4bf28b75ab0310a1d63a0
Signed-off-by: Zhuohao Lee <zhuohao@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58744
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
2021-11-02 08:15:45 +00:00
d6798e96fc mb/siemens/mc_ehl1: Clean up PCIe root port settings in devicetree
PCIe root ports #5 (00:1c.4) and #6 (00:1c.5) are not used on this
mainboard and are not routed either, so remove them from the devicetree
completely. PCIe root port #7 (00:1c.6) is connected and used. Add the
missing settings for L1 substates and latency reporting to disable these
features for this port as well.

Change-Id: I06f59f0369ffcd958b5fe12bb3c646d37103811f
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58568
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2021-11-02 08:14:05 +00:00
fec936659c mb/siemens/mc_ehl1: Clean up devicetree
There are a bunch of devices in the devicetree that are disabled in
FSP-S and not used on this board. Having them around in the devicetree,
even if disabled, is not necessary and leads to a message in the log
(left over static devices...check your devicetree).

This commit cleans up devicetree.cb and removes all unused and disabled
devices.

Change-Id: Ia5ffb382e3524e61b8583aca801063942fe2f247
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58567
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
2021-11-02 08:13:50 +00:00
3306f37fd6 lib: Add new argument as ddr_type to smbios_bus_width_to_spd_width()
Add DDR5 and LPDDR5 memory type checks while calculating bus width
extension (in bits).

Additionally, update all caller functions of
smbios_bus_width_to_spd_width() to pass `MemoryType` as argument.

Update `test_smbios_bus_width_to_spd_width()` to accommodate
different memory types.

Create new macro to fix incorrect bus width reporting
on platform with DDR5 and LPDDR5 memory.

With this code changes, on DDR5 system with 2 Ch per DIMM, 32 bit
primary bus width per Ch showed the Total width as:

Handle 0x000F, DMI type 17, 40 bytes
Memory Device
	Array Handle: 0x0009
	Error Information Handle: Not Provided
	Total Width: 80 bits
	Data Width: 64 bits
	Size: 16 GB
	...

BUG=b:194659789
Tested=On Alder Lake DDR5 RVP, SMBIOS type 17 shows expected `Total Width`.

Change-Id: I79ec64c9d522a34cb44b3f575725571823048380
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58601
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Rob Barnes <robbarnes@google.com>
2021-11-02 08:13:25 +00:00
35bcf5071c mb/google/zork/var/vilboz: Generate new SPD ID for new memory parts
Add new memory parts in the mem_parts_used.txt and generate the
SPD ID for the parts. The memory parts being added are:
1. Hynix H5ANAG6NCJR-XNC
2. Micron MT40A512M16TB-062E:R
3. ADATA 4JQA-0622AD

BUG=b:199469240
BRANCH=firmware-zork-13434.B
TEST=FW_NAME=vilboz emerge-zork coreboot chromeos-bootimage

Signed-off-by: Frank Wu <frank_wu@compal.corp-partner.google.com>
Change-Id: I57cca403800d9731a7b689ac9773a7940e83904e
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58690
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: EricR Lai <ericr_lai@compal.corp-partner.google.com>
2021-11-02 08:12:22 +00:00
dba7736104 util/kconfig: Uprev to Linux 5.15's kconfig
Upstream's changes only affect a script that we don't use.
Still, this keeps us in sync with the official version.

Change-Id: I39cbbfb8dc816b4f36f92e6bd53f40c733691242
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58792
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2021-11-02 08:10:47 +00:00
9f7c78b5ec util/kconfig: Uprev to Linux 5.14's kconfig
Upstream's changes have been minimal, to the perl script that we
don't use and a constness change, so I expect no harm. Still, this
keeps us in sync with the official version.

Change-Id: I5e5a2400bc3323938da4b946930e2ec119819672
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57880
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2021-11-02 08:10:41 +00:00
c710ee7319 util/kconfig: Rewrite patch in quilt's normal form
This is what quilt writes on `quilt refresh` and what it can apply and
unapply cleanly.

Change-Id: I8c8586da384b65fd5c21c1c1a093642534f83283
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57878
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
2021-11-02 06:40:41 +00:00
716 changed files with 12298 additions and 5021 deletions

32
.gitmodules vendored
View File

@ -1,62 +1,62 @@
[submodule "3rdparty/blobs"]
path = 3rdparty/blobs
url = ../blobs.git
url = https://review.coreboot.org/blobs.git
update = none
ignore = dirty
[submodule "util/nvidia-cbootimage"]
path = util/nvidia/cbootimage
url = ../nvidia-cbootimage.git
url = https://review.coreboot.org/nvidia-cbootimage.git
[submodule "vboot"]
path = 3rdparty/vboot
url = ../vboot.git
url = https://review.coreboot.org/vboot.git
branch = main
[submodule "arm-trusted-firmware"]
path = 3rdparty/arm-trusted-firmware
url = ../arm-trusted-firmware.git
url = https://review.coreboot.org/arm-trusted-firmware.git
[submodule "3rdparty/chromeec"]
path = 3rdparty/chromeec
url = ../chrome-ec.git
url = https://review.coreboot.org/chrome-ec.git
[submodule "libhwbase"]
path = 3rdparty/libhwbase
url = ../libhwbase.git
url = https://review.coreboot.org/libhwbase.git
[submodule "libgfxinit"]
path = 3rdparty/libgfxinit
url = ../libgfxinit.git
url = https://review.coreboot.org/libgfxinit.git
[submodule "3rdparty/fsp"]
path = 3rdparty/fsp
url = ../fsp.git
url = https://review.coreboot.org/fsp.git
update = none
ignore = dirty
[submodule "opensbi"]
path = 3rdparty/opensbi
url = ../opensbi.git
url = https://review.coreboot.org/opensbi.git
[submodule "intel-microcode"]
path = 3rdparty/intel-microcode
url = ../intel-microcode.git
url = https://review.coreboot.org/intel-microcode.git
update = none
ignore = dirty
branch = main
[submodule "3rdparty/ffs"]
path = 3rdparty/ffs
url = ../ffs.git
url = https://review.coreboot.org/ffs.git
[submodule "3rdparty/amd_blobs"]
path = 3rdparty/amd_blobs
url = ../amd_blobs
url = https://review.coreboot.org/amd_blobs
update = none
ignore = dirty
[submodule "3rdparty/cmocka"]
path = 3rdparty/cmocka
url = ../cmocka.git
url = https://review.coreboot.org/cmocka.git
update = none
[submodule "3rdparty/qc_blobs"]
path = 3rdparty/qc_blobs
url = ../qc_blobs.git
url = https://review.coreboot.org/qc_blobs.git
update = none
ignore = dirty
[submodule "3rdparty/intel-sec-tools"]
path = 3rdparty/intel-sec-tools
url = ../9esec-security-tooling.git
url = https://review.coreboot.org/9esec-security-tooling.git
[submodule "3rdparty/stm"]
path = 3rdparty/stm
url = ../STM
url = https://review.coreboot.org/STM
branch = stmpe

View File

@ -84,15 +84,6 @@ the raw Rx gpio value.
## Implementation Details
ACPI library in coreboot will provide weak definitions for all the
above functions with error messages indicating that these functions
are being used. This allows drivers to conditionally make use of GPIOs
based on device-tree entries or any other config option. It is
recommended that the SoC code in coreboot should provide
implementations of all the above functions generating ACPI AML code
irrespective of them being used in any driver. This allows mainboards
to use any drivers and take advantage of this common infrastructure.
Platforms are restricted to using Local5, Local6 and Local7 variables
only in implementations of the above functions. Any AML methods called
by the above functions do not have any such restrictions on use of

View File

@ -10,14 +10,14 @@
- ITE IT570E running [System76 EC](https://github.com/system76/ec)
- Graphics
- dGPU options
- NVIDIA GeForce RTX 3070
- NVIDIA GeForce RTX 3080
- NVIDIA GeForce RTX 3070 (Max-Q)
- NVIDIA GeForce RTX 3080 (Max-Q)
- eDP options
- 15.6" 1920x1080@144Hz LCD
- 17.3" 1920x1080@144Hz LCD
- 1x HDMI
- 1x Mini DisplayPort
- 1x DisplayPort over USB-C
- 15.6" 1920x1080@144Hz LCD (LG LP156WFG-SPB3)
- 17.3" 1920x1080@144Hz LCD (LG LP173WFG-SPB3)
- 1x HDMI 2.1
- 1x Mini DisplayPort 1.4
- 1x DisplayPort 1.4 over USB-C
- Memory
- Up to 64GB (2x32GB) dual-channel DDR4 SO-DIMMs @ 3200 MHz
- Networking
@ -26,13 +26,13 @@
- Intel Wi-Fi 6 AX200/AX201
- Power
- 180W (19.5V, 9.23A) AC barrel adapter
- Lite-On PA-1181-16
- Lite-On PA-1181-16, using a C5 power cord
- 73Wh 3-cell battery
- Sound
- Realtek ALC1220 codec
- TI TAS5825M smart amp
- Internal speakers and microphone
- Combined 3.5mm headphone/microphone jack
- Combined 3.5mm headphone & microphone jack
- Combined 3.5mm microphone & S/PDIF jack
- HDMI, mDP, USB-C DP audio
- Storage
@ -41,6 +41,9 @@
- USB
- 1x USB Type-C with Thunderbolt 4
- 3x USB 3.0 Type-A
- Dimensions
- 15": 35.75cm x 23.8cm x 1.98cm, 1.99kg
- 17": 39.59cm x 26.495cm x 1.99cm, 2.3kg
## Flashing coreboot

View File

@ -142,7 +142,7 @@ primarily to serve the needs of the server market.
coreboot support for Xeon-SP is in src/soc/intel/xeon_sp directory.
This release has support for SkyLake-SP (SKX-SP) which is the 2nd
generation, and for CooperLake-SP (CPX-SP) which is the 3rd generation
generation, and for Cooper Lake-SP (CPX-SP) which is the 3rd generation
or the latest generation [2] on market.
With this release, the codebase for multiple generations of Xeon-SP

View File

@ -1,18 +1,22 @@
Upcoming release - coreboot 4.15
coreboot 4.15
================================
The 4.15 release is planned for November 1st, 2021.
coreboot 4.15 was released on November 5th, 2021.
Since 4.14 there have been more than 2448 new commits by more than 219 developers.
Since 4.14 there have been more than 2597 new commits by more than 219 developers.
Of these, over 73 contributed to coreboot for the first time.
Welcome to the project!
Thank you to all the developers who continue to make coreboot the
great open source firmware project that it is.
Important Announcement
----------------------
We are going to be changing the cadence from every 6 months, to every 3 months.
That means the 4.16 release will be coming in February, 2022.
New mainboards
--------------
* Asus p8h61-m_pro_cm6630
@ -23,11 +27,19 @@ New mainboards
* Siemens mc_ehl
* SuperMicro x9sae
* System76 addw1
* System76 addw2
* System76 bonw14
* System76 darp6
* System76 darp7
* System76 galp2
* System76 galp3
* System76 galp3-b
* System76 galp4
* System76 galp5
* System76 gaze14
* System76 lemp10
* System76 oryp7
* System76 oryp8
Removed mainboards
------------------

View File

@ -1,7 +1,10 @@
Upcoming release - coreboot 4.16
================================
The 4.16 release is planned for May 2022.
The 4.16 release is planned for February, 2022.
We are increasing the frequency of releases in order to enable others to release quarterly on
a fresher version of coreboot.
Update this document with changes that should be in the release notes.

View File

@ -27,4 +27,4 @@ Upcoming release
----------------
Please add to the release notes as changes are added:
* [4.16 - May 2022](coreboot-4.16-relnotes.md)
* [4.16 - Feb 2022](coreboot-4.16-relnotes.md)

View File

@ -31,6 +31,7 @@
- Zako (HP Chromebox G1)
- Butterfly (HP Pavilion Chromebook 14)
- Cherry
- Tomato
- Banon (Acer Chromebook 15 (CB3-532))
- Celes (Samsung Chromebook 3)
- Cyan (Acer Chromebook R11 (C738T))
@ -66,60 +67,68 @@
- Nefario
- Rainier
- Guybrush
- Akemi
- Dratini
- Nipperkin
- Dewatt
- Akemi (IdeaPad Flex 5/5i Chromebook)
- Dratini (HP Pro c640 Chromebook)
- Duffy Legacy (32MB)
- Duffy
- Faffy
- Duffy (ASUS Chromebox 4)
- Faffy (ASUS Fanless Chromebox)
- Hatch
- Jinlon
- Jinlon (HP Elite c1030 Chromebook)
- Kaisa Legacy (32MB)
- Kaisa
- Kohaku
- Kindred
- Helios
- Kaisa (Acer Chromebox CXI4)
- Kohaku (Samsung Galaxy Chromebook)
- Kindred (Acer Chromebook 712)
- Helios (ASUS Chromebook Flip C436FA)
- Mushu
- Palkia
- Nightfury
- Noibat
- Nightfury (Samsung Galaxy Chromebook 2)
- Noibat (HP Chromebox G3)
- Puff
- Helios_Diskswap
- Stryke
- Wyvern
- Wyvern (CTL Chromebox CBx2)
- Dooly
- Ambassador
- Genesis
- Scout
- Moonbuggy
- Herobrine
- Senor
- Piglin
- Hoglin
- Guado (ASUS Chromebox CN62)
- Jecht
- Rikku (Acer Chromebox CXI2)
- Tidus (Lenovo ThinkCentre Chromebox)
- Aleena
- Careena
- Aleena/Kasumi (Acer Chromebook 315 (CB315-2H), 311 (C721) / Spin 311 (R721T))
- Barla/Careena (HP Chromebook 11A G6/G8 EE, 14A G5/G6)
- Grunt
- Liara
- Liara (Lenovo 14e Chromebook, Chromebook S345-14)
- Nuwani
- Treeya
- Treeya (Lenovo 100e/300e Gen2 AMD)
- Kukui
- Krane
- Kodama
- Krane (Lenovo Chromebook Duet/Lenovo IdeaPad Duet Chromebook)
- Kodama (Lenovo 10e Chromebook Tablet)
- Kakadu
- Flapjack
- Katsu
- Jacuzzi
- Juniper
- Juniper (Acer Chromebook Spin 311 (CP311-3H))
- Kappa
- Damu
- Damu (ASUS Chromebook Flip CM3 (CM3200))
- Cerise
- Stern
- Willow
- Esche
- Burnet
- Esche (HP Chromebook 11MK G9 EE)
- Burnet (HP Chromebook x360 11MK G3 EE)
- Fennel
- Cozmo
- Makomo
- Munna
- Pico
- Link (Google Chromebook Pixel (2013))
- Mancomb
- Mistral
- Nyan
- Nyan Big (Acer Chromebook 13 (CB5-311))
@ -132,7 +141,7 @@
- Atlas (Google Pixelbook Go)
- Poppy
- Nami
- Nautilus (Samsung Chromebook Plus (V2 / LTE))
- Nautilus (Samsung Chromebook Plus V2, V2 LTE)
- Nocturne (Google Pixel Slate)
- Rammus (Asus Chromebook C425, Flip C433, Flip C434)
- Soraka (HP Chromebook x2)
@ -158,8 +167,8 @@
- Snappy (HP Chromebook x360 11 G1 EE)
- Nasher
- Coral
- Arcada
- Sarien
- Arcada (Latitude 5300 2-in-1 Chromebook Enterprise)
- Sarien (Dell Latitude 5400 Chromebook Enterprise)
- Falco (HP Chromebook 14)
- Leon (Toshiba Chromebook)
- Peppy (Acer C720/C720P Chromebook)
@ -177,8 +186,8 @@
- Pazquel
- Pompom
- Quackingstick
- Trogdor
- Wormdingler
- Trogdor
- Veyron_Jaq (Haier Chromebook 11)
- Veyron_Jerry (Hisense Chromebook 11)
- Veyron_Mighty (Haier Chromebook 11(edu))
@ -187,15 +196,15 @@
- Veyron_Mickey (Asus Chromebit CS10)
- Veyron_Rialto
- Dalboz
- Vilboz
- Ezkinil
- Morphius
- Vilboz (Lenovo 100e/300e Gen3 AMD)
- Ezkinil (Acer Chromebook Spin 514)
- Morphius (Lenovo ThinkPad C13 Yoga Chromebook)
- Trembyle
- Berknip
- Woomax
- Dirinboz
- Berknip (HP Pro c645 Chromebook Enterprise)
- Woomax (ASUS Chromebook Flip CM5)
- Dirinboz (HP Chromebook 14a-nd0097nr)
- Shuboz
- Gumboz
- Gumboz (HP Chromebook x360 14a)
## HP
- Z220 SFF Workstation
@ -203,6 +212,7 @@
## Intel
- Alderlake-P RVP
- Alderlake-P RVP with Chrome EC
- Alderlake-P RVP with Microchip EC
- Alderlake-M RVP
- Alderlake-M RVP with Chrome EC
- Basking Ridge CRB

View File

@ -146,7 +146,7 @@ payloads/external/tianocore/tianocore/Build/UEFIPAYLOAD.fd tianocore: $(DOTCONFI
CONFIG_TIANOCORE_BOOTSPLASH_FILE=$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
CONFIG_TIANOCORE_UEFIPAYLOAD=$(CONFIG_TIANOCORE_UEFIPAYLOAD) \
CONFIG_TIANOCORE_UPSTREAM=$(CONFIG_TIANOCORE_UPSTREAM) \
CONFIG_MMCONF_BASE_ADDRESS=$(CONFIG_MMCONF_BASE_ADDRESS) \
CONFIG_ECAM_MMCONF_BASE_ADDRESS=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) \
CONFIG_TIANOCORE_ABOVE_4G_MEMORY=$(CONFIG_TIANOCORE_ABOVE_4G_MEMORY) \
CONFIG_TIANOCORE_BOOT_TIMEOUT=$(CONFIG_TIANOCORE_BOOT_TIMEOUT) \
CONFIG_TIANOCORE_CBMEM_LOGGING=$(CONFIG_TIANOCORE_CBMEM_LOGGING) \

View File

@ -9,7 +9,7 @@ project_git_repo=https://github.com/mrchromebox/edk2
project_git_branch=uefipayload_202107
upstream_git_repo=https://github.com/tianocore/edk2
build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_ECAM_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
ifeq ($(CONFIG_TIANOCORE_COREBOOTPAYLOAD),y)
project_git_branch=coreboot_fb

View File

@ -26,4 +26,21 @@ void write16(volatile void *addr, uint16_t val);
void write32(volatile void *addr, uint32_t val);
void write64(volatile void *addr, uint64_t val);
/* x86 I/O functions */
unsigned int inl(int port);
unsigned short inw(int port);
unsigned char inb(int port);
void outl(unsigned int val, int port);
void outw(unsigned short val, int port);
void outb(unsigned char val, int port);
void outsl(int port, const void *addr, unsigned long count);
void outsw(int port, const void *addr, unsigned long count);
void outsb(int port, const void *addr, unsigned long count);
void insl(int port, void *addr, unsigned long count);
void insw(int port, void *addr, unsigned long count);
void insb(int port, void *addr, unsigned long count);
#endif /* _ARCH_IO_H */

View File

@ -6,4 +6,3 @@ speaker-test-srcs += tests/drivers/speaker-test.c
speaker-test-mocks += inb
speaker-test-mocks += outb
speaker-test-mocks += arch_ndelay
speaker-test-cflags += -include $(testsrc)/include/mocks/x86_io.h

View File

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <libpayload.h>
#include <mocks/x86_io.h>
/* Include source to gain access to private defines */
#include "../drivers/speaker.c"

View File

@ -1,30 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef TESTS_MOCKS_X86_IO_H_
#define TESTS_MOCKS_X86_IO_H_
unsigned int inl(int port);
unsigned short inw(int port);
unsigned char inb(int port);
void outl(unsigned int val, int port);
void outw(unsigned short val, int port);
void outb(unsigned char val, int port);
void outsl(int port, const void *addr, unsigned long count);
void outsw(int port, const void *addr, unsigned long count);
void outsb(int port, const void *addr, unsigned long count);
void insl(int port, void *addr, unsigned long count);
void insw(int port, void *addr, unsigned long count);
void insb(int port, void *addr, unsigned long count);
#endif

34
spd/lp5/memory_parts.json Normal file
View File

@ -0,0 +1,34 @@
{
"parts": [
{
"name": "MT62F512M32D2DR-031 WT:B",
"attribs": {
"densityPerDieGb": 8,
"diesPerPackage": 2,
"bitWidthPerChannel": 16,
"ranksPerChannel": 1,
"speedMbps": 6400
}
},
{
"name": "MT62F1G32D4DR-031 WT:B",
"attribs": {
"densityPerDieGb": 8,
"diesPerPackage": 4,
"bitWidthPerChannel": 16,
"ranksPerChannel": 2,
"speedMbps": 6400
}
},
{
"name": "H9JCNNNCP3MLYR-N6E",
"attribs": {
"densityPerDieGb": 8,
"diesPerPackage": 4,
"bitWidthPerChannel": 16,
"ranksPerChannel": 2,
"speedMbps": 6400
}
}
]
}

View File

@ -0,0 +1,4 @@
# Generated by:
# util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5
ADL,set-0

View File

@ -0,0 +1,6 @@
# Generated by:
# util/spd_tools/bin/spd_gen spd/lp5/memory_parts.json lp5
MT62F512M32D2DR-031 WT:B,spd-1.hex
MT62F1G32D4DR-031 WT:B,spd-2.hex
H9JCNNNCP3MLYR-N6E,spd-2.hex

32
spd/lp5/set-0/spd-1.hex Normal file
View File

@ -0,0 +1,32 @@
23 10 13 0E 15 1A 95 08 00 00 00 00 02 01 00 00
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

32
spd/lp5/set-0/spd-2.hex Normal file
View File

@ -0,0 +1,32 @@
23 10 13 0E 15 1A B5 08 00 00 00 00 0A 01 00 00
00 00 0A 00 00 00 00 00 AA 00 90 A8 90 90 06 C0
03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

View File

@ -0,0 +1,32 @@
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

View File

@ -395,16 +395,6 @@ config FW_CONFIG
Enable support for probing devices with fw_config. This is a simple
bitmask broken into fields and options for probing.
config FW_CONFIG_SOURCE_CBFS
bool "Obtain Firmware Configuration value from CBFS"
depends on FW_CONFIG
default n
help
With this option enabled coreboot will look for the 32bit firmware
configuration value in CBFS at the selected prefix with the file name
"fw_config". This option will override other sources and allow the
local image to preempt the mainboard selected source.
config FW_CONFIG_SOURCE_CHROMEEC_CBI
bool "Obtain Firmware Configuration value from Google Chrome EC CBI"
depends on FW_CONFIG && EC_GOOGLE_CHROMEEC
@ -415,6 +405,27 @@ config FW_CONFIG_SOURCE_CHROMEEC_CBI
is not tried if FW_CONFIG_SOURCE_CBFS is enabled and the value was
found in CBFS.
config FW_CONFIG_SOURCE_CBFS
bool "Obtain Firmware Configuration value from CBFS"
depends on FW_CONFIG
default n
help
With this option enabled coreboot will look for the 32bit firmware
configuration value in CBFS at the selected prefix with the file name
"fw_config". This option will override other sources and allow the
local image to preempt the mainboard selected source and can be used as
FW_CONFIG_SOURCE_CHROMEEC_CBI fallback option.
config FW_CONFIG_SOURCE_VPD
bool "Obtain Firmware Configuration value from VPD"
depends on FW_CONFIG && VPD
default n
help
With this option enabled coreboot will look for the 32bit firmware
configuration value in VPD key name "fw_config". This option will
override other sources and allow the local image to preempt the mainboard
selected source and can be used for other FW_CONFIG_SOURCEs fallback option.
config HAVE_RAMPAYLOAD
bool
@ -677,12 +688,12 @@ config TIMER_QUEUE
config COOP_MULTITASKING
def_bool n
depends on TIMER_QUEUE && ARCH_X86 && CPU_INFO_V2
select TIMER_QUEUE
depends on ARCH_X86 && CPU_INFO_V2
help
Cooperative multitasking allows callbacks to be multiplexed on the
main thread of ramstage. With this enabled it allows for multiple
execution paths to take place when they have udelay() calls within
their code.
main thread. With this enabled it allows for multiple execution paths
to take place when they have udelay() calls within their code.
config NUM_THREADS
int
@ -785,6 +796,21 @@ config GENERATE_SMBIOS_TABLES
If unsure, say Y.
config SMBIOS_TYPE41_PROVIDED_BY_DEVTREE
bool
depends on ARCH_X86
help
If enabled, only generate SMBIOS Type 41 entries for PCI devices in
the devicetree for which Type 41 information is provided, e.g. with
the `smbios_dev_info` devicetree syntax. This is useful to manually
assign specific instance IDs to onboard devices irrespective of the
device traversal order. It is assumed that instance IDs for devices
of the same class are unique.
When disabled, coreboot autogenerates SMBIOS Type 41 entries for all
appropriate PCI devices in the devicetree. Instance IDs are assigned
successive numbers from a monotonically increasing counter, with one
counter for each device class.
config SMBIOS_PROVIDED_BY_MOBO
bool
default n
@ -1153,7 +1179,7 @@ config DEBUG_INTEL_ME
endif
config DEBUG_FUNC
bool "Enable function entry and exit reporting macros" if DEFAULT_CONSOLE_LOGLEVEL_8
bool "Enable function entry and exit reporting macros" if DEFAULT_CONSOLE_LOGLEVEL_8 || CONSOLE_OVERRIDE_LOGLEVEL
default n
help
This option enables additional function entry and exit debug messages

View File

@ -266,7 +266,8 @@ void acpi_create_madt(acpi_madt_t *madt)
static unsigned long acpi_fill_mcfg(unsigned long current)
{
current += acpi_create_mcfg_mmconfig((acpi_mcfg_mmconfig_t *)current,
CONFIG_MMCONF_BASE_ADDRESS, 0, 0, CONFIG_MMCONF_BUS_NUMBER - 1);
CONFIG_ECAM_MMCONF_BASE_ADDRESS, 0, 0,
CONFIG_ECAM_MMCONF_BUS_NUMBER - 1);
return current;
}
@ -291,7 +292,7 @@ void acpi_create_mcfg(acpi_mcfg_t *mcfg)
header->length = sizeof(acpi_mcfg_t);
header->revision = get_acpi_table_revision(MCFG);
if (CONFIG(MMCONF_SUPPORT))
if (CONFIG(ECAM_MMCONF_SUPPORT))
current = acpi_fill_mcfg(current);
/* (Re)calculate length and checksum. */
@ -1248,7 +1249,7 @@ unsigned long acpi_write_dbg2_pci_uart(acpi_rsdp_t *rsdp, unsigned long current,
printk(BIOS_INFO, "%s: Device not enabled\n", __func__);
return current;
}
res = find_resource(dev, PCI_BASE_ADDRESS_0);
res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (!res) {
printk(BIOS_ERR, "%s: Unable to find resource for %s\n",
__func__, dev_path(dev));

View File

@ -31,13 +31,13 @@ Method (_PIC, 1)
PICM = Arg0
}
#if CONFIG(MMCONF_SUPPORT)
#if CONFIG(ECAM_MMCONF_SUPPORT)
Scope(\_SB) {
/* Base address of PCIe config space */
Name(PCBA, CONFIG_MMCONF_BASE_ADDRESS)
Name(PCBA, CONFIG_ECAM_MMCONF_BASE_ADDRESS)
/* Length of PCIe config space, 1MB each bus */
Name(PCLN, CONFIG_MMCONF_LENGTH)
Name(PCLN, CONFIG_ECAM_MMCONF_LENGTH)
/* PCIe Configuration Space */
OperationRegion(PCFG, SystemMemory, PCBA, PCLN) /* Each bus consumes 1MB */

View File

@ -1,15 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _ARCH_SMP_SPINLOCK_H
#define _ARCH_SMP_SPINLOCK_H
#define DECLARE_SPIN_LOCK(x)
#define spin_is_locked(lock) 0
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
#include <smp/node.h>
#define boot_cpu() 1
#endif

View File

@ -43,6 +43,13 @@ cbfs-files-$(CONFIG_VGA_BIOS_DGPU) += pci$(stripped_vgabios_dgpu_id).rom
pci$(stripped_vgabios_dgpu_id).rom-file := $(call strip_quotes,$(CONFIG_VGA_BIOS_DGPU_FILE))
pci$(stripped_vgabios_dgpu_id).rom-type := optionrom
# The AMD LPC SPI DMA controller requires source files to be 64 byte aligned.
ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA),y)
pci$(stripped_vgabios_id).rom-align := 64
pci$(stripped_second_vbios_id).rom-align := 64
pci$(stripped_vgabios_dgpu_id).rom-align := 64
endif # CONFIG_SOC_AMD_COMMON_BLOCK_LPC_SPI_DMA
###############################################################################
# common support for early assembly includes
###############################################################################

View File

@ -69,7 +69,7 @@ void pci_io_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
outl(value, 0xCFC);
}
#if !CONFIG(MMCONF_SUPPORT)
#if !CONFIG(ECAM_MMCONF_SUPPORT)
/* Avoid name collisions as different stages have different signature
* for these functions. The _s_ stands for simple, fundamental IO or

View File

@ -4,6 +4,8 @@
#define ARCH_I386_PCI_OPS_H
#include <arch/pci_io_cfg.h>
#if CONFIG(ECAM_MMCONF_SUPPORT)
#include <device/pci_mmio_cfg.h>
#endif
#endif /* ARCH_I386_PCI_OPS_H */

View File

@ -15,10 +15,6 @@ typedef struct {
#define SPIN_LOCK_UNLOCKED { 1 }
#define STAGE_HAS_SPINLOCKS !ENV_ROMSTAGE_OR_BEFORE
#if STAGE_HAS_SPINLOCKS
#define DECLARE_SPIN_LOCK(x) \
static spinlock_t x = SPIN_LOCK_UNLOCKED;
@ -71,14 +67,4 @@ static __always_inline void spin_unlock(spinlock_t *lock)
: "=m" (lock->lock) : : "memory");
}
#else
#define DECLARE_SPIN_LOCK(x)
#define spin_is_locked(lock) 0
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
#endif
#endif /* ARCH_SMP_SPINLOCK_H */

View File

@ -224,6 +224,9 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm,
unsigned long *current, int *handle,
int type16_handle)
{
struct spd_info info;
get_spd_info(dimm->ddr_type, dimm->mod_type, &info);
struct smbios_type17 *t = smbios_carve_table(*current, SMBIOS_MEMORY_DEVICE,
sizeof(*t), *handle);
@ -244,24 +247,7 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm,
}
t->data_width = 8 * (1 << (dimm->bus_width & 0x7));
t->total_width = t->data_width + 8 * ((dimm->bus_width & 0x18) >> 3);
switch (dimm->mod_type) {
case SPD_RDIMM:
case SPD_MINI_RDIMM:
t->form_factor = MEMORY_FORMFACTOR_RIMM;
break;
case SPD_UDIMM:
case SPD_MICRO_DIMM:
case SPD_MINI_UDIMM:
t->form_factor = MEMORY_FORMFACTOR_DIMM;
break;
case SPD_SODIMM:
t->form_factor = MEMORY_FORMFACTOR_SODIMM;
break;
default:
t->form_factor = MEMORY_FORMFACTOR_UNKNOWN;
break;
}
t->form_factor = info.form_factor;
smbios_fill_dimm_manufacturer_from_id(dimm->mod_id, t);
smbios_fill_dimm_serial_number(dimm, t);
@ -278,19 +264,8 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm,
t->maximum_voltage = dimm->vdd_voltage;
/* Fill in type detail */
switch (dimm->mod_type) {
case SPD_RDIMM:
case SPD_MINI_RDIMM:
t->type_detail = MEMORY_TYPE_DETAIL_REGISTERED;
break;
case SPD_UDIMM:
case SPD_MINI_UDIMM:
t->type_detail = MEMORY_TYPE_DETAIL_UNBUFFERED;
break;
default:
t->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
}
t->type_detail = info.type_detail;
/* Synchronous = 1 */
t->type_detail |= MEMORY_TYPE_DETAIL_SYNCHRONOUS;
/* no handle for error information */
@ -1177,30 +1152,55 @@ static u8 smbios_get_device_type_from_dev(struct device *dev)
}
}
static bool smbios_get_type41_instance_id(struct device *dev, u8 device_type, u8 *instance_id)
{
#if CONFIG(SMBIOS_TYPE41_PROVIDED_BY_DEVTREE)
*instance_id = dev->smbios_instance_id;
return dev->smbios_instance_id_valid;
#else
static u8 type41_inst_cnt[SMBIOS_DEVICE_TYPE_COUNT + 1] = {};
if (device_type == SMBIOS_DEVICE_TYPE_OTHER ||
device_type == SMBIOS_DEVICE_TYPE_UNKNOWN)
return false;
if (device_type > SMBIOS_DEVICE_TYPE_COUNT)
return false;
*instance_id = type41_inst_cnt[device_type]++;
return true;
#endif
}
static const char *smbios_get_type41_refdes(struct device *dev)
{
#if CONFIG(SMBIOS_TYPE41_PROVIDED_BY_DEVTREE)
if (dev->smbios_refdes)
return dev->smbios_refdes;
#endif
return get_pci_subclass_name(dev);
}
static int smbios_generate_type41_from_devtree(struct device *dev, int *handle,
unsigned long *current)
{
static u8 type41_inst_cnt[SMBIOS_DEVICE_TYPE_COUNT + 1] = {};
if (dev->path.type != DEVICE_PATH_PCI)
return 0;
if (!dev->on_mainboard)
return 0;
u8 device_type = smbios_get_device_type_from_dev(dev);
const u8 device_type = smbios_get_device_type_from_dev(dev);
if (device_type == SMBIOS_DEVICE_TYPE_OTHER ||
device_type == SMBIOS_DEVICE_TYPE_UNKNOWN)
u8 instance_id;
if (!smbios_get_type41_instance_id(dev, device_type, &instance_id))
return 0;
if (device_type > SMBIOS_DEVICE_TYPE_COUNT)
return 0;
const char *name = get_pci_subclass_name(dev);
const char *name = smbios_get_type41_refdes(dev);
return smbios_write_type41(current, handle,
name, // name
type41_inst_cnt[device_type]++, // inst
instance_id, // inst
0, // segment
dev->bus->secondary, //bus
PCI_SLOT(dev->path.pci.devfn), // device

View File

@ -22,6 +22,9 @@ smm-y += region.c
postcar-y += region.c
ramstage-$(CONFIG_PLATFORM_USES_FSP1_1) += fsp_relocate.c
ifeq ($(CONFIG_FSP_M_XIP),)
romstage-$(CONFIG_PLATFORM_USES_FSP2_0) += fsp_relocate.c
endif
ramstage-$(CONFIG_PLATFORM_USES_FSP2_0) += fsp_relocate.c
bootblock-y += cbfs.c

View File

@ -3,6 +3,7 @@
#ifndef _MEM_POOL_H_
#define _MEM_POOL_H_
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
@ -16,23 +17,23 @@
* were chosen to optimize for the CBFS cache case which may need two buffers
* to map a single compressed file, and will free them in reverse order.)
*
* The memory returned by allocations are at least 8 byte aligned. Note
* that this requires the backing buffer to start on at least an 8 byte
* alignment.
* You must ensure the backing buffer is 'alignment' aligned.
*/
struct mem_pool {
uint8_t *buf;
size_t size;
size_t alignment;
uint8_t *last_alloc;
uint8_t *second_to_last_alloc;
size_t free_offset;
};
#define MEM_POOL_INIT(buf_, size_) \
#define MEM_POOL_INIT(buf_, size_, alignment_) \
{ \
.buf = (buf_), \
.size = (size_), \
.alignment = (alignment_), \
.last_alloc = NULL, \
.second_to_last_alloc = NULL, \
.free_offset = 0, \
@ -46,10 +47,15 @@ static inline void mem_pool_reset(struct mem_pool *mp)
}
/* Initialize a memory pool. */
static inline void mem_pool_init(struct mem_pool *mp, void *buf, size_t sz)
static inline void mem_pool_init(struct mem_pool *mp, void *buf, size_t sz,
size_t alignment)
{
assert(alignment);
assert((uintptr_t)buf % alignment == 0);
mp->buf = buf;
mp->size = sz;
mp->alignment = alignment;
mem_pool_reset(mp);
}

View File

@ -56,6 +56,8 @@ enum timestamp_id {
TS_DELAY_END = 111,
TS_READ_UCODE_START = 112,
TS_READ_UCODE_END = 113,
TS_ELOG_INIT_START = 114,
TS_ELOG_INIT_END = 115,
/* 500+ reserved for vendorcode extensions (500-600: google/chromeos) */
TS_START_COPYVER = 501,
@ -200,6 +202,8 @@ static const struct timestamp_id_to_name {
{ TS_DELAY_END, "Forced delay end" },
{ TS_READ_UCODE_START, "started reading uCode" },
{ TS_READ_UCODE_END, "finished reading uCode" },
{ TS_ELOG_INIT_START, "started elog init" },
{ TS_ELOG_INIT_END, "finished elog init" },
{ TS_START_COPYVER, "starting to load verstage" },
{ TS_END_COPYVER, "finished loading verstage" },

View File

@ -7,8 +7,11 @@ void *mem_pool_alloc(struct mem_pool *mp, size_t sz)
{
void *p;
/* Make all allocations be at least 8 byte aligned. */
sz = ALIGN_UP(sz, 8);
if (mp->alignment == 0)
return NULL;
/* We assume that mp->buf started mp->alignment aligned */
sz = ALIGN_UP(sz, mp->alignment);
/* Determine if any space available. */
if ((mp->size - mp->free_offset) < sz)

View File

@ -3,11 +3,3 @@
config CPU_AMD_AGESA_FAMILY14
bool
select X86_AMD_FIXED_MTRRS
if CPU_AMD_AGESA_FAMILY14
config CPU_ADDR_BITS
int
default 36
endif

View File

@ -25,9 +25,7 @@ static void model_14_init(struct device *dev)
disable_cache();
/*
* AGESA sets the MTRRs main MTRRs. The shadow area needs to be set
* by coreboot. The amd_setup_mtrrs should work, but needs debug on fam14.
* TODO:
* amd_setup_mtrrs();
* by coreboot.
*/
/* Enable access to AMD RdDram and WrDram extension bits */

View File

@ -4,11 +4,3 @@ config CPU_AMD_AGESA_FAMILY15_TN
bool
select IDS_OPTIONS_HOOKED_UP
select X86_AMD_FIXED_MTRRS
if CPU_AMD_AGESA_FAMILY15_TN
config CPU_ADDR_BITS
int
default 48
endif

View File

@ -25,9 +25,10 @@ static void model_15_init(struct device *dev)
u32 siblings;
#endif
//enable_cache();
//amd_setup_mtrrs();
//x86_mtrr_check();
/*
* AGESA sets the MTRRs main MTRRs. The shadow area needs to be set
* by coreboot.
*/
disable_cache();
/* Enable access to AMD RdDram and WrDram extension bits */
msr = rdmsr(SYSCFG_MSR);

View File

@ -6,10 +6,6 @@ config CPU_AMD_AGESA_FAMILY16_KB
if CPU_AMD_AGESA_FAMILY16_KB
config CPU_ADDR_BITS
int
default 40
config FORCE_AM1_SOCKET_SUPPORT
bool
default n

View File

@ -23,9 +23,10 @@ static void model_16_init(struct device *dev)
u32 siblings;
#endif
//enable_cache();
//amd_setup_mtrrs();
//x86_mtrr_check();
/*
* AGESA sets the MTRRs main MTRRs. The shadow area needs to be set
* by coreboot.
*/
disable_cache();
/* Enable access to AMD RdDram and WrDram extension bits */
msr = rdmsr(SYSCFG_MSR);

View File

@ -3,72 +3,11 @@
#include <amdblocks/biosram.h>
#include <console/console.h>
#include <device/device.h>
#include <arch/cpu.h>
#include <cpu/x86/mtrr.h>
#include <cpu/x86/msr.h>
#include <cpu/amd/mtrr.h>
#include <cpu/x86/cache.h>
/* These will likely move to some device node or cbmem. */
static uint64_t amd_topmem = 0;
static uint64_t amd_topmem2 = 0;
uint64_t bsp_topmem(void)
{
return amd_topmem;
}
uint64_t bsp_topmem2(void)
{
return amd_topmem2;
}
/* Take a copy of BSP CPUs TOP_MEM and TOP_MEM2 registers,
* so they can be distributed to AP CPUs. Not strictly MTRRs,
* but this is not that bad a place to have this code.
*/
void setup_bsp_ramtop(void)
{
msr_t msr, msr2;
/* TOP_MEM: the top of DRAM below 4G */
msr = rdmsr(TOP_MEM);
printk(BIOS_INFO,
"%s, TOP MEM: msr.lo = 0x%08x, msr.hi = 0x%08x\n",
__func__, msr.lo, msr.hi);
/* TOP_MEM2: the top of DRAM above 4G */
msr2 = rdmsr(TOP_MEM2);
printk(BIOS_INFO,
"%s, TOP MEM2: msr.lo = 0x%08x, msr.hi = 0x%08x\n",
__func__, msr2.lo, msr2.hi);
amd_topmem = (uint64_t) msr.hi << 32 | msr.lo;
amd_topmem2 = (uint64_t) msr2.hi << 32 | msr2.lo;
}
static void setup_ap_ramtop(void)
{
msr_t msr;
uint64_t v;
v = bsp_topmem();
if (!v)
return;
msr.hi = v >> 32;
msr.lo = (uint32_t) v;
wrmsr(TOP_MEM, msr);
v = bsp_topmem2();
msr.hi = v >> 32;
msr.lo = (uint32_t) v;
wrmsr(TOP_MEM2, msr);
}
void add_uma_resource_below_tolm(struct device *nb, int idx)
{
uint32_t topmem = bsp_topmem();
uint32_t topmem = amd_topmem();
uint32_t top_of_cacheable = restore_top_of_low_cacheable();
if (top_of_cacheable == topmem)
@ -82,79 +21,3 @@ void add_uma_resource_below_tolm(struct device *nb, int idx)
uma_resource(nb, idx, uma_base / KiB, uma_size / KiB);
}
void amd_setup_mtrrs(void)
{
unsigned long address_bits;
unsigned long i;
msr_t msr, sys_cfg;
// Test if this CPU is a Fam 0Fh rev. F or later
const int cpu_id = cpuid_eax(0x80000001);
printk(BIOS_SPEW, "CPU ID 0x80000001: %x\n", cpu_id);
const int has_tom2wb =
// ExtendedFamily > 0
(((cpu_id>>20)&0xf) > 0) ||
// Family == 0F
((((cpu_id>>8)&0xf) == 0xf) &&
// Rev>=F deduced from rev tables
(((cpu_id>>16)&0xf) >= 0x4));
if (has_tom2wb)
printk(BIOS_DEBUG, "CPU is Fam 0Fh rev.F or later. We can use TOM2WB for any memory above 4GB\n");
/* Enable the access to AMD RdDram and WrDram extension bits */
disable_cache();
sys_cfg = rdmsr(SYSCFG_MSR);
sys_cfg.lo |= SYSCFG_MSR_MtrrFixDramModEn;
wrmsr(SYSCFG_MSR, sys_cfg);
enable_cache();
/* Setup fixed MTRRs, but do not enable them just yet. */
x86_setup_fixed_mtrrs_no_enable();
disable_cache();
setup_ap_ramtop();
/* if DRAM above 4GB: set SYSCFG_MSR_TOM2En and SYSCFG_MSR_TOM2WB */
sys_cfg.lo &= ~(SYSCFG_MSR_TOM2En | SYSCFG_MSR_TOM2WB);
if (bsp_topmem2() > (uint64_t)1 << 32) {
sys_cfg.lo |= SYSCFG_MSR_TOM2En;
if (has_tom2wb)
sys_cfg.lo |= SYSCFG_MSR_TOM2WB;
}
/* zero the IORR's before we enable to prevent
* undefined side effects.
*/
msr.lo = msr.hi = 0;
for (i = MTRR_IORR0_BASE; i <= MTRR_IORR1_MASK; i++)
wrmsr(i, msr);
/* Enable Variable Mtrrs
* Enable the RdMem and WrMem bits in the fixed mtrrs.
* Disable access to the RdMem and WrMem in the fixed mtrr.
*/
sys_cfg.lo |= SYSCFG_MSR_MtrrVarDramEn | SYSCFG_MSR_MtrrFixDramEn;
sys_cfg.lo &= ~SYSCFG_MSR_MtrrFixDramModEn;
wrmsr(SYSCFG_MSR, sys_cfg);
enable_fixed_mtrr();
enable_cache();
//K8 could be 40, and GH could be 48
address_bits = CONFIG_CPU_ADDR_BITS;
/* AMD specific cpuid function to query number of address bits */
if (cpuid_eax(0x80000000) >= 0x80000008)
address_bits = cpuid_eax(0x80000008) & 0xff;
/* Now that I have mapped what is memory and what is not
* Set up the mtrrs so we can cache the memory.
*/
// Rev. F K8 supports has SYSCFG_MSR_TOM2WB and doesn't need
// variable MTRR to span memory above 4GB
// Lower revisions K8 need variable MTRR over 4GB
x86_setup_var_mtrrs(address_bits, has_tom2wb ? 0 : 1);
}

View File

@ -5,11 +5,3 @@ config CPU_AMD_PI_00730F01
select X86_AMD_FIXED_MTRRS
select SUPPORT_CPU_UCODE_IN_CBFS
select MICROCODE_BLOB_UNDISCLOSED
if CPU_AMD_PI_00730F01
config CPU_ADDR_BITS
int
default 40
endif

View File

@ -588,8 +588,8 @@ static void pre_mp_init(void)
static int get_cpu_count(void)
{
msr_t msr;
int num_threads;
int num_cores;
unsigned int num_threads;
unsigned int num_cores;
msr = rdmsr(MSR_CORE_THREAD_COUNT);
num_threads = (msr.lo >> 0) & 0xffff;

View File

@ -23,7 +23,7 @@ static void pre_mp_init(void)
static int get_cpu_count(void)
{
const struct cpuid_result cpuid1 = cpuid(1);
const char cores = (cpuid1.ebx >> 16) & 0xf;
const unsigned int cores = (cpuid1.ebx >> 16) & 0xf;
printk(BIOS_DEBUG, "CPU has %u cores.\n", cores);

View File

@ -11,11 +11,3 @@ config CPU_INTEL_MODEL_106CX
select SERIALIZED_SMM_INITIALIZATION
select CPU_INTEL_COMMON
select CPU_INTEL_COMMON_TIMEBASE
if CPU_INTEL_MODEL_106CX
config CPU_ADDR_BITS
int
default 32
endif

View File

@ -124,8 +124,8 @@ static void pre_mp_init(void)
static int get_cpu_count(void)
{
msr_t msr;
int num_threads;
int num_cores;
unsigned int num_threads;
unsigned int num_cores;
msr = rdmsr(MSR_CORE_THREAD_COUNT);
num_threads = (msr.lo >> 0) & 0xffff;

View File

@ -380,8 +380,8 @@ static void pre_mp_init(void)
static int get_cpu_count(void)
{
msr_t msr;
int num_threads;
int num_cores;
unsigned int num_threads;
unsigned int num_cores;
msr = rdmsr(MSR_CORE_THREAD_COUNT);
num_threads = (msr.lo >> 0) & 0xffff;

View File

@ -90,10 +90,6 @@ config SETUP_XIP_CACHE
non-eviction mode and therefore need to be careful to avoid
eviction.
config CPU_ADDR_BITS
int
default 36
config LOGICAL_CPUS
bool
default y

View File

@ -499,13 +499,21 @@ config PCI
if PCI
config NO_MMCONF_SUPPORT
config NO_ECAM_MMCONF_SUPPORT
bool
default n
help
Disable the use of the Enhanced Configuration
Access mechanism (ECAM) method for accessing PCI config
address space.
config MMCONF_SUPPORT
config ECAM_MMCONF_SUPPORT
bool
default !NO_MMCONF_SUPPORT
default !NO_ECAM_MMCONF_SUPPORT
help
Enable the use of the Enhanced Configuration
Access mechanism (ECAM) method for accessing PCI config
address space.
config PCIX_PLUGIN_SUPPORT
bool
@ -540,20 +548,20 @@ config PCIEXP_PLUGIN_SUPPORT
bool
default y
config MMCONF_BASE_ADDRESS
config ECAM_MMCONF_BASE_ADDRESS
hex
depends on MMCONF_SUPPORT
depends on ECAM_MMCONF_SUPPORT
config MMCONF_BUS_NUMBER
config ECAM_MMCONF_BUS_NUMBER
int
depends on MMCONF_SUPPORT
depends on ECAM_MMCONF_SUPPORT
config MMCONF_LENGTH
config ECAM_MMCONF_LENGTH
hex
depends on MMCONF_SUPPORT
default 0x04000000 if MMCONF_BUS_NUMBER = 64
default 0x08000000 if MMCONF_BUS_NUMBER = 128
default 0x10000000 if MMCONF_BUS_NUMBER = 256
depends on ECAM_MMCONF_SUPPORT
default 0x04000000 if ECAM_MMCONF_BUS_NUMBER = 64
default 0x08000000 if ECAM_MMCONF_BUS_NUMBER = 128
default 0x10000000 if ECAM_MMCONF_BUS_NUMBER = 256
default 0x0
config PCI_ALLOW_BUS_MASTER
@ -619,7 +627,7 @@ config PCIEXP_CLK_PM
config PCIEXP_L1_SUB_STATE
prompt "Enable PCIe ASPM L1 SubState"
bool
depends on (MMCONF_SUPPORT || PCI_IO_CFG_EXT)
depends on (ECAM_MMCONF_SUPPORT || PCI_IO_CFG_EXT)
default n
help
Detect and enable ASPM on PCIe links.
@ -635,8 +643,8 @@ if PCIEXP_HOTPLUG
config PCIEXP_HOTPLUG_BUSES
int "PCI Express Hotplug Buses"
default 8 if MMCONF_SUPPORT && MMCONF_BUS_NUMBER <= 64
default 16 if MMCONF_SUPPORT && MMCONF_BUS_NUMBER <= 128
default 8 if ECAM_MMCONF_SUPPORT && ECAM_MMCONF_BUS_NUMBER <= 64
default 16 if ECAM_MMCONF_SUPPORT && ECAM_MMCONF_BUS_NUMBER <= 128
default 32
help
This is the number of buses allocated for hotplug PCI express

View File

@ -227,7 +227,7 @@ __weak void mainboard_azalia_program_runtime_verbs(u8 *base, u32 viddid)
{
}
static void codec_init(struct device *dev, u8 *base, int addr)
void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes)
{
u32 reg32;
const u32 *verb;
@ -252,7 +252,7 @@ static void codec_init(struct device *dev, u8 *base, int addr)
/* 2 */
reg32 = read32(base + HDA_IR_REG);
printk(BIOS_DEBUG, "azalia_audio: codec viddid: %08x\n", reg32);
verb_size = azalia_find_verb(cim_verb_data, cim_verb_data_size, reg32, &verb);
verb_size = azalia_find_verb(verb_table, verb_table_bytes, reg32, &verb);
if (!verb_size) {
printk(BIOS_DEBUG, "azalia_audio: No verb!\n");
@ -261,19 +261,22 @@ static void codec_init(struct device *dev, u8 *base, int addr)
printk(BIOS_DEBUG, "azalia_audio: verb_size: %u\n", verb_size);
/* 3 */
azalia_program_verb_table(base, verb, verb_size);
printk(BIOS_DEBUG, "azalia_audio: verb loaded.\n");
const int rc = azalia_program_verb_table(base, verb, verb_size);
if (rc < 0)
printk(BIOS_DEBUG, "azalia_audio: verb not loaded.\n");
else
printk(BIOS_DEBUG, "azalia_audio: verb loaded.\n");
mainboard_azalia_program_runtime_verbs(base, reg32);
}
static void codecs_init(struct device *dev, u8 *base, u16 codec_mask)
void azalia_codecs_init(u8 *base, u16 codec_mask)
{
int i;
for (i = CONFIG_AZALIA_MAX_CODECS - 1; i >= 0; i--) {
if (codec_mask & (1 << i))
codec_init(dev, base, i);
azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size);
}
azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size);
@ -285,7 +288,7 @@ void azalia_audio_init(struct device *dev)
struct resource *res;
u16 codec_mask;
res = find_resource(dev, PCI_BASE_ADDRESS_0);
res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (!res)
return;
@ -297,7 +300,7 @@ void azalia_audio_init(struct device *dev)
if (codec_mask) {
printk(BIOS_DEBUG, "azalia_audio: codec_mask = %02x\n", codec_mask);
codecs_init(dev, base, codec_mask);
azalia_codecs_init(base, codec_mask);
}
}

View File

@ -857,8 +857,8 @@ void fixed_io_resource(struct device *dev, unsigned long index,
void mmconf_resource(struct device *dev, unsigned long index)
{
struct resource *resource = new_resource(dev, index);
resource->base = CONFIG_MMCONF_BASE_ADDRESS;
resource->size = CONFIG_MMCONF_LENGTH;
resource->base = CONFIG_ECAM_MMCONF_BASE_ADDRESS;
resource->size = CONFIG_ECAM_MMCONF_LENGTH;
resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE |
IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;

View File

@ -545,19 +545,19 @@ enum cb_err spd_add_smbios17(const u8 channel, const u8 slot,
switch (info->dimm_type) {
case SPD_DDR3_DIMM_TYPE_SO_DIMM:
dimm->mod_type = SPD_SODIMM;
dimm->mod_type = DDR3_SPD_SODIMM;
break;
case SPD_DDR3_DIMM_TYPE_72B_SO_CDIMM:
dimm->mod_type = SPD_72B_SO_CDIMM;
dimm->mod_type = DDR3_SPD_72B_SO_CDIMM;
break;
case SPD_DDR3_DIMM_TYPE_72B_SO_RDIMM:
dimm->mod_type = SPD_72B_SO_RDIMM;
dimm->mod_type = DDR3_SPD_72B_SO_RDIMM;
break;
case SPD_DDR3_DIMM_TYPE_UDIMM:
dimm->mod_type = SPD_UDIMM;
dimm->mod_type = DDR3_SPD_UDIMM;
break;
case SPD_DDR3_DIMM_TYPE_RDIMM:
dimm->mod_type = SPD_RDIMM;
dimm->mod_type = DDR3_SPD_RDIMM;
break;
case SPD_DDR3_DIMM_TYPE_UNDEFINED:
default:

View File

@ -299,16 +299,16 @@ enum cb_err spd_add_smbios17_ddr4(const u8 channel, const u8 slot, const u16 sel
switch (info->dimm_type) {
case SPD_DDR4_DIMM_TYPE_SO_DIMM:
dimm->mod_type = SPD_SODIMM;
dimm->mod_type = DDR4_SPD_SODIMM;
break;
case SPD_DDR4_DIMM_TYPE_72B_SO_RDIMM:
dimm->mod_type = SPD_72B_SO_RDIMM;
dimm->mod_type = DDR4_SPD_72B_SO_RDIMM;
break;
case SPD_DDR4_DIMM_TYPE_UDIMM:
dimm->mod_type = SPD_UDIMM;
dimm->mod_type = DDR4_SPD_UDIMM;
break;
case SPD_DDR4_DIMM_TYPE_RDIMM:
dimm->mod_type = SPD_RDIMM;
dimm->mod_type = DDR4_SPD_RDIMM;
break;
default:
dimm->mod_type = SPD_UNDEFINED;

View File

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <device/dram/spd.h>
#include <spd.h>
const char *spd_manufacturer_name(const uint16_t mod_id)
{
@ -38,3 +39,219 @@ const char *spd_manufacturer_name(const uint16_t mod_id)
return NULL;
}
}
static void convert_default_module_type_to_spd_info(struct spd_info *info)
{
info->form_factor = MEMORY_FORMFACTOR_UNKNOWN;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
}
static void convert_ddr2_module_type_to_spd_info(enum ddr2_module_type module_type,
struct spd_info *info)
{
switch (module_type) {
case DDR2_SPD_RDIMM:
case DDR2_SPD_MINI_RDIMM:
info->form_factor = MEMORY_FORMFACTOR_RIMM;
info->type_detail = MEMORY_TYPE_DETAIL_REGISTERED;
break;
case DDR2_SPD_UDIMM:
case DDR2_SPD_MINI_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_DIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNBUFFERED;
break;
case DDR2_SPD_MICRO_DIMM:
info->form_factor = MEMORY_FORMFACTOR_DIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
case DDR2_SPD_SODIMM:
info->form_factor = MEMORY_FORMFACTOR_SODIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
default:
convert_default_module_type_to_spd_info(info);
break;
}
}
static void convert_ddr3_module_type_to_spd_info(enum ddr3_module_type module_type,
struct spd_info *info)
{
switch (module_type) {
case DDR3_SPD_RDIMM:
case DDR3_SPD_MINI_RDIMM:
info->form_factor = MEMORY_FORMFACTOR_RIMM;
info->type_detail = MEMORY_TYPE_DETAIL_REGISTERED;
break;
case DDR3_SPD_UDIMM:
case DDR3_SPD_MINI_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_DIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNBUFFERED;
break;
case DDR3_SPD_MICRO_DIMM:
info->form_factor = MEMORY_FORMFACTOR_DIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
case DDR3_SPD_SODIMM:
case DDR3_SPD_72B_SO_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_SODIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
default:
convert_default_module_type_to_spd_info(info);
break;
}
}
static void convert_ddr4_module_type_to_spd_info(enum ddr4_module_type module_type,
struct spd_info *info)
{
switch (module_type) {
case DDR4_SPD_RDIMM:
case DDR4_SPD_MINI_RDIMM:
info->form_factor = MEMORY_FORMFACTOR_RIMM;
info->type_detail = MEMORY_TYPE_DETAIL_REGISTERED;
break;
case DDR4_SPD_UDIMM:
case DDR4_SPD_MINI_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_DIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNBUFFERED;
break;
case DDR4_SPD_SODIMM:
case DDR4_SPD_72B_SO_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_SODIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
default:
convert_default_module_type_to_spd_info(info);
break;
}
}
static void convert_ddr5_module_type_to_spd_info(enum ddr5_module_type module_type,
struct spd_info *info)
{
switch (module_type) {
case DDR5_SPD_RDIMM:
case DDR5_SPD_MINI_RDIMM:
info->form_factor = MEMORY_FORMFACTOR_RIMM;
info->type_detail = MEMORY_TYPE_DETAIL_REGISTERED;
break;
case DDR5_SPD_UDIMM:
case DDR5_SPD_MINI_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_DIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNBUFFERED;
break;
case DDR5_SPD_SODIMM:
case DDR5_SPD_72B_SO_UDIMM:
info->form_factor = MEMORY_FORMFACTOR_SODIMM;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
case DDR5_SPD_2DPC:
info->form_factor = MEMORY_FORMFACTOR_PROPRIETARY_CARD;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
default:
convert_default_module_type_to_spd_info(info);
break;
}
}
static void convert_lpx_module_type_to_spd_info(enum lpx_module_type module_type,
struct spd_info *info)
{
switch (module_type) {
case LPX_SPD_NONDIMM:
info->form_factor = MEMORY_FORMFACTOR_ROC;
info->type_detail = MEMORY_TYPE_DETAIL_UNKNOWN;
break;
default:
convert_default_module_type_to_spd_info(info);
break;
}
}
void get_spd_info(smbios_memory_type memory_type, uint8_t module_type, struct spd_info *info)
{
switch (memory_type) {
case MEMORY_TYPE_DDR2:
convert_ddr2_module_type_to_spd_info(module_type, info);
break;
case MEMORY_TYPE_DDR3:
convert_ddr3_module_type_to_spd_info(module_type, info);
break;
case MEMORY_TYPE_DDR4:
convert_ddr4_module_type_to_spd_info(module_type, info);
break;
case MEMORY_TYPE_DDR5:
convert_ddr5_module_type_to_spd_info(module_type, info);
break;
case MEMORY_TYPE_LPDDR3:
case MEMORY_TYPE_LPDDR4:
case MEMORY_TYPE_LPDDR5:
convert_lpx_module_type_to_spd_info(module_type, info);
break;
default:
convert_default_module_type_to_spd_info(info);
break;
}
}
static uint8_t convert_default_form_factor_to_module_type(void)
{
return SPD_UNDEFINED;
}
static uint8_t convert_ddrx_form_factor_to_module_type(smbios_memory_type memory_type,
smbios_memory_form_factor form_factor)
{
uint8_t module_type;
switch (form_factor) {
case MEMORY_FORMFACTOR_DIMM:
return DDR2_SPD_UDIMM;
case MEMORY_FORMFACTOR_RIMM:
return DDR2_SPD_RDIMM;
case MEMORY_FORMFACTOR_SODIMM:
module_type = (memory_type == MEMORY_TYPE_DDR2) ? DDR2_SPD_SODIMM
: DDR3_SPD_SODIMM;
return module_type;
default:
return convert_default_form_factor_to_module_type();
}
}
static uint8_t convert_lpx_form_factor_to_module_type(smbios_memory_form_factor form_factor)
{
switch (form_factor) {
case MEMORY_FORMFACTOR_ROC:
return LPX_SPD_NONDIMM;
default:
return convert_default_form_factor_to_module_type();
}
}
uint8_t convert_form_factor_to_module_type(smbios_memory_type memory_type,
smbios_memory_form_factor form_factor)
{
uint8_t module_type;
switch (memory_type) {
case MEMORY_TYPE_DDR2:
case MEMORY_TYPE_DDR3:
case MEMORY_TYPE_DDR4:
case MEMORY_TYPE_DDR5:
module_type = convert_ddrx_form_factor_to_module_type(memory_type, form_factor);
break;
case MEMORY_TYPE_LPDDR3:
case MEMORY_TYPE_LPDDR4:
case MEMORY_TYPE_LPDDR5:
module_type = convert_lpx_form_factor_to_module_type(form_factor);
break;
default:
module_type = convert_default_form_factor_to_module_type();
break;
}
return module_type;
}

View File

@ -7,7 +7,7 @@
#include <device/pci_ops.h>
#include <device/pci_type.h>
u8 *const pci_mmconf = (void *)(uintptr_t)CONFIG_MMCONF_BASE_ADDRESS;
u8 *const pci_mmconf = (void *)(uintptr_t)CONFIG_ECAM_MMCONF_BASE_ADDRESS;
/**
* Given a device, a capability type, and a last position, return the next

View File

@ -36,22 +36,18 @@ static void romstage_main(void)
struct postcar_frame pcf;
struct sysinfo romstage_state;
struct sysinfo *cb = &romstage_state;
unsigned int initial_apic_id = initial_lapicid();
int cbmem_initted = 0;
fill_sysinfo(cb);
if (initial_apic_id == 0) {
timestamp_add_now(TS_START_ROMSTAGE);
timestamp_add_now(TS_START_ROMSTAGE);
board_BeforeAgesa(cb);
board_BeforeAgesa(cb);
console_init();
}
console_init();
printk(BIOS_DEBUG, "APIC %02u: CPU Family_Model = %08x\n",
initial_apic_id, cpuid_eax(1));
initial_lapicid(), cpuid_eax(1));
set_ap_entry_ptr(ap_romstage_main);

View File

@ -22,7 +22,7 @@ int ast_crtc_do_set_base(struct drm_crtc *crtc)
struct drm_framebuffer *fb = crtc->primary->fb;
/* PCI BAR 0 */
struct resource *res = find_resource(crtc->dev->pdev, PCI_BASE_ADDRESS_0);
struct resource *res = probe_resource(crtc->dev->pdev, PCI_BASE_ADDRESS_0);
if (!res) {
printk(BIOS_ERR, "BAR0 resource not found.\n");
return -EIO;

View File

@ -16,6 +16,7 @@
#include <smbios.h>
#include <stdint.h>
#include <string.h>
#include <timestamp.h>
#define ELOG_MIN_AVAILABLE_ENTRIES 2 /* Shrink when this many can't fit */
#define ELOG_SHRINK_PERCENTAGE 25 /* Percent of total area to remove */
@ -749,6 +750,9 @@ int elog_init(void)
}
elog_state.elog_initialized = ELOG_BROKEN;
if (!ENV_SMM)
timestamp_add_now(TS_ELOG_INIT_START);
elog_debug("%s()\n", __func__);
/* Set up the backing store */
@ -781,6 +785,10 @@ int elog_init(void)
if (ENV_PAYLOAD_LOADER)
elog_add_boot_count();
if (!ENV_SMM)
timestamp_add_now(TS_ELOG_INIT_END);
return 0;
}

View File

@ -0,0 +1,37 @@
/* SPDX-License-Identifier: GPL-2.0-only */
// NVIDIA Advanced Optimus
#define NVOP_FUNC_SUPPORT 0
#define NVOP_FUNC_DISPLAYSTATUS 5
#define NVOP_FUNC_MDTL 6
#define NVOP_FUNC_GETOBJBYTYPE 16
#define NVOP_FUNC_GETALLOBJS 17
#define NVOP_FUNC_OPTIMUSCAPS 26
#define NVOP_FUNC_OPTIMUSFLAGS 27
Method (NVOP, 2, Serialized)
{
Printf("NVOP {")
Local0 = NVIDIA_ERROR_UNSUPPORTED
Switch (ToInteger(Arg0)) {
Case (NVOP_FUNC_SUPPORT) {
}
Case (NVOP_FUNC_OPTIMUSCAPS) {
CreateField (Arg1, 0, 1, FLGS) // Flag updates
CreateField (Arg1, 1, 1, PCOT) // PCIe Configuration Space Owner Target
CreateField (Arg1, 2, 1, PCOW) // PCIe Configuration Space Owner Write
CreateField (Arg1, 24, 2, OPCE) // Optimus Power Control Enable
}
Default {
Printf(" Unsupported NVOP_FUNC: %o", ToInteger(Arg0))
Local0 = NVIDIA_ERROR_UNSUPPORTED
}
}
Printf("} NVOP")
Return(Local0)
}

View File

@ -0,0 +1,83 @@
/* SPDX-License-Identifier: GPL-2.0-only */
// NVIDIA GPU Boost for Notebook and All-In-One-Projects
#define GPS_FUNC_SUPPORT 0
#define GPS_FUNC_GETOBJBYTYPE 16
#define GPS_FUNC_GETALLOBJS 17
#define GPS_FUNC_GETCALLBACKS 19
#define GPS_FUNC_PCONTROL 28
#define GPS_FUNC_PSHARESTATUS 32
#define GPS_FUNC_PSHAREPARAMS 42
Method (GPS, 2, Serialized)
{
Printf("GPS {")
Switch (ToInteger(Arg0)) {
// Bit list of supported functions
Case (GPS_FUNC_SUPPORT) {
Printf(" GPS_FUNC_SUPPORT")
// Functions supported: 0, 32, 42
Local0 = Buffer () {0x01, 0x00, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00}
}
// Get current platform status, thermal budget
Case (GPS_FUNC_PSHARESTATUS) {
Printf(" GPS_FUNC_PSHARESTATUS: %o", ToHexString(Arg1))
Local0 = Buffer (4) { 0 }
}
// Get GPU Boost platform parameters
Case (GPS_FUNC_PSHAREPARAMS) {
Printf(" GPS_FUNC_PSHAREPARAMS: %o", ToHexString(Arg1))
CreateField (Arg1, 0, 3, QTYP) // Query Type
CreateField (Arg1, 8, 1, GTMP) // GPU temperature status
CreateField (Arg1, 9, 1, CTMP) // CPU temperature status
Local0 = Buffer (36) { 0 }
CreateDWordField (Local0, 0, STAT) // Status
CreateDWordField (Local0, 4, VERS) // Version
CreateDWordField (Local0, 8, TGPU) // GPU temperature (C)
CreateDWordField (Local0, 12, PDTS) // CPU package temperature (C)
VERS = 0x00010000
STAT = QTYP
Printf(" Query Type = %o", ToInteger(QTYP))
Switch (ToInteger(QTYP)) {
// Get current status
Case (0) {
// TGPU must be 0.
}
// Get supported fields
Case (1) {
STAT |= 0x100
// TGPU must be 0.
}
// Get current operating limits
Case (2) {
// GPU temperature status must be 1.
STAT |= 0x100
// TGPU should be 0. GPU will use its own default.
}
Default {
Printf(" Unsupported Query Type: %o", ToInteger(QTYP))
Local0 = NVIDIA_ERROR_UNSUPPORTED
}
}
}
Default {
Printf(" Unsupported GPS_FUNC: %o", ToInteger(Arg0))
Local0 = NVIDIA_ERROR_UNSUPPORTED
}
}
Printf("} GPS")
Return(Local0)
}

View File

@ -1,202 +1,197 @@
/* SPDX-License-Identifier: GPL-2.0-only */
Device (\_SB.PCI0.PEGP) {
#define NVIDIA_ERROR_UNSPECIFIED 0x80000001
#define NVIDIA_ERROR_UNSUPPORTED 0x80000002
#define NBCI_DSM_GUID "D4A50B75-65C7-46F7-BFB7-41514CEA0244"
#define NBCI_REVISION_ID 0x102
#define GPS_DSM_GUID "A3132D01-8CDA-49BA-A52E-BC9D46DF6B81"
#define GPS_REVISION_ID 0x200
#define JT_DSM_GUID "CBECA351-067B-4924-9CBD-B46B00B86F34"
#define JT_REVISION_ID 0x103
#define NVOP_DSM_GUID "A486D8F8-0BDA-471B-A72B-6042A6B5BEE0"
#define NVOP_REVISION_ID 0x100
// 00:01.0
Device (\_SB.PCI0.PEG0)
{
Name (_ADR, CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 16)
PowerResource (PWRR, 0, 0) {
Name (_STA, 1)
Method (_ON) {
Debug = "PEGP.PWRR._ON"
If (_STA != 1) {
\_SB.PCI0.PEGP.DEV0._ON ()
_STA = 1
}
Method (_ON)
{
Printf("PEG0._ON {")
// TODO: Check for deferred GCx action
\_SB.PCI0.PEG0.DGPU._ON()
_STA = 1
Printf("} PEG0._ON")
}
Method (_OFF) {
Debug = "PEGP.PWRR._OFF"
If (_STA != 0) {
\_SB.PCI0.PEGP.DEV0._OFF ()
_STA = 0
}
Method (_OFF)
{
Printf("PEG0._OFF {")
// TODO: Check for deferred GCx action
\_SB.PCI0.PEG0.DGPU._OFF()
_STA = 0
Printf("} PEG0._OFF")
}
}
Name (_PR0, Package () { \_SB.PCI0.PEGP.PWRR })
Name (_PR2, Package () { \_SB.PCI0.PEGP.PWRR })
Name (_PR3, Package () { \_SB.PCI0.PEGP.PWRR })
Name (_PR0, Package () { PWRR })
Name (_PR2, Package () { PWRR })
Name (_PR3, Package () { PWRR })
}
Device (\_SB.PCI0.PEGP.DEV0) {
// 01:00.0
Device (\_SB.PCI0.PEG0.DGPU)
{
Name(_ADR, 0x00000000)
Name (_STA, 0xF)
Name (LTRE, 0)
// Memory mapped PCI express registers
// Not sure what this stuff is, but it is used to get into GC6
// TODO: use GPU config to generate address
OperationRegion (RPCX, SystemMemory, CONFIG_MMCONF_BASE_ADDRESS + 0x8000, 0x1000)
Field (RPCX, ByteAcc, NoLock, Preserve) {
PVID, 16,
PDID, 16,
CMDR, 8,
Offset (0x19),
PRBN, 8,
Offset (0x84),
D0ST, 2,
Offset (0xAA),
CEDR, 1,
Offset (0xAC),
, 4,
CMLW, 6,
Offset (0xB0),
ASPM, 2,
, 2,
P0LD, 1,
RTLK, 1,
Offset (0xC9),
, 2,
LREN, 1,
Offset (0x11A),
, 1,
VCNP, 1,
Offset (0x214),
Offset (0x216),
P0LS, 4,
Offset (0x248),
, 7,
Q0L2, 1,
Q0L0, 1,
Offset (0x504),
Offset (0x506),
PCFG, 2,
Offset (0x508),
TREN, 1,
Offset (0xC20),
, 4,
P0AP, 2,
Offset (0xC38),
, 3,
P0RM, 1,
Offset (0xC74),
P0LT, 4,
Offset (0xD0C),
, 20,
LREV, 1
Name (GPWR, 0) // GPU Power
Name (GCST, 6) // GCx State
Name (DPC, 0) // Deferred power control
Name (DPCX, 0) // Deferred power control on exit
Name (NVID, 0x00000000)
OperationRegion (PCIM, SystemMemory, 0x0E010000, 0xF0)
Field (PCIM, AnyAcc, Lock, Preserve)
{
Offset(0x2c),
SSID, 32,
}
Method (_ON) {
Debug = "PEGP.DEV0._ON"
// For supporting Hybrid Graphics, the package refers to the PCIe controller
// itself, which leverages GC6 Control methods under the dGPU namespace.
Name (_PR0, Package() { \_SB.PCI0.PEG0 })
Name (_PR3, Package() { \_SB.PCI0.PEG0 })
If (_STA != 0xF) {
Debug = " If DGPU_PWR_EN low"
If (! GTXS (DGPU_PWR_EN)) {
Debug = " DGPU_PWR_EN high"
STXS (DGPU_PWR_EN)
Debug = " Sleep 16"
Sleep (16)
}
Debug = " DGPU_RST_N high"
STXS(DGPU_RST_N)
Debug = " Sleep 10"
Sleep (10)
Debug = " Q0L0 = 1"
Q0L0 = 1
Debug = " Sleep 16"
Sleep (16)
Debug = " While Q0L0"
Local0 = 0
While (Q0L0) {
If ((Local0 > 4)) {
Debug = " While Q0L0 timeout"
Break
}
Sleep (16)
Local0++
}
Debug = " P0RM = 0"
P0RM = 0
Debug = " P0AP = 0"
P0AP = 0
Debug = Concatenate(" LREN = ", ToHexString(LTRE))
LREN = LTRE
Debug = " CEDR = 1"
CEDR = 1
Debug = " CMDR |= 7"
CMDR |= 7
Debug = " _STA = 0xF"
_STA = 0xF
Method (_STA)
{
Printf("DGPU._STA")
/*
* Only return "On" when:
* - GPU power is good
* - GPU has completed return to GC0
*
* In all other cases, return "Off".
*/
If ((GPWR == 1) && (GCST == 0)) {
Return (0xF)
} Else {
Return (0)
}
}
Method (_OFF) {
Debug = "PEGP.DEV0._OFF"
Method (_ON)
{
Printf("DGPU._ON {")
Printf(" Enable GPU power")
STXS(DGPU_PWR_EN)
Sleep(10)
If (_STA != 0x5) {
Debug = Concatenate(" LTRE = ", ToHexString(LREN))
LTRE = LREN
Printf(" Take GPU out of reset")
STXS(DGPU_RST_N)
Sleep(10)
Debug = " Q0L2 = 1"
Q0L2 = 1
GPWR = 1
GCST = 0
Debug = " Sleep 16"
Sleep (16)
/*
// TODO: Actually check link status
Printf("Wait for PCIe link")
Sleep(100)
Debug = " While Q0L2"
Local0 = Zero
While (Q0L2) {
If ((Local0 > 4)) {
Debug = " While Q0L2 timeout"
Break
}
Printf("Restore SSID: %o", NVID)
SSID = NVID
*/
Sleep (16)
Local0++
}
Debug = " P0RM = 1"
P0RM = 1
Debug = " P0AP = 3"
P0AP = 3
Debug = " Sleep 10"
Sleep (10)
Debug = " DGPU_RST_N low"
CTXS(DGPU_RST_N)
Debug = " While DGPU_GC6 low"
Local0 = Zero
While (! GRXS(DGPU_GC6)) {
If ((Local0 > 4)) {
Debug = " While DGPU_GC6 low timeout"
Debug = " DGPU_PWR_EN low"
CTXS (DGPU_PWR_EN)
Break
}
Sleep (16)
Local0++
}
Debug = " _STA = 0x5"
_STA = 0x5
}
Printf("} DGPU._ON")
}
Method (_OFF)
{
Printf("DGPU._OFF {")
/*
Printf("Save SSID: %o", SSID)
NVID = SSID
// TODO: Actually check link status
Printf("Wait for PCIe link")
Sleep(100)
*/
Printf("DGPU._OFF {")
Printf(" Put GPU in reset")
CTXS(DGPU_RST_N)
Sleep(10)
Printf(" Disable GPU power")
CTXS(DGPU_PWR_EN)
GPWR = 0
GCST = 6
Printf("} DGPU._OFF")
}
Method (_PS0)
{
// XGXS, XGIS, XCLM
Printf("_PS0 {}")
}
Method (_PS3)
{
// EGNS, EGIS, EGIN
Printf("_PS3 {}")
}
Method (_DSM, 4, Serialized)
{
// Notebook Common Interface
If (Arg0 == ToUUID(NBCI_DSM_GUID)) {
Printf("NBCI_DSM_GUID")
If (Arg1 <= NBCI_REVISION_ID) {
Printf(" TODO: Unimplemented!")
}
}
// NVIDIA GPU Boost
If (Arg0 == ToUUID(GPS_DSM_GUID)) {
Printf("GPS_DSM_GUID")
If (Arg1 <= GPS_REVISION_ID) {
Return(GPS(Arg2, Arg3))
}
}
// NVIDIA Low Power States
If (Arg0 == ToUUID(JT_DSM_GUID)) {
Printf("JT_DSM_GUID")
If (Arg1 <= JT_REVISION_ID) {
Return(NVJT(Arg2, Arg3))
}
}
// Advanced Optimus
If (Arg0 == ToUUID(NVOP_DSM_GUID)) {
Printf("NVOP_DSM_GUID")
If (Arg1 <= NVOP_REVISION_ID) {
Printf(" TODO: Unimplemented!")
}
}
Printf("Unsupported GUID: %o", ToHexString(Arg0))
Return(NVIDIA_ERROR_UNSUPPORTED)
}
#include "boost.asl"
#include "low_power_states.asl"
}

View File

@ -0,0 +1,169 @@
/* SPDX-License-Identifier: GPL-2.0-only */
// NVIDIA Low Power States
#define JT_FUNC_SUPPORT 0
#define JT_FUNC_CAPS 1
#define JT_FUNC_POWERCONTROL 3
#define JT_FUNC_PLATPOLICY 4
Method (NVJT, 2, Serialized)
{
Printf("NVJT {")
Switch (ToInteger(Arg0)) {
Case (JT_FUNC_SUPPORT) {
Printf(" JT_FUNC_SUPPORT");
// Functions supported: 0, 1, 3, 4
//Local0 = Buffer() { 0x1B, 0, 0, 0 }
Local0 = Buffer() { 0x13, 0, 0, 0 }
}
Case (JT_FUNC_CAPS) {
Printf(" JT_FUNC_CAPS");
Local0 = Buffer(4) { 0 }
// G-SYNC NVSR Power Features
CreateField (Local0, 0, 1, JTEN)
JTEN = 0
// NVSR
CreateField (Local0, 1, 2, NVSE)
NVSE = 1
// Panel Power Rail
CreateField (Local0, 3, 2, PPR)
PPR = 2
// Self-Refresh Control (SRC) Power Rail
CreateField (Local0, 5, 1, SRPR)
SRPR = 0
// FB Power Rail
CreateField (Local0, 6, 2, FBPR)
FBPR = 0
// GPU Power Rail
CreateField (Local0, 8, 2, GPR)
GPR = 0
// GC6 ROM
CreateField (Local0, 10, 1, GCR)
GCR = 0
// Panic Trap Handler
CreateField (Local0, 11, 1, PTH)
PTH = 1
// Supports Notify
CreateField (Local0, 12, 1, NOTS)
NOTS = 0
// MS Hybrid Support
CreateField (Local0, 13, 1, MHYB)
MHYB = 1
// Root Port Control
CreateField (Local0, 14, 1, RPC)
RPC = 1
// GC6 Version
CreateField (Local0, 15, 2, GC6V)
GC6V = 2
// GC6 Exit ISR Support
CreateField (Local0, 17, 1, GEI)
GEI = 0
// GC6 Self Wakeup Support
CreateField (Local0, 18, 1, GSW)
GSW = 0
// Maximum Revision Supported
CreateField (Local0, 20, 12, MXRV)
MXRV = JT_REVISION_ID
}
Case (JT_FUNC_POWERCONTROL) {
Printf(" JT_FUNC_POWERCONTROL: %o", ToHexString(Arg1));
// TODO
Local0 = NVIDIA_ERROR_UNSUPPORTED
/*
CreateField (Arg1, 0, 3, GPC) // GPU Power Control
CreateField (Arg1, 3, 1, GGP) // Global GPU Power
CreateField (Arg1, 4, 1, PPC) // Panel Power Control
CreateField (Arg1, 6, 2, NOC) // Notify on complete
CreateField (Arg1, 8, 2, PRGX) // PCIe Root Power GC6 Exit Sequence
CreateField (Arg1, 10, 2, PRGE) // PCIe Root Power GC6 Entry Sequence
CreateField (Arg1, 12, 1, PRPC) // Poll for Root Port Completion
CreateField (Arg1, 13, 1, PLON) // PCIe Root Port Control
CreateField (Arg1, 14, 2, DFGC) // Defer GC6 Enter/Exit until D3cold
CreateField (Arg1, 16, 3, GPCX) // Deferred GC6 Exit Control
CreateField (Arg1, 19, 1, EGEI) // Enable GC6 Exit ISR
CreateField (Arg1, 20, 2, PLCM) // PCIe Root Port Control Method for PLON
Local0 = Buffer(4) {0, 0, 0, 0}
CreateField (Local0, 0, 3, GCS) // GC State
CreateField (Local0, 3, 1, GPS) // GPU Power Status
CreateField (Local0, 7, 1, PSS) // Panel and SRC State
*/
/*
* DFGC
* 0: Perform request immediately
* 1: Defer GPC and GPCX to be processed when setting Device Power State
* 2: Clear any pending deferred requests
*/
/*
If (DFGC == 2) {
DPC = 0
DPCX = 0
}
*/
/*
* GPC
* 0 GSS) Get current GPU GCx Sleep Status
* 1 EGNS: Entery GC6 only. No SMI trap, No Self-Refresh. Panel
* and GPU will be powred down as normal. FB will remain powered.
* 2 EGIS: Enter GC6, keep Panel in Self-Refresh. Enable SMI trap on
* VGA I/O regiters. Control of screen is transitioned to the SRC and
* then the GPU is powered down. Panel and FB remain powered while
* the GPU is off.
* 3 XGXS: Exit GC6. Exit Panel Self-Refresh (Sparse). GPU is powered on.
* Disable SMI traps.
* 4 XGIS: Exit GC6 for Self-Refresh Update (Burst). GPU is powered on, but
* the SRC continues to retain control of screen refresh, while the
* GPU sends an update to SRC for display. Disable SMI traps.
* 5 EGIN: Enter GC6, keep Pnael in Self-Refresh. No SMI trap on VGA I/O
* registers. Control of screen is transitioned to SRC and then
* GPU is powred down. Panel and FB remain powered while the GPU is off.
* 6 XCLM: Trigger GPU_EVENT only. GPU_EVENT would be assered and de-asserted,
* regardless of GPU power state, without waiting for any GPU-side
* signaling. No change in GPU power state is made. SMI traps disabled.
*/
}
Case (JT_FUNC_PLATPOLICY) {
Printf(" JT_FUNC_PLATPOLICY: %o", ToHexString(Arg1));
//CreateField (Arg1, 2, 1, AUD) // Azalia Audio Device
//CreateField (Arg1, 3, 1, ADM) // Audio Disable Mask
//CreateField (Arg1, 4, 4, DGS) // Driver expected State Mask
// TODO: Save policy settings to NV CMOS?
Local0 = Buffer(4) { 0, 0, 0, 0 }
//CreateField (Local0, 2, 1, AUD) // Audio Device status
//CreateField (Local0, 4, 3, GRE) // SBIOS requested GPU state
}
Default {
Printf(" Unsupported JT_FUNC: %o", ToInteger(Arg0))
Local0 = NVIDIA_ERROR_UNSUPPORTED
}
}
Printf("} NVJT")
Return(Local0)
}

View File

@ -0,0 +1,90 @@
/* SPDX-License-Identifier: GPL-2.0-only */
// Notebook Common Interface
#define NBCI_FUNC_SUPPORT 0
#define NBCI_FUNC_PLATCAPS 1
#define NBCI_FUNC_PLATPOLICY 4
#define NBCI_FUNC_DISPLAYSTATUS 5
#define NBCI_FUNC_GETOBJBYTYPE 16
#define NBCI_FUNC_GETALLOBJS 17
#define NBCI_FUNC_GETEVENTLIST 18
#define NBCI_FUNC_CALLBACKS 29
#define NBCI_FUNC_GETBACKLIGHT 20
#define NBCI_FUNC_GETLICENSE 22
#define NBCI_FUNC_GETEFITABLE 23
Scope (\_SB.PCI0.PEG0.DGPU)
{
Method (NBCI, 2, NotSerialized)
{
Printf("NBCI {")
Local0 = NVIDIA_ERROR_UNSUPPORTED
Switch (ToInteger(Arg0)) {
// Bit list of supported functions
Case (NBCI_FUNC_SUPPORT) {
// Supported functions: 0
Local0 = Buffer() {0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
}
// Query Plaform Capabilities
Case (NBCI_FUNC_PLATCAPS) {
Printf(" NBCI_FUNC_PLATCAPS: Unimplemented!")
}
// Query Platform Policies
Case (NBCI_FUNC_PLATPOLICY) {
Printf(" NBCI_FUNC_PLATPOLICY: Unimplemented!")
}
// Query Display status
Case (NBCI_FUNC_DISPLAYSTATUS) {
Printf(" NBCI_FUNC_DISPLAYSTATUS: Unimplemented!")
}
// Fetch and specific Object by Type
Case (NBCI_FUNC_GETOBJBYTYPE) {
Printf(" NBCI_FUNC_GETOBJBYTYPE: Unimplemented!")
}
// Fetch all Objects
Case (NBCI_FUNC_GETALLOBJS) {
Printf(" NBCI_FUNC_GETALLOBJS: Unimplemented!")
}
// Get list of Notify events and their meaning
Case (NBCI_FUNC_GETEVENTLIST) {
Printf(" NBCI_FUNC_GETEVENTLIST: Unimplemented!")
}
// Get list of system-required callbacks
Case (NBCI_FUNC_CALLBACKS) {
Printf(" NBCI_FUNC_CALLBACKS: Unimplemented!")
}
// Get the Backlight setup settings
Case (NBCI_FUNC_GETBACKLIGHT) {
Printf(" NBCI_FUNC_GETBACKLIGHT: Unimplemented!")
}
// Get Software License Number
Case (NBCI_FUNC_GETLICENSE) {
Printf(" NBCI_FUNC_GETLICENSE: Unimplemented!")
}
// Get EFI System Table
Case (NBCI_FUNC_GETEFITABLE) {
Printf(" NBCI_FUNC_GETEFITABLE: Unimplemented!")
}
Default {
Printf(" Unsupported NBCI_FUNC: %o", ToInteger(Arg0))
Local0 = NVIDIA_ERROR_UNSUPPORTED
}
}
Printf("} NBCI")
Return(Local0)
}
}

View File

@ -15,10 +15,8 @@ void nvidia_set_power(const struct nvidia_gpu_config *config)
return;
}
printk(BIOS_DEBUG, "%s: GPU_PWR_EN = %d\n",
__func__, config->power_gpio);
printk(BIOS_DEBUG, "%s: GPU_RST# = %d\n",
__func__, config->reset_gpio);
printk(BIOS_DEBUG, "%s: GPU_PWR_EN = %d\n", __func__, config->power_gpio);
printk(BIOS_DEBUG, "%s: GPU_RST# = %d\n", __func__, config->reset_gpio);
gpio_set(config->reset_gpio, 0);
mdelay(4);

View File

@ -18,7 +18,6 @@
#include <stage_cache.h>
#include <string.h>
#include <timestamp.h>
#include <vendorcode/google/chromeos/chromeos.h>
static void raminit_common(struct romstage_params *params)
{
@ -104,9 +103,9 @@ void cache_as_ram_stage_main(FSP_INFO_HEADER *fih)
timestamp_add_now(TS_START_ROMSTAGE);
/* Display parameters */
if (!CONFIG(NO_MMCONF_SUPPORT))
printk(BIOS_SPEW, "CONFIG_MMCONF_BASE_ADDRESS: 0x%08x\n",
CONFIG_MMCONF_BASE_ADDRESS);
if (!CONFIG(NO_ECAM_MMCONF_SUPPORT))
printk(BIOS_SPEW, "CONFIG_ECAM_MMCONF_BASE_ADDRESS: 0x%08x\n",
CONFIG_ECAM_MMCONF_BASE_ADDRESS);
printk(BIOS_INFO, "Using FSP 1.1\n");
/* Display FSP banner */

View File

@ -218,6 +218,16 @@ config FSP_COMPRESS_FSP_M_LZ4
bool
depends on !FSP_M_XIP
config FSP_ALIGNMENT_FSP_S
int
help
Sets the CBFS alignment for FSP-S
config FSP_ALIGNMENT_FSP_M
int
help
Sets the CBFS alignment for FSP-M
config FSP_M_ADDR
hex
help

View File

@ -65,6 +65,9 @@ endif
ifeq ($(CONFIG_FSP_COMPRESS_FSP_M_LZ4),y)
$(FSP_M_CBFS)-compression := LZ4
endif
ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_M),)
$(FSP_M_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_M)
endif
cbfs-files-$(CONFIG_ADD_FSP_BINARIES) += $(FSP_S_CBFS)
$(FSP_S_CBFS)-file := $(call strip_quotes,$(CONFIG_FSP_S_FILE))
@ -75,6 +78,9 @@ endif
ifeq ($(CONFIG_FSP_COMPRESS_FSP_S_LZ4),y)
$(FSP_S_CBFS)-compression := LZ4
endif
ifneq ($(CONFIG_FSP_ALIGNMENT_FSP_S),)
$(FSP_S_CBFS)-align := $(CONFIG_FSP_ALIGNMENT_FSP_S)
endif
ifeq ($(CONFIG_FSP_FULL_FD),y)
$(obj)/Fsp_M.fd: $(call strip_quotes,$(CONFIG_FSP_FD_PATH)) $(DOTCONFIG)

View File

@ -32,7 +32,9 @@ enum fsp_notify_phase {
};
/* Main FSP stages */
void preload_fspm(void);
void fsp_memory_init(bool s3wake);
void preload_fsps(void);
void fsp_silicon_init(void);
/*

View File

@ -340,6 +340,15 @@ static void *fspm_allocator(void *arg, size_t size, const union cbfs_mdata *unus
return (void *)fspm_begin;
}
void preload_fspm(void)
{
if (!CONFIG(CBFS_PRELOAD))
return;
printk(BIOS_DEBUG, "Preloading %s\n", CONFIG_FSP_M_CBFS);
cbfs_preload(CONFIG_FSP_M_CBFS);
}
void fsp_memory_init(bool s3wake)
{
struct range_entry prog_ranges[2];

View File

@ -230,6 +230,15 @@ void fsps_load(void)
load_done = 1;
}
void preload_fsps(void)
{
if (!CONFIG(CBFS_PRELOAD))
return;
printk(BIOS_DEBUG, "Preloading %s\n", CONFIG_FSP_S_CBFS);
cbfs_preload(CONFIG_FSP_S_CBFS);
}
void fsp_silicon_init(void)
{
timestamp_add_now(TS_FSP_SILICON_INIT_LOAD);

View File

@ -163,8 +163,8 @@ enum cb_err fsp_load_component(struct fsp_load_descriptor *fspld, struct fsp_hea
if (!dest)
return CB_ERR;
/* Don't allow FSP-M relocation. */
if (!fspm_env() && fsp_component_relocate((uintptr_t)dest, dest, output_size) < 0) {
/* Don't allow FSP-M relocation when XIP. */
if (!fspm_xip() && fsp_component_relocate((uintptr_t)dest, dest, output_size) < 0) {
printk(BIOS_ERR, "Unable to relocate FSP component!\n");
return CB_ERR;
}

View File

@ -106,7 +106,7 @@ static int atl1e_eeprom_exist(u32 mem_base)
static void atl1e_init(struct device *dev)
{
/* Get the resource of the NIC mmio */
struct resource *nic_res = find_resource(dev, PCI_BASE_ADDRESS_0);
struct resource *nic_res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (nic_res == NULL) {
printk(BIOS_ERR, "atl1e: resource not found\n");

View File

@ -5,7 +5,7 @@
#include <edid.h>
#include <console/console.h>
#include <timer.h>
#include <dp_aux.h>
#include "ps8640.h"
int ps8640_get_edid(uint8_t bus, uint8_t chip, struct edid *out)
@ -80,3 +80,101 @@ int ps8640_init(uint8_t bus, uint8_t chip)
return 0;
}
static cb_err_t ps8640_bridge_aux_request(uint8_t bus,
uint8_t chip,
unsigned int target_reg,
unsigned int total_size,
enum aux_request request,
uint8_t *data)
{
int i;
uint32_t length;
uint8_t buf;
uint8_t reg;
int ret;
if (target_reg & ~SWAUX_ADDR_MASK)
return CB_ERR;
while (total_size) {
length = MIN(total_size, DP_AUX_MAX_PAYLOAD_BYTES);
total_size -= length;
ret = i2c_writeb(bus, chip, PAGE0_AUXCH_CFG3, AUXCH_CFG3_RESET);
if (ret)
return CB_ERR;
enum i2c_over_aux cmd = dp_get_aux_cmd(request, total_size);
if (i2c_writeb(bus, chip, PAGE0_SWAUX_ADDR_23_16,
(target_reg >> 16) | (cmd << 4)) ||
i2c_writeb(bus, chip, PAGE0_SWAUX_ADDR_15_8, target_reg >> 8) ||
i2c_writeb(bus, chip, PAGE0_SWAUX_ADDR_7_0, target_reg)) {
return CB_ERR;
}
if (dp_aux_request_is_write(request)) {
reg = PAGE0_SWAUX_WDATA;
for (i = 0; i < length; i++) {
ret = i2c_writeb(bus, chip, reg++, *data++);
if (ret)
return CB_ERR;
}
} else {
if (length == 0)
i2c_writeb(bus, chip, PAGE0_SWAUX_LENGTH, SWAUX_NO_PAYLOAD);
else
i2c_writeb(bus, chip, PAGE0_SWAUX_LENGTH, length - 1);
}
ret = i2c_writeb(bus, chip, PAGE0_SWAUX_CTRL, SWAUX_SEND);
if (ret)
return CB_ERR;
if (!wait_ms(100, !i2c_readb(bus, chip, PAGE0_SWAUX_CTRL, &buf) &&
!(buf & SWAUX_SEND)))
return CB_ERR;
if (i2c_readb(bus, chip, PAGE0_SWAUX_STATUS, &buf))
return CB_ERR;
switch (buf & SWAUX_STATUS_MASK) {
case SWAUX_STATUS_NACK:
case SWAUX_STATUS_I2C_NACK:
case SWAUX_STATUS_INVALID:
case SWAUX_STATUS_TIMEOUT:
return CB_ERR;
case SWAUX_STATUS_ACKM:
length = buf & SWAUX_M_MASK;
break;
}
if (length && !dp_aux_request_is_write(request)) {
reg = PAGE0_SWAUX_RDATA;
for (i = 0; i < length; i++) {
if (i2c_readb(bus, chip, reg++, &buf))
return CB_ERR;
*data++ = buf;
}
}
}
return CB_SUCCESS;
}
void ps8640_backlight_enable(uint8_t bus, uint8_t chip)
{
uint8_t val;
val = DP_BACKLIGHT_CONTROL_MODE_DPCD;
ps8640_bridge_aux_request(bus, chip, DP_BACKLIGHT_MODE_SET, 1,
DPCD_WRITE, &val);
val = 0xff;
ps8640_bridge_aux_request(bus, chip, DP_BACKLIGHT_BRIGHTNESS_MSB, 1,
DPCD_WRITE, &val);
val = DP_BACKLIGHT_ENABLE;
ps8640_bridge_aux_request(bus, chip, DP_DISPLAY_CONTROL_REGISTER, 1,
DPCD_WRITE, &val);
}

View File

@ -24,11 +24,33 @@ enum {
};
enum {
EDID_LENGTH = 128,
EDID_I2C_ADDR = 0x50,
EDID_EXTENSION_FLAG = 0x7e,
PAGE0_AUXCH_CFG3 = 0x76,
AUXCH_CFG3_RESET = 0xff,
PAGE0_SWAUX_ADDR_7_0 = 0x7d,
PAGE0_SWAUX_ADDR_15_8 = 0x7e,
PAGE0_SWAUX_ADDR_23_16 = 0x7f,
SWAUX_ADDR_MASK = 0xfffff,
PAGE0_SWAUX_LENGTH = 0x80,
SWAUX_LENGTH_MASK = 0xf,
SWAUX_NO_PAYLOAD = BIT(7),
PAGE0_SWAUX_WDATA = 0x81,
PAGE0_SWAUX_RDATA = 0x82,
PAGE0_SWAUX_CTRL = 0x83,
SWAUX_SEND = BIT(0),
PAGE0_SWAUX_STATUS = 0x84,
SWAUX_M_MASK = 0x1f,
SWAUX_STATUS_MASK = (0x7 << 5),
SWAUX_STATUS_NACK = (0x1 << 5),
SWAUX_STATUS_DEFER = (0x2 << 5),
SWAUX_STATUS_ACKM = (0x3 << 5),
SWAUX_STATUS_INVALID = (0x4 << 5),
SWAUX_STATUS_I2C_NACK = (0x5 << 5),
SWAUX_STATUS_I2C_DEFER = (0x6 << 5),
SWAUX_STATUS_TIMEOUT = (0x7 << 5),
};
int ps8640_init(uint8_t bus, uint8_t chip);
int ps8640_get_edid(uint8_t bus, uint8_t chip, struct edid *out);
void ps8640_backlight_enable(uint8_t bus, uint8_t chip);
#endif

View File

@ -4,6 +4,7 @@
#include <delay.h>
#include <endian.h>
#include <device/i2c_simple.h>
#include <dp_aux.h>
#include <edid.h>
#include <timer.h>
#include <types.h>
@ -31,14 +32,6 @@
#define DP_MAX_SUPPORTED_RATES 8 /* 16-bit little-endian */
#define DP_LANE_COUNT_MASK 0xf
/* Backlight configuration */
#define DP_BACKLIGHT_MODE_SET 0x721
#define DP_BACKLIGHT_CONTROL_MODE_MASK 0x3
#define DP_BACKLIGHT_CONTROL_MODE_DPCD 0x2
#define DP_DISPLAY_CONTROL_REGISTER 0x720
#define DP_BACKLIGHT_ENABLE 0x1
#define DP_BACKLIGHT_BRIGHTNESS_MSB 0x722
/* link configuration */
#define DP_LINK_BW_SET 0x100
#define DP_LINK_BW_1_62 0x06
@ -132,17 +125,6 @@ enum vstream_config {
VSTREAM_ENABLE = 1,
};
enum i2c_over_aux {
I2C_OVER_AUX_WRITE_MOT_0 = 0x0,
I2C_OVER_AUX_READ_MOT_0 = 0x1,
I2C_OVER_AUX_WRITE_STATUS_UPDATE_0 = 0x2,
I2C_OVER_AUX_WRITE_MOT_1 = 0x4,
I2C_OVER_AUX_READ_MOT_1 = 0x5,
I2C_OVER_AUX_WRITE_STATUS_UPDATE_1 = 0x6,
NATIVE_AUX_WRITE = 0x8,
NATIVE_AUX_READ = 0x9,
};
enum aux_cmd_status {
NAT_I2C_FAIL = 1 << 6,
AUX_SHORT = 1 << 5,
@ -166,21 +148,6 @@ enum ml_tx_mode {
REDRIVER_SEMI_AUTO_LINK_TRAINING = 0xb,
};
enum aux_request {
DPCD_READ,
DPCD_WRITE,
I2C_RAW_READ,
I2C_RAW_WRITE,
I2C_RAW_READ_AND_STOP,
I2C_RAW_WRITE_AND_STOP,
};
enum {
EDID_LENGTH = 128,
EDID_I2C_ADDR = 0x50,
EDID_EXTENSION_FLAG = 0x7e,
};
/*
* LUT index corresponds to register value and LUT values corresponds
* to dp data rate supported by the bridge in Mbps unit.
@ -189,41 +156,6 @@ static const unsigned int sn65dsi86_bridge_dp_rate_lut[] = {
0, 1620, 2160, 2430, 2700, 3240, 4320, 5400
};
static bool request_is_write(enum aux_request request)
{
switch (request) {
case I2C_RAW_WRITE_AND_STOP:
case I2C_RAW_WRITE:
case DPCD_WRITE:
return true;
default:
return false;
}
}
static enum i2c_over_aux get_aux_cmd(enum aux_request request, uint32_t remaining_after_this)
{
switch (request) {
case I2C_RAW_WRITE_AND_STOP:
if (!remaining_after_this)
return I2C_OVER_AUX_WRITE_MOT_0;
/* fallthrough */
case I2C_RAW_WRITE:
return I2C_OVER_AUX_WRITE_MOT_1;
case I2C_RAW_READ_AND_STOP:
if (!remaining_after_this)
return I2C_OVER_AUX_READ_MOT_0;
/* fallthrough */
case I2C_RAW_READ:
return I2C_OVER_AUX_READ_MOT_1;
case DPCD_WRITE:
return NATIVE_AUX_WRITE;
case DPCD_READ:
default:
return NATIVE_AUX_READ;
}
}
static cb_err_t sn65dsi86_bridge_aux_request(uint8_t bus,
uint8_t chip,
unsigned int target_reg,
@ -241,10 +173,10 @@ static cb_err_t sn65dsi86_bridge_aux_request(uint8_t bus,
NAT_I2C_FAIL | AUX_SHORT | AUX_DFER | AUX_RPLY_TOUT | SEND_INT);
while (total_size) {
length = MIN(total_size, 16);
length = MIN(total_size, DP_AUX_MAX_PAYLOAD_BYTES);
total_size -= length;
enum i2c_over_aux cmd = get_aux_cmd(request, total_size);
enum i2c_over_aux cmd = dp_get_aux_cmd(request, total_size);
if (i2c_writeb(bus, chip, SN_AUX_CMD_REG, (cmd << 4)) ||
i2c_writeb(bus, chip, SN_AUX_ADDR_19_16_REG, (target_reg >> 16) & 0xF) ||
i2c_writeb(bus, chip, SN_AUX_ADDR_15_8_REG, (target_reg >> 8) & 0xFF) ||
@ -252,7 +184,7 @@ static cb_err_t sn65dsi86_bridge_aux_request(uint8_t bus,
i2c_writeb(bus, chip, SN_AUX_LENGTH_REG, length))
return CB_ERR;
if (request_is_write(request)) {
if (dp_aux_request_is_write(request)) {
reg = SN_AUX_WDATA_REG_0;
for (i = 0; i < length; i++)
if (i2c_writeb(bus, chip, reg++, *data++))
@ -273,7 +205,7 @@ static cb_err_t sn65dsi86_bridge_aux_request(uint8_t bus,
return CB_ERR;
}
if (!request_is_write(request)) {
if (!dp_aux_request_is_write(request)) {
reg = SN_AUX_RDATA_REG_0;
for (i = 0; i < length; i++) {
if (i2c_readb(bus, chip, reg++, &buf))

View File

@ -12,7 +12,7 @@ static void oxford_oxpcie_enable(struct device *dev)
{
printk(BIOS_DEBUG, "Initializing Oxford OXPCIe952\n");
struct resource *res = find_resource(dev, PCI_BASE_ADDRESS_0);
struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (!res) {
printk(BIOS_WARNING, "OXPCIe952: No UART resource found.\n");
return;

View File

@ -75,7 +75,7 @@ static void pci_ehci_set_resources(struct device *dev)
if (ehci_drv_ops->set_resources)
ehci_drv_ops->set_resources(dev);
res = find_resource(dev, EHCI_BAR_INDEX);
res = probe_resource(dev, EHCI_BAR_INDEX);
if (!res)
return;

View File

@ -3,7 +3,7 @@
#include <assert.h>
#include <console/console.h>
#include <ec/google/chromeec/ec.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <security/vboot/vboot_common.h>
#define VBOOT_HASH_VSLOT 0
#define VBOOT_HASH_VSLOT_MASK (1 << (VBOOT_HASH_VSLOT))

View File

@ -97,6 +97,21 @@ static inline void *cbfs_type_cbmem_alloc(const char *name, uint32_t cbmem_id, s
static inline void *cbfs_ro_type_cbmem_alloc(const char *name, uint32_t cbmem_id,
size_t *size_out, enum cbfs_type *type);
/*
* Starts the processes of preloading a file into RAM.
*
* This method depends on COOP_MULTITASKING to parallelize the loading. This method is only
* effective when the underlying rdev supports DMA operations.
*
* When `cbfs_load`, `cbfs_alloc`, or `cbfs_map` are called after a preload has been started,
* they will wait for the preload to complete (if it hasn't already) and then perform
* verification and/or decompression.
*
* This method does not have a return value because the system should boot regardless if this
* method succeeds or fails.
*/
void cbfs_preload(const char *name);
/* Removes a previously allocated CBFS mapping. Should try to unmap mappings in strict LIFO
order where possible, since mapping backends often don't support more complicated cases. */
void cbfs_unmap(void *mapping);

View File

@ -43,7 +43,6 @@
#include <cpu/x86/msr.h>
#include <stdint.h>
void amd_setup_mtrrs(void);
struct device;
void add_uma_resource_below_tolm(struct device *nb, int idx);
@ -67,10 +66,16 @@ static __always_inline void wrmsr_amd(unsigned int index, msr_t msr)
);
}
/* To distribute topmem MSRs to APs. */
void setup_bsp_ramtop(void);
uint64_t bsp_topmem(void);
uint64_t bsp_topmem2(void);
static inline uint64_t amd_topmem(void)
{
return rdmsr(TOP_MEM).lo;
}
static inline uint64_t amd_topmem2(void)
{
msr_t msr = rdmsr(TOP_MEM2);
return (uint64_t)msr.hi << 32 | msr.lo;
}
#endif
#endif /* CPU_AMD_MTRR_H */

View File

@ -23,6 +23,8 @@ int azalia_enter_reset(u8 *base);
int azalia_exit_reset(u8 *base);
u32 azalia_find_verb(const u32 *verb_table, u32 verb_table_bytes, u32 viddid, const u32 **verb);
int azalia_program_verb_table(u8 *base, const u32 *verbs, u32 verb_size);
void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes);
void azalia_codecs_init(u8 *base, u16 codec_mask);
void azalia_audio_init(struct device *dev);
extern struct device_operations default_azalia_audio_ops;
@ -126,26 +128,27 @@ enum azalia_pin_location_2 {
ARRAY_SIZE(pc_beep_verbs); \
const u32 cim_verb_data_size = sizeof(cim_verb_data)
#define AZALIA_PIN_CFG(codec, pin, val) \
(((codec) << 28) | ((pin) << 20) | (0x71c << 8) \
| ((val) & 0xff)), \
(((codec) << 28) | ((pin) << 20) | (0x71d << 8) \
| (((val) >> 8) & 0xff)), \
(((codec) << 28) | ((pin) << 20) | (0x71e << 8) \
| (((val) >> 16) & 0xff)), \
(((codec) << 28) | ((pin) << 20) | (0x71f << 8) \
| (((val) >> 24) & 0xff))
#define AZALIA_VERB_12B(codec, pin, verb, val) \
((codec) << 28 | (pin) << 20 | (verb) << 8 | (val))
#define AZALIA_PIN_CFG_NC(n) (0x411111f0 | (n & 0xf))
#define AZALIA_PIN_CFG(codec, pin, val) \
AZALIA_VERB_12B(codec, pin, 0x71c, ((val) >> 0) & 0xff), \
AZALIA_VERB_12B(codec, pin, 0x71d, ((val) >> 8) & 0xff), \
AZALIA_VERB_12B(codec, pin, 0x71e, ((val) >> 16) & 0xff), \
AZALIA_VERB_12B(codec, pin, 0x71f, ((val) >> 24) & 0xff)
#define AZALIA_RESET(pin) \
(((pin) << 20) | 0x7ff00), (((pin) << 20) | 0x7ff00), \
(((pin) << 20) | 0x7ff00), (((pin) << 20) | 0x7ff00)
#define AZALIA_PIN_CFG_NC(n) (0x411111f0 | ((n) & 0xf))
#define AZALIA_SUBVENDOR(codec, val) \
(((codec) << 28) | (0x01720 << 8) | ((val) & 0xff)), \
(((codec) << 28) | (0x01721 << 8) | (((val) >> 8) & 0xff)), \
(((codec) << 28) | (0x01722 << 8) | (((val) >> 16) & 0xff)), \
(((codec) << 28) | (0x01723 << 8) | (((val) >> 24) & 0xff))
#define AZALIA_RESET(pin) \
AZALIA_VERB_12B(0, pin, 0x7ff, 0), \
AZALIA_VERB_12B(0, pin, 0x7ff, 0), \
AZALIA_VERB_12B(0, pin, 0x7ff, 0), \
AZALIA_VERB_12B(0, pin, 0x7ff, 0)
#define AZALIA_SUBVENDOR(codec, val) \
AZALIA_VERB_12B(codec, 1, 0x720, ((val) >> 0) & 0xff), \
AZALIA_VERB_12B(codec, 1, 0x721, ((val) >> 8) & 0xff), \
AZALIA_VERB_12B(codec, 1, 0x722, ((val) >> 16) & 0xff), \
AZALIA_VERB_12B(codec, 1, 0x723, ((val) >> 24) & 0xff)
#endif /* DEVICE_AZALIA_H */

View File

@ -148,6 +148,17 @@ struct device {
u8 smbios_slot_data_width;
u8 smbios_slot_length;
const char *smbios_slot_designation;
#if CONFIG(SMBIOS_TYPE41_PROVIDED_BY_DEVTREE)
/*
* These fields are intentionally guarded so that attempts to use
* the corresponding devicetree syntax without selecting the Kconfig
* option result in build-time errors. Smaller size is a side effect.
*/
bool smbios_instance_id_valid;
u8 smbios_instance_id;
const char *smbios_refdes;
#endif
#endif
#endif
DEVTREE_CONST void *chip_info;

View File

@ -3,8 +3,18 @@
#ifndef DEVICE_DRAM_SPD_H
#define DEVICE_DRAM_SPD_H
#include <smbios.h>
#include <types.h>
const char *spd_manufacturer_name(const uint16_t mod_id);
struct spd_info {
uint16_t type_detail;
uint8_t form_factor;
};
void get_spd_info(smbios_memory_type memory_type, uint8_t module_type, struct spd_info *info);
uint8_t convert_form_factor_to_module_type(smbios_memory_type memory_type,
smbios_memory_form_factor form_factor);
#endif /* DEVICE_DRAM_SPD_H */

View File

@ -620,8 +620,6 @@
#define PCI_DEVICE_ID_AMD_FAM17H_SATA_AHCI_RAID_VER0 0x7916
#define PCI_DEVICE_ID_AMD_FAM17H_SATA_AHCI_RAID_VER1 0x7917
#define PCI_DEVICE_ID_AMD_FAM17H_MODEL18H_SD 0x7906
#define PCI_DEVICE_ID_AMD_FAM17H_SMBUS 0x790B
#define PCI_DEVICE_ID_AMD_FAM17H_LPC 0x790E
#define PCI_DEVICE_ID_AMD_FAM17H_MODEL18H_GBE 0x1458
#define PCI_DEVICE_ID_AMD_FAM17H_MODEL60H_GBE 0x1641
#define PCI_DEVICE_ID_AMD_FAM17H_I2S_AC97 0x1644
@ -3334,6 +3332,10 @@
#define PCI_DEVICE_ID_INTEL_MCC_PCIE_RP6 0x4b3d
#define PCI_DEVICE_ID_INTEL_MCC_PCIE_RP7 0x4b3e
#define PCI_DEVICE_ID_INTEL_ADL_P_PCIE_RP1 0x464d
#define PCI_DEVICE_ID_INTEL_ADL_P_PCIE_RP2 0x460d
#define PCI_DEVICE_ID_INTEL_ADL_P_PCIE_RP3 0x463d
#define PCI_DEVICE_ID_INTEL_ADP_P_PCIE_RP1 0x51b8
#define PCI_DEVICE_ID_INTEL_ADP_P_PCIE_RP2 0x51b9
#define PCI_DEVICE_ID_INTEL_ADP_P_PCIE_RP3 0x51ba

View File

@ -7,10 +7,6 @@
#include <device/mmio.h>
#include <device/pci_type.h>
/* By not assigning this to CONFIG_MMCONF_BASE_ADDRESS here we
* prevent some sub-optimal constant folding. */
extern u8 *const pci_mmconf;
/* Using a unique datatype for MMIO writes makes the pointers to _not_
* qualify for pointer aliasing with any other objects in memory.
*
@ -29,44 +25,66 @@ union pci_bank {
uint32_t reg32[4096 / sizeof(uint32_t)];
};
#if CONFIG(ECAM_MMCONF_SUPPORT)
#if CONFIG_ECAM_MMCONF_BASE_ADDRESS == 0
#error "CONFIG_ECAM_MMCONF_BASE_ADDRESS undefined!"
#endif
#if CONFIG_ECAM_MMCONF_BUS_NUMBER * MiB != CONFIG_ECAM_MMCONF_LENGTH
#error "CONFIG_ECAM_MMCONF_LENGTH does not correspond with CONFIG_ECAM_MMCONF_BUS_NUMBER!"
#endif
/* By not assigning this to CONFIG_ECAM_MMCONF_BASE_ADDRESS here we
prevent some sub-optimal constant folding. */
extern u8 *const pci_mmconf;
static __always_inline
volatile union pci_bank *pcicfg(pci_devfn_t dev)
{
return (void *)&pci_mmconf[PCI_DEVFN_OFFSET(dev)];
}
#endif
/*
* Avoid name collisions as different stages have different signature
* for these functions. The _s_ stands for simple, fundamental IO or
* MMIO variant.
*/
static __always_inline
uint8_t pci_mmio_read_config8(pci_devfn_t dev, uint16_t reg)
uint8_t pci_s_read_config8(pci_devfn_t dev, uint16_t reg)
{
return pcicfg(dev)->reg8[reg];
}
static __always_inline
uint16_t pci_mmio_read_config16(pci_devfn_t dev, uint16_t reg)
uint16_t pci_s_read_config16(pci_devfn_t dev, uint16_t reg)
{
return pcicfg(dev)->reg16[reg / sizeof(uint16_t)];
}
static __always_inline
uint32_t pci_mmio_read_config32(pci_devfn_t dev, uint16_t reg)
uint32_t pci_s_read_config32(pci_devfn_t dev, uint16_t reg)
{
return pcicfg(dev)->reg32[reg / sizeof(uint32_t)];
}
static __always_inline
void pci_mmio_write_config8(pci_devfn_t dev, uint16_t reg, uint8_t value)
void pci_s_write_config8(pci_devfn_t dev, uint16_t reg, uint8_t value)
{
pcicfg(dev)->reg8[reg] = value;
}
static __always_inline
void pci_mmio_write_config16(pci_devfn_t dev, uint16_t reg, uint16_t value)
void pci_s_write_config16(pci_devfn_t dev, uint16_t reg, uint16_t value)
{
pcicfg(dev)->reg16[reg / sizeof(uint16_t)] = value;
}
static __always_inline
void pci_mmio_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
void pci_s_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
{
pcicfg(dev)->reg32[reg / sizeof(uint32_t)] = value;
}
@ -95,57 +113,4 @@ uint32_t *pci_mmio_config32_addr(pci_devfn_t dev, uint16_t reg)
return (uint32_t *)&pcicfg(dev)->reg32[reg / sizeof(uint32_t)];
}
#if CONFIG(MMCONF_SUPPORT)
#if CONFIG_MMCONF_BASE_ADDRESS == 0
#error "CONFIG_MMCONF_BASE_ADDRESS undefined!"
#endif
#if CONFIG_MMCONF_BUS_NUMBER * MiB != CONFIG_MMCONF_LENGTH
#error "CONFIG_MMCONF_LENGTH does not correspond with CONFIG_MMCONF_BUS_NUMBER!"
#endif
/* Avoid name collisions as different stages have different signature
* for these functions. The _s_ stands for simple, fundamental IO or
* MMIO variant.
*/
static __always_inline
uint8_t pci_s_read_config8(pci_devfn_t dev, uint16_t reg)
{
return pci_mmio_read_config8(dev, reg);
}
static __always_inline
uint16_t pci_s_read_config16(pci_devfn_t dev, uint16_t reg)
{
return pci_mmio_read_config16(dev, reg);
}
static __always_inline
uint32_t pci_s_read_config32(pci_devfn_t dev, uint16_t reg)
{
return pci_mmio_read_config32(dev, reg);
}
static __always_inline
void pci_s_write_config8(pci_devfn_t dev, uint16_t reg, uint8_t value)
{
pci_mmio_write_config8(dev, reg, value);
}
static __always_inline
void pci_s_write_config16(pci_devfn_t dev, uint16_t reg, uint16_t value)
{
pci_mmio_write_config16(dev, reg, value);
}
static __always_inline
void pci_s_write_config32(pci_devfn_t dev, uint16_t reg, uint32_t value)
{
pci_mmio_write_config32(dev, reg, value);
}
#endif
#endif /* _PCI_MMIO_CFG_H */

View File

@ -1,5 +1,8 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __USBC_MUX_H__
#define __USBC_MUX_H__
/* struct to hold all USB-C mux related variables */
struct usbc_mux_info {
bool dp; /* DP connected */
@ -67,3 +70,5 @@ struct usbc_ops {
};
const struct usbc_ops *usbc_get_ops(void);
#endif /* __USBC_MUX_H__ */

View File

@ -12,7 +12,7 @@
* Use this when setting dimm_info.bus_width if the raw SPD values are not
* available.
*/
uint8_t smbios_bus_width_to_spd_width(uint16_t total_width,
uint8_t smbios_bus_width_to_spd_width(uint8_t ddr_type, uint16_t total_width,
uint16_t data_width);
/**
@ -28,7 +28,7 @@ uint32_t smbios_memory_size_to_mib(uint16_t memory_size,
*
* Use this when setting dimm_info.mod_type.
*/
uint8_t
smbios_form_factor_to_spd_mod_type(smbios_memory_form_factor form_factor);
uint8_t smbios_form_factor_to_spd_mod_type(smbios_memory_type memory_type,
smbios_memory_form_factor form_factor);
#endif

48
src/include/dp_aux.h Normal file
View File

@ -0,0 +1,48 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _DP_AUX_H_
#define _DP_AUX_H_
#include <types.h>
enum {
EDID_LENGTH = 128,
EDID_I2C_ADDR = 0x50,
EDID_EXTENSION_FLAG = 0x7e,
};
enum i2c_over_aux {
I2C_OVER_AUX_WRITE_MOT_0 = 0x0,
I2C_OVER_AUX_READ_MOT_0 = 0x1,
I2C_OVER_AUX_WRITE_STATUS_UPDATE_0 = 0x2,
I2C_OVER_AUX_WRITE_MOT_1 = 0x4,
I2C_OVER_AUX_READ_MOT_1 = 0x5,
I2C_OVER_AUX_WRITE_STATUS_UPDATE_1 = 0x6,
NATIVE_AUX_WRITE = 0x8,
NATIVE_AUX_READ = 0x9,
};
enum aux_request {
DPCD_READ,
DPCD_WRITE,
I2C_RAW_READ,
I2C_RAW_WRITE,
I2C_RAW_READ_AND_STOP,
I2C_RAW_WRITE_AND_STOP,
};
/* Backlight configuration */
#define DP_BACKLIGHT_MODE_SET 0x721
#define DP_BACKLIGHT_CONTROL_MODE_MASK 0x3
#define DP_BACKLIGHT_CONTROL_MODE_DPCD 0x2
#define DP_DISPLAY_CONTROL_REGISTER 0x720
#define DP_BACKLIGHT_ENABLE 0x1
#define DP_BACKLIGHT_BRIGHTNESS_MSB 0x722
#define DP_AUX_MAX_PAYLOAD_BYTES 16
bool dp_aux_request_is_write(enum aux_request request);
enum i2c_over_aux dp_get_aux_cmd(enum aux_request request, uint32_t remaining_after_this);
#endif

View File

@ -15,6 +15,8 @@ void list_remove(struct list_node *node);
void list_insert_after(struct list_node *node, struct list_node *after);
// Insert list_node node before list_node before in a doubly linked list.
void list_insert_before(struct list_node *node, struct list_node *before);
// Appends the node to the end of the list.
void list_append(struct list_node *node, struct list_node *head);
#define list_for_each(ptr, head, member) \
for ((ptr) = container_of((head).next, typeof(*(ptr)), member); \

View File

@ -292,6 +292,17 @@
#define ENV_INITIAL_STAGE ENV_BOOTBLOCK
#endif
#if ENV_X86
#define STAGE_HAS_SPINLOCKS !ENV_ROMSTAGE_OR_BEFORE
#elif ENV_RISCV
#define STAGE_HAS_SPINLOCKS 1
#else
#define STAGE_HAS_SPINLOCKS 0
#endif
/* When set <arch/smp/spinlock.h> is included for the spinlock implementation. */
#define ENV_STAGE_SUPPORTS_SMP (CONFIG(SMP) && STAGE_HAS_SPINLOCKS)
/**
* For pre-DRAM stages and post-CAR always build with simple device model, ie.
* PCI, PNP and CPU functions operate without use of devicetree. The reason

View File

@ -1,7 +1,7 @@
#ifndef SMP_SPINLOCK_H
#define SMP_SPINLOCK_H
#if CONFIG(SMP)
#if ENV_STAGE_SUPPORTS_SMP
#include <arch/smp/spinlock.h>
#else /* !CONFIG_SMP */

View File

@ -197,17 +197,70 @@ enum spd_memory_type {
#define MODULE_BUFFERED 1
#define MODULE_REGISTERED 2
/* Byte 3: Module type information */
#define SPD_UNDEFINED 0x00
#define SPD_RDIMM 0x01
#define SPD_UDIMM 0x02
#define SPD_SODIMM 0x04
#define SPD_72B_SO_CDIMM 0x06
#define SPD_72B_SO_RDIMM 0x07
#define SPD_MICRO_DIMM 0x08
#define SPD_MINI_RDIMM 0x10
#define SPD_MINI_UDIMM 0x20
#define SPD_ECC_8BIT (1<<3)
#define SPD_ECC_8BIT_LP5_DDR5 (1<<4)
/* Byte 3: Module type information */
enum ddr2_module_type {
DDR2_SPD_RDIMM = 0x01,
DDR2_SPD_UDIMM = 0x02,
DDR2_SPD_SODIMM = 0x04,
DDR2_SPD_72B_SO_CDIMM = 0x06,
DDR2_SPD_72B_SO_RDIMM = 0x07,
DDR2_SPD_MICRO_DIMM = 0x08,
DDR2_SPD_MINI_RDIMM = 0x10,
DDR2_SPD_MINI_UDIMM = 0x20,
};
enum ddr3_module_type {
DDR3_SPD_RDIMM = 0x01,
DDR3_SPD_UDIMM = 0x02,
DDR3_SPD_SODIMM = 0x03,
DDR3_SPD_MICRO_DIMM = 0x04,
DDR3_SPD_MINI_RDIMM = 0x05,
DDR3_SPD_MINI_UDIMM = 0x06,
DDR3_SPD_MINI_CDIMM = 0x07,
DDR3_SPD_72B_SO_UDIMM = 0x08,
DDR3_SPD_72B_SO_RDIMM = 0x09,
DDR3_SPD_72B_SO_CDIMM = 0x0a,
DDR3_SPD_LRDIMM = 0x0b,
DDR3_SPD_16B_SO_DIMM = 0x0c,
DDR3_SPD_32B_SO_RDIMM = 0x0d,
};
enum ddr4_module_type {
DDR4_SPD_RDIMM = 0x01,
DDR4_SPD_UDIMM = 0x02,
DDR4_SPD_SODIMM = 0x03,
DDR4_SPD_LRDIMM = 0x04,
DDR4_SPD_MINI_RDIMM = 0x05,
DDR4_SPD_MINI_UDIMM = 0x06,
DDR4_SPD_72B_SO_UDIMM = 0x08,
DDR4_SPD_72B_SO_RDIMM = 0x09,
DDR4_SPD_16B_SO_DIMM = 0x0c,
DDR4_SPD_32B_SO_RDIMM = 0x0d,
};
enum ddr5_module_type {
DDR5_SPD_RDIMM = 0x01,
DDR5_SPD_UDIMM = 0x02,
DDR5_SPD_SODIMM = 0x03,
DDR5_SPD_LRDIMM = 0x04,
DDR5_SPD_MINI_RDIMM = 0x05,
DDR5_SPD_MINI_UDIMM = 0x06,
DDR5_SPD_72B_SO_UDIMM = 0x08,
DDR5_SPD_72B_SO_RDIMM = 0x09,
DDR5_SPD_SOLDERED_DOWN = 0x0b,
DDR5_SPD_16B_SO_DIMM = 0x0c,
DDR5_SPD_32B_SO_RDIMM = 0x0d,
DDR5_SPD_1DPC = 0x0e,
DDR5_SPD_2DPC = 0x0f,
};
enum lpx_module_type {
LPX_SPD_LPDIMM = 0x07,
LPX_SPD_NONDIMM = 0x0e,
};
#endif

View File

@ -5,7 +5,7 @@
#include <arch/cpu.h>
#include <bootstate.h>
#include <commonlib/bsd/cb_err.h>
#include <stdint.h>
#include <types.h>
struct thread_mutex {
bool locked;

View File

@ -70,7 +70,7 @@ config HWBASE_DYNAMIC_MMIO
config HWBASE_DEFAULT_MMCONF
hex
default MMCONF_BASE_ADDRESS
default ECAM_MMCONF_BASE_ADDRESS
config HWBASE_DIRECT_PCIDEV
def_bool y
@ -99,6 +99,22 @@ config NO_CBFS_MCACHE
lookup must re-read the same CBFS directory entries from flash to find
the respective file.
config CBFS_CACHE_ALIGN
int
default 8
help
Sets the alignment of the buffers returned by the cbfs_cache.
config CBFS_PRELOAD
bool
depends on COOP_MULTITASKING
help
When enabled it will be possible to preload CBFS files into the
cbfs_cache. This helps reduce boot time by loading the files
in the background before they are actually required. This feature
depends on the read-only boot_device having a DMA controller to
perform the background transfer.
config PAYLOAD_PRELOAD
bool
depends on COOP_MULTITASKING

View File

@ -28,6 +28,8 @@ CFLAGS_ramstage += $(CFLAGS_asan)
$(obj)/ramstage/lib/asan.o: CFLAGS_asan =
endif
all-y += list.c
decompressor-y += decompressor.c
$(call src-to-obj,decompressor,$(dir)/decompressor.c): $(objcbfs)/bootblock.lz4
$(call src-to-obj,decompressor,$(dir)/decompressor.c): CCACHE_EXTRAFILES=$(objcbfs)/bootblock.lz4
@ -147,6 +149,7 @@ ramstage-$(CONFIG_BOOTSPLASH) += bootsplash.c
ramstage-$(CONFIG_BOOTSPLASH) += jpeg.c
ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
ramstage-$(CONFIG_COVERAGE) += libgcov.c
ramstage-y += dp_aux.c
ramstage-y += edid.c
ramstage-y += edid_fill_fb.c
ramstage-y += memrange.c
@ -154,7 +157,6 @@ ramstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
ramstage-$(CONFIG_GENERIC_UDELAY) += timer.c
ramstage-y += b64_decode.c
ramstage-$(CONFIG_ACPI_NHLT) += nhlt.c
ramstage-y += list.c
ramstage-$(CONFIG_FLATTENED_DEVICE_TREE) += device_tree.c
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit.c
ramstage-$(CONFIG_PAYLOAD_FIT_SUPPORT) += fit_payload.c

View File

@ -10,25 +10,28 @@
#include <console/console.h>
#include <fmap.h>
#include <lib.h>
#include <list.h>
#include <metadata_hash.h>
#include <security/tpm/tspi/crtm.h>
#include <security/vboot/vboot_common.h>
#include <stdlib.h>
#include <string.h>
#include <symbols.h>
#include <thread.h>
#include <timestamp.h>
#if ENV_STAGE_HAS_DATA_SECTION
struct mem_pool cbfs_cache = MEM_POOL_INIT(_cbfs_cache, REGION_SIZE(cbfs_cache));
struct mem_pool cbfs_cache =
MEM_POOL_INIT(_cbfs_cache, REGION_SIZE(cbfs_cache), CONFIG_CBFS_CACHE_ALIGN);
#else
struct mem_pool cbfs_cache = MEM_POOL_INIT(NULL, 0);
struct mem_pool cbfs_cache = MEM_POOL_INIT(NULL, 0, 0);
#endif
static void switch_to_postram_cache(int unused)
{
if (_preram_cbfs_cache != _postram_cbfs_cache)
mem_pool_init(&cbfs_cache, _postram_cbfs_cache,
REGION_SIZE(postram_cbfs_cache));
mem_pool_init(&cbfs_cache, _postram_cbfs_cache, REGION_SIZE(postram_cbfs_cache),
CONFIG_CBFS_CACHE_ALIGN);
}
ROMSTAGE_CBMEM_INIT_HOOK(switch_to_postram_cache);
@ -265,12 +268,156 @@ static size_t cbfs_load_and_decompress(const struct region_device *rdev, void *b
}
}
struct cbfs_preload_context {
struct region_device rdev;
struct thread_handle handle;
struct list_node list_node;
void *buffer;
char name[];
};
static struct list_node cbfs_preload_context_list;
static struct cbfs_preload_context *alloc_cbfs_preload_context(size_t additional)
{
struct cbfs_preload_context *context;
size_t size = sizeof(*context) + additional;
context = mem_pool_alloc(&cbfs_cache, size);
if (!context)
return NULL;
memset(context, 0, size);
return context;
}
static void append_cbfs_preload_context(struct cbfs_preload_context *context)
{
list_append(&context->list_node, &cbfs_preload_context_list);
}
static void free_cbfs_preload_context(struct cbfs_preload_context *context)
{
list_remove(&context->list_node);
mem_pool_free(&cbfs_cache, context);
}
static enum cb_err cbfs_preload_thread_entry(void *arg)
{
struct cbfs_preload_context *context = arg;
if (rdev_readat_full(&context->rdev, context->buffer) < 0) {
ERROR("%s(name='%s') readat failed\n", __func__, context->name);
return CB_ERR;
}
return CB_SUCCESS;
}
void cbfs_preload(const char *name)
{
struct region_device rdev;
union cbfs_mdata mdata;
struct cbfs_preload_context *context;
bool force_ro = false;
size_t size;
if (!CONFIG(CBFS_PRELOAD))
dead_code();
DEBUG("%s(name='%s')\n", __func__, name);
if (cbfs_boot_lookup(name, force_ro, &mdata, &rdev))
return;
size = region_device_sz(&rdev);
context = alloc_cbfs_preload_context(strlen(name) + 1);
if (!context) {
ERROR("%s(name='%s') failed to allocate preload context\n", __func__, name);
return;
}
context->buffer = mem_pool_alloc(&cbfs_cache, size);
if (context->buffer == NULL) {
ERROR("%s(name='%s') failed to allocate %zu bytes for preload buffer\n",
__func__, name, size);
goto out;
}
context->rdev = rdev;
strcpy(context->name, name);
append_cbfs_preload_context(context);
if (thread_run(&context->handle, cbfs_preload_thread_entry, context) == 0)
return;
ERROR("%s(name='%s') failed to start preload thread\n", __func__, name);
mem_pool_free(&cbfs_cache, context->buffer);
out:
free_cbfs_preload_context(context);
}
static struct cbfs_preload_context *find_cbfs_preload_context(const char *name)
{
struct cbfs_preload_context *context;
list_for_each(context, cbfs_preload_context_list, list_node) {
if (strcmp(context->name, name) == 0)
return context;
}
return NULL;
}
static enum cb_err get_preload_rdev(struct region_device *rdev, const char *name)
{
enum cb_err err;
struct cbfs_preload_context *context;
if (!CONFIG(CBFS_PRELOAD) || (!ENV_RAMSTAGE && !ENV_ROMSTAGE))
return CB_ERR_ARG;
context = find_cbfs_preload_context(name);
if (!context)
return CB_ERR_ARG;
err = thread_join(&context->handle);
if (err != CB_SUCCESS) {
ERROR("%s(name='%s') Preload thread failed: %u\n", __func__, name, err);
goto out;
}
if (rdev_chain_mem(rdev, context->buffer, region_device_sz(&context->rdev)) != 0) {
ERROR("%s(name='%s') chaining failed\n", __func__, name);
err = CB_ERR;
goto out;
}
err = CB_SUCCESS;
DEBUG("%s(name='%s') preload successful\n", __func__, name);
out:
free_cbfs_preload_context(context);
return err;
}
void *_cbfs_alloc(const char *name, cbfs_allocator_t allocator, void *arg,
size_t *size_out, bool force_ro, enum cbfs_type *type)
{
struct region_device rdev;
bool preload_successful = false;
union cbfs_mdata mdata;
void *loc;
void *loc = NULL;
DEBUG("%s(name='%s', alloc=%p(%p), force_ro=%s, type=%d)\n", __func__, name, allocator,
arg, force_ro ? "true" : "false", type ? *type : -1);
@ -305,6 +452,10 @@ void *_cbfs_alloc(const char *name, cbfs_allocator_t allocator, void *arg,
if (CONFIG(CBFS_VERIFICATION))
file_hash = cbfs_file_hash(&mdata);
/* Update the rdev with the preload content */
if (!force_ro && get_preload_rdev(&rdev, name) == CB_SUCCESS)
preload_successful = true;
/* allocator == NULL means do a cbfs_map() */
if (allocator) {
loc = allocator(arg, size, &mdata);
@ -312,11 +463,11 @@ void *_cbfs_alloc(const char *name, cbfs_allocator_t allocator, void *arg,
void *mapping = rdev_mmap_full(&rdev);
if (!mapping)
return NULL;
goto out;
if (cbfs_file_hash_mismatch(mapping, size, file_hash)) {
rdev_munmap(&rdev, mapping);
return NULL;
goto out;
}
return mapping;
@ -327,19 +478,28 @@ void *_cbfs_alloc(const char *name, cbfs_allocator_t allocator, void *arg,
* it is not possible to add a CBFS_CACHE.
*/
ERROR("Cannot map compressed file %s without cbfs_cache\n", mdata.h.filename);
return NULL;
goto out;
} else {
loc = mem_pool_alloc(&cbfs_cache, size);
}
if (!loc) {
ERROR("'%s' allocation failure\n", mdata.h.filename);
return NULL;
goto out;
}
size = cbfs_load_and_decompress(&rdev, loc, size, compression, file_hash);
if (!size)
return NULL;
loc = NULL;
out:
/*
* When using cbfs_preload we need to free the preload buffer after populating the
* destination buffer.
*/
if (preload_successful)
cbfs_unmap(rdev_mmap_full(&rdev));
return loc;
}

View File

@ -1,11 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/dram/spd.h>
#include <dimm_info_util.h>
#include <smbios.h>
#include <spd.h>
#include <console/console.h>
uint8_t smbios_bus_width_to_spd_width(uint16_t total_width, uint16_t data_width)
uint8_t smbios_bus_width_to_spd_width(uint8_t ddr_type, uint16_t total_width,
uint16_t data_width)
{
uint8_t out;
@ -38,7 +40,10 @@ uint8_t smbios_bus_width_to_spd_width(uint16_t total_width, uint16_t data_width)
switch (extension_bits) {
case 8:
out |= SPD_ECC_8BIT;
if (ddr_type == MEMORY_TYPE_DDR5 || ddr_type == MEMORY_TYPE_LPDDR5)
out |= SPD_ECC_8BIT_LP5_DDR5;
else
out |= SPD_ECC_8BIT;
break;
case 0:
/* No extension bits */
@ -68,18 +73,8 @@ uint32_t smbios_memory_size_to_mib(uint16_t memory_size, uint32_t extended_size)
return memory_size;
}
uint8_t
smbios_form_factor_to_spd_mod_type(smbios_memory_form_factor form_factor)
uint8_t smbios_form_factor_to_spd_mod_type(smbios_memory_type memory_type,
smbios_memory_form_factor form_factor)
{
/* This switch reverses the switch in smbios.c */
switch (form_factor) {
case MEMORY_FORMFACTOR_DIMM:
return SPD_UDIMM;
case MEMORY_FORMFACTOR_RIMM:
return SPD_RDIMM;
case MEMORY_FORMFACTOR_SODIMM:
return SPD_SODIMM;
default:
return SPD_UNDEFINED;
}
return convert_form_factor_to_module_type(memory_type, form_factor);
}

41
src/lib/dp_aux.c Normal file
View File

@ -0,0 +1,41 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <delay.h>
#include <dp_aux.h>
#include <console/console.h>
#include <timer.h>
bool dp_aux_request_is_write(enum aux_request request)
{
switch (request) {
case I2C_RAW_WRITE_AND_STOP:
case I2C_RAW_WRITE:
case DPCD_WRITE:
return true;
default:
return false;
}
}
enum i2c_over_aux dp_get_aux_cmd(enum aux_request request, uint32_t remaining_after_this)
{
switch (request) {
case I2C_RAW_WRITE_AND_STOP:
if (!remaining_after_this)
return I2C_OVER_AUX_WRITE_MOT_0;
/* fallthrough */
case I2C_RAW_WRITE:
return I2C_OVER_AUX_WRITE_MOT_1;
case I2C_RAW_READ_AND_STOP:
if (!remaining_after_this)
return I2C_OVER_AUX_READ_MOT_0;
/* fallthrough */
case I2C_RAW_READ:
return I2C_OVER_AUX_READ_MOT_1;
case DPCD_WRITE:
return NATIVE_AUX_WRITE;
case DPCD_READ:
default:
return NATIVE_AUX_READ;
}
}

View File

@ -11,6 +11,7 @@
#include <lib.h>
#include <stdbool.h>
#include <stdint.h>
#include <drivers/vpd/vpd.h>
uint64_t fw_config_get(void)
{
@ -21,30 +22,40 @@ uint64_t fw_config_get(void)
if (fw_config_value_initialized)
return fw_config_value;
fw_config_value_initialized = true;
/* Look in CBFS to allow override of value. */
if (CONFIG(FW_CONFIG_SOURCE_CBFS)) {
if (cbfs_load(CONFIG_CBFS_PREFIX "/fw_config", &fw_config_value,
sizeof(fw_config_value)) != sizeof(fw_config_value)) {
printk(BIOS_WARNING, "%s: Could not get fw_config from CBFS\n",
__func__);
fw_config_value = UNDEFINED_FW_CONFIG;
} else {
printk(BIOS_INFO, "FW_CONFIG value from CBFS is 0x%" PRIx64 "\n",
fw_config_value);
return fw_config_value;
}
}
fw_config_value = UNDEFINED_FW_CONFIG;
/* Read the value from EC CBI. */
if (CONFIG(FW_CONFIG_SOURCE_CHROMEEC_CBI)) {
if (google_chromeec_cbi_get_fw_config(&fw_config_value)) {
printk(BIOS_WARNING, "%s: Could not get fw_config from EC\n", __func__);
fw_config_value = UNDEFINED_FW_CONFIG;
}
if (google_chromeec_cbi_get_fw_config(&fw_config_value))
printk(BIOS_WARNING, "%s: Could not get fw_config from CBI\n",
__func__);
else
printk(BIOS_INFO, "FW_CONFIG value from CBI is 0x%" PRIx64 "\n",
fw_config_value);
}
/* Look in CBFS to allow override of value. */
if (CONFIG(FW_CONFIG_SOURCE_CBFS) && fw_config_value == UNDEFINED_FW_CONFIG) {
if (cbfs_load(CONFIG_CBFS_PREFIX "/fw_config", &fw_config_value,
sizeof(fw_config_value)) != sizeof(fw_config_value))
printk(BIOS_WARNING, "%s: Could not get fw_config from CBFS\n",
__func__);
else
printk(BIOS_INFO, "FW_CONFIG value from CBFS is 0x%" PRIx64 "\n",
fw_config_value);
}
if (CONFIG(FW_CONFIG_SOURCE_VPD) && fw_config_value == UNDEFINED_FW_CONFIG) {
int vpd_value;
if (vpd_get_int("fw_config", VPD_RW_THEN_RO, &vpd_value)) {
fw_config_value = vpd_value;
printk(BIOS_INFO, "FW_CONFIG value from VPD is 0x%" PRIx64 "\n",
fw_config_value);
} else
printk(BIOS_WARNING, "%s: Could not get fw_config from vpd\n",
__func__);
}
printk(BIOS_INFO, "FW_CONFIG value is 0x%" PRIx64 "\n", fw_config_value);
return fw_config_value;
}

View File

@ -28,3 +28,11 @@ void list_insert_before(struct list_node *node, struct list_node *before)
if (node->prev)
node->prev->next = node;
}
void list_append(struct list_node *node, struct list_node *head)
{
while (head->next)
head = head->next;
list_insert_after(node, head);
}

Some files were not shown because too many files have changed in this diff Show More