Skip to content

Commit

Permalink
mainboard/system76/gaze16: Add System76 Gazelle (gaze16)
Browse files Browse the repository at this point in the history
Change-Id: Ifb90f9b73a10abf53a21738e2c466d539df9a37c
Co-authored-by: Tim Crawford <[email protected]>
  • Loading branch information
jackpot51 and crawfxrd committed Jul 20, 2021
1 parent 909f958 commit a4f9ee0
Show file tree
Hide file tree
Showing 26 changed files with 1,624 additions and 0 deletions.
92 changes: 92 additions & 0 deletions src/mainboard/system76/gaze16/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
if BOARD_SYSTEM76_GAZE16_3050 || BOARD_SYSTEM76_GAZE16_3060

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_COLOR_KEYBOARD
select EC_SYSTEM76_EC_DGPU
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 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
select USE_OPTION_TABLE

config MAINBOARD_DIR
string
default "system76/gaze16"

config MAINBOARD_PART_NUMBER
string
default "gaze16-3050" if BOARD_SYSTEM76_GAZE16_3050
default "gaze16-3060" if BOARD_SYSTEM76_GAZE16_3060

config MAINBOARD_SMBIOS_PRODUCT_NAME
string
default "Gazelle"

config MAINBOARD_VERSION
string
default "gaze16-3050" if BOARD_SYSTEM76_GAZE16_3050
default "gaze16-3060" if BOARD_SYSTEM76_GAZE16_3060

config VARIANT_DIR
string
default "3050" if BOARD_SYSTEM76_GAZE16_3050
default "3060" if BOARD_SYSTEM76_GAZE16_3060

config OVERRIDE_DEVICETREE
string
default "variants/$(CONFIG_VARIANT_DIR)/overridetree.cb"

config CBFS_SIZE
hex
default 0xA00000

config CONSOLE_POST
bool
default y

config DIMM_MAX
int
default 4 # Hack to make soc code work

config DIMM_SPD_SIZE
int
default 512

config DRIVERS_SYSTEM76_DGPU_DEVICE
hex
default 0x01

config MAX_CPUS
int
default 16

config ONBOARD_VGA_IS_PRIMARY
bool
default y

config POST_DEVICE
bool
default n

config UART_FOR_CONSOLE
int
default 2

endif
5 changes: 5 additions & 0 deletions src/mainboard/system76/gaze16/Kconfig.name
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config BOARD_SYSTEM76_GAZE16_3050
bool "gaze16 3050"

config BOARD_SYSTEM76_GAZE16_3060
bool "gaze16 3060"
11 changes: 11 additions & 0 deletions src/mainboard/system76/gaze16/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## SPDX-License-Identifier: GPL-2.0-only

CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/$(VARIANT_DIR)/include

bootblock-y += bootblock.c

romstage-y += variants/$(VARIANT_DIR)/romstage.c

ramstage-y += ramstage.c
ramstage-y += variants/$(VARIANT_DIR)/ramstage.c
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
30 changes: 30 additions & 0 deletions src/mainboard/system76/gaze16/acpi/backlight.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* 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
})
}
30 changes: 30 additions & 0 deletions src/mainboard/system76/gaze16/acpi/dgpu.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* SPDX-License-Identifier: GPL-2.0-only */

Scope (\_SB.PCI0.RP01) {
Device (DEV0) {
Name(_ADR, 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 = 0x50171558
Printf("GPU _ON %o", ToHexString(^^SSID))
_STA = 1
}

Method (_OFF) {
Printf("GPU _OFF %o", ToHexString(^^SSID))
_STA = 0
}
}
}
}
15 changes: 15 additions & 0 deletions src/mainboard/system76/gaze16/acpi/mainboard.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#include <variant/gpio.h>
#include "dgpu.asl"

#define EC_GPE_SCI 0x6E
#define EC_GPE_SWI 0x6E
#include <ec/system76/ec/acpi/ec.asl>

Scope (\_SB) {
#include "sleep.asl"
Scope (PCI0) {
#include "backlight.asl"
}
}
46 changes: 46 additions & 0 deletions src/mainboard/system76/gaze16/acpi/sleep.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#include <intelblocks/gpio.h>

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_ENABLE_GPIO_PM_CONFIG)
}

/*
* 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_ENABLE_GPIO_PM_CONFIG)
} Else {
/* S0ix Exit */
PGPM (0)
}
}
8 changes: 8 additions & 0 deletions src/mainboard/system76/gaze16/board_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Vendor name: System76
Board name: gaze16
Category: laptop
Release year: 2021
ROM package: SOIC-8
ROM protocol: SPI
ROM socketed: n
Flashrom support: y
11 changes: 11 additions & 0 deletions src/mainboard/system76/gaze16/bootblock.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#include <bootblock_common.h>
#include <gpio.h>
#include <variant/gpio.h>
#include <drivers/system76/dgpu/bootblock.c>

void bootblock_mainboard_init(void) {
gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table));
dgpu_power_enable(1);
}
2 changes: 2 additions & 0 deletions src/mainboard/system76/gaze16/cmos.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
boot_option=Fallback
preserve_smmstore=0
35 changes: 35 additions & 0 deletions src/mainboard/system76/gaze16/cmos.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# SPDX-License-Identifier: GPL-2.0-only

entries

0 384 r 0 reserved_memory

# RTC_BOOT_BYTE (coreboot hardcoded)
384 1 e 2 boot_option
388 4 h 0 reboot_counter

#395 4 e 3 debug_level
408 1 h 1 preserve_smmstore
984 16 h 0 check_sum

enumerations

1 0 Disable
1 1 Enable

2 0 Fallback
2 1 Normal

3 0 Emergency
3 1 Alert
3 2 Critical
3 3 Error
3 4 Warning
3 5 Notice
3 6 Info
3 7 Debug
3 8 Spew

checksums

checksum 392 983 984
Loading

0 comments on commit a4f9ee0

Please sign in to comment.