From 3449cbbdca2e683d24c852ddd2f53109fdeb5715 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Fri, 16 Oct 2020 09:32:50 -0600 Subject: [PATCH] Disable GMA ACPI Change-Id: Ifc07265b35bc41a980cb0c8f034294144409f510 --- src/mainboard/system76/galp5/Kconfig | 4 +-- .../system76/galp5/acpi/backlight.asl | 30 ------------------- .../system76/galp5/acpi/mainboard.asl | 24 +++++++++++---- src/mainboard/system76/galp5/acpi/sleep.asl | 14 --------- src/mainboard/system76/galp5/bootblock.c | 9 ++++-- src/mainboard/system76/galp5/dsdt.asl | 5 ---- 6 files changed, 26 insertions(+), 60 deletions(-) delete mode 100644 src/mainboard/system76/galp5/acpi/backlight.asl delete mode 100644 src/mainboard/system76/galp5/acpi/sleep.asl diff --git a/src/mainboard/system76/galp5/Kconfig b/src/mainboard/system76/galp5/Kconfig index 207aad7bbb..2f682b74c8 100644 --- a/src/mainboard/system76/galp5/Kconfig +++ b/src/mainboard/system76/galp5/Kconfig @@ -5,10 +5,10 @@ config BOARD_SPECIFIC_OPTIONS select BOARD_ROMSIZE_KB_16384 select DRIVERS_I2C_HID select DRIVERS_INTEL_PMC - select DRIVERS_SYSTEM76_DGPU + #TODO select DRIVERS_SYSTEM76_DGPU select EC_SYSTEM76_EC #TODO select EC_SYSTEM76_EC_BAT_THRESHOLDS - #TODO select EC_SYSTEM76_EC_DGPU + select EC_SYSTEM76_EC_DGPU select HAVE_ACPI_RESUME select HAVE_ACPI_TABLES select HAVE_SMI_HANDLER diff --git a/src/mainboard/system76/galp5/acpi/backlight.asl b/src/mainboard/system76/galp5/acpi/backlight.asl deleted file mode 100644 index 12aaab6e4f..0000000000 --- a/src/mainboard/system76/galp5/acpi/backlight.asl +++ /dev/null @@ -1,30 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include - -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 - }) -} diff --git a/src/mainboard/system76/galp5/acpi/mainboard.asl b/src/mainboard/system76/galp5/acpi/mainboard.asl index 6ce25f041a..1fd37b0fe3 100644 --- a/src/mainboard/system76/galp5/acpi/mainboard.asl +++ b/src/mainboard/system76/galp5/acpi/mainboard.asl @@ -1,15 +1,27 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include "../gpio.h" -//TODO #include +#if CONFIG(DRIVERS_SYSTEM76_DGPU) + #include +#endif -#define EC_GPE_SCI 0x6E // TODO -#define EC_GPE_SWI 0x6B // TODO +#define EC_GPE_SCI 0x6E +#define EC_GPE_SWI 0x6B #include Scope (\_SB) { - #include "sleep.asl" - Scope (PCI0) { - #include "backlight.asl" + /* Method called from _PTS prior to enter sleep state */ + Method (MPTS, 1) { + \_SB.PCI0.LPCB.EC0.PTS (Arg0) + +#if CONFIG(DRIVERS_SYSTEM76_DGPU) + // Turn DGPU on before sleeping + \_SB.PCI0.PEGP.DEV0._ON() +#endif + } + + /* Method called from _WAK prior to wakeup */ + Method (MWAK, 1) { + \_SB.PCI0.LPCB.EC0.WAK (Arg0) } } diff --git a/src/mainboard/system76/galp5/acpi/sleep.asl b/src/mainboard/system76/galp5/acpi/sleep.asl deleted file mode 100644 index 0d1a9daac3..0000000000 --- a/src/mainboard/system76/galp5/acpi/sleep.asl +++ /dev/null @@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -/* Method called from _PTS prior to enter sleep state */ -Method (MPTS, 1) { - \_SB.PCI0.LPCB.EC0.PTS (Arg0) - - // Turn DGPU on before sleeping - //TODO \_SB.PCI0.PEGP.DEV0._ON() -} - -/* Method called from _WAK prior to wakeup */ -Method (MWAK, 1) { - \_SB.PCI0.LPCB.EC0.WAK (Arg0) -} diff --git a/src/mainboard/system76/galp5/bootblock.c b/src/mainboard/system76/galp5/bootblock.c index 6e1fb6a188..bcba4f71ee 100644 --- a/src/mainboard/system76/galp5/bootblock.c +++ b/src/mainboard/system76/galp5/bootblock.c @@ -3,10 +3,13 @@ #include #include #include "gpio.h" -#include +#if CONFIG(DRIVERS_SYSTEM76_DGPU) + #include +#endif void bootblock_mainboard_init(void) { gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table)); - //TODO: enable GPU - dgpu_power_enable(0); +#if CONFIG(DRIVERS_SYSTEM76_DGPU) + dgpu_power_enable(1); +#endif } diff --git a/src/mainboard/system76/galp5/dsdt.asl b/src/mainboard/system76/galp5/dsdt.asl index 28ae3fc05d..22627d760b 100644 --- a/src/mainboard/system76/galp5/dsdt.asl +++ b/src/mainboard/system76/galp5/dsdt.asl @@ -1,8 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -// Hack for including GMA ACPI code -#define SYSTEM76_ACPI_NO_GFX0 - #include DefinitionBlock( "dsdt.aml", @@ -13,7 +10,6 @@ DefinitionBlock( 0x20110725 // OEM revision ) { - #include #include #include @@ -22,7 +18,6 @@ DefinitionBlock( Device (PCI0) { #include #include - //TODO #include } }