Compare commits
19 Commits
system76
...
system76-4
Author | SHA1 | Date | |
---|---|---|---|
|
a8bf2b32ae | ||
|
43019aa7da | ||
|
2018180c47 | ||
|
87aaef8d1a | ||
|
182adc61a2 | ||
|
1b49402e33 | ||
|
8138513b35 | ||
|
ba0100f010 | ||
|
72cd47f9ba | ||
|
8b8a831699 | ||
|
fb352b86fc | ||
|
084e54522a | ||
|
8d28bd2c9f | ||
|
9747417290 | ||
|
2a0ab9f8cf | ||
|
5ff2a1548f | ||
|
ad3eee8f83 | ||
|
90176c56f4 | ||
|
cb8a72cace |
32
.gitmodules
vendored
32
.gitmodules
vendored
@ -1,62 +1,62 @@
|
||||
[submodule "3rdparty/blobs"]
|
||||
path = 3rdparty/blobs
|
||||
url = ../blobs.git
|
||||
url = https://review.coreboot.org/blobs.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "util/nvidia-cbootimage"]
|
||||
path = util/nvidia/cbootimage
|
||||
url = ../nvidia-cbootimage.git
|
||||
url = https://review.coreboot.org/nvidia-cbootimage.git
|
||||
[submodule "vboot"]
|
||||
path = 3rdparty/vboot
|
||||
url = ../vboot.git
|
||||
url = https://review.coreboot.org/vboot.git
|
||||
branch = main
|
||||
[submodule "arm-trusted-firmware"]
|
||||
path = 3rdparty/arm-trusted-firmware
|
||||
url = ../arm-trusted-firmware.git
|
||||
url = https://review.coreboot.org/arm-trusted-firmware.git
|
||||
[submodule "3rdparty/chromeec"]
|
||||
path = 3rdparty/chromeec
|
||||
url = ../chrome-ec.git
|
||||
url = https://review.coreboot.org/chrome-ec.git
|
||||
[submodule "libhwbase"]
|
||||
path = 3rdparty/libhwbase
|
||||
url = ../libhwbase.git
|
||||
url = https://review.coreboot.org/libhwbase.git
|
||||
[submodule "libgfxinit"]
|
||||
path = 3rdparty/libgfxinit
|
||||
url = ../libgfxinit.git
|
||||
url = https://review.coreboot.org/libgfxinit.git
|
||||
[submodule "3rdparty/fsp"]
|
||||
path = 3rdparty/fsp
|
||||
url = ../fsp.git
|
||||
url = https://review.coreboot.org/fsp.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "opensbi"]
|
||||
path = 3rdparty/opensbi
|
||||
url = ../opensbi.git
|
||||
url = https://review.coreboot.org/opensbi.git
|
||||
[submodule "intel-microcode"]
|
||||
path = 3rdparty/intel-microcode
|
||||
url = ../intel-microcode.git
|
||||
url = https://review.coreboot.org/intel-microcode.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
branch = main
|
||||
[submodule "3rdparty/ffs"]
|
||||
path = 3rdparty/ffs
|
||||
url = ../ffs.git
|
||||
url = https://review.coreboot.org/ffs.git
|
||||
[submodule "3rdparty/amd_blobs"]
|
||||
path = 3rdparty/amd_blobs
|
||||
url = ../amd_blobs
|
||||
url = https://review.coreboot.org/amd_blobs
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/cmocka"]
|
||||
path = 3rdparty/cmocka
|
||||
url = ../cmocka.git
|
||||
url = https://review.coreboot.org/cmocka.git
|
||||
update = none
|
||||
[submodule "3rdparty/qc_blobs"]
|
||||
path = 3rdparty/qc_blobs
|
||||
url = ../qc_blobs.git
|
||||
url = https://review.coreboot.org/qc_blobs.git
|
||||
update = none
|
||||
ignore = dirty
|
||||
[submodule "3rdparty/intel-sec-tools"]
|
||||
path = 3rdparty/intel-sec-tools
|
||||
url = ../9esec-security-tooling.git
|
||||
url = https://review.coreboot.org/9esec-security-tooling.git
|
||||
[submodule "3rdparty/stm"]
|
||||
path = 3rdparty/stm
|
||||
url = ../STM
|
||||
url = https://review.coreboot.org/STM
|
||||
branch = stmpe
|
||||
|
10
src/drivers/gfx/nvidia/Kconfig
Normal file
10
src/drivers/gfx/nvidia/Kconfig
Normal file
@ -0,0 +1,10 @@
|
||||
config DRIVERS_GFX_NVIDIA
|
||||
bool
|
||||
default n
|
||||
help
|
||||
Support for NVIDIA Optimus with GC6 3.0
|
||||
|
||||
config DRIVERS_GFX_NVIDIA_BRIDGE
|
||||
hex "PCI bridge for the GPU device"
|
||||
default 0x01
|
||||
depends on DRIVERS_GFX_NVIDIA
|
5
src/drivers/gfx/nvidia/Makefile.inc
Normal file
5
src/drivers/gfx/nvidia/Makefile.inc
Normal file
@ -0,0 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
romstage-$(CONFIG_DRIVERS_GFX_NVIDIA) += romstage.c
|
||||
|
||||
ramstage-$(CONFIG_DRIVERS_GFX_NVIDIA) += nvidia.c
|
202
src/drivers/gfx/nvidia/acpi/gpu.asl
Normal file
202
src/drivers/gfx/nvidia/acpi/gpu.asl
Normal file
@ -0,0 +1,202 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
Device (\_SB.PCI0.PEGP) {
|
||||
Name (_ADR, CONFIG_DRIVERS_GFX_NVIDIA_BRIDGE << 16)
|
||||
|
||||
PowerResource (PWRR, 0, 0) {
|
||||
Name (_STA, 1)
|
||||
|
||||
Method (_ON) {
|
||||
Debug = "PEGP.PWRR._ON"
|
||||
If (_STA != 1) {
|
||||
\_SB.PCI0.PEGP.DEV0._ON ()
|
||||
_STA = 1
|
||||
}
|
||||
}
|
||||
|
||||
Method (_OFF) {
|
||||
Debug = "PEGP.PWRR._OFF"
|
||||
If (_STA != 0) {
|
||||
\_SB.PCI0.PEGP.DEV0._OFF ()
|
||||
_STA = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Name (_PR0, Package () { \_SB.PCI0.PEGP.PWRR })
|
||||
Name (_PR2, Package () { \_SB.PCI0.PEGP.PWRR })
|
||||
Name (_PR3, Package () { \_SB.PCI0.PEGP.PWRR })
|
||||
}
|
||||
|
||||
Device (\_SB.PCI0.PEGP.DEV0) {
|
||||
Name(_ADR, 0x00000000)
|
||||
Name (_STA, 0xF)
|
||||
Name (LTRE, 0)
|
||||
|
||||
// Memory mapped PCI express registers
|
||||
// Not sure what this stuff is, but it is used to get into GC6
|
||||
// TODO: use GPU config to generate address
|
||||
OperationRegion (RPCX, SystemMemory, CONFIG_ECAM_MMCONF_BASE_ADDRESS + 0x8000, 0x1000)
|
||||
Field (RPCX, ByteAcc, NoLock, Preserve) {
|
||||
PVID, 16,
|
||||
PDID, 16,
|
||||
CMDR, 8,
|
||||
Offset (0x19),
|
||||
PRBN, 8,
|
||||
Offset (0x84),
|
||||
D0ST, 2,
|
||||
Offset (0xAA),
|
||||
CEDR, 1,
|
||||
Offset (0xAC),
|
||||
, 4,
|
||||
CMLW, 6,
|
||||
Offset (0xB0),
|
||||
ASPM, 2,
|
||||
, 2,
|
||||
P0LD, 1,
|
||||
RTLK, 1,
|
||||
Offset (0xC9),
|
||||
, 2,
|
||||
LREN, 1,
|
||||
Offset (0x11A),
|
||||
, 1,
|
||||
VCNP, 1,
|
||||
Offset (0x214),
|
||||
Offset (0x216),
|
||||
P0LS, 4,
|
||||
Offset (0x248),
|
||||
, 7,
|
||||
Q0L2, 1,
|
||||
Q0L0, 1,
|
||||
Offset (0x504),
|
||||
Offset (0x506),
|
||||
PCFG, 2,
|
||||
Offset (0x508),
|
||||
TREN, 1,
|
||||
Offset (0xC20),
|
||||
, 4,
|
||||
P0AP, 2,
|
||||
Offset (0xC38),
|
||||
, 3,
|
||||
P0RM, 1,
|
||||
Offset (0xC74),
|
||||
P0LT, 4,
|
||||
Offset (0xD0C),
|
||||
, 20,
|
||||
LREV, 1
|
||||
}
|
||||
|
||||
Method (_ON) {
|
||||
Debug = "PEGP.DEV0._ON"
|
||||
|
||||
If (_STA != 0xF) {
|
||||
Debug = " If DGPU_PWR_EN low"
|
||||
If (! GTXS (DGPU_PWR_EN)) {
|
||||
Debug = " DGPU_PWR_EN high"
|
||||
STXS (DGPU_PWR_EN)
|
||||
|
||||
Debug = " Sleep 16"
|
||||
Sleep (16)
|
||||
}
|
||||
|
||||
Debug = " DGPU_RST_N high"
|
||||
STXS(DGPU_RST_N)
|
||||
|
||||
Debug = " Sleep 10"
|
||||
Sleep (10)
|
||||
|
||||
Debug = " Q0L0 = 1"
|
||||
Q0L0 = 1
|
||||
|
||||
Debug = " Sleep 16"
|
||||
Sleep (16)
|
||||
|
||||
Debug = " While Q0L0"
|
||||
Local0 = 0
|
||||
While (Q0L0) {
|
||||
If ((Local0 > 4)) {
|
||||
Debug = " While Q0L0 timeout"
|
||||
Break
|
||||
}
|
||||
|
||||
Sleep (16)
|
||||
Local0++
|
||||
}
|
||||
|
||||
Debug = " P0RM = 0"
|
||||
P0RM = 0
|
||||
|
||||
Debug = " P0AP = 0"
|
||||
P0AP = 0
|
||||
|
||||
Debug = Concatenate(" LREN = ", ToHexString(LTRE))
|
||||
LREN = LTRE
|
||||
|
||||
Debug = " CEDR = 1"
|
||||
CEDR = 1
|
||||
|
||||
Debug = " CMDR |= 7"
|
||||
CMDR |= 7
|
||||
|
||||
Debug = " _STA = 0xF"
|
||||
_STA = 0xF
|
||||
}
|
||||
}
|
||||
|
||||
Method (_OFF) {
|
||||
Debug = "PEGP.DEV0._OFF"
|
||||
|
||||
If (_STA != 0x5) {
|
||||
Debug = Concatenate(" LTRE = ", ToHexString(LREN))
|
||||
LTRE = LREN
|
||||
|
||||
Debug = " Q0L2 = 1"
|
||||
Q0L2 = 1
|
||||
|
||||
Debug = " Sleep 16"
|
||||
Sleep (16)
|
||||
|
||||
Debug = " While Q0L2"
|
||||
Local0 = Zero
|
||||
While (Q0L2) {
|
||||
If ((Local0 > 4)) {
|
||||
Debug = " While Q0L2 timeout"
|
||||
Break
|
||||
}
|
||||
|
||||
Sleep (16)
|
||||
Local0++
|
||||
}
|
||||
|
||||
Debug = " P0RM = 1"
|
||||
P0RM = 1
|
||||
|
||||
Debug = " P0AP = 3"
|
||||
P0AP = 3
|
||||
|
||||
Debug = " Sleep 10"
|
||||
Sleep (10)
|
||||
|
||||
Debug = " DGPU_RST_N low"
|
||||
CTXS(DGPU_RST_N)
|
||||
|
||||
Debug = " While DGPU_GC6 low"
|
||||
Local0 = Zero
|
||||
While (! GRXS(DGPU_GC6)) {
|
||||
If ((Local0 > 4)) {
|
||||
Debug = " While DGPU_GC6 low timeout"
|
||||
|
||||
Debug = " DGPU_PWR_EN low"
|
||||
CTXS (DGPU_PWR_EN)
|
||||
Break
|
||||
}
|
||||
|
||||
Sleep (16)
|
||||
Local0++
|
||||
}
|
||||
|
||||
Debug = " _STA = 0x5"
|
||||
_STA = 0x5
|
||||
}
|
||||
}
|
||||
}
|
10
src/drivers/gfx/nvidia/chip.h
Normal file
10
src/drivers/gfx/nvidia/chip.h
Normal file
@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef _DRIVERS_GFX_NVIDIA_CHIP_H_
|
||||
#define _DRIVERS_GFX_NVIDIA_CHIP_H_
|
||||
|
||||
struct drivers_gfx_nvidia_config {
|
||||
/* TODO: Set GPIOs in devicetree? */
|
||||
};
|
||||
|
||||
#endif /* _DRIVERS_GFX_NVIDIA_CHIP_H_ */
|
19
src/drivers/gfx/nvidia/gpu.h
Normal file
19
src/drivers/gfx/nvidia/gpu.h
Normal file
@ -0,0 +1,19 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#ifndef _DRIVERS_GFX_NVIDIA_GPU_H_
|
||||
#define _DRIVERS_GFX_NVIDIA_GPU_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
struct nvidia_gpu_config {
|
||||
/* GPIO for GPU_PWR_EN */
|
||||
unsigned int power_gpio;
|
||||
/* GPIO for GPU_RST# */
|
||||
unsigned int reset_gpio;
|
||||
/* Enable or disable GPU power */
|
||||
bool enable;
|
||||
};
|
||||
|
||||
void nvidia_set_power(const struct nvidia_gpu_config *config);
|
||||
|
||||
#endif /* _DRIVERS_NVIDIA_GPU_H_ */
|
67
src/drivers/gfx/nvidia/nvidia.c
Normal file
67
src/drivers/gfx/nvidia/nvidia.c
Normal file
@ -0,0 +1,67 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include "chip.h"
|
||||
#include <console/console.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
|
||||
#define NVIDIA_SUBSYSTEM_ID_OFFSET 0x40
|
||||
|
||||
static void nvidia_read_resources(struct device *dev)
|
||||
{
|
||||
printk(BIOS_DEBUG, "%s: %s\n", __func__, dev_path(dev));
|
||||
|
||||
pci_dev_read_resources(dev);
|
||||
|
||||
// Find all BARs on GPU, mark them above 4g if prefetchable
|
||||
for (int bar = PCI_BASE_ADDRESS_0; bar <= PCI_BASE_ADDRESS_5; bar += 4) {
|
||||
struct resource *res = probe_resource(dev, bar);
|
||||
|
||||
if (res) {
|
||||
if (res->flags & IORESOURCE_PREFETCH) {
|
||||
printk(BIOS_INFO, " BAR at 0x%02x marked above 4g\n", bar);
|
||||
res->flags |= IORESOURCE_ABOVE_4G;
|
||||
} else {
|
||||
printk(BIOS_DEBUG, " BAR at 0x%02x not prefetch\n", bar);
|
||||
}
|
||||
} else {
|
||||
printk(BIOS_DEBUG, " BAR at 0x%02x not found\n", bar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void nvidia_set_subsystem(struct device *dev, unsigned int vendor, unsigned int device)
|
||||
{
|
||||
pci_write_config32(dev, NVIDIA_SUBSYSTEM_ID_OFFSET,
|
||||
((device & 0xffff) << 16) | (vendor & 0xffff));
|
||||
}
|
||||
|
||||
static struct pci_operations nvidia_device_ops_pci = {
|
||||
.set_subsystem = nvidia_set_subsystem,
|
||||
};
|
||||
|
||||
static struct device_operations nvidia_device_ops = {
|
||||
.read_resources = nvidia_read_resources,
|
||||
.set_resources = pci_dev_set_resources,
|
||||
.enable_resources = pci_dev_enable_resources,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
.write_acpi_tables = pci_rom_write_acpi_tables,
|
||||
.acpi_fill_ssdt = pci_rom_ssdt,
|
||||
#endif
|
||||
.init = pci_dev_init,
|
||||
.ops_pci = &nvidia_device_ops_pci,
|
||||
|
||||
};
|
||||
|
||||
static void nvidia_enable(struct device *dev)
|
||||
{
|
||||
if (!dev->enabled || dev->path.type != DEVICE_PATH_PCI)
|
||||
return;
|
||||
|
||||
dev->ops = &nvidia_device_ops;
|
||||
}
|
||||
|
||||
struct chip_operations drivers_gfx_nvidia_ops = {
|
||||
CHIP_NAME("NVIDIA Optimus graphics device")
|
||||
.enable_dev = nvidia_enable
|
||||
};
|
33
src/drivers/gfx/nvidia/romstage.c
Normal file
33
src/drivers/gfx/nvidia/romstage.c
Normal file
@ -0,0 +1,33 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <console/console.h>
|
||||
#include <delay.h>
|
||||
#include <device/device.h>
|
||||
#include <device/pci.h>
|
||||
#include <gpio.h>
|
||||
#include "chip.h"
|
||||
#include "gpu.h"
|
||||
|
||||
void nvidia_set_power(const struct nvidia_gpu_config *config)
|
||||
{
|
||||
if (!config->power_gpio || !config->reset_gpio) {
|
||||
printk(BIOS_ERR, "%s: GPU_PWR_EN and GPU_RST# must be set\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
printk(BIOS_DEBUG, "%s: GPU_PWR_EN = %d\n", __func__, config->power_gpio);
|
||||
printk(BIOS_DEBUG, "%s: GPU_RST# = %d\n", __func__, config->reset_gpio);
|
||||
|
||||
gpio_set(config->reset_gpio, 0);
|
||||
mdelay(4);
|
||||
|
||||
if (config->enable) {
|
||||
gpio_set(config->power_gpio, 1);
|
||||
mdelay(4);
|
||||
gpio_set(config->reset_gpio, 1);
|
||||
} else {
|
||||
gpio_set(config->power_gpio, 0);
|
||||
}
|
||||
|
||||
mdelay(4);
|
||||
}
|
@ -13,6 +13,11 @@ config EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
bool
|
||||
default n
|
||||
|
||||
config EC_SYSTEM76_EC_DGPU
|
||||
depends on EC_SYSTEM76_EC
|
||||
bool
|
||||
default n
|
||||
|
||||
config EC_SYSTEM76_EC_OLED
|
||||
depends on EC_SYSTEM76_EC
|
||||
bool
|
||||
|
@ -117,6 +117,9 @@ Device (S76D) {
|
||||
Method (NFAN, 0, Serialized) {
|
||||
Return (Package() {
|
||||
"CPU fan",
|
||||
#if CONFIG(EC_SYSTEM76_EC_DGPU)
|
||||
"GPU fan",
|
||||
#endif
|
||||
})
|
||||
}
|
||||
|
||||
@ -144,6 +147,9 @@ Device (S76D) {
|
||||
Method (NTMP, 0, Serialized) {
|
||||
Return (Package() {
|
||||
"CPU temp",
|
||||
#if CONFIG(EC_SYSTEM76_EC_DGPU)
|
||||
"GPU temp",
|
||||
#endif
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,8 @@
|
||||
#define CPUID_COMETLAKE_H_S_6_2_G0 0xa0650
|
||||
#define CPUID_COMETLAKE_H_S_6_2_G1 0xa0653
|
||||
#define CPUID_COMETLAKE_H_S_10_2_P0 0xa0651
|
||||
#define CPUID_COMETLAKE_H_S_10_2_Q0_P1 0xa0654
|
||||
#define CPUID_COMETLAKE_H_S_10_2_P1 0xa0654
|
||||
#define CPUID_COMETLAKE_H_S_10_2_Q0 0xa0655
|
||||
#define CPUID_TIGERLAKE_A0 0x806c0
|
||||
#define CPUID_TIGERLAKE_B0 0x806c1
|
||||
#define CPUID_TIGERLAKE_R0 0x806d1
|
||||
|
@ -3,11 +3,13 @@ if BOARD_SYSTEM76_ADDW1 || BOARD_SYSTEM76_ADDW2
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select DRIVERS_I2C_TAS5825M
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select EC_SYSTEM76_EC_OLED
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
@ -60,6 +62,9 @@ config ONBOARD_VGA_IS_PRIMARY
|
||||
config UART_FOR_CONSOLE
|
||||
default 2
|
||||
|
||||
config MAX_CPUS
|
||||
default 16
|
||||
|
||||
config DIMM_MAX
|
||||
default 2
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <variant/gpio.h>
|
||||
#include <drivers/gfx/nvidia/acpi/gpu.asl>
|
||||
|
||||
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
||||
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -58,6 +58,13 @@ chip soc/intel/cannonlake
|
||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||
register "PcieClkSrcUsage[8]" = "0x40"
|
||||
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
|
||||
device pci 02.0 on end # Integrated Graphics Device
|
||||
device pci 04.0 on # SA Thermal device
|
||||
|
@ -3,7 +3,15 @@
|
||||
#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
|
||||
|
||||
#ifndef __ACPI__
|
||||
void variant_configure_early_gpios(void);
|
||||
void variant_configure_gpios(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/gfx/nvidia/gpu.h>
|
||||
#include <soc/cnl_memcfg_init.h>
|
||||
#include <soc/romstage.h>
|
||||
#include <variant/gpio.h>
|
||||
|
||||
static const struct cnl_mb_cfg memcfg = {
|
||||
.spd[0] = {
|
||||
@ -20,6 +22,18 @@ static const struct cnl_mb_cfg memcfg = {
|
||||
|
||||
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 higher memory speeds
|
||||
memupd->FspmConfig.SaOcSupport = 1;
|
||||
|
||||
|
@ -3,10 +3,12 @@ if BOARD_SYSTEM76_BONW14
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -62,10 +62,12 @@ chip soc/intel/cannonlake
|
||||
register "PcieClkSrcUsage[7]" = "0x40"
|
||||
register "PcieClkSrcClkReq[7]" = "7"
|
||||
|
||||
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
|
||||
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
|
||||
# TODO: is this enough to disable iGPU?
|
||||
device pci 02.0 off end # Integrated Graphics Device
|
||||
|
@ -22,6 +22,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
select TPM_RDRESP_NEED_DELAY
|
||||
|
||||
config MAINBOARD_DIR
|
||||
default "system76/cml-u"
|
||||
|
31
src/mainboard/system76/cml-u/acpi/backlight.asl
Normal file
31
src/mainboard/system76/cml-u/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -6,6 +6,9 @@
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
||||
Scope (\_GPE) {
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -19,7 +19,6 @@ DefinitionBlock(
|
||||
{
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/cannonlake/acpi/southbridge.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
31
src/mainboard/system76/darp7/acpi/backlight.asl
Normal file
31
src/mainboard/system76/darp7/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -6,4 +6,7 @@
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Enable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -20,7 +20,6 @@ DefinitionBlock(
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/southbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/tcss.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -3,11 +3,13 @@ if BOARD_SYSTEM76_GALP5
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select DRIVERS_INTEL_PMC
|
||||
select DRIVERS_INTEL_USB4_RETIMER
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
select HAVE_OPTION_TABLE
|
||||
@ -22,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
select TPM_RDRESP_NEED_DELAY
|
||||
|
||||
config MAINBOARD_DIR
|
||||
default "system76/galp5"
|
||||
@ -57,4 +60,7 @@ config UART_FOR_CONSOLE
|
||||
config USE_PM_ACPI_TIMER
|
||||
default n
|
||||
|
||||
config DRIVERS_GFX_NVIDIA_BRIDGE
|
||||
default 0x1c
|
||||
|
||||
endif
|
||||
|
31
src/mainboard/system76/galp5/acpi/backlight.asl
Normal file
31
src/mainboard/system76/galp5/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
40
src/mainboard/system76/galp5/acpi/dgpu.asl
Normal file
40
src/mainboard/system76/galp5/acpi/dgpu.asl
Normal file
@ -0,0 +1,40 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
Scope (\_SB.PCI0.RP05)
|
||||
{
|
||||
Device (DEV0)
|
||||
{
|
||||
Name(_ADR, 0x00000000)
|
||||
|
||||
// Fix SSID being lost across sleep by saving it
|
||||
Name(NVSS, 0x00000000)
|
||||
|
||||
OperationRegion (PCIC, PCI_Config, 0x00, 0x50)
|
||||
Field (PCIC, DwordAcc, NoLock, Preserve)
|
||||
{
|
||||
Offset (0x40),
|
||||
SSID, 32,
|
||||
}
|
||||
|
||||
Name (_PR0, Package () { PWRR })
|
||||
Name (_PR3, Package () { PWRR })
|
||||
PowerResource (PWRR, 0, 0)
|
||||
{
|
||||
Name (_STA, 1)
|
||||
|
||||
Method (_ON)
|
||||
{
|
||||
^^SSID = ^^NVSS
|
||||
Printf("GPU _ON %o", ToHexString(^^SSID))
|
||||
_STA = 1
|
||||
}
|
||||
|
||||
Method (_OFF)
|
||||
{
|
||||
^^NVSS = ^^SSID
|
||||
Printf("GPU _OFF %o", ToHexString(^^SSID))
|
||||
_STA = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include "dgpu.asl"
|
||||
|
||||
#define EC_GPE_SCI 0x6E
|
||||
#define EC_GPE_SWI 0x6B
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Enable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -278,6 +278,13 @@ chip soc/intel/tigerlake
|
||||
register "srcclk_pin" = "2" # PEG_CLKREQ#
|
||||
device generic 0 on end
|
||||
end
|
||||
|
||||
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
|
||||
device ref pcie_rp9 on
|
||||
# PCIe root port #9 x1, Clock 3 (CARD)
|
||||
|
@ -20,7 +20,6 @@ DefinitionBlock(
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/southbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/tcss.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -5,6 +5,12 @@
|
||||
|
||||
#include <soc/gpio.h>
|
||||
|
||||
#define DGPU_RST_N GPP_U4
|
||||
#define DGPU_PWR_EN GPP_U5
|
||||
#define DGPU_GC6 GPP_D2
|
||||
|
||||
#ifndef __ACPI__
|
||||
|
||||
static const struct pad_config early_gpio_table[] = {
|
||||
PAD_CFG_NF(GPP_C20, UP_20K, DEEP, NF1), // UART2_RXD
|
||||
PAD_CFG_NF(GPP_C21, UP_20K, DEEP, NF1), // UART2_TXD
|
||||
@ -222,4 +228,6 @@ static const struct pad_config gpio_table[] = {
|
||||
//PAD_CFG_GPO(GPP_U5, 0, DEEP), // DGPU_PWR_EN
|
||||
};
|
||||
|
||||
#endif /* __ACPI__ */
|
||||
|
||||
#endif /* MAINBOARD_GPIO_H */
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include "gpio.h"
|
||||
#include <drivers/gfx/nvidia/gpu.h>
|
||||
#include <fsp/util.h>
|
||||
#include <soc/meminit.h>
|
||||
#include <soc/romstage.h>
|
||||
@ -18,5 +20,20 @@ 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;
|
||||
|
||||
// Allow memory clocks higher than 2933 MHz
|
||||
mupd->FspmConfig.SaOcSupport = 1;
|
||||
|
||||
memcfg_init(&mupd->FspmConfig, &board_cfg, &spd_info, half_populated);
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ if BOARD_SYSTEM76_GAZE14 || BOARD_SYSTEM76_GAZE15
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
|
31
src/mainboard/system76/gaze15/acpi/backlight.asl
Normal file
31
src/mainboard/system76/gaze15/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -1,11 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <variant/gpio.h>
|
||||
#include <drivers/gfx/nvidia/acpi/gpu.asl>
|
||||
|
||||
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
||||
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
||||
Scope (\_GPE) {
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -57,6 +57,13 @@ chip soc/intel/cannonlake
|
||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||
register "PcieClkSrcUsage[8]" = "0x40"
|
||||
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
|
||||
device pci 02.0 on # Integrated Graphics Device
|
||||
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
||||
|
@ -18,7 +18,6 @@ DefinitionBlock(
|
||||
Device (\_SB.PCI0) {
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/cannonlake/acpi/southbridge.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -3,7 +3,15 @@
|
||||
#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
|
||||
|
||||
#ifndef __ACPI__
|
||||
void variant_configure_early_gpios(void);
|
||||
void variant_configure_gpios(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/gfx/nvidia/gpu.h>
|
||||
#include <soc/cnl_memcfg_init.h>
|
||||
#include <soc/romstage.h>
|
||||
#include <variant/gpio.h>
|
||||
|
||||
static const struct cnl_mb_cfg memcfg = {
|
||||
.spd[0] = {
|
||||
@ -20,5 +22,17 @@ static const struct cnl_mb_cfg memcfg = {
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -3,10 +3,12 @@ if BOARD_SYSTEM76_GAZE16_3050 || BOARD_SYSTEM76_GAZE16_3060 || BOARD_SYSTEM76_GA
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
@ -19,6 +21,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select NO_UART_ON_SUPERIO
|
||||
select SOC_INTEL_TIGERLAKE
|
||||
select SOC_INTEL_TIGERLAKE_PCH_H
|
||||
select SOC_INTEL_TIGERLAKE_S3
|
||||
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
|
31
src/mainboard/system76/gaze16/acpi/backlight.asl
Normal file
31
src/mainboard/system76/gaze16/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
40
src/mainboard/system76/gaze16/acpi/dgpu.asl
Normal file
40
src/mainboard/system76/gaze16/acpi/dgpu.asl
Normal file
@ -0,0 +1,40 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
Scope (\_SB.PCI0.PEG1)
|
||||
{
|
||||
Device (DEV0)
|
||||
{
|
||||
Name(_ADR, 0x00000000)
|
||||
|
||||
// Fix SSID being lost across sleep by saving it
|
||||
Name(NVSS, 0x00000000)
|
||||
|
||||
OperationRegion (PCIC, PCI_Config, 0x00, 0x50)
|
||||
Field (PCIC, DwordAcc, NoLock, Preserve)
|
||||
{
|
||||
Offset (0x40),
|
||||
SSID, 32,
|
||||
}
|
||||
|
||||
Name (_PR0, Package () { PWRR })
|
||||
Name (_PR3, Package () { PWRR })
|
||||
PowerResource (PWRR, 0, 0)
|
||||
{
|
||||
Name (_STA, 1)
|
||||
|
||||
Method (_ON)
|
||||
{
|
||||
^^SSID = ^^NVSS
|
||||
Printf("GPU _ON %o", ToHexString(^^SSID))
|
||||
_STA = 1
|
||||
}
|
||||
|
||||
Method (_OFF)
|
||||
{
|
||||
^^NVSS = ^^SSID
|
||||
Printf("GPU _OFF %o", ToHexString(^^SSID))
|
||||
_STA = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include "dgpu.asl"
|
||||
|
||||
#define EC_GPE_SCI 0x6E
|
||||
#define EC_GPE_SWI 0x6B
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -125,7 +125,9 @@ chip soc/intel/tigerlake
|
||||
device i2c 15 on end
|
||||
end
|
||||
end
|
||||
device ref heci1 on end
|
||||
device ref heci1 on
|
||||
register "HeciEnabled" = "1"
|
||||
end
|
||||
device ref uart2 on
|
||||
# Debug console
|
||||
register "SerialIoUartMode[PchSerialIoIndexUART2]" = "PchSerialIoSkipInit"
|
||||
|
@ -19,7 +19,6 @@ DefinitionBlock(
|
||||
{
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/southbridge.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -1,8 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/gfx/nvidia/gpu.h>
|
||||
#include <fsp/util.h>
|
||||
#include <soc/meminit.h>
|
||||
#include <soc/romstage.h>
|
||||
#include <variant/gpio.h>
|
||||
#include "variant.h"
|
||||
|
||||
static const struct mb_cfg board_cfg = {
|
||||
@ -22,9 +24,21 @@ static const struct mem_spd spd_info = {
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
variant_memory_init_params(mupd);
|
||||
|
||||
const bool half_populated = false;
|
||||
// Enable dGPU power
|
||||
nvidia_set_power(&config);
|
||||
|
||||
// Set primary display to internal graphics
|
||||
mupd->FspmConfig.PrimaryDisplay = 0;
|
||||
|
||||
memcfg_init(&mupd->FspmConfig, &board_cfg, &spd_info, half_populated);
|
||||
}
|
||||
|
@ -5,6 +5,12 @@
|
||||
|
||||
#include <soc/gpio.h>
|
||||
|
||||
#define DGPU_RST_N GPP_F8
|
||||
#define DGPU_PWR_EN GPP_F9
|
||||
#define DGPU_GC6 GPP_K11
|
||||
|
||||
#ifndef __ACPI__
|
||||
|
||||
static const struct pad_config early_gpio_table[] = {
|
||||
PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), // UART2_RXD
|
||||
PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), // UART2_TXD
|
||||
@ -285,4 +291,6 @@ static const struct pad_config gpio_table[] = {
|
||||
PAD_CFG_GPI(GPP_S7, NONE, DEEP), // DMIC_DAT_PCH
|
||||
};
|
||||
|
||||
#endif /* __ACPI__ */
|
||||
|
||||
#endif /* VARIANT_GPIO_H */
|
||||
|
@ -17,6 +17,13 @@ chip soc/intel/tigerlake
|
||||
register "srcclk_pin" = "-1" # GFX_CLKREQ0#
|
||||
device generic 0 on end
|
||||
end
|
||||
|
||||
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
|
||||
device ref peg0 on
|
||||
# PCIe PEG0 x4, Clock 4 (SSD2)
|
||||
|
@ -5,6 +5,12 @@
|
||||
|
||||
#include <soc/gpio.h>
|
||||
|
||||
#define DGPU_RST_N GPP_F8
|
||||
#define DGPU_PWR_EN GPP_F9
|
||||
#define DGPU_GC6 GPP_K11
|
||||
|
||||
#ifndef __ACPI__
|
||||
|
||||
static const struct pad_config early_gpio_table[] = {
|
||||
PAD_CFG_NF(GPP_C20, NONE, DEEP, NF1), // UART2_RXD
|
||||
PAD_CFG_NF(GPP_C21, NONE, DEEP, NF1), // UART2_TXD
|
||||
@ -285,4 +291,6 @@ static const struct pad_config gpio_table[] = {
|
||||
PAD_CFG_GPI(GPP_S7, NONE, DEEP), // MIC_DATA_PCH
|
||||
};
|
||||
|
||||
#endif /* __ACPI__ */
|
||||
|
||||
#endif /* VARIANT_GPIO_H */
|
||||
|
@ -17,6 +17,13 @@ chip soc/intel/tigerlake
|
||||
register "srcclk_pin" = "-1" # PEG_CLKREQ#
|
||||
device generic 0 on end
|
||||
end
|
||||
|
||||
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
|
||||
device ref peg0 on
|
||||
# PCIe PEG0 x4, Clock 7 (SSD1)
|
||||
|
@ -17,6 +17,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select SOC_INTEL_KABYLAKE
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
select TPM_RDRESP_NEED_DELAY
|
||||
|
||||
config MAINBOARD_DIR
|
||||
default "system76/kbl-u"
|
||||
|
31
src/mainboard/system76/lemp10/acpi/backlight.asl
Normal file
31
src/mainboard/system76/lemp10/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -6,4 +6,7 @@
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Enable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -20,7 +20,6 @@ DefinitionBlock(
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/southbridge.asl>
|
||||
#include <soc/intel/tigerlake/acpi/tcss.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -13,7 +13,6 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
||||
.topo = MEM_TOPO_MIXED,
|
||||
.cbfs_index = 0,
|
||||
.smbus = {
|
||||
[0] = { .addr_dimm[0] = 0x50, },
|
||||
[1] = { .addr_dimm[0] = 0x52, },
|
||||
},
|
||||
};
|
||||
|
@ -21,7 +21,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
select USE_LEGACY_8254_TIMER # Fix failure to boot GRUB
|
||||
select TPM_RDRESP_NEED_DELAY
|
||||
|
||||
config MAINBOARD_DIR
|
||||
default "system76/lemp9"
|
||||
@ -59,10 +59,6 @@ config VGA_BIOS_ID
|
||||
string
|
||||
default "8086,9b41"
|
||||
|
||||
config TPM_PIRQ
|
||||
hex
|
||||
default 0x10 # GPP_A7/PIRQA#
|
||||
|
||||
config POST_DEVICE
|
||||
bool
|
||||
default n
|
||||
|
31
src/mainboard/system76/lemp9/acpi/backlight.asl
Normal file
31
src/mainboard/system76/lemp9/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -6,6 +6,9 @@
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
||||
Scope (\_GPE) {
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -3,11 +3,13 @@ if BOARD_SYSTEM76_ORYP5
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select DRIVERS_I2C_TAS5825M
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
@ -22,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
select TPM_RDRESP_NEED_DELAY
|
||||
|
||||
config MAINBOARD_DIR
|
||||
default "system76/oryp5"
|
||||
|
31
src/mainboard/system76/oryp5/acpi/backlight.asl
Normal file
31
src/mainboard/system76/oryp5/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <mainboard/gpio.h>
|
||||
#include <drivers/gfx/nvidia/acpi/gpu.asl>
|
||||
|
||||
#define EC_GPE_SCI 0x17 /* GPP_B23 */
|
||||
#define EC_GPE_SWI 0x26 /* GPP_G6 */
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
@ -7,6 +10,9 @@
|
||||
Scope (\_SB)
|
||||
{
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
||||
Scope (\_GPE)
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -65,6 +65,13 @@ chip soc/intel/cannonlake
|
||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||
register "PcieClkSrcUsage[8]" = "0x40"
|
||||
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
|
||||
device pci 02.0 on # Integrated Graphics Device
|
||||
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
||||
|
@ -19,7 +19,6 @@ DefinitionBlock(
|
||||
{
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/cannonlake/acpi/southbridge.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -3,7 +3,15 @@
|
||||
#ifndef 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
|
||||
|
||||
#ifndef __ACPI__
|
||||
void mainboard_configure_early_gpios(void);
|
||||
void mainboard_configure_gpios(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* 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/romstage.h>
|
||||
|
||||
@ -20,6 +22,18 @@ static const struct cnl_mb_cfg memcfg = {
|
||||
|
||||
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
|
||||
memupd->FspmConfig.SaOcSupport = 1;
|
||||
|
||||
|
@ -3,11 +3,13 @@ if BOARD_SYSTEM76_ORYP6 || BOARD_SYSTEM76_ORYP7
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select DRIVERS_I2C_TAS5825M
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
|
31
src/mainboard/system76/oryp6/acpi/backlight.asl
Normal file
31
src/mainboard/system76/oryp6/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
@ -1,11 +1,17 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <variant/gpio.h>
|
||||
#include <drivers/gfx/nvidia/acpi/gpu.asl>
|
||||
|
||||
#define EC_GPE_SCI 0x03 /* GPP_K3 */
|
||||
#define EC_GPE_SWI 0x06 /* GPP_K6 */
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
||||
Scope (\_GPE) {
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
@ -12,10 +12,15 @@ entries
|
||||
400 8 r 0 century
|
||||
|
||||
412 4 e 6 debug_level
|
||||
984 16 h 0 check_sum
|
||||
416 1 e 2 me_state
|
||||
417 3 h 0 me_state_counter
|
||||
976 16 h 0 check_sum
|
||||
|
||||
enumerations
|
||||
|
||||
2 0 Enable
|
||||
2 1 Disable
|
||||
|
||||
4 0 Fallback
|
||||
4 1 Normal
|
||||
|
||||
@ -31,4 +36,4 @@ enumerations
|
||||
|
||||
checksums
|
||||
|
||||
checksum 408 983 984
|
||||
checksum 408 975 976
|
||||
|
@ -62,6 +62,13 @@ chip soc/intel/cannonlake
|
||||
# PCI Express Graphics #0 x16, Clock 8 (NVIDIA GPU)
|
||||
register "PcieClkSrcUsage[8]" = "0x40"
|
||||
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
|
||||
device pci 02.0 on # Integrated Graphics Device
|
||||
register "gfx" = "GMA_DEFAULT_PANEL(0)"
|
||||
|
@ -18,7 +18,6 @@ DefinitionBlock(
|
||||
Device (\_SB.PCI0) {
|
||||
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
|
||||
#include <soc/intel/cannonlake/acpi/southbridge.asl>
|
||||
#include <drivers/intel/gma/acpi/default_brightness_levels.asl>
|
||||
}
|
||||
|
||||
#include <southbridge/intel/common/acpi/sleepstates.asl>
|
||||
|
@ -3,7 +3,15 @@
|
||||
#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
|
||||
|
||||
#ifndef __ACPI__
|
||||
void variant_configure_early_gpios(void);
|
||||
void variant_configure_gpios(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -1,7 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/gfx/nvidia/gpu.h>
|
||||
#include <soc/cnl_memcfg_init.h>
|
||||
#include <soc/romstage.h>
|
||||
#include <variant/gpio.h>
|
||||
#include <variant/romstage.h>
|
||||
|
||||
static const struct cnl_mb_cfg memcfg = {
|
||||
@ -21,6 +23,18 @@ static const struct cnl_mb_cfg memcfg = {
|
||||
|
||||
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);
|
||||
|
||||
cannonlake_memcfg_init(&memupd->FspmConfig, &memcfg);
|
||||
|
@ -3,11 +3,13 @@ if BOARD_SYSTEM76_ORYP8
|
||||
config BOARD_SPECIFIC_OPTIONS
|
||||
def_bool y
|
||||
select BOARD_ROMSIZE_KB_16384
|
||||
select DRIVERS_GFX_NVIDIA
|
||||
select DRIVERS_I2C_HID
|
||||
select DRIVERS_I2C_TAS5825M
|
||||
select EC_SYSTEM76_EC
|
||||
select EC_SYSTEM76_EC_BAT_THRESHOLDS
|
||||
select EC_SYSTEM76_EC_COLOR_KEYBOARD
|
||||
select EC_SYSTEM76_EC_DGPU
|
||||
select HAVE_ACPI_RESUME
|
||||
select HAVE_ACPI_TABLES
|
||||
select HAVE_CMOS_DEFAULT
|
||||
@ -21,6 +23,7 @@ config BOARD_SPECIFIC_OPTIONS
|
||||
select PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G
|
||||
select SOC_INTEL_TIGERLAKE
|
||||
select SOC_INTEL_TIGERLAKE_PCH_H
|
||||
select SOC_INTEL_TIGERLAKE_S3
|
||||
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
|
||||
select SPD_READ_BY_WORD
|
||||
select SYSTEM_TYPE_LAPTOP
|
||||
|
31
src/mainboard/system76/oryp8/acpi/backlight.asl
Normal file
31
src/mainboard/system76/oryp8/acpi/backlight.asl
Normal file
@ -0,0 +1,31 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include <drivers/intel/gma/acpi/gma.asl>
|
||||
|
||||
Scope (GFX0)
|
||||
{
|
||||
Name (BRIG, Package (22) {
|
||||
40, /* default AC */
|
||||
40, /* default Battery */
|
||||
5,
|
||||
10,
|
||||
15,
|
||||
20,
|
||||
25,
|
||||
30,
|
||||
35,
|
||||
40,
|
||||
45,
|
||||
50,
|
||||
55,
|
||||
60,
|
||||
65,
|
||||
70,
|
||||
75,
|
||||
80,
|
||||
85,
|
||||
90,
|
||||
95,
|
||||
100
|
||||
})
|
||||
}
|
40
src/mainboard/system76/oryp8/acpi/dgpu.asl
Normal file
40
src/mainboard/system76/oryp8/acpi/dgpu.asl
Normal file
@ -0,0 +1,40 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
Scope (\_SB.PCI0.PEG1)
|
||||
{
|
||||
Device (DEV0)
|
||||
{
|
||||
Name(_ADR, 0x00000000)
|
||||
|
||||
// Fix SSID being lost across sleep by saving it
|
||||
Name(NVSS, 0x00000000)
|
||||
|
||||
OperationRegion (PCIC, PCI_Config, 0x00, 0x50)
|
||||
Field (PCIC, DwordAcc, NoLock, Preserve)
|
||||
{
|
||||
Offset (0x40),
|
||||
SSID, 32,
|
||||
}
|
||||
|
||||
Name (_PR0, Package () { PWRR })
|
||||
Name (_PR3, Package () { PWRR })
|
||||
PowerResource (PWRR, 0, 0)
|
||||
{
|
||||
Name (_STA, 1)
|
||||
|
||||
Method (_ON)
|
||||
{
|
||||
^^SSID = ^^NVSS
|
||||
Printf("GPU _ON %o", ToHexString(^^SSID))
|
||||
_STA = 1
|
||||
}
|
||||
|
||||
Method (_OFF)
|
||||
{
|
||||
^^NVSS = ^^SSID
|
||||
Printf("GPU _OFF %o", ToHexString(^^SSID))
|
||||
_STA = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,14 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
#include "dgpu.asl"
|
||||
|
||||
#define EC_GPE_SCI 0x6E
|
||||
#define EC_GPE_SWI 0x6B
|
||||
#include <ec/system76/ec/acpi/ec.asl>
|
||||
|
||||
Scope (\_SB) {
|
||||
#include "sleep.asl"
|
||||
Scope (PCI0) {
|
||||
#include "backlight.asl"
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,3 @@
|
||||
boot_option=Fallback
|
||||
debug_level=Debug
|
||||
me_state=Disable
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user