Compare commits
2 Commits
upstream-8
...
upstream-8
Author | SHA1 | Date | |
---|---|---|---|
|
d87fb53d73 | ||
|
67a7ee7eb8 |
@@ -1,38 +0,0 @@
|
|||||||
config DRIVERS_GFX_NVIDIA
|
|
||||||
bool
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Support for NVIDIA Optimus graphics
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_BRIDGE
|
|
||||||
hex "PCI bridge for the GPU device"
|
|
||||||
default 0x01
|
|
||||||
depends on DRIVERS_GFX_NVIDIA
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
depends on DRIVERS_GFX_NVIDIA
|
|
||||||
bool
|
|
||||||
default n
|
|
||||||
help
|
|
||||||
Support for NVIDIA Dynamic Boost
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_TPP
|
|
||||||
int "Total processor power offset from default TGP in watts"
|
|
||||||
default 45
|
|
||||||
depends on DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
help
|
|
||||||
This identifies the available power for the CPU or GPU boost
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MIN
|
|
||||||
int "Minimum TGP offset from default TGP in watts"
|
|
||||||
default 0
|
|
||||||
depends on DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
help
|
|
||||||
This is used to transfer power from the GPU to the CPU
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MAX
|
|
||||||
int "Maximum TGP offset from default TGP in watts"
|
|
||||||
default 0
|
|
||||||
depends on DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
help
|
|
||||||
This is used to transfer power from the CPU to the GPU
|
|
@@ -1,5 +0,0 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0-only
|
|
||||||
|
|
||||||
romstage-$(CONFIG_DRIVERS_GFX_NVIDIA) += romstage.c
|
|
||||||
|
|
||||||
ramstage-$(CONFIG_DRIVERS_GFX_NVIDIA) += nvidia.c
|
|
@@ -1,96 +0,0 @@
|
|||||||
/* 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"
|
|
@@ -1,30 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#define NV_ERROR_SUCCESS 0x0
|
|
||||||
#define NV_ERROR_UNSPECIFIED 0x80000001
|
|
||||||
#define NV_ERROR_UNSUPPORTED 0x80000002
|
|
||||||
|
|
||||||
#include "gps.asl"
|
|
||||||
#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)
|
|
||||||
}
|
|
||||||
} ElseIf (Arg0 == ToUUID (GPS_DSM_GUID)) {
|
|
||||||
If (ToInteger(Arg1) == GPS_REVISION_ID) {
|
|
||||||
Return (GPS(Arg2, Arg3))
|
|
||||||
} Else {
|
|
||||||
Printf(" Unsupported GPS revision: %o", SFST(Arg1))
|
|
||||||
Return (NV_ERROR_UNSUPPORTED)
|
|
||||||
}
|
|
||||||
} Else {
|
|
||||||
Printf(" Unsupported GUID: %o", IDST(Arg0))
|
|
||||||
Return (NV_ERROR_UNSPECIFIED)
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#define GPS_DSM_GUID "A3132D01-8CDA-49BA-A52E-BC9D46DF6B81"
|
|
||||||
#define GPS_REVISION_ID 0x00000200
|
|
||||||
#define GPS_FUNC_SUPPORT 0x00000000
|
|
||||||
#define GPS_FUNC_PSHARESTATUS 0x00000020
|
|
||||||
#define GPS_FUNC_PSHAREPARAMS 0x0000002A
|
|
||||||
|
|
||||||
Method(GPS, 2, Serialized) {
|
|
||||||
Printf(" GPU GPS")
|
|
||||||
Switch(ToInteger(Arg0)) {
|
|
||||||
Case(GPS_FUNC_SUPPORT) {
|
|
||||||
Printf(" Supported Functions")
|
|
||||||
Return(ITOB(
|
|
||||||
(1 << GPS_FUNC_SUPPORT) |
|
|
||||||
(1 << GPS_FUNC_PSHARESTATUS) |
|
|
||||||
(1 << GPS_FUNC_PSHAREPARAMS)
|
|
||||||
))
|
|
||||||
}
|
|
||||||
Case(GPS_FUNC_PSHARESTATUS) {
|
|
||||||
Printf(" Power Share Status")
|
|
||||||
Return(ITOB(0))
|
|
||||||
}
|
|
||||||
Case(GPS_FUNC_PSHAREPARAMS) {
|
|
||||||
Printf(" Power Share Parameters")
|
|
||||||
|
|
||||||
CreateField(Arg1, 0, 4, QTYP) // Query type
|
|
||||||
|
|
||||||
Name(GPSP, Buffer(36) { 0x00 })
|
|
||||||
CreateDWordField(GPSP, 0, RSTS) // Response status
|
|
||||||
CreateDWordField(GPSP, 4, VERS) // Version
|
|
||||||
|
|
||||||
// Set query type of response
|
|
||||||
RSTS = QTYP
|
|
||||||
// Set version of response
|
|
||||||
VERS = 0x00010000
|
|
||||||
|
|
||||||
Switch(ToInteger(QTYP)) {
|
|
||||||
Case(0) {
|
|
||||||
Printf(" Request Current Information")
|
|
||||||
// No required information
|
|
||||||
Return(GPSP)
|
|
||||||
}
|
|
||||||
Case(1) {
|
|
||||||
Printf(" Request Supported Fields")
|
|
||||||
// Support GPU temperature field
|
|
||||||
RSTS |= (1 << 8)
|
|
||||||
Return(GPSP)
|
|
||||||
}
|
|
||||||
Case(2) {
|
|
||||||
Printf(" Request Current Limits")
|
|
||||||
// No required limits
|
|
||||||
Return(GPSP)
|
|
||||||
}
|
|
||||||
Default {
|
|
||||||
Printf(" Unknown Query: %o", SFST(QTYP))
|
|
||||||
Return(NV_ERROR_UNSUPPORTED)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Default {
|
|
||||||
Printf(" Unsupported function: %o", SFST(Arg0))
|
|
||||||
Return(NV_ERROR_UNSUPPORTED)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
Device (DEV0) {
|
|
||||||
Name(_ADR, 0x00000000)
|
|
||||||
|
|
||||||
#include "utility.asl"
|
|
||||||
#include "dsm.asl"
|
|
||||||
#include "power.asl"
|
|
||||||
}
|
|
||||||
|
|
||||||
#if CONFIG(DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST)
|
|
||||||
Scope (\_SB) {
|
|
||||||
Device(NPCF) {
|
|
||||||
#include "utility.asl"
|
|
||||||
#include "nvpcf.asl"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
@@ -1,152 +0,0 @@
|
|||||||
/* 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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,113 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#define NVPCF_DSM_GUID "36b49710-2483-11e7-9598-0800200c9a66"
|
|
||||||
#define NVPCF_REVISION_ID 0x00000200
|
|
||||||
#define NVPCF_ERROR_SUCCESS 0x0
|
|
||||||
#define NVPCF_ERROR_GENERIC 0x80000001
|
|
||||||
#define NVPCF_ERROR_UNSUPPORTED 0x80000002
|
|
||||||
#define NVPCF_FUNC_GET_SUPPORTED 0x00000000
|
|
||||||
#define NVPCF_FUNC_GET_STATIC_CONFIG_TABLES 0x00000001
|
|
||||||
#define NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS 0x00000002
|
|
||||||
|
|
||||||
Name(_HID, "NVDA0820")
|
|
||||||
|
|
||||||
Name(_UID, "NPCF")
|
|
||||||
|
|
||||||
Method(_DSM, 4, Serialized) {
|
|
||||||
Printf("NVPCF _DSM")
|
|
||||||
If (Arg0 == ToUUID(NVPCF_DSM_GUID)) {
|
|
||||||
If (ToInteger(Arg1) == NVPCF_REVISION_ID) {
|
|
||||||
Return(NPCF(Arg2, Arg3))
|
|
||||||
} Else {
|
|
||||||
Printf(" Unsupported NVPCF revision: %o", SFST(Arg1))
|
|
||||||
Return(NVPCF_ERROR_GENERIC)
|
|
||||||
}
|
|
||||||
} Else {
|
|
||||||
Printf(" Unsupported GUID: %o", IDST(Arg0))
|
|
||||||
Return(NVPCF_ERROR_GENERIC)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Method(NPCF, 2, Serialized) {
|
|
||||||
Printf(" NVPCF NPCF")
|
|
||||||
Switch(ToInteger(Arg0)) {
|
|
||||||
Case(NVPCF_FUNC_GET_SUPPORTED) {
|
|
||||||
Printf(" Supported Functions")
|
|
||||||
Return(ITOB(
|
|
||||||
(1 << NVPCF_FUNC_GET_SUPPORTED) |
|
|
||||||
(1 << NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) |
|
|
||||||
(1 << NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS)
|
|
||||||
))
|
|
||||||
}
|
|
||||||
Case(NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) {
|
|
||||||
Printf(" Get Static Config")
|
|
||||||
Return(Buffer(14) {
|
|
||||||
// Device table header
|
|
||||||
0x20, 0x03, 0x01,
|
|
||||||
// Intel + NVIDIA
|
|
||||||
0x00,
|
|
||||||
// Controller table header
|
|
||||||
0x23, 0x04, 0x05, 0x01,
|
|
||||||
// Dynamic boost controller
|
|
||||||
0x01,
|
|
||||||
// Supports DC
|
|
||||||
0x01,
|
|
||||||
// Reserved
|
|
||||||
0x00, 0x00, 0x00,
|
|
||||||
// Checksum
|
|
||||||
0xAD
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Case(NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS) {
|
|
||||||
Printf(" Update Dynamic Boost")
|
|
||||||
|
|
||||||
CreateField(Arg1, 0x28, 2, ICMD) // Input command
|
|
||||||
|
|
||||||
Name(PCFP, Buffer(49) {
|
|
||||||
// Table version
|
|
||||||
0x23,
|
|
||||||
// Table header size
|
|
||||||
0x05,
|
|
||||||
// Size of common status in bytes
|
|
||||||
0x10,
|
|
||||||
// Size of controller entry in bytes
|
|
||||||
0x1C,
|
|
||||||
// Other fields filled in later
|
|
||||||
})
|
|
||||||
CreateByteField(PCFP, 0x04, CCNT) // Controller count
|
|
||||||
CreateWordField(PCFP, 0x19, ATPP) // AC TPP offset
|
|
||||||
CreateWordField(PCFP, 0x1D, AMXP) // AC maximum TGP offset
|
|
||||||
CreateWordField(PCFP, 0x21, AMNP) // AC minimum TGP offset
|
|
||||||
|
|
||||||
Switch(ToInteger(ICMD)) {
|
|
||||||
Case(0) {
|
|
||||||
Printf(" Get Controller Params")
|
|
||||||
// Number of controllers
|
|
||||||
CCNT = 1
|
|
||||||
// AC total processor power offset from default TGP in 1/8 watt units
|
|
||||||
ATPP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_TPP << 3)
|
|
||||||
// AC maximum TGP offset from default TGP in 1/8 watt units
|
|
||||||
AMXP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MAX << 3)
|
|
||||||
// AC minimum TGP offset from default TGP in 1/8 watt units
|
|
||||||
AMNP = (CONFIG_DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MIN << 3)
|
|
||||||
Printf("PCFP: %o", SFST(PCFP))
|
|
||||||
Return(PCFP)
|
|
||||||
}
|
|
||||||
Case(1) {
|
|
||||||
Printf(" Set Controller Status")
|
|
||||||
//TODO
|
|
||||||
Printf("PCFP: %o", SFST(PCFP))
|
|
||||||
Return(PCFP)
|
|
||||||
}
|
|
||||||
Default {
|
|
||||||
Printf(" Unknown Input Command: %o", SFST(ICMD))
|
|
||||||
Return(NV_ERROR_UNSUPPORTED)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Default {
|
|
||||||
Printf(" Unsupported function: %o", SFST(Arg0))
|
|
||||||
Return(NVPCF_ERROR_UNSUPPORTED)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,120 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
//TODO: evaluate sleeps
|
|
||||||
|
|
||||||
OperationRegion (PCIC, PCI_Config, 0x00, 0xFF)
|
|
||||||
Field (PCIC, DwordAcc, NoLock, Preserve) {
|
|
||||||
Offset (0x40),
|
|
||||||
SSID, 32, // Subsystem vendor and product ID
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enter GC6
|
|
||||||
Method(GC6I, 0, Serialized) {
|
|
||||||
Printf(" GPU GC6I START")
|
|
||||||
|
|
||||||
// Enter L23
|
|
||||||
^^DL23()
|
|
||||||
Sleep(5)
|
|
||||||
|
|
||||||
// Put GPU into reset
|
|
||||||
Printf(" Put GPU into reset")
|
|
||||||
CTXS(DGPU_RST_N)
|
|
||||||
Sleep(5)
|
|
||||||
|
|
||||||
Printf(" GPU GC6I FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exit GC6
|
|
||||||
Method(GC6O, 0, Serialized) {
|
|
||||||
Printf(" GPU GC6O START")
|
|
||||||
|
|
||||||
// Bring GPU out of reset
|
|
||||||
Printf(" Bring GPU out of reset")
|
|
||||||
STXS(DGPU_RST_N)
|
|
||||||
Sleep(5)
|
|
||||||
|
|
||||||
// Exit L23
|
|
||||||
^^L23D()
|
|
||||||
Sleep(5)
|
|
||||||
|
|
||||||
Printf(" GPU GC6O FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
Method (_ON, 0, Serialized) {
|
|
||||||
Printf(" GPU _ON START")
|
|
||||||
|
|
||||||
If (DFEN == JT_DFGC_DEFER) {
|
|
||||||
Switch (ToInteger(DFCO)) {
|
|
||||||
Case (JT_GPC_XGXS) {
|
|
||||||
Printf(" Exit GC6 and stop self-refresh")
|
|
||||||
GC6O()
|
|
||||||
}
|
|
||||||
Default {
|
|
||||||
Printf(" Unsupported DFCO: %o", SFST(DFCO))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DFEN = JT_DFGC_NONE
|
|
||||||
} Else {
|
|
||||||
Printf(" Standard RTD3 power on")
|
|
||||||
STXS(DGPU_PWR_EN)
|
|
||||||
Sleep(5)
|
|
||||||
GC6O()
|
|
||||||
}
|
|
||||||
|
|
||||||
Printf(" GPU _ON FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
Method (_OFF, 0, Serialized) {
|
|
||||||
Printf(" GPU _OFF START")
|
|
||||||
|
|
||||||
If (DFEN == JT_DFGC_DEFER) {
|
|
||||||
Switch (ToInteger(DFCI)) {
|
|
||||||
Case (JT_GPC_EGNS) {
|
|
||||||
Printf(" Enter GC6 without self-refresh")
|
|
||||||
GC6I()
|
|
||||||
}
|
|
||||||
Case (JT_GPC_EGIS) {
|
|
||||||
Printf(" Enter GC6 with self-refresh")
|
|
||||||
GC6I()
|
|
||||||
}
|
|
||||||
Default {
|
|
||||||
Printf(" Unsupported DFCI: %o", SFST(DFCI))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DFEN = JT_DFGC_NONE
|
|
||||||
} Else {
|
|
||||||
Printf(" Standard RTD3 power off")
|
|
||||||
GC6I()
|
|
||||||
CTXS(DGPU_PWR_EN)
|
|
||||||
Sleep(5)
|
|
||||||
}
|
|
||||||
|
|
||||||
Printf(" GPU _OFF FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main power resource
|
|
||||||
PowerResource (PWRR, 0, 0) {
|
|
||||||
Name (_STA, 1)
|
|
||||||
|
|
||||||
Method (_ON, 0, Serialized) {
|
|
||||||
Printf("GPU PWRR._ON")
|
|
||||||
|
|
||||||
// Restore SSID
|
|
||||||
^^SSID = DGPU_SSID
|
|
||||||
Printf(" Restore SSID: %o", SFST(^^SSID))
|
|
||||||
|
|
||||||
_STA = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Method (_OFF, 0, Serialized) {
|
|
||||||
Printf("GPU PWRR._OFF")
|
|
||||||
|
|
||||||
_STA = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Power resources for entering D0
|
|
||||||
Name (_PR0, Package () { PWRR })
|
|
||||||
|
|
||||||
// Power resources for entering D3
|
|
||||||
Name (_PR3, Package () { PWRR })
|
|
@@ -1,63 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
// Convert a byte to a hex string, trimming extra parts
|
|
||||||
Method (BHEX, 1) {
|
|
||||||
Local0 = ToHexString(Arg0)
|
|
||||||
Return (Mid(Local0, SizeOf(Local0) - 2, 2))
|
|
||||||
}
|
|
||||||
|
|
||||||
// UUID to string
|
|
||||||
Method (IDST, 1) {
|
|
||||||
Local0 = ""
|
|
||||||
Fprintf(
|
|
||||||
Local0,
|
|
||||||
"%o%o%o%o-%o%o-%o%o-%o%o-%o%o%o%o%o%o",
|
|
||||||
BHEX(DerefOf(Arg0[3])),
|
|
||||||
BHEX(DerefOf(Arg0[2])),
|
|
||||||
BHEX(DerefOf(Arg0[1])),
|
|
||||||
BHEX(DerefOf(Arg0[0])),
|
|
||||||
BHEX(DerefOf(Arg0[5])),
|
|
||||||
BHEX(DerefOf(Arg0[4])),
|
|
||||||
BHEX(DerefOf(Arg0[7])),
|
|
||||||
BHEX(DerefOf(Arg0[6])),
|
|
||||||
BHEX(DerefOf(Arg0[8])),
|
|
||||||
BHEX(DerefOf(Arg0[9])),
|
|
||||||
BHEX(DerefOf(Arg0[10])),
|
|
||||||
BHEX(DerefOf(Arg0[11])),
|
|
||||||
BHEX(DerefOf(Arg0[12])),
|
|
||||||
BHEX(DerefOf(Arg0[13])),
|
|
||||||
BHEX(DerefOf(Arg0[14])),
|
|
||||||
BHEX(DerefOf(Arg0[15]))
|
|
||||||
)
|
|
||||||
Return (Local0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Safe hex conversion, checks type first
|
|
||||||
Method (SFST, 1) {
|
|
||||||
Local0 = ObjectType(Arg0)
|
|
||||||
If (Local0 == 1 || Local0 == 2 || Local0 == 3) {
|
|
||||||
Return (ToHexString(Arg0))
|
|
||||||
} Else {
|
|
||||||
Return (Concatenate("Type: ", Arg0))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert from 4-byte buffer to 32-bit integer
|
|
||||||
Method (BTOI, 1) {
|
|
||||||
Return(
|
|
||||||
DerefOf(Arg0[0]) |
|
|
||||||
(DerefOf(Arg0[1]) << 8) |
|
|
||||||
(DerefOf(Arg0[2]) << 16) |
|
|
||||||
(DerefOf(Arg0[3]) << 24)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert from 32-bit integer to 4-byte buffer
|
|
||||||
Method (ITOB, 1) {
|
|
||||||
Local0 = Buffer(4) { 0, 0, 0, 0 }
|
|
||||||
Local0[0] = Arg0 & 0xFF
|
|
||||||
Local0[1] = (Arg0 >> 8) & 0xFF
|
|
||||||
Local0[2] = (Arg0 >> 16) & 0xFF
|
|
||||||
Local0[3] = (Arg0 >> 24) & 0xFF
|
|
||||||
Return (Local0)
|
|
||||||
}
|
|
@@ -1,140 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
/* NVIDIA GC6 on (TGL and ADL) (CPU and PCH) PCIe ports */
|
|
||||||
|
|
||||||
// Port mapped PCI express config space
|
|
||||||
OperationRegion (PCIC, PCI_Config, 0x00, 0xFF)
|
|
||||||
|
|
||||||
Field (PCIC, AnyAcc, NoLock, Preserve) {
|
|
||||||
Offset(0x52), /* LSTS - Link Status Register */
|
|
||||||
, 13,
|
|
||||||
LASX, 1, /* 0, Link Active Status */
|
|
||||||
|
|
||||||
Offset(0x60), /* RSTS - Root Status Register */
|
|
||||||
, 16,
|
|
||||||
PSPX, 1, /* 16, PME Status */
|
|
||||||
|
|
||||||
Offset(0xD8), /* 0xD8, MPC - Miscellaneous Port Configuration Register */
|
|
||||||
, 30,
|
|
||||||
HPEX, 1, /* 30, Hot Plug SCI Enable */
|
|
||||||
PMEX, 1, /* 31, Power Management SCI Enable */
|
|
||||||
|
|
||||||
Offset (0xE0), /* 0xE0, SPR - Scratch Pad Register */
|
|
||||||
SCB0, 1, /* Scratch bit 0 */
|
|
||||||
|
|
||||||
Offset(0xE2), /* 0xE2, RPPGEN - Root Port Power Gating Enable */
|
|
||||||
, 2,
|
|
||||||
L23E, 1, /* 2, L23_Rdy Entry Request (L23ER) */
|
|
||||||
L23R, 1, /* 3, L23_Rdy to Detect Transition (L23R2DT) */
|
|
||||||
}
|
|
||||||
|
|
||||||
Field (PCIC, AnyAcc, NoLock, WriteAsZeros) {
|
|
||||||
Offset(0xDC), /* 0xDC, SMSCS - SMI/SCI Status Register */
|
|
||||||
, 30,
|
|
||||||
HPSX, 1, /* 30, Hot Plug SCI Status */
|
|
||||||
PMSX, 1 /* 31, Power Management SCI Status */
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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++
|
|
||||||
}
|
|
||||||
SCB0 = 1
|
|
||||||
|
|
||||||
Printf(" GPU PORT DL23 FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Exit L23
|
|
||||||
Method (L23D, 0, Serialized) {
|
|
||||||
Printf(" GPU PORT L23D START")
|
|
||||||
|
|
||||||
If ((SCB0 == 1)) {
|
|
||||||
L23R = 1
|
|
||||||
Local0 = 0
|
|
||||||
While (L23R) {
|
|
||||||
If ((Local0 > 4)) {
|
|
||||||
Break
|
|
||||||
}
|
|
||||||
Sleep (16)
|
|
||||||
Local0++
|
|
||||||
}
|
|
||||||
|
|
||||||
SCB0 = 0
|
|
||||||
Local0 = 0
|
|
||||||
While ((LASX == 0)) {
|
|
||||||
If ((Local0 > 8)) {
|
|
||||||
Break
|
|
||||||
}
|
|
||||||
Sleep (16)
|
|
||||||
Local0++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Printf(" GPU PORT L23D FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
Method (HPME, 0, Serialized) {
|
|
||||||
Printf(" GPU PORT HPME START")
|
|
||||||
|
|
||||||
If (PMSX == 1) {
|
|
||||||
Printf(" Notify GPU driver of PME SCI")
|
|
||||||
Notify(DEV0, 0x2)
|
|
||||||
Printf(" Clear PME SCI")
|
|
||||||
PMSX = 1
|
|
||||||
Printf(" Consume PME notification")
|
|
||||||
PSPX = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Printf(" GPU PORT HPME FINISH")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main power resource
|
|
||||||
PowerResource (PWRR, 0, 0) {
|
|
||||||
Name (_STA, 1)
|
|
||||||
|
|
||||||
Method (_ON, 0, Serialized) {
|
|
||||||
Printf("GPU PORT PWRR._ON")
|
|
||||||
|
|
||||||
HPME();
|
|
||||||
If (PMEX == 1) {
|
|
||||||
Printf(" Disable power management SCI")
|
|
||||||
PMEX = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
^^DEV0._ON()
|
|
||||||
|
|
||||||
_STA = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Method (_OFF, 0, Serialized) {
|
|
||||||
Printf("GPU PORT PWRR._OFF")
|
|
||||||
|
|
||||||
^^DEV0._OFF()
|
|
||||||
|
|
||||||
If (PMEX == 0) {
|
|
||||||
Printf(" Enable power management SCI")
|
|
||||||
PMEX = 1
|
|
||||||
HPME()
|
|
||||||
}
|
|
||||||
|
|
||||||
_STA = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Power resources for entering D0
|
|
||||||
Name (_PR0, Package () { PWRR })
|
|
||||||
|
|
||||||
// Power resources for entering D3
|
|
||||||
Name (_PR3, Package () { PWRR })
|
|
||||||
|
|
||||||
#include "common/gpu.asl"
|
|
@@ -1,10 +0,0 @@
|
|||||||
/* 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_ */
|
|
@@ -1,19 +0,0 @@
|
|||||||
/* 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_ */
|
|
@@ -1,71 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#include "chip.h"
|
|
||||||
#include <console/console.h>
|
|
||||||
#include <device/device.h>
|
|
||||||
#include <device/pci.h>
|
|
||||||
#include <device/pci_ids.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 (!is_dev_enabled(dev) || dev->path.type != DEVICE_PATH_PCI)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (pci_read_config16(dev, PCI_VENDOR_ID) != PCI_VID_NVIDIA)
|
|
||||||
return;
|
|
||||||
|
|
||||||
dev->ops = &nvidia_device_ops;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct chip_operations drivers_gfx_nvidia_ops = {
|
|
||||||
.name = "NVIDIA Optimus Graphics Device",
|
|
||||||
.enable_dev = nvidia_enable
|
|
||||||
};
|
|
@@ -1,33 +0,0 @@
|
|||||||
/* 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(10);
|
|
||||||
|
|
||||||
if (config->enable) {
|
|
||||||
gpio_set(config->power_gpio, 1);
|
|
||||||
mdelay(25);
|
|
||||||
gpio_set(config->reset_gpio, 1);
|
|
||||||
} else {
|
|
||||||
gpio_set(config->power_gpio, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
mdelay(10);
|
|
||||||
}
|
|
@@ -36,6 +36,18 @@
|
|||||||
#define DDR4_SPD_PART_OFF 329
|
#define DDR4_SPD_PART_OFF 329
|
||||||
#define DDR4_SPD_PART_LEN 20
|
#define DDR4_SPD_PART_LEN 20
|
||||||
#define DDR4_SPD_SN_OFF 325
|
#define DDR4_SPD_SN_OFF 325
|
||||||
|
#define MAX_SPD_PAGE_SIZE_SPD5 128
|
||||||
|
#define MAX_SPD_SIZE (SPD_PAGE_LEN * 4)
|
||||||
|
#define SPD_HUB_MEMREG(addr) ((u8)(0x80 | (addr)))
|
||||||
|
#define SPD5_MR11 0x0B
|
||||||
|
#define SPD5_MR0 0x00
|
||||||
|
#define SPD5_MEMREG_REG(addr) ((u8)((~0x80) & (addr)))
|
||||||
|
#define SPD5_MR0_SPD5_HUB_DEV 0x51
|
||||||
|
|
||||||
|
struct spd_offset_table {
|
||||||
|
u16 start; /* Offset 0 */
|
||||||
|
u16 end; /* Offset 2 */
|
||||||
|
};
|
||||||
|
|
||||||
struct spd_block {
|
struct spd_block {
|
||||||
u8 addr_map[CONFIG_DIMM_MAX]; /* 7 bit I2C addresses */
|
u8 addr_map[CONFIG_DIMM_MAX]; /* 7 bit I2C addresses */
|
||||||
|
@@ -209,7 +209,9 @@ enum cb_err spd_fill_from_cache(uint8_t *spd_cache, struct spd_block *blk)
|
|||||||
|
|
||||||
dram_type = *(spd_cache + SC_SPD_OFFSET(i) + SPD_DRAM_TYPE);
|
dram_type = *(spd_cache + SC_SPD_OFFSET(i) + SPD_DRAM_TYPE);
|
||||||
|
|
||||||
if (dram_type == SPD_DRAM_DDR4)
|
if (dram_type == SPD_DRAM_DDR5)
|
||||||
|
blk->len = CONFIG_DIMM_SPD_SIZE;
|
||||||
|
else if (dram_type == SPD_DRAM_DDR4)
|
||||||
blk->len = SPD_PAGE_LEN_DDR4;
|
blk->len = SPD_PAGE_LEN_DDR4;
|
||||||
else
|
else
|
||||||
blk->len = SPD_PAGE_LEN;
|
blk->len = SPD_PAGE_LEN;
|
||||||
|
@@ -7,7 +7,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select BOARD_ROMSIZE_KB_16384
|
select BOARD_ROMSIZE_KB_16384
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select DRIVERS_I2C_TAS5825M
|
select DRIVERS_I2C_TAS5825M
|
||||||
select EC_SYSTEM76_EC
|
select EC_SYSTEM76_EC
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## SPDX-License-Identifier: GPL-2.0-only
|
## SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
|
@@ -1,19 +1,11 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
||||||
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
|
|
||||||
Scope (\_SB) {
|
Scope (\_SB) {
|
||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
|
||||||
Device (PEGP) {
|
|
||||||
Name (_ADR, CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 16)
|
|
||||||
#include <drivers/gfx/nvidia/acpi/coffeelake.asl>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Scope (\_GPE) {
|
Scope (\_GPE) {
|
||||||
|
@@ -56,12 +56,6 @@ chip soc/intel/cannonlake
|
|||||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||||
register "PcieClkSrcUsage[8]" = "0x40"
|
register "PcieClkSrcUsage[8]" = "0x40"
|
||||||
register "PcieClkSrcClkReq[8]" = "8"
|
register "PcieClkSrcClkReq[8]" = "8"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device pci 02.0 on end # Integrated Graphics Device
|
device pci 02.0 on end # Integrated Graphics Device
|
||||||
device pci 04.0 on # SA Thermal device
|
device pci 04.0 on # SA Thermal device
|
||||||
|
@@ -3,16 +3,7 @@
|
|||||||
#ifndef VARIANT_GPIO_H
|
#ifndef VARIANT_GPIO_H
|
||||||
#define VARIANT_GPIO_H
|
#define VARIANT_GPIO_H
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F8
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_GC6 GPP_K11
|
|
||||||
#define DGPU_SSID 0x50151558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
void variant_configure_early_gpios(void);
|
||||||
void variant_configure_gpios(void);
|
void variant_configure_gpios(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/cnl_memcfg_init.h>
|
#include <soc/cnl_memcfg_init.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
static const struct cnl_mb_cfg memcfg = {
|
static const struct cnl_mb_cfg memcfg = {
|
||||||
.spd[0] = {
|
.spd[0] = {
|
||||||
@@ -22,17 +20,5 @@ static const struct cnl_mb_cfg memcfg = {
|
|||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
||||||
{
|
{
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
|
||||||
memupd->FspmConfig.PrimaryDisplay = 0;
|
|
||||||
|
|
||||||
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_C12
|
|
||||||
#define DGPU_SSID 0x65e11558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
|
||||||
void variant_configure_gpios(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@@ -35,12 +35,10 @@ config BOARD_SYSTEM76_GALP6
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_GAZE17_3050
|
config BOARD_SYSTEM76_GAZE17_3050
|
||||||
select BOARD_SYSTEM76_ADL_COMMON
|
select BOARD_SYSTEM76_ADL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
|
|
||||||
config BOARD_SYSTEM76_GAZE17_3060_B
|
config BOARD_SYSTEM76_GAZE17_3060_B
|
||||||
select BOARD_SYSTEM76_ADL_COMMON
|
select BOARD_SYSTEM76_ADL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select MAINBOARD_USES_IFD_GBE_REGION
|
select MAINBOARD_USES_IFD_GBE_REGION
|
||||||
|
|
||||||
@@ -50,15 +48,11 @@ config BOARD_SYSTEM76_LEMP11
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_ORYP9
|
config BOARD_SYSTEM76_ORYP9
|
||||||
select BOARD_SYSTEM76_ADL_COMMON
|
select BOARD_SYSTEM76_ADL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select DRIVERS_I2C_TAS5825M
|
select DRIVERS_I2C_TAS5825M
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
|
|
||||||
config BOARD_SYSTEM76_ORYP10
|
config BOARD_SYSTEM76_ORYP10
|
||||||
select BOARD_SYSTEM76_ADL_COMMON
|
select BOARD_SYSTEM76_ADL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
|
|
||||||
if BOARD_SYSTEM76_ADL_COMMON
|
if BOARD_SYSTEM76_ADL_COMMON
|
||||||
@@ -109,12 +103,6 @@ config CONSOLE_POST
|
|||||||
config D3COLD_SUPPORT
|
config D3COLD_SUPPORT
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_TPP
|
|
||||||
default 45 if BOARD_SYSTEM76_ORYP9 || BOARD_SYSTEM76_ORYP10
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MAX
|
|
||||||
default 25 if BOARD_SYSTEM76_ORYP9 || BOARD_SYSTEM76_ORYP10
|
|
||||||
|
|
||||||
config FMDFILE
|
config FMDFILE
|
||||||
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/board.fmd"
|
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/board.fmd"
|
||||||
|
|
||||||
|
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
|
|
||||||
ifeq ($(CONFIG_DRIVERS_GFX_NVIDIA),y)
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
|
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#if CONFIG(DRIVERS_GFX_NVIDIA)
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x6E
|
#define EC_GPE_SCI 0x6E
|
||||||
#define EC_GPE_SWI 0x6B
|
#define EC_GPE_SWI 0x6B
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -12,11 +8,5 @@ Scope (\_SB) {
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
|
|
||||||
#if CONFIG(DRIVERS_GFX_NVIDIA)
|
|
||||||
Scope (PEG2) {
|
|
||||||
#include <drivers/gfx/nvidia/acpi/tigerlake.asl>
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_B2
|
|
||||||
#define DGPU_PWR_EN GPP_A14
|
|
||||||
#define DGPU_GC6 GPP_F13
|
|
||||||
#define DGPU_SSID 0x866d1558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -38,10 +38,6 @@ chip soc/intel/alderlake
|
|||||||
.clk_req = 3,
|
.clk_req = 3,
|
||||||
.flags = PCIE_RP_LTR,
|
.flags = PCIE_RP_LTR,
|
||||||
}"
|
}"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device ref pcie4_0 on
|
device ref pcie4_0 on
|
||||||
# PCIe PEG0 x4, Clock 0 (SSD2)
|
# PCIe PEG0 x4, Clock 0 (SSD2)
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -19,14 +17,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_B2
|
|
||||||
#define DGPU_PWR_EN GPP_A14
|
|
||||||
#define DGPU_GC6 GPP_F13
|
|
||||||
#define DGPU_SSID 0x867c1558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -38,10 +38,6 @@ chip soc/intel/alderlake
|
|||||||
.clk_req = 3,
|
.clk_req = 3,
|
||||||
.flags = PCIE_RP_LTR,
|
.flags = PCIE_RP_LTR,
|
||||||
}"
|
}"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device ref igpu on
|
device ref igpu on
|
||||||
# DDIA is eDP
|
# DDIA is eDP
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -19,14 +17,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_B2
|
|
||||||
#define DGPU_PWR_EN GPP_A14
|
|
||||||
#define DGPU_GC6 GPP_A7
|
|
||||||
#define DGPU_SSID 0x65f51558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -23,10 +23,6 @@ chip soc/intel/alderlake
|
|||||||
.clk_req = 3,
|
.clk_req = 3,
|
||||||
.flags = PCIE_RP_LTR,
|
.flags = PCIE_RP_LTR,
|
||||||
}"
|
}"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device ref igpu on
|
device ref igpu on
|
||||||
register "ddi_portA_config" = "1"
|
register "ddi_portA_config" = "1"
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -22,14 +20,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_B2
|
|
||||||
#define DGPU_PWR_EN GPP_A14
|
|
||||||
#define DGPU_GC6 GPP_A7
|
|
||||||
#define DGPU_SSID 0x65f51558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -23,10 +23,6 @@ chip soc/intel/alderlake
|
|||||||
.clk_req = 3,
|
.clk_req = 3,
|
||||||
.flags = PCIE_RP_LTR,
|
.flags = PCIE_RP_LTR,
|
||||||
}"
|
}"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device ref igpu on
|
device ref igpu on
|
||||||
register "ddi_portA_config" = "1"
|
register "ddi_portA_config" = "1"
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -19,14 +17,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -7,7 +7,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select BOARD_ROMSIZE_KB_16384
|
select BOARD_ROMSIZE_KB_16384
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select EC_SYSTEM76_EC
|
select EC_SYSTEM76_EC
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
|
@@ -59,12 +59,11 @@ chip soc/intel/cannonlake
|
|||||||
# PCI Express Graphics #0 x16, Clock 7 (NVIDIA GPU)
|
# PCI Express Graphics #0 x16, Clock 7 (NVIDIA GPU)
|
||||||
register "PcieClkSrcUsage[7]" = "0x40"
|
register "PcieClkSrcUsage[7]" = "0x40"
|
||||||
register "PcieClkSrcClkReq[7]" = "7"
|
register "PcieClkSrcClkReq[7]" = "7"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
device pci 00.0 on end # VGA controller
|
||||||
device pci 00.1 on end # Audio device
|
device pci 00.1 on end # Audio device
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
device pci 00.2 on end # USB xHCI Host controller
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
device pci 00.3 on end # USB Type-C UCSI controller
|
||||||
end
|
|
||||||
end
|
end
|
||||||
# TODO: is this enough to disable iGPU?
|
# TODO: is this enough to disable iGPU?
|
||||||
device pci 02.0 off end # Integrated Graphics Device
|
device pci 02.0 off end # Integrated Graphics Device
|
||||||
|
@@ -7,7 +7,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select BOARD_ROMSIZE_KB_16384
|
select BOARD_ROMSIZE_KB_16384
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select EC_SYSTEM76_EC
|
select EC_SYSTEM76_EC
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
## SPDX-License-Identifier: GPL-2.0-only
|
## SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
||||||
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -10,10 +8,6 @@ Scope (\_SB) {
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
Device (PEGP) {
|
|
||||||
Name (_ADR, CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 16)
|
|
||||||
#include <drivers/gfx/nvidia/acpi/coffeelake.asl>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -55,12 +55,6 @@ chip soc/intel/cannonlake
|
|||||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||||
register "PcieClkSrcUsage[8]" = "0x40"
|
register "PcieClkSrcUsage[8]" = "0x40"
|
||||||
register "PcieClkSrcClkReq[8]" = "8"
|
register "PcieClkSrcClkReq[8]" = "8"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device pci 02.0 on # Integrated Graphics Device
|
device pci 02.0 on # Integrated Graphics Device
|
||||||
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
||||||
|
@@ -3,16 +3,7 @@
|
|||||||
#ifndef VARIANT_GPIO_H
|
#ifndef VARIANT_GPIO_H
|
||||||
#define VARIANT_GPIO_H
|
#define VARIANT_GPIO_H
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F8
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_GC6 GPP_K11
|
|
||||||
#define DGPU_SSID 0x50e11558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
void variant_configure_early_gpios(void);
|
||||||
void variant_configure_gpios(void);
|
void variant_configure_gpios(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/cnl_memcfg_init.h>
|
#include <soc/cnl_memcfg_init.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
static const struct cnl_mb_cfg memcfg = {
|
static const struct cnl_mb_cfg memcfg = {
|
||||||
.spd[0] = {
|
.spd[0] = {
|
||||||
@@ -22,17 +20,5 @@ static const struct cnl_mb_cfg memcfg = {
|
|||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
||||||
{
|
{
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
|
||||||
memupd->FspmConfig.PrimaryDisplay = 0;
|
|
||||||
|
|
||||||
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
||||||
}
|
}
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_K21
|
|
||||||
#define DGPU_SSID 0x85501558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
|
||||||
void variant_configure_gpios(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_K21
|
|
||||||
#define DGPU_SSID 0x85201558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
|
||||||
void variant_configure_gpios(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@@ -7,7 +7,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select BOARD_ROMSIZE_KB_16384
|
select BOARD_ROMSIZE_KB_16384
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select DRIVERS_I2C_TAS5825M
|
select DRIVERS_I2C_TAS5825M
|
||||||
select EC_SYSTEM76_EC
|
select EC_SYSTEM76_EC
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <mainboard/gpio.h>
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x17 /* GPP_B23 */
|
#define EC_GPE_SCI 0x17 /* GPP_B23 */
|
||||||
#define EC_GPE_SWI 0x26 /* GPP_G6 */
|
#define EC_GPE_SWI 0x26 /* GPP_G6 */
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -11,10 +9,6 @@ Scope (\_SB)
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
Device (PEGP) {
|
|
||||||
Name (_ADR, CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 16)
|
|
||||||
#include <drivers/gfx/nvidia/acpi/coffeelake.asl>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -63,12 +63,6 @@ chip soc/intel/cannonlake
|
|||||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||||
register "PcieClkSrcUsage[8]" = "0x40"
|
register "PcieClkSrcUsage[8]" = "0x40"
|
||||||
register "PcieClkSrcClkReq[8]" = "8"
|
register "PcieClkSrcClkReq[8]" = "8"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device pci 02.0 on # Integrated Graphics Device
|
device pci 02.0 on # Integrated Graphics Device
|
||||||
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
||||||
|
@@ -3,16 +3,7 @@
|
|||||||
#ifndef MAINBOARD_GPIO_H
|
#ifndef MAINBOARD_GPIO_H
|
||||||
#define MAINBOARD_GPIO_H
|
#define MAINBOARD_GPIO_H
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_C12
|
|
||||||
#define DGPU_SSID 0x95e61558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void mainboard_configure_early_gpios(void);
|
void mainboard_configure_early_gpios(void);
|
||||||
void mainboard_configure_gpios(void);
|
void mainboard_configure_gpios(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <mainboard/gpio.h>
|
|
||||||
#include <soc/cnl_memcfg_init.h>
|
#include <soc/cnl_memcfg_init.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
|
|
||||||
@@ -22,18 +20,6 @@ static const struct cnl_mb_cfg memcfg = {
|
|||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
||||||
{
|
{
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
|
||||||
memupd->FspmConfig.PrimaryDisplay = 0;
|
|
||||||
|
|
||||||
// Allow memory speeds higher than 2666 MT/s
|
// Allow memory speeds higher than 2666 MT/s
|
||||||
memupd->FspmConfig.SaOcSupport = 1;
|
memupd->FspmConfig.SaOcSupport = 1;
|
||||||
|
|
||||||
|
@@ -7,7 +7,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select BOARD_ROMSIZE_KB_16384
|
select BOARD_ROMSIZE_KB_16384
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select DRIVERS_I2C_TAS5825M
|
select DRIVERS_I2C_TAS5825M
|
||||||
select EC_SYSTEM76_EC
|
select EC_SYSTEM76_EC
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
## SPDX-License-Identifier: GPL-2.0-only
|
## SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
||||||
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -10,10 +8,6 @@ Scope (\_SB) {
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
Device (PEGP) {
|
|
||||||
Name (_ADR, CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 16)
|
|
||||||
#include <drivers/gfx/nvidia/acpi/coffeelake.asl>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -60,12 +60,6 @@ chip soc/intel/cannonlake
|
|||||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||||
register "PcieClkSrcUsage[8]" = "0x40"
|
register "PcieClkSrcUsage[8]" = "0x40"
|
||||||
register "PcieClkSrcClkReq[8]" = "8"
|
register "PcieClkSrcClkReq[8]" = "8"
|
||||||
chip drivers/gfx/nvidia
|
|
||||||
device pci 00.0 on end # VGA controller
|
|
||||||
device pci 00.1 on end # Audio device
|
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
device pci 02.0 on # Integrated Graphics Device
|
device pci 02.0 on # Integrated Graphics Device
|
||||||
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
||||||
|
@@ -3,16 +3,7 @@
|
|||||||
#ifndef VARIANT_GPIO_H
|
#ifndef VARIANT_GPIO_H
|
||||||
#define VARIANT_GPIO_H
|
#define VARIANT_GPIO_H
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F8
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_GC6 GPP_K11
|
|
||||||
#define DGPU_SSID 0x65f11558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
void variant_configure_early_gpios(void);
|
||||||
void variant_configure_gpios(void);
|
void variant_configure_gpios(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/cnl_memcfg_init.h>
|
#include <soc/cnl_memcfg_init.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
#include <variant/romstage.h>
|
#include <variant/romstage.h>
|
||||||
|
|
||||||
static const struct cnl_mb_cfg memcfg = {
|
static const struct cnl_mb_cfg memcfg = {
|
||||||
@@ -23,18 +21,6 @@ static const struct cnl_mb_cfg memcfg = {
|
|||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
void mainboard_memory_init_params(FSPM_UPD *memupd)
|
||||||
{
|
{
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
|
||||||
memupd->FspmConfig.PrimaryDisplay = 0;
|
|
||||||
|
|
||||||
variant_configure_fspm(memupd);
|
variant_configure_fspm(memupd);
|
||||||
|
|
||||||
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_K21
|
|
||||||
#define DGPU_SSID 0x50d31558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
|
||||||
void variant_configure_gpios(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,18 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_K21
|
|
||||||
#define DGPU_SSID 0x65e51558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
|
||||||
void variant_configure_gpios(void);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@@ -27,8 +27,6 @@ config BOARD_SYSTEM76_RPL_COMMON
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_ADDW3
|
config BOARD_SYSTEM76_ADDW3
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select MAINBOARD_USES_IFD_GBE_REGION
|
select MAINBOARD_USES_IFD_GBE_REGION
|
||||||
select PCIEXP_HOTPLUG
|
select PCIEXP_HOTPLUG
|
||||||
@@ -36,16 +34,12 @@ config BOARD_SYSTEM76_ADDW3
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_ADDW4
|
config BOARD_SYSTEM76_ADDW4
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select PCIEXP_HOTPLUG
|
select PCIEXP_HOTPLUG
|
||||||
select SOC_INTEL_ALDERLAKE_PCH_S
|
select SOC_INTEL_ALDERLAKE_PCH_S
|
||||||
|
|
||||||
config BOARD_SYSTEM76_BONW15
|
config BOARD_SYSTEM76_BONW15
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select PCIEXP_HOTPLUG
|
select PCIEXP_HOTPLUG
|
||||||
select SOC_INTEL_ALDERLAKE_PCH_S
|
select SOC_INTEL_ALDERLAKE_PCH_S
|
||||||
@@ -62,8 +56,6 @@ config BOARD_SYSTEM76_GALP7
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_GAZE18
|
config BOARD_SYSTEM76_GAZE18
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select SOC_INTEL_ALDERLAKE_PCH_P
|
select SOC_INTEL_ALDERLAKE_PCH_P
|
||||||
|
|
||||||
@@ -75,16 +67,12 @@ config BOARD_SYSTEM76_LEMP12
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_ORYP11
|
config BOARD_SYSTEM76_ORYP11
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select SOC_INTEL_ALDERLAKE_PCH_P
|
select SOC_INTEL_ALDERLAKE_PCH_P
|
||||||
select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES
|
select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES
|
||||||
|
|
||||||
config BOARD_SYSTEM76_ORYP12
|
config BOARD_SYSTEM76_ORYP12
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select DRIVERS_I2C_TAS5825M
|
select DRIVERS_I2C_TAS5825M
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select PCIEXP_HOTPLUG
|
select PCIEXP_HOTPLUG
|
||||||
@@ -92,8 +80,6 @@ config BOARD_SYSTEM76_ORYP12
|
|||||||
|
|
||||||
config BOARD_SYSTEM76_SERW13
|
config BOARD_SYSTEM76_SERW13
|
||||||
select BOARD_SYSTEM76_RPL_COMMON
|
select BOARD_SYSTEM76_RPL_COMMON
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST
|
|
||||||
select EC_SYSTEM76_EC_DGPU
|
select EC_SYSTEM76_EC_DGPU
|
||||||
select PCIEXP_HOTPLUG
|
select PCIEXP_HOTPLUG
|
||||||
select SOC_INTEL_ALDERLAKE_PCH_S
|
select SOC_INTEL_ALDERLAKE_PCH_S
|
||||||
@@ -158,17 +144,6 @@ config CONSOLE_POST
|
|||||||
config D3COLD_SUPPORT
|
config D3COLD_SUPPORT
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_BRIDGE
|
|
||||||
default 0x02 if BOARD_SYSTEM76_BONW15
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_TPP
|
|
||||||
default 45 if BOARD_SYSTEM76_ORYP11 || BOARD_SYSTEM76_ORYP12
|
|
||||||
default 55 if BOARD_SYSTEM76_ADDW3 || BOARD_SYSTEM76_ADDW4 || BOARD_SYSTEM76_GAZE18 || BOARD_SYSTEM76_SERW13
|
|
||||||
default 80 if BOARD_SYSTEM76_BONW15
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_DYNAMIC_BOOST_MAX
|
|
||||||
default 25 if BOARD_SYSTEM76_ADDW3 || BOARD_SYSTEM76_ADDW4 || BOARD_SYSTEM76_BONW15 || BOARD_SYSTEM76_GAZE18 || BOARD_SYSTEM76_ORYP11 || BOARD_SYSTEM76_ORYP12 || BOARD_SYSTEM76_SERW13
|
|
||||||
|
|
||||||
config FMDFILE
|
config FMDFILE
|
||||||
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/variants/\$(CONFIG_VARIANT_DIR)/board.fmd"
|
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/variants/\$(CONFIG_VARIANT_DIR)/board.fmd"
|
||||||
|
|
||||||
|
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
|
|
||||||
ifeq ($(CONFIG_DRIVERS_GFX_NVIDIA),y)
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
|
||||||
endif
|
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
|
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#if CONFIG(DRIVERS_GFX_NVIDIA)
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x6E
|
#define EC_GPE_SCI 0x6E
|
||||||
#define EC_GPE_SWI 0x6B
|
#define EC_GPE_SWI 0x6B
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -12,17 +8,5 @@ Scope (\_SB) {
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
|
|
||||||
#if CONFIG(DRIVERS_GFX_NVIDIA)
|
|
||||||
#if CONFIG(SOC_INTEL_ALDERLAKE_PCH_P) || CONFIG(BOARD_SYSTEM76_BONW15)
|
|
||||||
Scope (PEG2) {
|
|
||||||
#include <drivers/gfx/nvidia/acpi/tigerlake.asl>
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
Scope (PEG1) {
|
|
||||||
#include <drivers/gfx/nvidia/acpi/tigerlake.asl>
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif // CONFIG(DRIVERS_GFX_NVIDIA)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_R16
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_GC6 GPP_F8
|
|
||||||
#define DGPU_SSID 0xa6711558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -24,15 +22,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_R16
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_SSID 0x03531558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -24,15 +22,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to hybrid graphics
|
// Set primary display to hybrid graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 4;
|
mupd->FspmConfig.PrimaryDisplay = 4;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_R16
|
|
||||||
#define DGPU_PWR_EN GPP_F22
|
|
||||||
#define DGPU_GC6 GPP_F8
|
|
||||||
#define DGPU_SSID 0x37021558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -24,15 +22,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_B2
|
|
||||||
#define DGPU_PWR_EN GPP_A14
|
|
||||||
#define DGPU_GC6 GPP_F13
|
|
||||||
#define DGPU_SSID 0x56301558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -21,15 +19,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_B2
|
|
||||||
#define DGPU_PWR_EN GPP_A14
|
|
||||||
#define DGPU_GC6 GPP_F13
|
|
||||||
#define DGPU_SSID 0x66a21558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -21,15 +19,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_R16
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_SSID 0x66a61558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -24,15 +22,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to hybrid graphics
|
// Set primary display to hybrid graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 4;
|
mupd->FspmConfig.PrimaryDisplay = 4;
|
||||||
|
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
|
|
||||||
#ifndef VARIANT_GPIO_H
|
|
||||||
#define VARIANT_GPIO_H
|
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_R16
|
|
||||||
#define DGPU_PWR_EN GPP_F9
|
|
||||||
#define DGPU_GC6 GPP_A11
|
|
||||||
#define DGPU_SSID 0xd5021558
|
|
||||||
|
|
||||||
#endif
|
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -24,14 +22,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
// Set primary display to internal graphics
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select DRIVERS_GENERIC_BAYHUB_LV2
|
select DRIVERS_GENERIC_BAYHUB_LV2
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select DRIVERS_I2C_TAS5825M if BOARD_SYSTEM76_ORYP8
|
select DRIVERS_I2C_TAS5825M if BOARD_SYSTEM76_ORYP8
|
||||||
select EC_SYSTEM76_EC
|
select EC_SYSTEM76_EC
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
## SPDX-License-Identifier: GPL-2.0-only
|
## SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include
|
||||||
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include
|
|
||||||
|
|
||||||
bootblock-y += bootblock.c
|
bootblock-y += bootblock.c
|
||||||
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x6E
|
#define EC_GPE_SCI 0x6E
|
||||||
#define EC_GPE_SWI 0x6B
|
#define EC_GPE_SWI 0x6B
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -10,8 +8,5 @@ Scope (\_SB) {
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
Scope (PEG1) {
|
|
||||||
#include <drivers/gfx/nvidia/acpi/tigerlake.asl>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,16 +3,7 @@
|
|||||||
#ifndef VARIANT_GPIO_H
|
#ifndef VARIANT_GPIO_H
|
||||||
#define VARIANT_GPIO_H
|
#define VARIANT_GPIO_H
|
||||||
|
|
||||||
#include <soc/gpio.h>
|
|
||||||
|
|
||||||
#define DGPU_RST_N GPP_F22
|
|
||||||
#define DGPU_PWR_EN GPP_F23
|
|
||||||
#define DGPU_GC6 GPP_C12
|
|
||||||
#define DGPU_SSID 0x65d11558
|
|
||||||
|
|
||||||
#ifndef __ACPI__
|
|
||||||
void variant_configure_early_gpios(void);
|
void variant_configure_early_gpios(void);
|
||||||
void variant_configure_gpios(void);
|
void variant_configure_gpios(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@@ -1,9 +1,7 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
#include <variant/romstage.h>
|
#include <variant/romstage.h>
|
||||||
|
|
||||||
static const struct mb_cfg board_cfg = {
|
static const struct mb_cfg board_cfg = {
|
||||||
@@ -23,21 +21,9 @@ static const struct mem_spd spd_info = {
|
|||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
const bool half_populated = false;
|
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
|
||||||
|
|
||||||
variant_memory_init_params(mupd);
|
variant_memory_init_params(mupd);
|
||||||
|
|
||||||
|
const bool half_populated = false;
|
||||||
|
|
||||||
memcfg_init(mupd, &board_cfg, &spd_info, half_populated);
|
memcfg_init(mupd, &board_cfg, &spd_info, half_populated);
|
||||||
}
|
}
|
||||||
|
@@ -6,11 +6,15 @@ chip soc/intel/tigerlake
|
|||||||
# PCIe PEG2 (remapped to PEG1 by FSP) x8, Clock 0 (DGPU)
|
# PCIe PEG2 (remapped to PEG1 by FSP) x8, Clock 0 (DGPU)
|
||||||
register "PcieClkSrcUsage[0]" = "0x42"
|
register "PcieClkSrcUsage[0]" = "0x42"
|
||||||
register "PcieClkSrcClkReq[0]" = "0"
|
register "PcieClkSrcClkReq[0]" = "0"
|
||||||
chip drivers/gfx/nvidia
|
chip soc/intel/common/block/pcie/rtd3
|
||||||
device pci 00.0 on end # VGA controller
|
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_F9)" # DGPU_PWR_EN
|
||||||
device pci 00.1 on end # Audio device
|
register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_F8)" # DGPU_RST#_PCH
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
register "enable_delay_ms" = "16"
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
register "enable_off_delay_ms" = "4"
|
||||||
|
register "reset_delay_ms" = "10"
|
||||||
|
register "reset_off_delay_ms" = "4"
|
||||||
|
register "srcclk_pin" = "0" # GFX_CLKREQ0#
|
||||||
|
device generic 0 on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref igpu on
|
device ref igpu on
|
||||||
|
@@ -6,11 +6,15 @@ chip soc/intel/tigerlake
|
|||||||
# PCIe PEG1 x16, Clock 9 (DGPU)
|
# PCIe PEG1 x16, Clock 9 (DGPU)
|
||||||
register "PcieClkSrcUsage[9]" = "0x41"
|
register "PcieClkSrcUsage[9]" = "0x41"
|
||||||
register "PcieClkSrcClkReq[9]" = "9"
|
register "PcieClkSrcClkReq[9]" = "9"
|
||||||
chip drivers/gfx/nvidia
|
chip soc/intel/common/block/pcie/rtd3
|
||||||
device pci 00.0 on end # VGA controller
|
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_F9)" # DGPU_PWR_EN
|
||||||
device pci 00.1 on end # Audio device
|
register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_F8)" # DGPU_RST#_PCH
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
register "enable_delay_ms" = "16"
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
register "enable_off_delay_ms" = "4"
|
||||||
|
register "reset_delay_ms" = "10"
|
||||||
|
register "reset_off_delay_ms" = "4"
|
||||||
|
register "srcclk_pin" = "9" # PEG_CLKREQ#
|
||||||
|
device generic 0 on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref igpu on
|
device ref igpu on
|
||||||
|
@@ -19,11 +19,15 @@ chip soc/intel/tigerlake
|
|||||||
# PCIe PEG1 x16, Clock 9 (DGPU)
|
# PCIe PEG1 x16, Clock 9 (DGPU)
|
||||||
register "PcieClkSrcUsage[9]" = "0x41"
|
register "PcieClkSrcUsage[9]" = "0x41"
|
||||||
register "PcieClkSrcClkReq[9]" = "9"
|
register "PcieClkSrcClkReq[9]" = "9"
|
||||||
chip drivers/gfx/nvidia
|
chip soc/intel/common/block/pcie/rtd3
|
||||||
device pci 00.0 on end # VGA controller
|
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_F9)" # DGPU_PWR_EN
|
||||||
device pci 00.1 on end # Audio device
|
register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_F8)" # DGPU_RST#_PCH
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
register "enable_delay_ms" = "16"
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
register "enable_off_delay_ms" = "4"
|
||||||
|
register "reset_delay_ms" = "10"
|
||||||
|
register "reset_off_delay_ms" = "4"
|
||||||
|
register "srcclk_pin" = "9" # PEG_CLKREQ#
|
||||||
|
device generic 0 on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref peg0 on
|
device ref peg0 on
|
||||||
|
@@ -8,7 +8,6 @@ config BOARD_SPECIFIC_OPTIONS
|
|||||||
select DRIVERS_GENERIC_BAYHUB_LV2
|
select DRIVERS_GENERIC_BAYHUB_LV2
|
||||||
select DRIVERS_GENERIC_CBFS_SERIAL
|
select DRIVERS_GENERIC_CBFS_SERIAL
|
||||||
select DRIVERS_GENERIC_CBFS_UUID
|
select DRIVERS_GENERIC_CBFS_UUID
|
||||||
select DRIVERS_GFX_NVIDIA if BOARD_SYSTEM76_GALP5
|
|
||||||
select DRIVERS_I2C_HID
|
select DRIVERS_I2C_HID
|
||||||
select DRIVERS_INTEL_PMC
|
select DRIVERS_INTEL_PMC
|
||||||
select DRIVERS_INTEL_USB4_RETIMER
|
select DRIVERS_INTEL_USB4_RETIMER
|
||||||
@@ -74,15 +73,4 @@ config UART_FOR_CONSOLE
|
|||||||
config USE_PM_ACPI_TIMER
|
config USE_PM_ACPI_TIMER
|
||||||
default n
|
default n
|
||||||
|
|
||||||
# For galp5 with dGPU
|
|
||||||
if DRIVERS_GFX_NVIDIA
|
|
||||||
|
|
||||||
config ONBOARD_VGA_IS_PRIMARY
|
|
||||||
default y
|
|
||||||
|
|
||||||
config DRIVERS_GFX_NVIDIA_BRIDGE
|
|
||||||
default 0x1c
|
|
||||||
|
|
||||||
endif # DRIVERS_GFX_NVIDIA
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@@ -1,9 +1,5 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#if CONFIG(BOARD_SYSTEM76_GALP5)
|
|
||||||
#include <variant/gpio.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EC_GPE_SCI 0x6E
|
#define EC_GPE_SCI 0x6E
|
||||||
#define EC_GPE_SWI 0x6B
|
#define EC_GPE_SWI 0x6B
|
||||||
#include <ec/system76/ec/acpi/ec.asl>
|
#include <ec/system76/ec/acpi/ec.asl>
|
||||||
@@ -12,10 +8,5 @@ Scope (\_SB) {
|
|||||||
#include "sleep.asl"
|
#include "sleep.asl"
|
||||||
Scope (PCI0) {
|
Scope (PCI0) {
|
||||||
#include "backlight.asl"
|
#include "backlight.asl"
|
||||||
#if CONFIG(BOARD_SYSTEM76_GALP5)
|
|
||||||
Scope (RP01) { // Remapped from RP05
|
|
||||||
#include <drivers/gfx/nvidia/acpi/tigerlake.asl>
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -144,11 +144,15 @@ chip soc/intel/tigerlake
|
|||||||
register "PcieRpLtrEnable[4]" = "1"
|
register "PcieRpLtrEnable[4]" = "1"
|
||||||
register "PcieClkSrcUsage[2]" = "4"
|
register "PcieClkSrcUsage[2]" = "4"
|
||||||
register "PcieClkSrcClkReq[2]" = "2"
|
register "PcieClkSrcClkReq[2]" = "2"
|
||||||
chip drivers/gfx/nvidia
|
chip soc/intel/common/block/pcie/rtd3
|
||||||
device pci 00.0 on end # VGA controller
|
register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_U5)" # DGPU_PWR_EN
|
||||||
device pci 00.1 on end # Audio device
|
register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_U4)" # DGPU_RST#_PCH
|
||||||
device pci 00.2 on end # USB xHCI Host controller
|
register "enable_delay_ms" = "16"
|
||||||
device pci 00.3 on end # USB Type-C UCSI controller
|
register "enable_off_delay_ms" = "4"
|
||||||
|
register "reset_delay_ms" = "10"
|
||||||
|
register "reset_off_delay_ms" = "4"
|
||||||
|
register "srcclk_pin" = "2" # PEG_CLKREQ#
|
||||||
|
device generic 0 on end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
device ref pcie_rp9 on
|
device ref pcie_rp9 on
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
|
||||||
#include <drivers/gfx/nvidia/gpu.h>
|
#include <fsp/util.h>
|
||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <soc/romstage.h>
|
#include <soc/romstage.h>
|
||||||
#include <variant/gpio.h>
|
|
||||||
|
|
||||||
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||||
{
|
{
|
||||||
@@ -19,17 +18,5 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||||||
};
|
};
|
||||||
const bool half_populated = false;
|
const bool half_populated = false;
|
||||||
|
|
||||||
const struct nvidia_gpu_config config = {
|
|
||||||
.power_gpio = DGPU_PWR_EN,
|
|
||||||
.reset_gpio = DGPU_RST_N,
|
|
||||||
.enable = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable dGPU power
|
|
||||||
nvidia_set_power(&config);
|
|
||||||
|
|
||||||
// Set primary display to internal graphics
|
|
||||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
|
||||||
|
|
||||||
memcfg_init(mupd, &board_cfg, &spd_info, half_populated);
|
memcfg_init(mupd, &board_cfg, &spd_info, half_populated);
|
||||||
}
|
}
|
||||||
|
@@ -13,8 +13,11 @@ static void update_spd_len(struct spd_block *blk)
|
|||||||
if (blk->spd_array[i] != NULL)
|
if (blk->spd_array[i] != NULL)
|
||||||
j |= blk->spd_array[i][SPD_DRAM_TYPE];
|
j |= blk->spd_array[i][SPD_DRAM_TYPE];
|
||||||
|
|
||||||
|
/* If spd used is DDR5, then its length is 1024 byte. */
|
||||||
|
if (j == SPD_DRAM_DDR5)
|
||||||
|
blk->len = CONFIG_DIMM_SPD_SIZE;
|
||||||
/* If spd used is DDR4, then its length is 512 byte. */
|
/* If spd used is DDR4, then its length is 512 byte. */
|
||||||
if (j == SPD_DRAM_DDR4)
|
else if (j == SPD_DRAM_DDR4)
|
||||||
blk->len = SPD_PAGE_LEN_DDR4;
|
blk->len = SPD_PAGE_LEN_DDR4;
|
||||||
else
|
else
|
||||||
blk->len = SPD_PAGE_LEN;
|
blk->len = SPD_PAGE_LEN;
|
||||||
@@ -37,6 +40,61 @@ static void smbus_read_spd(u8 *spd, u8 addr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void switch_page(u8 spd_addr, u8 new_page)
|
||||||
|
{
|
||||||
|
u32 offset;
|
||||||
|
/*
|
||||||
|
* By default,an SPD5 hub accepts 1 byte addressing pointing
|
||||||
|
* to the first 128 bytes of memory. MR11[2:0] selects the page
|
||||||
|
* pointer to address the entire 1024 bytes of non-volatile memory.
|
||||||
|
*/
|
||||||
|
offset = SPD5_MEMREG_REG(SPD5_MR11);
|
||||||
|
smbus_write_byte(spd_addr, offset, new_page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read the SPD data over the SMBus, at the specified SPD address,
|
||||||
|
* starting at the specified starting offset and read the given amount of data.
|
||||||
|
*/
|
||||||
|
static void smbus_read_spd5(u8 *spd, u8 spd_addr, u16 size)
|
||||||
|
{
|
||||||
|
u8 page = ~0;
|
||||||
|
u32 max_page_size = MAX_SPD_PAGE_SIZE_SPD5;
|
||||||
|
|
||||||
|
if (size > MAX_SPD_SIZE) {
|
||||||
|
printk(BIOS_ERR, "Maximum SPD size reached\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
u8 next_page = (u8) (i / max_page_size);
|
||||||
|
if (next_page != page) {
|
||||||
|
switch_page(spd_addr, next_page);
|
||||||
|
page = next_page;
|
||||||
|
}
|
||||||
|
unsigned int byte_addr = SPD_HUB_MEMREG(i % max_page_size);
|
||||||
|
spd[i] = smbus_read_byte(spd_addr, byte_addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read SPD5 MR0 and check if SPD Byte 0 matches the SPD5 HUB MR0 identifier.*/
|
||||||
|
static int is_spd5_hub(u8 spd_addr)
|
||||||
|
{
|
||||||
|
u8 spd_hub_byte;
|
||||||
|
|
||||||
|
spd_hub_byte = smbus_read_byte(spd_addr, SPD5_MEMREG_REG(SPD5_MR0));
|
||||||
|
return spd_hub_byte == SPD5_MR0_SPD5_HUB_DEV;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reset the SPD page back to page 0 on an SPD5 Hub device at the
|
||||||
|
* input SPD SMbus address.
|
||||||
|
*/
|
||||||
|
static void reset_page_spd5(u8 spd_addr)
|
||||||
|
{
|
||||||
|
/* Set SPD5 MR11[2:0] = 0 (Page 0) */
|
||||||
|
smbus_write_byte(spd_addr, SPD5_MEMREG_REG(SPD5_MR11), 0);
|
||||||
|
}
|
||||||
|
|
||||||
/* return -1 if SMBus errors otherwise return 0 */
|
/* return -1 if SMBus errors otherwise return 0 */
|
||||||
static int get_spd(u8 *spd, u8 addr)
|
static int get_spd(u8 *spd, u8 addr)
|
||||||
{
|
{
|
||||||
@@ -52,22 +110,31 @@ static int get_spd(u8 *spd, u8 addr)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i2c_eeprom_read(addr, 0, SPD_PAGE_LEN, spd) < 0) {
|
if (is_spd5_hub(addr)) {
|
||||||
printk(BIOS_INFO, "do_i2c_eeprom_read failed, using fallback\n");
|
smbus_read_spd5(spd, addr, CONFIG_DIMM_SPD_SIZE);
|
||||||
smbus_read_spd(spd, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if module is DDR4, DDR4 spd is 512 byte. */
|
/* Reset the page for the next loop iteration */
|
||||||
if (spd[SPD_DRAM_TYPE] == SPD_DRAM_DDR4 && CONFIG_DIMM_SPD_SIZE > SPD_PAGE_LEN) {
|
reset_page_spd5(addr);
|
||||||
/* Switch to page 1 */
|
} else {
|
||||||
smbus_write_byte(SPD_PAGE_1, 0, 0);
|
|
||||||
|
|
||||||
if (i2c_eeprom_read(addr, 0, SPD_PAGE_LEN, spd + SPD_PAGE_LEN) < 0) {
|
if (i2c_eeprom_read(addr, 0, SPD_PAGE_LEN, spd) < 0) {
|
||||||
printk(BIOS_INFO, "do_i2c_eeprom_read failed, using fallback\n");
|
printk(BIOS_INFO, "do_i2c_eeprom_read failed, using fallback\n");
|
||||||
smbus_read_spd(spd + SPD_PAGE_LEN, addr);
|
smbus_read_spd(spd, addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if module is DDR4, DDR4 spd is 512 byte. */
|
||||||
|
if (spd[SPD_DRAM_TYPE] == SPD_DRAM_DDR4 &&
|
||||||
|
CONFIG_DIMM_SPD_SIZE > SPD_PAGE_LEN) {
|
||||||
|
/* Switch to page 1 */
|
||||||
|
smbus_write_byte(SPD_PAGE_1, 0, 0);
|
||||||
|
|
||||||
|
if (i2c_eeprom_read(addr, 0, SPD_PAGE_LEN, spd + SPD_PAGE_LEN) < 0) {
|
||||||
|
printk(BIOS_INFO, "do_i2c_eeprom_read failed, using fallback\n");
|
||||||
|
smbus_read_spd(spd + SPD_PAGE_LEN, addr);
|
||||||
|
}
|
||||||
|
/* Restore to page 0 */
|
||||||
|
smbus_write_byte(SPD_PAGE_0, 0, 0);
|
||||||
}
|
}
|
||||||
/* Restore to page 0 */
|
|
||||||
smbus_write_byte(SPD_PAGE_0, 0, 0);
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
#define LPX_PHYSICAL_CH_WIDTH 16
|
#define LPX_PHYSICAL_CH_WIDTH 16
|
||||||
#define LPX_CHANNELS CHANNEL_COUNT(LPX_PHYSICAL_CH_WIDTH)
|
#define LPX_CHANNELS CHANNEL_COUNT(LPX_PHYSICAL_CH_WIDTH)
|
||||||
|
|
||||||
#define DDR5_PHYSICAL_CH_WIDTH 32
|
#define DDR5_PHYSICAL_CH_WIDTH 64 /* 32*2 */
|
||||||
#define DDR5_CHANNELS CHANNEL_COUNT(DDR5_PHYSICAL_CH_WIDTH)
|
#define DDR5_CHANNELS CHANNEL_COUNT(DDR5_PHYSICAL_CH_WIDTH)
|
||||||
|
|
||||||
static void set_rcomp_config(FSP_M_CONFIG *mem_cfg, const struct mb_cfg *mb_cfg)
|
static void set_rcomp_config(FSP_M_CONFIG *mem_cfg, const struct mb_cfg *mb_cfg)
|
||||||
@@ -38,18 +38,16 @@ static const struct soc_mem_cfg soc_mem_cfg[] = {
|
|||||||
.num_phys_channels = DDR5_CHANNELS,
|
.num_phys_channels = DDR5_CHANNELS,
|
||||||
.phys_to_mrc_map = {
|
.phys_to_mrc_map = {
|
||||||
[0] = 0,
|
[0] = 0,
|
||||||
[1] = 1,
|
[1] = 4,
|
||||||
[2] = 4,
|
|
||||||
[3] = 5,
|
|
||||||
},
|
},
|
||||||
.md_phy_masks = {
|
.md_phy_masks = {
|
||||||
/*
|
/*
|
||||||
* Physical channels 0 and 1 are populated in case of
|
* Only channel 0 is populated in case of half-populated
|
||||||
* half-populated configurations.
|
* configuration.
|
||||||
*/
|
*/
|
||||||
.half_channel = BIT(0) | BIT(1),
|
.half_channel = BIT(0),
|
||||||
/* In mixed topologies, channels 2 and 3 are always memory-down. */
|
/* In mixed topologies, either channel 0 or 1 can be memory-down. */
|
||||||
.mixed_topo = BIT(2) | BIT(3),
|
.mixed_topo = BIT(0) | BIT(1),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
[MEM_TYPE_LP5X] = {
|
[MEM_TYPE_LP5X] = {
|
||||||
@@ -75,7 +73,8 @@ static const struct soc_mem_cfg soc_mem_cfg[] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void mem_init_spd_upds(FSP_M_CONFIG *mem_cfg, const struct mem_channel_data *data)
|
static void mem_init_spd_upds(FSP_M_CONFIG *mem_cfg, const struct mem_channel_data *data,
|
||||||
|
bool expand_channels)
|
||||||
{
|
{
|
||||||
efi_uintn_t *spd_upds[MRC_CHANNELS][CONFIG_DIMMS_PER_CHANNEL] = {
|
efi_uintn_t *spd_upds[MRC_CHANNELS][CONFIG_DIMMS_PER_CHANNEL] = {
|
||||||
[0] = { &mem_cfg->MemorySpdPtr000, &mem_cfg->MemorySpdPtr001, },
|
[0] = { &mem_cfg->MemorySpdPtr000, &mem_cfg->MemorySpdPtr001, },
|
||||||
@@ -108,7 +107,16 @@ static void mem_init_spd_upds(FSP_M_CONFIG *mem_cfg, const struct mem_channel_da
|
|||||||
for (dimm = 0; dimm < CONFIG_DIMMS_PER_CHANNEL; dimm++) {
|
for (dimm = 0; dimm < CONFIG_DIMMS_PER_CHANNEL; dimm++) {
|
||||||
efi_uintn_t *spd_ptr = spd_upds[ch][dimm];
|
efi_uintn_t *spd_ptr = spd_upds[ch][dimm];
|
||||||
|
|
||||||
*spd_ptr = data->spd[ch][dimm];
|
// In DDR5 systems, we need to copy the SPD data such that:
|
||||||
|
// Channel 0 data is used by channel 0 and 1
|
||||||
|
// Channel 2 data is used by channel 2 and 3
|
||||||
|
// Channel 4 data is used by channel 4 and 5
|
||||||
|
// Channel 6 data is used by channel 6 and 7
|
||||||
|
if (expand_channels)
|
||||||
|
*spd_ptr = data->spd[ch & 6][dimm];
|
||||||
|
else
|
||||||
|
*spd_ptr = data->spd[ch][dimm];
|
||||||
|
|
||||||
if (*spd_ptr)
|
if (*spd_ptr)
|
||||||
enable_channel = 1;
|
enable_channel = 1;
|
||||||
}
|
}
|
||||||
@@ -174,27 +182,12 @@ static void mem_init_dqs_upds(FSP_M_CONFIG *mem_cfg, const struct mem_channel_da
|
|||||||
mem_init_dq_dqs_upds(dqs_upds, mb_cfg->dqs_map, upd_size, data, auto_detect);
|
mem_init_dq_dqs_upds(dqs_upds, mb_cfg->dqs_map, upd_size, data, auto_detect);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DDR5_CH_DIMM_OFFSET(ch, dimm) ((ch) * CONFIG_DIMMS_PER_CHANNEL + (dimm))
|
|
||||||
|
|
||||||
static void ddr5_fill_dimm_module_info(FSP_M_CONFIG *mem_cfg, const struct mb_cfg *mb_cfg,
|
|
||||||
const struct mem_spd *spd_info)
|
|
||||||
{
|
|
||||||
for (size_t ch = 0; ch < soc_mem_cfg[MEM_TYPE_DDR5].num_phys_channels; ch++) {
|
|
||||||
for (size_t dimm = 0; dimm < CONFIG_DIMMS_PER_CHANNEL; dimm++) {
|
|
||||||
size_t mrc_ch = soc_mem_cfg[MEM_TYPE_DDR5].phys_to_mrc_map[ch];
|
|
||||||
mem_cfg->SpdAddressTable[DDR5_CH_DIMM_OFFSET(mrc_ch, dimm)] =
|
|
||||||
spd_info->smbus[ch].addr_dimm[dimm] << 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mem_init_dq_upds(mem_cfg, NULL, mb_cfg, true);
|
|
||||||
mem_init_dqs_upds(mem_cfg, NULL, mb_cfg, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg,
|
void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg,
|
||||||
const struct mem_spd *spd_info, bool half_populated)
|
const struct mem_spd *spd_info, bool half_populated)
|
||||||
{
|
{
|
||||||
struct mem_channel_data data;
|
struct mem_channel_data data;
|
||||||
bool dq_dqs_auto_detect = false;
|
bool dq_dqs_auto_detect = false;
|
||||||
|
bool expand_channels = false;
|
||||||
FSP_M_CONFIG *mem_cfg = &memupd->FspmConfig;
|
FSP_M_CONFIG *mem_cfg = &memupd->FspmConfig;
|
||||||
|
|
||||||
mem_cfg->ECT = mb_cfg->ect;
|
mem_cfg->ECT = mb_cfg->ect;
|
||||||
@@ -205,14 +198,7 @@ void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg,
|
|||||||
case MEM_TYPE_DDR5:
|
case MEM_TYPE_DDR5:
|
||||||
meminit_ddr(mem_cfg, &mb_cfg->ddr_config);
|
meminit_ddr(mem_cfg, &mb_cfg->ddr_config);
|
||||||
dq_dqs_auto_detect = true;
|
dq_dqs_auto_detect = true;
|
||||||
/*
|
expand_channels = true;
|
||||||
* TODO: Drop this workaround once SMBus driver in coreboot is updated to
|
|
||||||
* support DDR5 EEPROM reading.
|
|
||||||
*/
|
|
||||||
if (spd_info->topo == MEM_TOPO_DIMM_MODULE) {
|
|
||||||
ddr5_fill_dimm_module_info(mem_cfg, mb_cfg, spd_info);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case MEM_TYPE_LP5X:
|
case MEM_TYPE_LP5X:
|
||||||
meminit_lp5x(mem_cfg, &mb_cfg->lp5x_config);
|
meminit_lp5x(mem_cfg, &mb_cfg->lp5x_config);
|
||||||
@@ -221,9 +207,9 @@ void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg,
|
|||||||
die("Unsupported memory type(%d)\n", mb_cfg->type);
|
die("Unsupported memory type(%d)\n", mb_cfg->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
mem_populate_channel_data(memupd, &soc_mem_cfg[mb_cfg->type], spd_info,
|
mem_populate_channel_data(memupd, &soc_mem_cfg[mb_cfg->type], spd_info, half_populated,
|
||||||
half_populated, &data);
|
&data);
|
||||||
mem_init_spd_upds(mem_cfg, &data);
|
mem_init_spd_upds(mem_cfg, &data, expand_channels);
|
||||||
mem_init_dq_upds(mem_cfg, &data, mb_cfg, dq_dqs_auto_detect);
|
mem_init_dq_upds(mem_cfg, &data, mb_cfg, dq_dqs_auto_detect);
|
||||||
mem_init_dqs_upds(mem_cfg, &data, mb_cfg, dq_dqs_auto_detect);
|
mem_init_dqs_upds(mem_cfg, &data, mb_cfg, dq_dqs_auto_detect);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user