Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kudu6 #86

Draft
wants to merge 55 commits into
base: system76
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
9c1f72a
submodules: Use absolute paths
crawfxrd Dec 21, 2021
fd7e5f8
mb/system76/*: Apply custom backlight levels
crawfxrd Sep 17, 2021
98b27e9
drivers/gfx/nvidia: Add driver for NVIDIA Optimus
crawfxrd Aug 18, 2021
c111e46
mb/system76/*: Enable dGPUs
crawfxrd Sep 17, 2021
98513ad
soc/intel/tigerlake: Remove write to IOP TCSS_IN_D3
jackpot51 Sep 8, 2021
0e0b593
intel/block/pcie/rtd3: ACPI debug messages
jackpot51 Dec 29, 2020
f14f41e
intel/block/pcie/rtd3: Also implement _PR3
jackpot51 Dec 29, 2020
0d96fb3
soc/intel: Add Cometlake-H/S Q0 (10+2) CPU
jackpot51 Sep 27, 2021
4cb1593
mb/system76: select TPM_RDRESP_NEED_DELAY
jackpot51 Sep 27, 2021
7bcc106
mb/system76/lemp9: Fix TPM error message
jackpot51 Mar 1, 2021
36c44fb
mb/system76: TGL-H: Disable D3cold for TCSS
crawfxrd Nov 15, 2021
872c49b
src/mb/system76/*: Shrink CMOS option table 1 byte
crawfxrd Nov 22, 2021
afcfa1c
mb/system76/addw1: Increase max CPUs to 16
crawfxrd Dec 7, 2021
4b657de
mb/system76/bonw14: Enable TAS5825M smart amp
crawfxrd Jan 26, 2022
149f6cb
mb/system76: Configure I2C HID IRQs as level triggered
crawfxrd Jan 24, 2022
85b2e0d
mb/system76: TGL-U: Disable AER for CPU PCIe RP
crawfxrd May 5, 2022
f1a67f8
include/smbios.h: Add PCIe Gen5 slot type definitions
miczyg1 Apr 15, 2022
19e658a
soc/alderlake: Add ADL-S PCIe support
miczyg1 Apr 15, 2022
b5cdcb1
soc/intel/alderlake/hsphy: Add support for HSPHY firmware loading
miczyg1 May 5, 2022
c24f2ed
mb/system76/addw1: Disable SaOcSupport to eliminate hangs with 3200MT…
jackpot51 May 13, 2022
6e9ec53
Refactor GC6 support for all boards
jackpot51 May 16, 2022
dfbcfaa
mb/system76/gaze17: Add new mainboard
jackpot51 May 16, 2022
2479c7c
mb/system76/gaze17: Add pin muxing
jackpot51 May 25, 2022
90ac4fe
mb/system76/gaze17: Let FSP set TPM IRQ
jackpot51 May 25, 2022
c419da8
mb/system76/gaze17: WIP: S0ix
crawfxrd May 25, 2022
7e4221e
mb/system76/gaze17: Enable SATA DEVSLP
jackpot51 May 26, 2022
4d2a483
mb/system76/gaze17: Enable ME by default
jackpot51 May 26, 2022
cf0a4fc
mb/system76/gaze17: Disable S3 suspend
jackpot51 May 26, 2022
8482a83
soc/intel/alderlake: Add SLP_S0 residency register and enable LPIT su…
jackpot51 May 26, 2022
8805014
soc/intel/alderlake: Hide PMC and IOM devices
jackpot51 May 26, 2022
f0b04c0
mb/system76/gaze17: Do not enable GNA
jackpot51 May 26, 2022
63367e4
soc/intel/alderlake: Set FSP-S GnaEnable based on devicetree
jackpot51 May 26, 2022
334f6f9
ec/system76: Hide ACPI device
jackpot51 May 26, 2022
fbd1e73
soc/intel/tgl: Add PEG devices to IRQ constraints
crawfxrd May 25, 2022
7e0a708
mb/system76/gaze17: Enable DisplayPort audio
jackpot51 Jun 6, 2022
1957255
soc/intel/alderlake/fsp_params.c: Fill PCI SSID parameters
miczyg1 Apr 25, 2022
137b12a
mb/system76/adl-p: Add Darter Pro 8
crawfxrd Jun 21, 2022
bfa4225
mb/system76/adl-p: Fix SATA detection
crawfxrd Jun 23, 2022
67a59cb
mb/system76/adl-p: Add Lemur Pro 11 as a variant
crawfxrd Jun 22, 2022
d33dcc7
mb/system76/adl-p: Fix booting FSP debug build
crawfxrd Jun 27, 2022
b734f0f
soc/intel/adl: Set memory-down to CH0
crawfxrd Jun 28, 2022
19e85a3
mb/system76/adl-p: lemp11: Fix power config
crawfxrd Jul 5, 2022
3502c82
WIP
jackpot51 Nov 2, 2021
1cfef49
Add more AMD firmware settings
jackpot51 Nov 2, 2021
83424ce
Use LPC
jackpot51 Nov 2, 2021
1165fa9
Add APCB
jackpot51 Nov 2, 2021
6a26d0d
Add amdfw.cfg
jackpot51 Nov 3, 2021
ee392ba
Use DDR4 ABL0
jackpot51 Nov 3, 2021
7dd9a88
Set correct EFS flags
jackpot51 Nov 3, 2021
86033d3
Load MP2 firmware and delete PSP boot loader AB
jackpot51 Nov 4, 2021
cd0254d
Add APCB backup
jackpot51 Nov 4, 2021
b356357
Remove bootloader whitelist
jackpot51 Nov 9, 2021
1bcce6f
Add other APCB sources
jackpot51 Nov 9, 2021
ceb6908
soc/amd/cezanne: enable LPC decodes if platform uses LPC
jackpot51 Nov 9, 2021
45fcc5b
Remove ESPI config and enable LPC decodes for EC command and debug
jackpot51 Nov 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions src/drivers/gfx/nvidia/Kconfig
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions src/drivers/gfx/nvidia/Makefile.inc
Original file line number Diff line number Diff line change
@@ -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
96 changes: 96 additions & 0 deletions src/drivers/gfx/nvidia/acpi/coffeelake.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* NVIDIA GC6 on CFL and CML CPU PCIe ports */

// Memory mapped PCI express config space
OperationRegion (PCIC, SystemMemory, CONFIG_ECAM_MMCONF_BASE_ADDRESS + (CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 15), 0x1000)

Field (PCIC, ByteAcc, NoLock, Preserve) {
PVID, 16,
PDID, 16,

Offset (0x248),
, 7,
L23E, 1, /* L23_Rdy Entry Request */
L23R, 1, /* L23_Rdy to Detect Transition */

Offset (0xC20),
, 4,
P0AP, 2, /* Additional power savings */

Offset (0xC38),
, 3,
P0RM, 1, /* Robust squelch mechanism */
}

// Enter L23
Method (DL23, 0, Serialized) {
Printf(" GPU PORT DL23 START")

L23E = 1
Sleep (16)
Local0 = 0
While (L23E) {
If ((Local0 > 4)) {
Break
}

Sleep (16)
Local0++
}

P0RM = 1
P0AP = 3

Printf(" GPU PORT DL23 FINISH")
}

// Exit L23
Method (L23D, 0, Serialized) {
Printf(" GPU PORT L23D START")

L23R = 1
Sleep (16)
Local0 = 0
While (L23R) {
If ((Local0 > 4)) {
Break
}

Sleep (16)
Local0++
}

P0RM = 0
P0AP = 0

Printf(" GPU PORT L23D FINISH")
}

// Main power resource
PowerResource (PWRR, 0, 0) {
Name (_STA, 1)

Method (_ON, 0, Serialized) {
Printf("GPU PORT PWRR._ON")

^^DEV0._ON()

_STA = 1
}

Method (_OFF, 0, Serialized) {
Printf("GPU PORT PWRR._OFF")

^^DEV0._OFF()

_STA = 0
}
}

// Power resources for entering D0
Name (_PR0, Package () { PWRR })

// Power resources for entering D3
Name (_PR3, Package () { PWRR })

#include "common/gpu.asl"
22 changes: 22 additions & 0 deletions src/drivers/gfx/nvidia/acpi/common/dsm.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#define NV_ERROR_SUCCESS 0x0
#define NV_ERROR_UNSPECIFIED 0x80000001
#define NV_ERROR_UNSUPPORTED 0x80000002

#include "nvjt.asl"

Method (_DSM, 4, Serialized) {
Printf("GPU _DSM")
If (Arg0 == ToUUID (JT_DSM_GUID)) {
If (ToInteger(Arg1) >= JT_REVISION_ID_MIN) {
Return (NVJT(Arg2, Arg3))
} Else {
Printf(" Unsupported JT revision: %o", SFST(Arg1))
Return (NV_ERROR_UNSUPPORTED)
}
} Else {
Printf(" Unsupported GUID: %o", IDST(Arg0))
Return (NV_ERROR_UNSPECIFIED)
}
}
9 changes: 9 additions & 0 deletions src/drivers/gfx/nvidia/acpi/common/gpu.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */

Device (DEV0) {
Name(_ADR, 0x00000000)

#include "utility.asl"
#include "dsm.asl"
#include "power.asl"
}
152 changes: 152 additions & 0 deletions src/drivers/gfx/nvidia/acpi/common/nvjt.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#define JT_DSM_GUID "CBECA351-067B-4924-9CBD-B46B00B86F34"
#define JT_REVISION_ID_MIN 0x00000100
#define JT_REVISION_ID_MAX 0x00000200
#define JT_FUNC_SUPPORT 0x00000000
#define JT_FUNC_CAPS 0x00000001
#define JT_FUNC_POWERCONTROL 0x00000003

//TODO: SMI traps and EGIN/XCLM
#define JT_GPC_GSS 0 // Get current GPU GCx sleep status
#define JT_GPC_EGNS 1 // Enter GC6 without self-refresh
#define JT_GPC_EGIS 2 // Enter GC6 with self-refresh
#define JT_GPC_XGXS 3 // Exit GC6 and stop self-refresh
#define JT_GPC_XGIS 4 // Exit GC6 for self-refresh update

#define JT_DFGC_NONE 0 // Handle request immediately
#define JT_DFGC_DEFER 1 // Defer GPC and GPCX
//TODO #define JT_DFGC_CLEAR 2 // Clear pending requests

// Deferred GC6 enter/exit until D3-cold (saved DFGC)
Name(DFEN, 0)

// Deferred GC6 enter control (saved GPC)
Name(DFCI, 0)

// Deferred GC6 exit control (saved GPCX)
Name(DFCO, 0)

Method (NVJT, 2, Serialized) {
Printf(" GPU NVJT")
Switch (ToInteger(Arg0)) {
Case (JT_FUNC_SUPPORT) {
Printf(" Supported Functions")
Return(ITOB(
(1 << JT_FUNC_SUPPORT) |
(1 << JT_FUNC_CAPS) |
(1 << JT_FUNC_POWERCONTROL)
))
}
Case (JT_FUNC_CAPS) {
Printf(" Capabilities")
Return(ITOB(
(1 << 0) | // G-SYNC NSVR power-saving features are enabled
(1 << 1) | // NVSR disabled
(2 << 3) | // Panel power and backlight are on the suspend rail
(0 << 5) | // self-refresh controller remains powered while panel is powered
(0 << 6) | // FB is not on the suspend rail but is powered on in GC6
(0 << 8) | // Combined power rail for all GPUs
(0 << 10) | // External SPI ROM
(1 << 11) | // No SMI handler for kernel panic exit while in GC6
(0 << 12) | // Supports notify on GC6 state done
(1 << 13) | // Support deferred GC6
(1 << 14) | // Support fine-grained root port control
(2 << 15) | // GC6 version is GC6-R
(0 << 17) | // GC6 exit ISR is not supported
(0 << 18) | // GC6 self wakeup not supported
(JT_REVISION_ID_MAX << 20) // Highest revision supported
))
}
Case (JT_FUNC_POWERCONTROL) {
Printf(" Power Control: %o", SFST(Arg1))

CreateField (Arg1, 0, 3, GPC) // GPU power control
CreateField (Arg1, 4, 1, PPC) // Panel power control
CreateField (Arg1, 14, 2, DFGC) // Defer GC6 enter/exit until D3 cold
CreateField (Arg1, 16, 3, GPCX) // Deferred GC6 exit control

// Save deferred GC6 request
If ((ToInteger(GPC) != 0) || (ToInteger(DFGC) != 0)) {
DFEN = DFGC
DFCI = GPC
DFCO = GPCX
}

// Buffer to cache current state
Name (JTBF, Buffer (4) { 0, 0, 0, 0 })
CreateField (JTBF, 0, 3, CGCS) // Current GC state
CreateField (JTBF, 3, 1, CGPS) // Current GPU power status
CreateField (JTBF, 7, 1, CPSS) // Current panel and SRC state (0 when on)

// If doing deferred GC6 request, return now
If (ToInteger(DFGC) != 0) {
CGCS = 1
CGPS = 1
Return (JTBF)
}

// Apply requested state
Switch (ToInteger(GPC)) {
Case (JT_GPC_GSS) {
Printf(" Get current GPU GCx sleep status")
//TODO: include transitions!
If (GTXS(DGPU_RST_N)) {
// GPU powered on
CGCS = 1
CGPS = 1
} ElseIf (GTXS(DGPU_PWR_EN)) {
// GPU powered off, GC6
CGCS = 3
CGPS = 0
} Else {
// GPU powered off, D3 cold
CGCS = 2
CGPS = 0
}
}
Case (JT_GPC_EGNS) {
Printf(" Enter GC6 without self-refresh")
GC6I()
CPSS = 1
}
Case (JT_GPC_EGIS) {
Printf(" Enter GC6 with self-refresh")
GC6I()
If (ToInteger(PPC) == 0) {
CPSS = 0
}
}
Case (JT_GPC_XGXS) {
Printf(" Exit GC6 and stop self-refresh")
GC6O()

CGCS = 1
CGPS = 1
If (ToInteger(PPC) != 0) {
CPSS = 0
}
}
Case (JT_GPC_XGIS) {
Printf(" Exit GC6 for self-refresh update")
GC6O()

CGCS = 1
CGPS = 1
If (ToInteger(PPC) != 0) {
CPSS = 0
}
}
Default {
Printf(" Unsupported GPU power control: %o", SFST(GPC))
}
}

Return (JTBF)
}
Default {
Printf(" Unsupported function: %o", SFST(Arg0))
Return (NV_ERROR_UNSUPPORTED)
}
}
}
Loading