From b44202b29ab27b6a902ed7abb41288b6461b66aa Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 13 Oct 2021 08:16:04 -0600 Subject: [PATCH] mb/system76/oryp8: Add System76 Oryx Pro 8 https://tech-docs.system76.com/models/oryp8/README.html Tested with TianoCore (UeifPayloadPkg). Working: - PS/2 keyboard, touchpad - Both DIMM slots - Both M.2 SSD slots - All USB ports - Webcam - Ethernet - WiFi/Bluetooth - Integrated graphics using Intel GOP driver - Internal microphone - Internal speakers - Combined 3.5mm headphone & microphone jack - Combined 3.5mm microphone & S/PDIF jack* - S3 suspend/resume - Booting to Pop!_OS Linux 21.10 and Windows 10 20H2 - Flashing with flashrom Not working: - Discrete/Hybrid graphics Not tested: - Thunderbolt functionality - S/PDIF output Change-Id: Iabc8e273f997d7f5852ddec63e0c1bf0c9434acb Signed-off-by: Jeremy Soller Signed-off-by: Tim Crawford Reviewed-on: https://review.coreboot.org/c/coreboot/+/57652 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- Documentation/mainboard/index.md | 1 + Documentation/mainboard/system76/oryp8.md | 70 + src/mainboard/system76/oryp8/Kconfig | 66 + src/mainboard/system76/oryp8/Kconfig.name | 2 + src/mainboard/system76/oryp8/Makefile.inc | 13 + .../system76/oryp8/acpi/mainboard.asl | 9 + src/mainboard/system76/oryp8/acpi/sleep.asl | 46 + src/mainboard/system76/oryp8/board_info.txt | 8 + src/mainboard/system76/oryp8/bootblock.c | 9 + src/mainboard/system76/oryp8/cmos.default | 2 + src/mainboard/system76/oryp8/cmos.layout | 34 + src/mainboard/system76/oryp8/data.vbt | Bin 0 -> 8704 bytes src/mainboard/system76/oryp8/devicetree.cb | 221 ++ src/mainboard/system76/oryp8/dsdt.asl | 34 + src/mainboard/system76/oryp8/gpio.c | 281 +++ src/mainboard/system76/oryp8/gpio_early.c | 17 + src/mainboard/system76/oryp8/hda_verb.c | 30 + .../system76/oryp8/include/mainboard/gpio.h | 9 + src/mainboard/system76/oryp8/ramstage.c | 27 + src/mainboard/system76/oryp8/romstage.c | 30 + src/mainboard/system76/oryp8/tas5825m.c | 1787 +++++++++++++++++ 21 files changed, 2696 insertions(+) create mode 100644 Documentation/mainboard/system76/oryp8.md create mode 100644 src/mainboard/system76/oryp8/Kconfig create mode 100644 src/mainboard/system76/oryp8/Kconfig.name create mode 100644 src/mainboard/system76/oryp8/Makefile.inc create mode 100644 src/mainboard/system76/oryp8/acpi/mainboard.asl create mode 100644 src/mainboard/system76/oryp8/acpi/sleep.asl create mode 100644 src/mainboard/system76/oryp8/board_info.txt create mode 100644 src/mainboard/system76/oryp8/bootblock.c create mode 100644 src/mainboard/system76/oryp8/cmos.default create mode 100644 src/mainboard/system76/oryp8/cmos.layout create mode 100644 src/mainboard/system76/oryp8/data.vbt create mode 100644 src/mainboard/system76/oryp8/devicetree.cb create mode 100644 src/mainboard/system76/oryp8/dsdt.asl create mode 100644 src/mainboard/system76/oryp8/gpio.c create mode 100644 src/mainboard/system76/oryp8/gpio_early.c create mode 100644 src/mainboard/system76/oryp8/hda_verb.c create mode 100644 src/mainboard/system76/oryp8/include/mainboard/gpio.h create mode 100644 src/mainboard/system76/oryp8/ramstage.c create mode 100644 src/mainboard/system76/oryp8/romstage.c create mode 100644 src/mainboard/system76/oryp8/tas5825m.c diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md index 77af47370f..f3455ccd26 100644 --- a/Documentation/mainboard/index.md +++ b/Documentation/mainboard/index.md @@ -193,6 +193,7 @@ The boards in this section are not real mainboards, but emulators. - [Oryx Pro 5](system76/oryp5.md) - [Oryx Pro 6](system76/oryp6.md) - [Oryx Pro 7](system76/oryp7.md) +- [Oryx Pro 8](system76/oryp8.md) ## Texas Instruments diff --git a/Documentation/mainboard/system76/oryp8.md b/Documentation/mainboard/system76/oryp8.md new file mode 100644 index 0000000000..cfd59d0e77 --- /dev/null +++ b/Documentation/mainboard/system76/oryp8.md @@ -0,0 +1,70 @@ +# System76 Oryx Pro 8 (oryp8) + +## Specs + +- CPU + - Intel Core i7-11800H +- Chipset + - Intel HM570 +- EC + - ITE IT570E running [System76 EC](https://github.com/system76/ec) +- Graphics + - dGPU options + - NVIDIA GeForce RTX 3070 (Max-Q) + - NVIDIA GeForce RTX 3080 (Max-Q) + - eDP options + - 15.6" 1920x1080@144Hz LCD (LG LP156WFG-SPB3) + - 17.3" 1920x1080@144Hz LCD (LG LP173WFG-SPB3) + - 1x HDMI 2.1 + - 1x Mini DisplayPort 1.4 + - 1x DisplayPort 1.4 over USB-C +- Memory + - Up to 64GB (2x32GB) dual-channel DDR4 SO-DIMMs @ 3200 MHz +- Networking + - Gigabit Ethernet + - M.2 PCIe/CNVi WiFi/Bluetooth + - Intel Wi-Fi 6 AX200/AX201 +- Power + - 180W (19.5V, 9.23A) AC barrel adapter + - Lite-On PA-1181-16, using a C5 power cord + - 73Wh 3-cell battery +- Sound + - Realtek ALC1220 codec + - TI TAS5825M smart amp + - Internal speakers and microphone + - Combined 3.5mm headphone & microphone jack + - Combined 3.5mm microphone & S/PDIF jack + - HDMI, mDP, USB-C DP audio +- Storage + - 1x M.2 PCIe NVMe Gen 4 SSD + - 1x M.2 PCIe NVMe Gen 3 or SATA SSD +- USB + - 1x USB Type-C with Thunderbolt 4 + - 3x USB 3.0 Type-A +- Dimensions + - 15": 35.75cm x 23.8cm x 1.98cm, 1.99kg + - 17": 39.59cm x 26.495cm x 1.99cm, 2.3kg + +## Flashing coreboot + +```eval_rst ++---------------------+-----------------+ +| Type | Value | ++=====================+=================+ +| Socketed flash | no | ++---------------------+-----------------+ +| Vendor | GigaDevice | ++---------------------+-----------------+ +| Model | GD25B127D | ++---------------------+-----------------+ +| Size | 16 MiB | ++---------------------+-----------------+ +| Package | SOIC-8 | ++---------------------+-----------------+ +| Internal flashing | yes | ++---------------------+-----------------+ +| External flashing | yes | ++---------------------+-----------------+ +``` + +The flash chip (U74) is right of the bottom DIMM slot. diff --git a/src/mainboard/system76/oryp8/Kconfig b/src/mainboard/system76/oryp8/Kconfig new file mode 100644 index 0000000000..6c9ff4e5eb --- /dev/null +++ b/src/mainboard/system76/oryp8/Kconfig @@ -0,0 +1,66 @@ +if BOARD_SYSTEM76_ORYP8 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select BOARD_ROMSIZE_KB_16384 + 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 HAVE_ACPI_RESUME + select HAVE_ACPI_TABLES + select HAVE_CMOS_DEFAULT + select HAVE_OPTION_TABLE + 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 PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G + select SOC_INTEL_TIGERLAKE + select SOC_INTEL_TIGERLAKE_PCH_H + 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/oryp8" + +config MAINBOARD_PART_NUMBER + default "oryp8" + +config MAINBOARD_SMBIOS_PRODUCT_NAME + default "Oryx Pro" + +config MAINBOARD_VERSION + default "oryp8" + +config CBFS_SIZE + default 0xA00000 + +config CONSOLE_POST + default y + +config DIMM_MAX + default 4 + +config DIMM_SPD_SIZE + default 512 + +config ONBOARD_VGA_IS_PRIMARY + default y + +config POST_DEVICE + default n + +config UART_FOR_CONSOLE + default 2 + +# PM Timer Disabled, saves power +config USE_PM_ACPI_TIMER + default n + +endif diff --git a/src/mainboard/system76/oryp8/Kconfig.name b/src/mainboard/system76/oryp8/Kconfig.name new file mode 100644 index 0000000000..236b8c87cc --- /dev/null +++ b/src/mainboard/system76/oryp8/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_SYSTEM76_ORYP8 + bool "oryp8" diff --git a/src/mainboard/system76/oryp8/Makefile.inc b/src/mainboard/system76/oryp8/Makefile.inc new file mode 100644 index 0000000000..c9b4d07e06 --- /dev/null +++ b/src/mainboard/system76/oryp8/Makefile.inc @@ -0,0 +1,13 @@ +## SPDX-License-Identifier: GPL-2.0-only + +CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include + +bootblock-y += bootblock.c +bootblock-y += gpio_early.c + +romstage-y += romstage.c + +ramstage-y += gpio.c +ramstage-y += hda_verb.c +ramstage-y += ramstage.c +ramstage-y += tas5825m.c diff --git a/src/mainboard/system76/oryp8/acpi/mainboard.asl b/src/mainboard/system76/oryp8/acpi/mainboard.asl new file mode 100644 index 0000000000..4675bc94b8 --- /dev/null +++ b/src/mainboard/system76/oryp8/acpi/mainboard.asl @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#define EC_GPE_SCI 0x6E +#define EC_GPE_SWI 0x6B +#include + +Scope (\_SB) { + #include "sleep.asl" +} diff --git a/src/mainboard/system76/oryp8/acpi/sleep.asl b/src/mainboard/system76/oryp8/acpi/sleep.asl new file mode 100644 index 0000000000..83888f3e59 --- /dev/null +++ b/src/mainboard/system76/oryp8/acpi/sleep.asl @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Method (PGPM, 1, Serialized) +{ + For (Local0 = 0, Local0 < 6, Local0++) + { + \_SB.PCI0.CGPM (Local0, Arg0) + } +} + +/* + * Method called from _PTS prior to system sleep state entry + * Enables dynamic clock gating for all 5 GPIO communities + */ +Method (MPTS, 1, Serialized) +{ + \_SB.PCI0.LPCB.EC0.PTS (Arg0) + PGPM (MISCCFG_GPIO_PM_CONFIG_BITS) +} + +/* + * Method called from _WAK prior to system sleep state wakeup + * Disables dynamic clock gating for all 5 GPIO communities + */ +Method (MWAK, 1, Serialized) +{ + PGPM (0) + \_SB.PCI0.LPCB.EC0.WAK (Arg0) +} + +/* + * S0ix Entry/Exit Notifications + * Called from \_SB.PEPD._DSM + */ +Method (MS0X, 1, Serialized) +{ + If (Arg0 == 1) { + /* S0ix Entry */ + PGPM (MISCCFG_GPIO_PM_CONFIG_BITS) + } Else { + /* S0ix Exit */ + PGPM (0) + } +} diff --git a/src/mainboard/system76/oryp8/board_info.txt b/src/mainboard/system76/oryp8/board_info.txt new file mode 100644 index 0000000000..544c341cf5 --- /dev/null +++ b/src/mainboard/system76/oryp8/board_info.txt @@ -0,0 +1,8 @@ +Vendor name: System76 +Board name: oryp8 +Category: laptop +Release year: 2021 +ROM package: SOIC-8 +ROM protocol: SPI +ROM socketed: n +Flashrom support: y diff --git a/src/mainboard/system76/oryp8/bootblock.c b/src/mainboard/system76/oryp8/bootblock.c new file mode 100644 index 0000000000..6b88360ada --- /dev/null +++ b/src/mainboard/system76/oryp8/bootblock.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include + +void bootblock_mainboard_init(void) +{ + mainboard_configure_early_gpios(); +} diff --git a/src/mainboard/system76/oryp8/cmos.default b/src/mainboard/system76/oryp8/cmos.default new file mode 100644 index 0000000000..06b04332a2 --- /dev/null +++ b/src/mainboard/system76/oryp8/cmos.default @@ -0,0 +1,2 @@ +boot_option=Fallback +debug_level=Debug diff --git a/src/mainboard/system76/oryp8/cmos.layout b/src/mainboard/system76/oryp8/cmos.layout new file mode 100644 index 0000000000..ac817525dd --- /dev/null +++ b/src/mainboard/system76/oryp8/cmos.layout @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: GPL-2.0-only + +entries + +0 384 r 0 reserved_memory + +# RTC_BOOT_BYTE (coreboot hardcoded) +384 1 e 4 boot_option +388 4 h 0 reboot_counter + +# RTC_CLK_ALTCENTURY +400 8 r 0 century + +412 4 e 6 debug_level +984 16 h 0 check_sum + +enumerations + +4 0 Fallback +4 1 Normal + +6 0 Emergency +6 1 Alert +6 2 Critical +6 3 Error +6 4 Warning +6 5 Notice +6 6 Info +6 7 Debug +6 8 Spew + +checksums + +checksum 408 983 984 diff --git a/src/mainboard/system76/oryp8/data.vbt b/src/mainboard/system76/oryp8/data.vbt new file mode 100644 index 0000000000000000000000000000000000000000..5641c17f76d843dfaf63eff3e2bd7105abb2a8bd GIT binary patch literal 8704 zcmeHMO-vg{6n?X|*N(fCjf@h9CUk&^7#d*hB$OaaS=&J31cGe{b)-rdVmCo?zy(s# zs*<-72YOqnQbnRxu_{%qIMH(t<SKDDn3k|spW`-Ybfh@y! zl-UAsr~p$4kF_{8H`1S+18zh zSqm`8!;CgJ6Jb|&hw&gI?B?#U#~+|pu995{BQ%1jMqk^?2d0f}Eu-3PvBP=f0P-;M zTga2hw~_B6r;$HK{sj4R2C5I*6z6h}p~2acHW}Y-G!x8BgBNpsXD^fvSP6roDk(?N27Hj!rA13) zRT>s)xKUQ+Z5oJf*@K3!yB9aZjcsalrDOxqMXo^=*Q&7L(gjtSTJxytdP#!_{KGDd zTdIlVJI&*(VQ5kY_54_{Na}2H1!zh&arm%H&%_#=RE6fp0`tMF^M#M3S*!8F<<&B& zwN}*7!TJS24Hlh$Ql*S#sfv8K-=4{ams*t2z5K+A8ce`fRgx-Jqe1CVH)2b1#Tn)~ zz-=&LIwC!9PI4Rgk_~f`R^i2?M#zNdQAJV$tY5 zPBq$D8VeKf^`L|+X7SnYMY{?y4ID99KFs>f$APaarJ=#lL}+p*k-R#2C-D+A37s zoF<0BD!NwfNq3c~xjE``8ykq$=Hh(=-O@Sk7L6nCirXM1ph(eZufQ(wg} z<#HD=!T@ZNWmabMTSzu#)~8>;(0~KR25u+vdco$IZX4_&&^kTi!42Pp%L^Wa^KBts zYdx1@SBv()pJ7|X_$@p3UMr1Ec}?Wh`x6w8XUgRVxOF~a7mH_82iT9A>9q*dB2bG! zEdsR&)FM!eKrI6QV+8uX5RSv!QvjNvwCC0fd zmpy!f0JBP*u#D%_ZFn3ea#u7gH^0PFXv+#wAcYtOpToT@(mFDeEm|m%QPyad%Vhd* zOtwj)u!6F-GFf&}098~36}7CHJ!P`T!vw}Ht7H&#w517U#@V5U{r!?9po