diff --git a/src/mainboard/system76/adl-p/Kconfig b/src/mainboard/system76/adl-p/Kconfig index 31d19e7495..368b8e0740 100644 --- a/src/mainboard/system76/adl-p/Kconfig +++ b/src/mainboard/system76/adl-p/Kconfig @@ -3,6 +3,7 @@ if BOARD_SYSTEM76_DARP8 || BOARD_SYSTEM76_LEMP11 || BOARD_SYSTEM76_ORYP9 config BOARD_SPECIFIC_OPTIONS def_bool y select BOARD_ROMSIZE_KB_32768 + select DRIVERS_GFX_NVIDIA if BOARD_SYSTEM76_ORYP9 select DRIVERS_I2C_HID select DRIVERS_INTEL_PMC select DRIVERS_INTEL_USB4_RETIMER diff --git a/src/mainboard/system76/adl-p/Makefile.inc b/src/mainboard/system76/adl-p/Makefile.inc index 9dea9f3b1f..136eaec201 100644 --- a/src/mainboard/system76/adl-p/Makefile.inc +++ b/src/mainboard/system76/adl-p/Makefile.inc @@ -1,4 +1,5 @@ CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include +CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include bootblock-y += bootblock.c bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c diff --git a/src/mainboard/system76/adl-p/acpi/mainboard.asl b/src/mainboard/system76/adl-p/acpi/mainboard.asl index c982a9ee4c..f7453fc339 100644 --- a/src/mainboard/system76/adl-p/acpi/mainboard.asl +++ b/src/mainboard/system76/adl-p/acpi/mainboard.asl @@ -1,5 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#if CONFIG(DRIVERS_GFX_NVIDIA) +#include +#endif + #define EC_GPE_SCI 0x6E #define EC_GPE_SWI 0x6B #include @@ -8,5 +12,11 @@ Scope (\_SB) { #include "sleep.asl" Scope (PCI0) { #include "backlight.asl" + +#if CONFIG(DRIVERS_GFX_NVIDIA) + Scope (PEG2) { + #include + } +#endif } } diff --git a/src/mainboard/system76/adl-p/variants/oryp9/include/variant/gpio.h b/src/mainboard/system76/adl-p/variants/oryp9/include/variant/gpio.h new file mode 100644 index 0000000000..489487ba7b --- /dev/null +++ b/src/mainboard/system76/adl-p/variants/oryp9/include/variant/gpio.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef VARIANT_GPIO_H +#define VARIANT_GPIO_H + +#include + +#define DGPU_RST_N GPP_B2 +#define DGPU_PWR_EN GPP_A14 +#define DGPU_GC6 GPP_A7 +#define DGPU_SSID 0x65f51558 + +#endif diff --git a/src/mainboard/system76/adl-p/variants/oryp9/overridetree.cb b/src/mainboard/system76/adl-p/variants/oryp9/overridetree.cb index 6eb022c2ea..0a91b5190a 100644 --- a/src/mainboard/system76/adl-p/variants/oryp9/overridetree.cb +++ b/src/mainboard/system76/adl-p/variants/oryp9/overridetree.cb @@ -18,13 +18,17 @@ chip soc/intel/alderlake device domain 0 on subsystemid 0x1558 0x65f5 inherit - device ref pcie5 off + device ref pcie5 on # CPU PCIe RP#2 x8, Clock 3 (DGPU) register "cpu_pcie_rp[CPU_RP(2)]" = "{ .clk_src = 3, .clk_req = 3, .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 device ref igpu on register "ddi_portA_config" = "1" diff --git a/src/mainboard/system76/adl-p/variants/oryp9/romstage.c b/src/mainboard/system76/adl-p/variants/oryp9/romstage.c index 7019059fdf..7080e45b4a 100644 --- a/src/mainboard/system76/adl-p/variants/oryp9/romstage.c +++ b/src/mainboard/system76/adl-p/variants/oryp9/romstage.c @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include #include #include +#include void mainboard_memory_init_params(FSPM_UPD *mupd) { @@ -18,6 +20,17 @@ 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; + mupd->FspmConfig.PchHdaAudioLinkHdaEnable = 1; mupd->FspmConfig.DmiMaxLinkSpeed = 4; mupd->FspmConfig.GpioOverride = 0;