Skip to content

Commit

Permalink
mb/system76/gaze17: Add new mainboard
Browse files Browse the repository at this point in the history
Change-Id: Ie4c5297088b06c4e4b9c111f798cb17638fa8592
  • Loading branch information
jackpot51 committed May 16, 2022
1 parent 48e7ffc commit e19c39e
Show file tree
Hide file tree
Showing 26 changed files with 1,150 additions and 0 deletions.
75 changes: 75 additions & 0 deletions src/mainboard/system76/gaze17/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
if BOARD_SYSTEM76_GAZE17_3050 || BOARD_SYSTEM76_GAZE17_3060_B

config BOARD_SPECIFIC_OPTIONS
def_bool y
select BOARD_ROMSIZE_KB_32768
select DRIVERS_GFX_NVIDIA
select DRIVERS_I2C_HID
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_TPM2
select MAINBOARD_USES_IFD_GBE_REGION if BOARD_SYSTEM76_GAZE17_3060_B
select MEMORY_MAPPED_TPM
select NO_UART_ON_SUPERIO
select PCIEXP_HOTPLUG
select PCIEXP_HOTPLUG_PREFETCH_MEM_BELOW_4G
select SOC_INTEL_ALDERLAKE_PCH_P
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select SOC_INTEL_CRASHLOG
select SPD_READ_BY_WORD
select SYSTEM_TYPE_LAPTOP
select TPM_MEASURED_BOOT
select TPM_RDRESP_NEED_DELAY

config MAINBOARD_DIR
default "system76/gaze17"

config MAINBOARD_PART_NUMBER
default "gaze17-3050" if BOARD_SYSTEM76_GAZE17_3050
default "gaze17-3060-b" if BOARD_SYSTEM76_GAZE17_3060_B

config MAINBOARD_SMBIOS_PRODUCT_NAME
default "Gazelle"

config MAINBOARD_VERSION
default "gaze17-3050" if BOARD_SYSTEM76_GAZE17_3050
default "gaze17-3060-b" if BOARD_SYSTEM76_GAZE17_3060_B

config VARIANT_DIR
default "3050" if BOARD_SYSTEM76_GAZE17_3050
default "3060" if BOARD_SYSTEM76_GAZE17_3060_B

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

config CBFS_SIZE
default 0xA00000

config CONSOLE_POST
default y

config DIMM_SPD_SIZE
default 512

config ONBOARD_VGA_IS_PRIMARY
default y

config POST_DEVICE
default n

config UART_FOR_CONSOLE
default 0

# PM Timer Disabled, saves power
config USE_PM_ACPI_TIMER
default n

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

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

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

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

romstage-y += romstage.c

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

#include <variant/gpio.h>

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

Scope (\_SB) {
#include "sleep.asl"
Scope (PCI0) {
#include "backlight.asl"
Scope (PEG2) {
#include <drivers/gfx/nvidia/acpi/tigerlake.asl>
}
}
}
46 changes: 46 additions & 0 deletions src/mainboard/system76/gaze17/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_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)
}
}
8 changes: 8 additions & 0 deletions src/mainboard/system76/gaze17/board_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Vendor name: System76
Board name: gaze17
Category: laptop
Release year: 2022
ROM package: WSON-8
ROM protocol: SPI
ROM socketed: n
Flashrom support: y
9 changes: 9 additions & 0 deletions src/mainboard/system76/gaze17/bootblock.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#include <bootblock_common.h>
#include <variant/gpio.h>

void bootblock_mainboard_init(void)
{
variant_configure_early_gpios();
}
3 changes: 3 additions & 0 deletions src/mainboard/system76/gaze17/cmos.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
boot_option=Fallback
debug_level=Debug
me_state=Disable
39 changes: 39 additions & 0 deletions src/mainboard/system76/gaze17/cmos.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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
416 1 e 2 me_state
417 3 h 0 me_state_counter
984 16 h 0 check_sum

enumerations

2 0 Enable
2 1 Disable

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
Loading

0 comments on commit e19c39e

Please sign in to comment.