From 9d7f328e41e66ca654bc8f24390d91dc009e72f4 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 13 Oct 2020 11:59:41 -0600 Subject: [PATCH] galp5 Change-Id: I09342ee3a49331f8c1463f962ea8fc2d522ef448 --- src/mainboard/system76/galp5/Kconfig | 78 +++++ src/mainboard/system76/galp5/Kconfig.name | 2 + src/mainboard/system76/galp5/Makefile.inc | 3 + .../system76/galp5/acpi/backlight.asl | 30 ++ src/mainboard/system76/galp5/acpi/gpe.asl | 11 + .../system76/galp5/acpi/mainboard.asl | 19 ++ src/mainboard/system76/galp5/acpi/sleep.asl | 14 + src/mainboard/system76/galp5/board_info.txt | 8 + src/mainboard/system76/galp5/bootblock.c | 11 + src/mainboard/system76/galp5/data.vbt | Bin 0 -> 8192 bytes src/mainboard/system76/galp5/devicetree.cb | 299 ++++++++++++++++++ src/mainboard/system76/galp5/dsdt.asl | 31 ++ src/mainboard/system76/galp5/gpio.h | 223 +++++++++++++ src/mainboard/system76/galp5/hda_verb.c | 26 ++ src/mainboard/system76/galp5/ramstage.c | 10 + src/mainboard/system76/galp5/romstage.c | 46 +++ 16 files changed, 811 insertions(+) create mode 100644 src/mainboard/system76/galp5/Kconfig create mode 100644 src/mainboard/system76/galp5/Kconfig.name create mode 100644 src/mainboard/system76/galp5/Makefile.inc create mode 100644 src/mainboard/system76/galp5/acpi/backlight.asl create mode 100644 src/mainboard/system76/galp5/acpi/gpe.asl create mode 100644 src/mainboard/system76/galp5/acpi/mainboard.asl create mode 100644 src/mainboard/system76/galp5/acpi/sleep.asl create mode 100644 src/mainboard/system76/galp5/board_info.txt create mode 100644 src/mainboard/system76/galp5/bootblock.c create mode 100644 src/mainboard/system76/galp5/data.vbt create mode 100644 src/mainboard/system76/galp5/devicetree.cb create mode 100644 src/mainboard/system76/galp5/dsdt.asl create mode 100644 src/mainboard/system76/galp5/gpio.h create mode 100644 src/mainboard/system76/galp5/hda_verb.c create mode 100644 src/mainboard/system76/galp5/ramstage.c create mode 100644 src/mainboard/system76/galp5/romstage.c diff --git a/src/mainboard/system76/galp5/Kconfig b/src/mainboard/system76/galp5/Kconfig new file mode 100644 index 0000000000..46e59a35be --- /dev/null +++ b/src/mainboard/system76/galp5/Kconfig @@ -0,0 +1,78 @@ +if BOARD_SYSTEM76_GALP5 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select BOARD_ROMSIZE_KB_16384 + select DRIVERS_I2C_HID + select DRIVERS_SYSTEM76_DGPU + select EC_SYSTEM76_EC + select EC_SYSTEM76_EC_BAT_THRESHOLDS + select EC_SYSTEM76_EC_DGPU + select HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + select HAVE_SMI_HANDLER + select INTEL_GMA_HAVE_VBT + select INTEL_LPSS_UART_FOR_CONSOLE + select MAINBOARD_HAS_LPC_TPM + select MAINBOARD_HAS_TPM2 + select NO_UART_ON_SUPERIO + select PCIEXP_HOTPLUG + select SOC_INTEL_TIGERLAKE + select SOC_INTEL_COMMON_BLOCK_HDA + select SOC_INTEL_COMMON_BLOCK_HDA_VERB + select SPD_READ_BY_WORD + select SYSTEM_TYPE_LAPTOP + select TPM_RDRESP_NEED_DELAY + select USE_LEGACY_8254_TIMER # Fix failure to boot GRUB + +config MAINBOARD_DIR + string + default "system76/galp5" + +config MAINBOARD_PART_NUMBER + string + default "galp5" + +config MAINBOARD_SMBIOS_PRODUCT_NAME + string + default "Galago Pro" + +config MAINBOARD_VERSION + string + default "galp5" + +#TODO: subsystem IDs + +config CBFS_SIZE + hex + default 0xA00000 + +config CONSOLE_POST + bool + default y + +config ONBOARD_VGA_IS_PRIMARY + bool + default y + +config UART_FOR_CONSOLE + int + default 2 + +config MAX_CPUS + int + default 8 + +config DIMM_MAX + int + default 2 + +config DIMM_SPD_SIZE + int + default 512 + +config POST_DEVICE + bool + default n + +endif diff --git a/src/mainboard/system76/galp5/Kconfig.name b/src/mainboard/system76/galp5/Kconfig.name new file mode 100644 index 0000000000..663f6503ee --- /dev/null +++ b/src/mainboard/system76/galp5/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_SYSTEM76_GALP5 + bool "galp5" diff --git a/src/mainboard/system76/galp5/Makefile.inc b/src/mainboard/system76/galp5/Makefile.inc new file mode 100644 index 0000000000..c15a0141f1 --- /dev/null +++ b/src/mainboard/system76/galp5/Makefile.inc @@ -0,0 +1,3 @@ +bootblock-y += bootblock.c +ramstage-y += ramstage.c +ramstage-y += hda_verb.c diff --git a/src/mainboard/system76/galp5/acpi/backlight.asl b/src/mainboard/system76/galp5/acpi/backlight.asl new file mode 100644 index 0000000000..12aaab6e4f --- /dev/null +++ b/src/mainboard/system76/galp5/acpi/backlight.asl @@ -0,0 +1,30 @@ +/* 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/gpe.asl b/src/mainboard/system76/galp5/acpi/gpe.asl new file mode 100644 index 0000000000..bc19e05169 --- /dev/null +++ b/src/mainboard/system76/galp5/acpi/gpe.asl @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +// GPP_K6 SCI +Method (_L06, 0, Serialized) { + Debug = Concatenate("GPE _L06: ", ToHexString(\_SB.PCI0.LPCB.EC0.WFNO)) + If (\_SB.PCI0.LPCB.EC0.ECOK) { + If (\_SB.PCI0.LPCB.EC0.WFNO == One) { + Notify(\_SB.LID0, 0x80) + } + } +} diff --git a/src/mainboard/system76/galp5/acpi/mainboard.asl b/src/mainboard/system76/galp5/acpi/mainboard.asl new file mode 100644 index 0000000000..eb1a57f1c7 --- /dev/null +++ b/src/mainboard/system76/galp5/acpi/mainboard.asl @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include "../gpio.h" +#include + +#define EC_GPE_SCI 0x03 /* GPP_K3 */ +#define EC_GPE_SWI 0x06 /* GPP_K6 */ +#include + +Scope (\_SB) { + #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } +} + +Scope (\_GPE) { + #include "gpe.asl" +} diff --git a/src/mainboard/system76/galp5/acpi/sleep.asl b/src/mainboard/system76/galp5/acpi/sleep.asl new file mode 100644 index 0000000000..cd8ffefa38 --- /dev/null +++ b/src/mainboard/system76/galp5/acpi/sleep.asl @@ -0,0 +1,14 @@ +/* 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 + \_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/board_info.txt b/src/mainboard/system76/galp5/board_info.txt new file mode 100644 index 0000000000..8170b4afa2 --- /dev/null +++ b/src/mainboard/system76/galp5/board_info.txt @@ -0,0 +1,8 @@ +Vendor name: System76 +Board name: galp5 +Category: laptop +Release year: 2020 +ROM package: SOIC-8 +ROM protocol: SPI +ROM socketed: n +Flashrom support: y diff --git a/src/mainboard/system76/galp5/bootblock.c b/src/mainboard/system76/galp5/bootblock.c new file mode 100644 index 0000000000..44489dfa6d --- /dev/null +++ b/src/mainboard/system76/galp5/bootblock.c @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include "gpio.h" +#include + +void bootblock_mainboard_init(void) { + gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table)); + dgpu_power_enable(1); +} diff --git a/src/mainboard/system76/galp5/data.vbt b/src/mainboard/system76/galp5/data.vbt new file mode 100644 index 0000000000000000000000000000000000000000..55a753d896a5a79bc856599edbd17cdb769b22d1 GIT binary patch literal 8192 zcmeHMO-vg{6n^8Mwd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