Compare commits

...

111 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
474 changed files with 7719 additions and 1902 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

@ -188,6 +188,7 @@ The boards in this section are not real mainboards, but emulators.
- [Galago Pro 4](system76/galp4.md)
- [Galago Pro 5](system76/galp5.md)
- [Gazelle 15](system76/gaze15.md)
- [Gazelle 16](system76/gaze16.md)
- [Lemur Pro 9](system76/lemp9.md)
- [Lemur Pro 10](system76/lemp10.md)
- [Oryx Pro 5](system76/oryp5.md)

View File

@ -0,0 +1,87 @@
# System76 Gazelle 16 (gaze16)
## Specs
- CPU
- Intel Core i7-11800H
- Chipset
- Intel HM570
- EC
- ITE IT5570E running [System76 EC](https://github.com/system76/ec)
- Graphics
- dGPU options
- NVIDIA GeForce RTX 3050
- NVIDIA GeForce RTX 3050 Ti
- NVIDIA GeForce RTX 3060
- eDP displays
- 15.6" 1920x1080@144Hz LCD (AUO B156HAN08.4)
- 17.3" 1920x1080@144Hz LCD (LG LP173WFG-SPB3)
- External outputs
- RTX 3050/3050 Ti
- 1x HDMI
- 1x Mini DisplayPort 1.4
- RTX 3060
- 1x HDMI
- 1x Mini DisplayPort 1.2
- 1x DisplayPort 1.4 over USB-C
- Memory
- Up to 64GB (2x32GB) dual-channel DDR4 SO-DIMMs @ 3200 MHz
- Networking
- Gigabit Ethernet
- Either onboard Intel I219-V or Realtek RTL8111H controller
- M.2 PCIe/CNVi WiFi/Bluetooth
- Intel Wi-Fi 6 AX200/AX201
- Power
- RTX 3050/3050 Ti
- 150W AC barrel adapter
- Included: Chicony A17-150P2A, using a C5 power cord
- RTX 3060
- 180W AC barrel adapter
- Included: Chicony A17-180P4A, using a C5 power cord
- 48.96Wh 4-cell battery
- Sound
- Realtek ALC256 codec
- Internal speakers and microphone
- Combined 3.5mm headphone/microphone jack
- Dedicated 3.5mm microphone jack
- HDMI, mDP, USB-C DP audio
- Storage
- 1x M.2 PCIe NVMe Gen 4 SSD
- 1x M.2 PCIe NVMe Gen 3 or SATA 3 SSD
- SD card reader
- Realtek RTS5227S on RTX 3050/3050 Ti models
- Realtek OZ711LV2 on RTX 3060 models
- USB
- 1x USB 3.2 Gen 2 Type-C
- Supports DisplayPort over USB-C on RTX 3060 models only
- Does not support USB-C charging (USB-PD) or Thunderbolt
- 1x USB 3.2 Gen 2 Type-A
- 1x USB 3.2 Gen 1 Type-A
- 1x USB 2.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
```eval_rst
+---------------------+---------------------+
| Type | Value |
+=====================+=====================+
| Socketed flash | no |
+---------------------+---------------------+
| Vendor | GigaDevice |
+---------------------+---------------------+
| Model | GD25B127D |
+---------------------+---------------------+
| Size | 16 MiB |
+---------------------+---------------------+
| Package | SOIC-8 |
+---------------------+---------------------+
| Internal flashing | yes |
+---------------------+---------------------+
| External flashing | yes |
+---------------------+---------------------+
```
The flash chip (U51 on 3050 variant, U52 on 3060 variant) is left of the top DIMM slot.

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,7 +1,7 @@
Upcoming release - coreboot 4.15
coreboot 4.15
================================
The 4.15 release is planned for November 5th, 2021.
coreboot 4.15 was released on November 5th, 2021.
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.

View File

@ -1,7 +1,7 @@
Upcoming release - coreboot 4.16
================================
The 4.16 release is planned for Februrary, 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.

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

@ -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

@ -1179,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. */

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

@ -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,7 +4,7 @@
#define ARCH_I386_PCI_OPS_H
#include <arch/pci_io_cfg.h>
#if CONFIG(MMCONF_SUPPORT)
#if CONFIG(ECAM_MMCONF_SUPPORT)
#include <device/pci_mmio_cfg.h>
#endif

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 */

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);
@ -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

@ -0,0 +1,10 @@
config DRIVERS_GFX_NVIDIA
bool
default n
help
Support for NVIDIA Optimus with GC6 3.0
config DRIVERS_GFX_NVIDIA_BRIDGE
hex "PCI bridge for the GPU device"
default 0x01
depends on DRIVERS_GFX_NVIDIA

View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
romstage-$(CONFIG_DRIVERS_GFX_NVIDIA) += romstage.c
ramstage-$(CONFIG_DRIVERS_GFX_NVIDIA) += nvidia.c

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

@ -0,0 +1,197 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#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)
{
Printf("PEG0._ON {")
// TODO: Check for deferred GCx action
\_SB.PCI0.PEG0.DGPU._ON()
_STA = 1
Printf("} PEG0._ON")
}
Method (_OFF)
{
Printf("PEG0._OFF {")
// TODO: Check for deferred GCx action
\_SB.PCI0.PEG0.DGPU._OFF()
_STA = 0
Printf("} PEG0._OFF")
}
}
Name (_PR0, Package () { PWRR })
Name (_PR2, Package () { PWRR })
Name (_PR3, Package () { PWRR })
}
// 01:00.0
Device (\_SB.PCI0.PEG0.DGPU)
{
Name(_ADR, 0x00000000)
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,
}
// 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 })
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 (_ON)
{
Printf("DGPU._ON {")
Printf(" Enable GPU power")
STXS(DGPU_PWR_EN)
Sleep(10)
Printf(" Take GPU out of reset")
STXS(DGPU_RST_N)
Sleep(10)
GPWR = 1
GCST = 0
/*
// TODO: Actually check link status
Printf("Wait for PCIe link")
Sleep(100)
Printf("Restore SSID: %o", NVID)
SSID = NVID
*/
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

@ -0,0 +1,10 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _DRIVERS_GFX_NVIDIA_CHIP_H_
#define _DRIVERS_GFX_NVIDIA_CHIP_H_
struct drivers_gfx_nvidia_config {
/* TODO: Set GPIOs in devicetree? */
};
#endif /* _DRIVERS_GFX_NVIDIA_CHIP_H_ */

View File

@ -0,0 +1,19 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _DRIVERS_GFX_NVIDIA_GPU_H_
#define _DRIVERS_GFX_NVIDIA_GPU_H_
#include <stdbool.h>
struct nvidia_gpu_config {
/* GPIO for GPU_PWR_EN */
unsigned int power_gpio;
/* GPIO for GPU_RST# */
unsigned int reset_gpio;
/* Enable or disable GPU power */
bool enable;
};
void nvidia_set_power(const struct nvidia_gpu_config *config);
#endif /* _DRIVERS_NVIDIA_GPU_H_ */

View File

@ -0,0 +1,67 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "chip.h"
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#define NVIDIA_SUBSYSTEM_ID_OFFSET 0x40
static void nvidia_read_resources(struct device *dev)
{
printk(BIOS_DEBUG, "%s: %s\n", __func__, dev_path(dev));
pci_dev_read_resources(dev);
// Find all BARs on GPU, mark them above 4g if prefetchable
for (int bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar += 4) {
struct resource *res = probe_resource(dev, bar);
if (res) {
if (res->flags & IORESOURCE_PREFETCH) {
printk(BIOS_INFO, " BAR at 0x%02x marked above 4g\n", bar);
res->flags |= IORESOURCE_ABOVE_4G;
} else {
printk(BIOS_DEBUG, " BAR at 0x%02x not prefetch\n", bar);
}
} else {
printk(BIOS_DEBUG, " BAR at 0x%02x not found\n", bar);
}
}
}
static void nvidia_set_subsystem(struct device *dev, unsigned int vendor, unsigned int device)
{
pci_write_config32(dev, NVIDIA_SUBSYSTEM_ID_OFFSET,
((device & 0xffff) << 16) | (vendor & 0xffff));
}
static struct pci_operations nvidia_device_ops_pci = {
.set_subsystem = nvidia_set_subsystem,
};
static struct device_operations nvidia_device_ops = {
.read_resources = nvidia_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
#if CONFIG(HAVE_ACPI_TABLES)
.write_acpi_tables = pci_rom_write_acpi_tables,
.acpi_fill_ssdt = pci_rom_ssdt,
#endif
.init = pci_dev_init,
.ops_pci = &nvidia_device_ops_pci,
};
static void nvidia_enable(struct device *dev)
{
if (!dev->enabled || dev->path.type != DEVICE_PATH_PCI)
return;
dev->ops = &nvidia_device_ops;
}
struct chip_operations drivers_gfx_nvidia_ops = {
CHIP_NAME("NVIDIA Optimus graphics device")
.enable_dev = nvidia_enable
};

View File

@ -0,0 +1,33 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
#include <delay.h>
#include <device/device.h>
#include <device/pci.h>
#include <gpio.h>
#include "chip.h"
#include "gpu.h"
void nvidia_set_power(const struct nvidia_gpu_config *config)
{
if (!config->power_gpio || !config->reset_gpio) {
printk(BIOS_ERR, "%s: GPU_PWR_EN and GPU_RST# must be set\n", __func__);
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);
gpio_set(config->reset_gpio, 0);
mdelay(4);
if (config->enable) {
gpio_set(config->power_gpio, 1);
mdelay(4);
gpio_set(config->reset_gpio, 1);
} else {
gpio_set(config->power_gpio, 0);
}
mdelay(4);
}

View File

@ -103,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

@ -13,6 +13,11 @@ config EC_SYSTEM76_EC_COLOR_KEYBOARD
bool
default n
config EC_SYSTEM76_EC_DGPU
depends on EC_SYSTEM76_EC
bool
default n
config EC_SYSTEM76_EC_OLED
depends on EC_SYSTEM76_EC
bool

View File

@ -117,6 +117,9 @@ Device (S76D) {
Method (NFAN, 0, Serialized) {
Return (Package() {
"CPU fan",
#if CONFIG(EC_SYSTEM76_EC_DGPU)
"GPU fan",
#endif
})
}
@ -144,6 +147,9 @@ Device (S76D) {
Method (NTMP, 0, Serialized) {
Return (Package() {
"CPU temp",
#if CONFIG(EC_SYSTEM76_EC_DGPU)
"GPU temp",
#endif
})
}

View File

@ -44,7 +44,8 @@
#define CPUID_COMETLAKE_H_S_6_2_G0 0xa0650
#define CPUID_COMETLAKE_H_S_6_2_G1 0xa0653
#define CPUID_COMETLAKE_H_S_10_2_P0 0xa0651
#define CPUID_COMETLAKE_H_S_10_2_Q0_P1 0xa0654
#define CPUID_COMETLAKE_H_S_10_2_P1 0xa0654
#define CPUID_COMETLAKE_H_S_10_2_Q0 0xa0655
#define CPUID_TIGERLAKE_A0 0x806c0
#define CPUID_TIGERLAKE_B0 0x806c1
#define CPUID_TIGERLAKE_R0 0x806d1

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;

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

@ -3332,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

@ -25,17 +25,17 @@ union pci_bank {
uint32_t reg32[4096 / sizeof(uint32_t)];
};
#if CONFIG(MMCONF_SUPPORT)
#if CONFIG(ECAM_MMCONF_SUPPORT)
#if CONFIG_MMCONF_BASE_ADDRESS == 0
#error "CONFIG_MMCONF_BASE_ADDRESS undefined!"
#if CONFIG_ECAM_MMCONF_BASE_ADDRESS == 0
#error "CONFIG_ECAM_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!"
#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_MMCONF_BASE_ADDRESS here we
/* By not assigning this to CONFIG_ECAM_MMCONF_BASE_ADDRESS here we
prevent some sub-optimal constant folding. */
extern u8 *const pci_mmconf;

View File

@ -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

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,18 +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

@ -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

View File

@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/dram/spd.h>
#include <dimm_info_util.h>
#include <smbios.h>
#include <spd.h>
@ -72,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);
}

View File

@ -398,10 +398,10 @@ enum cb_err thread_join(struct thread_handle *handle)
if (handle->state == THREAD_UNINITIALIZED)
return CB_ERR_ARG;
stopwatch_init(&sw);
printk(BIOS_SPEW, "waiting for thread\n");
stopwatch_init(&sw);
while (handle->state != THREAD_DONE)
assert(thread_yield() == 0);

View File

@ -3,6 +3,7 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)

View File

@ -85,7 +85,7 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
.mchbar = CONFIG_FIXED_MCHBAR_MMIO_BASE,
.dmibar = CONFIG_FIXED_DMIBAR_MMIO_BASE,
.epbar = CONFIG_FIXED_EPBAR_MMIO_BASE,
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
.pciexbar = CONFIG_ECAM_MMCONF_BASE_ADDRESS,
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
.wdbbar = 0x4000000,
.wdbsize = 0x1000,

View File

@ -3,7 +3,7 @@ if BOARD_EMULATION_QEMU_X86_I440FX
config BOARD_SPECIFIC_OPTIONS
def_bool y
select CPU_QEMU_X86
select NO_MMCONF_SUPPORT
select NO_ECAM_MMCONF_SUPPORT
select SOUTHBRIDGE_INTEL_I82371EB
select HAVE_OPTION_TABLE
select HAVE_CMOS_DEFAULT

View File

@ -56,10 +56,10 @@ config MAINBOARD_DIR
config MAINBOARD_PART_NUMBER
default "QEMU x86 q35/ich9"
config MMCONF_BASE_ADDRESS
config ECAM_MMCONF_BASE_ADDRESS
default 0xb0000000
config MMCONF_BUS_NUMBER
config ECAM_MMCONF_BUS_NUMBER
int
default 256

View File

@ -11,12 +11,12 @@ static void bootblock_northbridge_init(void)
{
/*
* The "io" variant of the config access is explicitly used to
* setup the PCIEXBAR because CONFIG(MMCONF_SUPPORT) is set to
* setup the PCIEXBAR because CONFIG(ECAM_MMCONF_SUPPORT) is set to
* to true. That way all subsequent non-explicit config accesses use
* MCFG. This code also assumes that bootblock_northbridge_init() is
* the first thing called in the non-asm boot block code. The final
* assumption is that no assembly code is using the
* CONFIG(MMCONF_SUPPORT) option to do PCI config accesses.
* CONFIG(ECAM_MMCONF_SUPPORT) option to do PCI config accesses.
*
* The PCIEXBAR is assumed to live in the memory mapped IO space under
* 4GiB.

View File

@ -2,6 +2,7 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)

View File

@ -14,7 +14,7 @@
static uint32_t encode_pciexbar_length(void)
{
switch (CONFIG_MMCONF_BUS_NUMBER) {
switch (CONFIG_ECAM_MMCONF_BUS_NUMBER) {
case 256: return 0 << 1;
case 128: return 1 << 1;
case 64: return 2 << 1;
@ -24,7 +24,7 @@ static uint32_t encode_pciexbar_length(void)
uint32_t make_pciexbar(void)
{
return CONFIG_MMCONF_BASE_ADDRESS | encode_pciexbar_length() | 1;
return CONFIG_ECAM_MMCONF_BASE_ADDRESS | encode_pciexbar_length() | 1;
}
/* Check that MCFG is active. If it's not, QEMU was started for machine PC */

View File

@ -2,12 +2,12 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <soc/chromeos.h>
#include <southbridge/intel/lynxpoint/lp_gpio.h>
/* SPI Write protect is GPIO 16 */
#define CROS_WP_GPIO 58
#include "onboard.h"
void fill_lb_gpios(struct lb_gpios *gpios)
{

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef AURON_ONBOARD_H
#define AURON_ONBOARD_H
/* SPI Write protect is GPIO 58 */
#define CROS_WP_GPIO 58
#endif

View File

@ -6,10 +6,9 @@
#include <device/device.h>
#include <southbridge/intel/lynxpoint/pch.h>
#include <southbridge/intel/common/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#define GPIO_SPI_WP 58
#define GPIO_REC_MODE 12
#include "onboard.h"
#define FLAG_SPI_WP 0
#define FLAG_REC_MODE 1
@ -26,6 +25,16 @@ void fill_lb_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
static bool raw_write_protect_state(void)
{
return get_gpio(GPIO_SPI_WP);
}
static bool raw_recovery_mode_switch(void)
{
return !get_gpio(GPIO_REC_MODE);
}
int get_write_protect_state(void)
{
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
@ -44,11 +53,11 @@ void init_bootmode_straps(void)
const pci_devfn_t dev = PCI_DEV(0, 0x1f, 2);
/* Write Protect: GPIO58 = GPIO_SPI_WP, active high */
if (get_gpio(GPIO_SPI_WP))
if (raw_write_protect_state())
flags |= (1 << FLAG_SPI_WP);
/* Recovery: GPIO12 = RECOVERY_L, active low */
if (!get_gpio(GPIO_REC_MODE))
if (raw_recovery_mode_switch())
flags |= (1 << FLAG_REC_MODE);
/* Developer: Virtual */

View File

@ -16,6 +16,12 @@
/* WLAN wake is GPIO 10 */
#define WLAN_WAKE_GPIO 10
/* Recovery: GPIO12 = RECOVERY_L, active low */
#define GPIO_REC_MODE 12
/* Write Protect: GPIO58 = GPIO_SPI_WP, active high */
#define GPIO_SPI_WP 58
/* IT8772F defs */
#define IT8772F_BASE 0x2e
#define IT8772F_SERIAL_DEV PNP_DEV(IT8772F_BASE, IT8772F_SP1)

View File

@ -14,12 +14,15 @@ config BOARD_GOOGLE_BRYA_COMMON
def_bool y
select BOARD_ROMSIZE_KB_32768
select DRIVERS_GENERIC_ALC1015
select DRIVERS_GENERIC_GPIO_KEYS
select DRIVERS_GENERIC_MAX98357A
select DRIVERS_I2C_GENERIC
select DRIVERS_I2C_HID
select DRIVERS_I2C_NAU8825
select DRIVERS_I2C_SX9324
select DRIVERS_INTEL_DPTF
select PMC_IPC_ACPI_INTERFACE
select DRIVERS_INTEL_DPTF_SUPPORTS_TPCH
select DRIVERS_INTEL_PMC
select DRIVERS_INTEL_SOUNDWIRE
select DRIVERS_INTEL_USB4_RETIMER

View File

@ -27,6 +27,7 @@ config BOARD_GOOGLE_GIMBLE
bool "-> Gimble"
select BOARD_GOOGLE_BASEBOARD_BRYA
select CHROMEOS_DSM_CALIB if CHROMEOS
select CHROMEOS_DSM_PARAM_FILE_NAME if CHROMEOS
select DRIVERS_I2C_MAX98390
config BOARD_GOOGLE_REDRIX

View File

@ -5,6 +5,7 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)

View File

@ -68,6 +68,9 @@ chip soc/intel/alderlake
register "PchHdaIDispLinkFrequency" = "HDA_LINKFREQ_96MHZ"
register "PchHdaIDispCodecEnable" = "1"
# FIVR RFI Spread Spectrum 1.5%
register "FivrSpreadSpectrum" = "FIVR_SS_1_5"
# Intel Common SoC Config
#+-------------------+---------------------------+
#| Field | Value |

View File

@ -2,7 +2,7 @@
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
#include <types.h>
#include <soc/gpio.h>
#include <vendorcode/google/chromeos/chromeos.h>
@ -318,9 +318,9 @@ static const struct pad_config gpio_table[] = {
/* R5 : HDA_SDI1 ==> DMIC_DATA0_R */
PAD_CFG_NF(GPP_R5, NONE, DEEP, NF3),
/* R6 : I2S2_TXD ==> DMIC_CLK1_R */
PAD_CFG_NF(GPP_R6, NONE, DEEP, NF2),
PAD_CFG_NF(GPP_R6, NONE, DEEP, NF3),
/* R7 : I2S2_RXD ==> DMIC_DATA1_R */
PAD_CFG_NF(GPP_R7, NONE, DEEP, NF2),
PAD_CFG_NF(GPP_R7, NONE, DEEP, NF3),
/* S0 : SNDW0_CLK ==> NC */
PAD_NC(GPP_S0, NONE),

View File

@ -74,6 +74,9 @@ chip soc/intel/alderlake
register "PchHdaIDispLinkFrequency" = "HDA_LINKFREQ_96MHZ"
register "PchHdaIDispCodecEnable" = "1"
# FIVR RFI Spread Spectrum 1.5%
register "FivrSpreadSpectrum" = "FIVR_SS_1_5"
# Intel Common SoC Config
#+-------------------+---------------------------+
#| Field | Value |

View File

@ -2,7 +2,7 @@
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
#include <types.h>
#include <soc/gpio.h>
#include <vendorcode/google/chromeos/chromeos.h>

View File

@ -7,7 +7,7 @@ fw_config
end
chip soc/intel/alderlake
register "SaGv" = "SaGv_Disabled"
register "SaGv" = "SaGv_Enabled"
# FIVR configurations for brya are disabled since the board doesn't have V1p05 and Vnn
# bypass rails implemented.
@ -132,16 +132,16 @@ chip soc/intel/alderlake
device ref pmc hidden
chip drivers/intel/pmc_mux
device generic 0 on
chip drivers/intel/pmc_mux/conn
register "usb2_port_number" = "2"
register "usb3_port_number" = "2"
device generic 1 alias conn1 on end
end
chip drivers/intel/pmc_mux/conn
register "usb2_port_number" = "3"
register "usb3_port_number" = "3"
device generic 2 alias conn2 on end
end
chip drivers/intel/pmc_mux/conn
register "usb2_port_number" = "2"
register "usb3_port_number" = "2"
device generic 1 alias conn1 on end
end
end
end
end

View File

@ -34,6 +34,7 @@ chip soc/intel/alderlake
register "SaGv" = "SaGv_Enabled"
register "TcssAuxOri" = "1"
register "typec_aux_bias_pads[0]" = "{.pad_auxp_dc = GPP_E22, .pad_auxn_dc = GPP_E23}"
register "usb2_ports[1]" = "USB2_PORT_MAX(OC1)" # set MAX to USB2_C1 for eye diagram
register "usb2_ports[2]" = "USB2_PORT_EMPTY" # Disable USB2_C2
register "usb2_ports[3]" = "USB2_PORT_EMPTY" # M.2 WWAN
register "usb2_ports[7]" = "USB2_PORT_MID(OC_SKIP)" # Type-A MLB Port
@ -135,7 +136,7 @@ chip soc/intel/alderlake
register "name" = ""MXW0""
register "r0_calib_key" = ""dsm_calib_r0_0""
register "temperature_calib_key" = ""dsm_calib_temp_0""
register "dsm_param_file_name" = ""dsm_param""
register "dsm_param_file_name" = ""dsm_param_R""
register "vmon_slot_no" = "0"
register "imon_slot_no" = "1"
device i2c 0x38 on
@ -147,7 +148,7 @@ chip soc/intel/alderlake
register "name" = ""MXW1""
register "r0_calib_key" = ""dsm_calib_r0_1""
register "temperature_calib_key" = ""dsm_calib_temp_1""
register "dsm_param_file_name" = ""dsm_param""
register "dsm_param_file_name" = ""dsm_param_L""
register "vmon_slot_no" = "1"
register "imon_slot_no" = "0"
device i2c 0x3c on

View File

@ -30,10 +30,14 @@ static const struct pad_config override_gpio_table[] = {
PAD_NC(GPP_D3, NONE),
/* D5 : SRCCLKREQ0# ==> SSD_CLKREQ_ODL */
PAD_CFG_NF(GPP_D5, NONE, DEEP, NF1),
/* D6 : SRCCLKREQ1# ==> APU_PEN_DETECT_ODL */
PAD_CFG_GPI_GPIO_DRIVER(GPP_D6, NONE, PLTRST),
/* D7 : SRCCLKREQ2# ==> NC */
PAD_NC(GPP_D7, NONE),
/* D8 : SRCCLKREQ3# ==> NC */
PAD_NC(GPP_D8, NONE),
/* D17 : UART1_RXD ==> APU_PEN_DETECT_ODL */
PAD_CFG_GPI_SCI(GPP_D17, NONE, DEEP, EDGE_SINGLE, NONE),
/* D18 : UART1_TXD ==> NC */
PAD_NC(GPP_D18, NONE),

View File

@ -15,6 +15,15 @@ end
chip soc/intel/alderlake
register "SaGv" = "SaGv_Enabled"
# GPE configuration
register "pmc_gpe0_dw1" = "GPP_D"
register "usb2_ports[1]" = "USB2_PORT_EMPTY" # Disable USB2_C1
register "usb2_ports[3]" = "USB2_PORT_EMPTY" # Disable M.2 WWAN
register "usb2_ports[9]" = "USB2_PORT_EMPTY" # Disable M.2 Bluetooth
register "usb3_ports[3]" = "USB3_PORT_EMPTY" # Disable M.2 WWAN
# FIVR configurations for kano are disabled since the board doesn't have V1p05 and Vnn
# bypass rails implemented.
register "ext_fivr_settings" = "{
@ -223,6 +232,19 @@ chip soc/intel/alderlake
register "hid_desc_reg_offset" = "0x01"
device i2c 0x10 on end
end
chip drivers/generic/gpio_keys
register "name" = ""PENH""
# GPP_D6 is the IRQ source, and GPP_D17 is the wake source
register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_LOW(GPP_D6)"
register "key.wake_gpe" = "GPE0_DW1_17"
register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
device generic 0 on end
end
end
device ref i2c2 on
chip drivers/i2c/sx9324

View File

@ -22,7 +22,16 @@ fw_config
end
chip soc/intel/alderlake
# This disabled autonomous GPIO power management, otherwise
# old cr50 FW only supports short pulses; need to clarify
# the minimum PCH IRQ pulse width with Intel, b/180111628
register "gpio_override_pm" = "1"
register "gpio_pm[COMM_0]" = "0"
register "gpio_pm[COMM_1]" = "0"
register "gpio_pm[COMM_2]" = "0"
register "gpio_pm[COMM_3]" = "0"
register "gpio_pm[COMM_4]" = "0"
register "gpio_pm[COMM_5]" = "0"
register "SaGv" = "SaGv_Enabled"
register "MaxDramSpeed" = "3733"

View File

@ -34,6 +34,8 @@ chip soc/intel/alderlake
register "SaGv" = "SaGv_Enabled"
register "CnviBtAudioOffload" = "true"
# FIVR RFI Spread Spectrum 6%
register "FivrSpreadSpectrum" = "FIVR_SS_6"
# Intel Common SoC Config
#+-------------------+---------------------------+

View File

@ -46,8 +46,8 @@ static const struct pad_config override_gpio_table[] = {
/* D3 : ISH_GP3 ==> NC */
PAD_NC(GPP_D3, NONE),
/* D5 : SRCCLKREQ0# ==> NC */
PAD_NC(GPP_D5, NONE),
/* D5 : SRCCLKREQ0# ==> SSD_CLKREQ_ODL */
PAD_CFG_NF(GPP_D5, NONE, DEEP, NF1),
/* D9 : ISH_SPI_CS# ==> NC */
PAD_NC(GPP_D9, NONE),
/* D10 : ISH_SPI_CLK ==> NC */
@ -174,6 +174,27 @@ static const struct pad_config early_gpio_table[] = {
* B4 is programmed here so that it is sequenced after EN_PP3300_SSD.
*/
PAD_CFG_GPO(GPP_B4, 1, DEEP),
/* CPU PCIe VGPIO for PEG60 */
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_48, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_49, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_50, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_51, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_52, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_53, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_54, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_55, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_56, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_57, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_58, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_59, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_60, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_61, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_62, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_63, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_76, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_77, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_78, NONE, DEEP, NF1),
PAD_CFG_NF_VWEN(GPP_vGPIO_PCIE_79, NONE, DEEP, NF1),
};
const struct pad_config *variant_gpio_override_table(size_t *num)

View File

@ -221,6 +221,13 @@ chip soc/intel/alderlake
device generic 0 alias dptf_policy on end
end
end
device ref pcie4_0 on
# Enable CPU PCIE RP 1 using CLK 0
register "cpu_pcie_rp[CPU_RP(1)]" = "{
.clk_req = 0,
.clk_src = 0,
}"
end
device ref tbt_pcie_rp0 off end
device ref tbt_pcie_rp1 off end
device ref tbt_pcie_rp2 off end

View File

@ -1,6 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <console/console.h>
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <device/device.h>
@ -8,12 +7,10 @@
#include <southbridge/intel/bd82x6x/pch.h>
#include <southbridge/intel/common/gpio.h>
#include <ec/quanta/ene_kb3940q/ec.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include "ec.h"
#define WP_GPIO 6
#define DEVMODE_GPIO 54
#define FORCE_RECOVERY_MODE 0
#include "onboard.h"
void fill_lb_gpios(struct lb_gpios *gpios)
{
@ -42,23 +39,13 @@ int get_lid_switch(void)
return (ec_mem_read(EC_HW_GPI_STATUS) >> EC_GPI_LID_STAT_BIT) & 1;
}
/* FIXME: VBOOT reads this in ENV_ROMSTAGE. */
int get_recovery_mode_switch(void)
{
int ec_rec_mode = 0;
if (ENV_RAMSTAGE)
return (ec_mem_read(EC_CODE_STATE) == EC_COS_EC_RO);
if (FORCE_RECOVERY_MODE) {
printk(BIOS_DEBUG, "FORCING RECOVERY MODE.\n");
return 1;
}
if (ENV_RAMSTAGE) {
if (ec_mem_read(EC_CODE_STATE) == EC_COS_EC_RO)
ec_rec_mode = 1;
printk(BIOS_DEBUG, "RECOVERY MODE FROM EC: %x\n", ec_rec_mode);
}
return ec_rec_mode;
return 0;
}
static const struct cros_gpio cros_gpios[] = {

View File

@ -79,7 +79,7 @@ void mainboard_fill_pei_data(struct pei_data *pei_data)
.mchbar = CONFIG_FIXED_MCHBAR_MMIO_BASE,
.dmibar = CONFIG_FIXED_DMIBAR_MMIO_BASE,
.epbar = CONFIG_FIXED_EPBAR_MMIO_BASE,
.pciexbar = CONFIG_MMCONF_BASE_ADDRESS,
.pciexbar = CONFIG_ECAM_MMCONF_BASE_ADDRESS,
.smbusbar = CONFIG_FIXED_SMBUS_IO_BASE,
.wdbbar = 0x4000000,
.wdbsize = 0x1000,

View File

@ -16,4 +16,8 @@
/* 0x00: White LINK LED and Amber ACTIVE LED */
#define BUTTERFLY_NIC_LED_MODE 0x00
/* SPI write protect, active low */
#define WP_GPIO 6
#endif

View File

@ -22,6 +22,8 @@ config MAINBOARD_DIR
config MAINBOARD_PART_NUMBER
string
default "Corsola" if BOARD_GOOGLE_CORSOLA
default "Kingler" if BOARD_GOOGLE_KINGLER
default "Krabby" if BOARD_GOOGLE_KRABBY
config BOOT_DEVICE_SPI_FLASH_BUS
int

View File

@ -3,3 +3,11 @@ comment "Corsola"
config BOARD_GOOGLE_CORSOLA
bool "-> Corsola"
select BOARD_GOOGLE_CORSOLA_COMMON
config BOARD_GOOGLE_KINGLER
bool "-> Kingler"
select BOARD_GOOGLE_CORSOLA_COMMON
config BOARD_GOOGLE_KRABBY
bool "-> Krabby"
select BOARD_GOOGLE_CORSOLA_COMMON

View File

@ -8,9 +8,11 @@ verstage-y += reset.c
romstage-y += memlayout.ld
romstage-y += chromeos.c
romstage-y += regulator.c
romstage-y += romstage.c
ramstage-y += memlayout.ld
ramstage-y += chromeos.c
ramstage-y += mainboard.c
ramstage-y += regulator.c
ramstage-y += reset.c

View File

@ -1,9 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <device/device.h>
#include <soc/usb.h>
static void mainboard_init(struct device *dev)
{
setup_usb_host();
}
static void mainboard_enable(struct device *dev)

View File

@ -0,0 +1,46 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <assert.h>
#include <console/console.h>
#include <soc/mt6366.h>
#include <soc/regulator.h>
#define REGULATOR_NOT_SUPPORT -1
static const int regulator_id[] = {
[MTK_REGULATOR_VDD1] = REGULATOR_NOT_SUPPORT,
[MTK_REGULATOR_VDD2] = REGULATOR_NOT_SUPPORT,
[MTK_REGULATOR_VDDQ] = MT6366_VDDQ,
[MTK_REGULATOR_VMDDR] = REGULATOR_NOT_SUPPORT,
[MTK_REGULATOR_VCORE] = MT6366_VCORE,
[MTK_REGULATOR_VCC] = REGULATOR_NOT_SUPPORT,
[MTK_REGULATOR_VCCQ] = REGULATOR_NOT_SUPPORT,
[MTK_REGULATOR_VDRAM1] = MT6366_VDRAM1,
[MTK_REGULATOR_VMCH] = MT6366_VMCH,
[MTK_REGULATOR_VMC] = MT6366_VMC,
};
_Static_assert(ARRAY_SIZE(regulator_id) == MTK_REGULATOR_NUM, "regulator_id size error");
void mainboard_set_regulator_vol(enum mtk_regulator regulator,
uint32_t voltage_uv)
{
assert(regulator < MTK_REGULATOR_NUM);
if (regulator_id[regulator] < 0) {
printk(BIOS_ERR, "Invalid regulator ID: %d\n", regulator);
return;
}
mt6366_set_voltage(regulator_id[regulator], voltage_uv);
}
uint32_t mainboard_get_regulator_vol(enum mtk_regulator regulator)
{
assert(regulator < MTK_REGULATOR_NUM);
if (regulator_id[regulator] < 0) {
printk(BIOS_ERR, "Invalid regulator ID: %d\n", regulator);
return 0;
}
return mt6366_get_voltage(regulator_id[regulator]);
}

View File

@ -1,7 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/stages.h>
#include <soc/mt6366.h>
void platform_romstage_main(void)
{
mt6366_init();
}

View File

@ -5,6 +5,7 @@
#include <device/mmio.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
/* The WP status pin lives on MF_ISH_GPIO_4 */

View File

@ -5,6 +5,7 @@
#include <ec/google/chromeec/ec_commands.h>
#include <soc/cpu.h>
#include <soc/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <bootmode.h>

View File

@ -150,6 +150,7 @@ config BOARD_GOOGLE_BUGZZY
select BASEBOARD_DEDEDE_LAPTOP
select DRIVERS_GENERIC_MAX98357A
select DRIVERS_I2C_DA7219
select GEO_SAR_ENABLE if CHROMEOS_WIFI_SAR
config BOARD_GOOGLE_CORORI
bool "-> Corori"

View File

@ -5,6 +5,7 @@
#include <bootmode.h>
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
void fill_lb_gpios(struct lb_gpios *gpios)

View File

@ -2,7 +2,7 @@
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
/* Pad configuration in ramstage*/

View File

@ -63,12 +63,18 @@ chip soc/intel/jasperlake
},
.i2c[1] = {
.speed = I2C_SPEED_FAST,
.rise_time_ns = 133,
.fall_time_ns = 29,
},
.i2c[2] = {
.speed = I2C_SPEED_FAST,
.rise_time_ns = 227,
.fall_time_ns = 9,
},
.i2c[3] = {
.speed = I2C_SPEED_FAST,
.rise_time_ns = 91,
.fall_time_ns = 2,
},
.i2c[4] = {
.speed = I2C_SPEED_FAST,
@ -114,10 +120,10 @@ chip soc/intel/jasperlake
}
}"
register "controls.charger_perf" = "{
[0] = { 55, 3500 },
[1] = { 47, 3000 },
[2] = { 39, 2500 },
[3] = { 31, 2000 },
[0] = { 255, 2800 },
[1] = { 39, 2500 },
[2] = { 31, 2000 },
[3] = { 23, 1500 },
}"
device generic 0 on end
end

View File

@ -1,9 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <ec/google/chromeec/ec.h>
#include <fw_config.h>
#include <sar.h>
enum {
GALTIC_SKU_START = 0x120000,
GALTIC_SKU_END = 0x12ffff,
GALITH_SKU_START = 0x130000,
GALITH_SKU_END = 0x13ffff,
GALLOP_SKU_START = 0x150000,
GALLOP_SKU_END = 0x15ffff,
GALTIC360_SKU_START = 0x260000,
GALTIC360_SKU_END = 0x26ffff,
GALITH360_SKU_START = 0x270000,
GALITH360_SKU_END = 0x27ffff,
};
const char *get_wifi_sar_cbfs_filename(void)
{
return "wifi_sar-galtic.hex";
uint32_t sku_id = google_chromeec_get_board_sku();
if (sku_id >= GALTIC_SKU_START && sku_id <= GALTIC_SKU_END)
return "wifi_sar-galtic.hex";
if (sku_id >= GALTIC360_SKU_START && sku_id <= GALTIC360_SKU_END)
return "wifi_sar-galtic360.hex";
if (sku_id >= GALITH360_SKU_START && sku_id <= GALITH360_SKU_END)
return "wifi_sar-galith360.hex";
return WIFI_SAR_CBFS_DEFAULT_FILENAME;
}

View File

@ -19,6 +19,7 @@ fw_config
option TS_RAYD_0001 4
option TS_WDHT0002 5
option TS_GTCH7503 6
option TS_ELAN_9004 7
end
field AUDIO_CODEC_SOURCE 49 51
option AUDIO_CODEC_UNPROVISIONED 0
@ -227,6 +228,26 @@ chip soc/intel/jasperlake
probe TS_SOURCE TS_ELAN_6918
end
end
chip drivers/i2c/hid
register "generic.hid" = ""ELAN9004""
register "generic.desc" = ""ELAN Touchscreen""
register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_D4_IRQ)"
register "generic.probed" = "1"
register "generic.reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_D5)"
register "generic.reset_delay_ms" = "20"
register "generic.reset_off_delay_ms" = "2"
register "generic.stop_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_A11)"
register "generic.stop_delay_ms" = "280"
register "generic.stop_off_delay_ms" = "2"
register "generic.enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D6)"
register "generic.enable_delay_ms" = "1"
register "generic.has_power_resource" = "1"
register "generic.disable_gpio_export_in_crs" = "1"
register "hid_desc_reg_offset" = "0x01"
device i2c 10 on
probe TS_SOURCE TS_ELAN_9004
end
end
chip drivers/i2c/hid
register "generic.hid" = ""WDHT0002""
register "generic.desc" = ""WDT Touchscreen""

View File

@ -243,15 +243,28 @@ chip soc/intel/jasperlake
register "hid" = ""10EC1015""
register "desc" = ""Realtek SPK AMP L""
register "uid" = "0"
device i2c 28 on end
device i2c 28 on
probe AUDIO_AMP UNPROVISIONED
probe AUDIO_AMP RT1015_I2C
end
end
chip drivers/i2c/generic
register "hid" = ""10EC1015""
register "desc" = ""Realtek SPK AMP R""
register "uid" = "1"
device i2c 29 on end
device i2c 29 on
probe AUDIO_AMP UNPROVISIONED
probe AUDIO_AMP RT1015_I2C
end
end
end
device pci 1f.3 on end # Intel HDA
device pci 1f.3 on
chip drivers/generic/alc1015
register "sdb" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D17)"
device generic 0 on
probe AUDIO_AMP RT1015P_AUTO
end
end
end # Intel HDA
end
end

View File

@ -8,6 +8,7 @@
#include <gpio.h>
#include <soc/gpio.h>
#include <variant/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <security/tpm/tss.h>
#include <device/device.h>
@ -32,24 +33,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
static int cros_get_gpio_value(int type)
int get_write_protect_state(void)
{
const struct cros_gpio *cros_gpios;
size_t i, num_gpios = 0;
return gpio_get(GPIO_PCH_WP);
}
cros_gpios = variant_cros_gpios(&num_gpios);
for (i = 0; i < num_gpios; i++) {
const struct cros_gpio *gpio = &cros_gpios[i];
if (gpio->type == type) {
int state = gpio_get(gpio->gpio_num);
if (gpio->polarity == CROS_GPIO_ACTIVE_LOW)
return !state;
else
return state;
}
}
return 0;
static bool raw_get_recovery_mode_switch(void)
{
return !gpio_get(GPIO_REC_MODE);
}
void mainboard_chromeos_acpi_generate(void)
@ -62,11 +53,6 @@ void mainboard_chromeos_acpi_generate(void)
chromeos_acpi_gpio_generate(cros_gpios, num_gpios);
}
int get_write_protect_state(void)
{
return cros_get_gpio_value(CROS_GPIO_WP);
}
int get_recovery_mode_switch(void)
{
static enum rec_mode_state saved_rec_mode = REC_MODE_UNINITIALIZED;
@ -92,7 +78,7 @@ int get_recovery_mode_switch(void)
state = REC_MODE_REQUESTED;
/* Read state from the GPIO controlled by servo. */
if (cros_get_gpio_value(CROS_GPIO_REC))
if (raw_get_recovery_mode_switch())
state = REC_MODE_REQUESTED;
/* Store the state in case this is called again in verstage. */

View File

@ -6,6 +6,7 @@
#include <gpio.h>
#include <soc/gpio.h>
#include <variant/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <security/tpm/tss.h>
#include <device/device.h>
@ -30,24 +31,14 @@ void fill_lb_gpios(struct lb_gpios *gpios)
lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
}
static int cros_get_gpio_value(int type)
int get_write_protect_state(void)
{
const struct cros_gpio *cros_gpios;
size_t i, num_gpios = 0;
return gpio_get(GPP_E15);
}
cros_gpios = variant_cros_gpios(&num_gpios);
for (i = 0; i < num_gpios; i++) {
const struct cros_gpio *gpio = &cros_gpios[i];
if (gpio->type == type) {
int state = gpio_get(gpio->gpio_num);
if (gpio->polarity == CROS_GPIO_ACTIVE_LOW)
return !state;
else
return state;
}
}
return 0;
static bool raw_get_recovery_mode_switch(void)
{
return !gpio_get(GPP_E8);
}
void mainboard_chromeos_acpi_generate(void)
@ -60,11 +51,6 @@ void mainboard_chromeos_acpi_generate(void)
chromeos_acpi_gpio_generate(cros_gpios, num_gpios);
}
int get_write_protect_state(void)
{
return cros_get_gpio_value(CROS_GPIO_WP);
}
int get_recovery_mode_switch(void)
{
static enum rec_mode_state saved_rec_mode = REC_MODE_UNINITIALIZED;
@ -90,7 +76,7 @@ int get_recovery_mode_switch(void)
state = REC_MODE_REQUESTED;
/* Read state from the GPIO controlled by servo. */
if (cros_get_gpio_value(CROS_GPIO_REC))
if (raw_get_recovery_mode_switch())
state = REC_MODE_REQUESTED;
/* Store the state in case this is called again in verstage. */

View File

@ -4,6 +4,7 @@
#include <boot/coreboot_tables.h>
#include <gpio.h>
#include <soc/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include "gpio.h"

View File

@ -5,6 +5,7 @@
#include <gpio.h>
#include <baseboard/variants.h>
#include <soc/gpio.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
#include <variant/gpio.h>

View File

@ -2,7 +2,7 @@
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
#include <types.h>
#include <vendorcode/google/chromeos/chromeos.h>
/* Pad configuration in ramstage */

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