Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/include/device/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -4553,6 +4553,9 @@
#define PCI_DID_INTEL_PTL_H_GT2_2 0xb0a0
#define PCI_DID_INTEL_PTL_H_GT2_3 0xb0b0
#define PCI_DID_INTEL_PTL_H_GT2_4 0xb08f
#define PCI_DID_INTEL_PTL_H_GT2_5 0xb081
#define PCI_DID_INTEL_PTL_H_GT2_6 0xb082
#define PCI_DID_INTEL_PTL_H_GT2_7 0xb083
#define PCI_DID_INTEL_WCL_GT2_1 0xfd80
#define PCI_DID_INTEL_WCL_GT2_2 0xfd81
#define PCI_DID_INTEL_NVL_GT2_1 0xd741
Expand Down
88 changes: 88 additions & 0 deletions src/mainboard/system76/ptl/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
## SPDX-License-Identifier: GPL-2.0-only

config BOARD_SYSTEM76_PTL_COMMON
def_bool n
select BOARD_ROMSIZE_KB_32768
select DRIVERS_GENERIC_BAYHUB_LV2
select DRIVERS_GENERIC_CBFS_SERIAL
select DRIVERS_GENERIC_CBFS_UUID
#select DRIVERS_GFX_GENERIC
select DRIVERS_I2C_HID
select EC_SYSTEM76_EC
select EC_SYSTEM76_EC_LOCKDOWN
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 MEMORY_MAPPED_TPM
select NO_UART_ON_SUPERIO
select PCIEXP_SUPPORT_RESIZABLE_BARS
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select SOC_INTEL_PANTHERLAKE_U_H
select SPD_READ_BY_WORD
select SYSTEM_TYPE_LAPTOP

config BOARD_SYSTEM76_LEMP14
select BOARD_SYSTEM76_PTL_COMMON
select DRIVERS_I2C_TAS5825M
select HAVE_SPD_IN_CBFS
select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES

if BOARD_SYSTEM76_PTL_COMMON

config MAINBOARD_DIR
default "system76/ptl"

config VARIANT_DIR
default "lemp14" if BOARD_SYSTEM76_LEMP14

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

config MAINBOARD_PART_NUMBER
default "lemp14" if BOARD_SYSTEM76_LEMP14

config MAINBOARD_SMBIOS_PRODUCT_NAME
default "Lemur Pro" if BOARD_SYSTEM76_LEMP14

config MAINBOARD_VERSION
default "lemp14" if BOARD_SYSTEM76_LEMP14

config CMOS_DEFAULT_FILE
default "src/mainboard/\$(MAINBOARDDIR)/cmos.default"

config CONSOLE_POST
default y

config D3COLD_SUPPORT
default n

config DIMM_SPD_SIZE
default 512

config FMDFILE
default "src/mainboard/\$(CONFIG_MAINBOARD_DIR)/variants/\$(CONFIG_VARIANT_DIR)/board.fmd"

config ONBOARD_VGA_IS_PRIMARY
default y

config PCIEXP_DEFAULT_MAX_RESIZABLE_BAR_BITS
default 36

config POST_DEVICE
default n

config TPM_MEASURED_BOOT
default y

config UART_FOR_CONSOLE
default 0

# PM Timer Disabled, saves power
config USE_PM_ACPI_TIMER
default n

endif
4 changes: 4 additions & 0 deletions src/mainboard/system76/ptl/Kconfig.name
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## SPDX-License-Identifier: GPL-2.0-only

config BOARD_SYSTEM76_LEMP14
bool "lemp14"
16 changes: 16 additions & 0 deletions src/mainboard/system76/ptl/Makefile.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## SPDX-License-Identifier: GPL-2.0-only

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

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

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

ramstage-y += ramstage.c
ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c
ramstage-y += variants/$(VARIANT_DIR)/gpio.c
ramstage-y += variants/$(VARIANT_DIR)/ramstage.c
ramstage-$(CONFIG_DRIVERS_I2C_TAS5825M) += variants/$(VARIANT_DIR)/tas5825m.c

SPD_SOURCES = Foresee-16GB-FX5P2004G-60 Foresee-32GB-FX5P4008G-60 Micron-16GB-MT62F1G32D2DS-023 Micron-32GB-MT62F2G32D4DS-023
31 changes: 31 additions & 0 deletions src/mainboard/system76/ptl/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) {
100, /* default AC */
100, /* default Battery */
5,
10,
15,
20,
25,
30,
35,
40,
45,
50,
55,
60,
65,
70,
75,
80,
85,
90,
95,
100
})
}
12 changes: 12 additions & 0 deletions src/mainboard/system76/ptl/acpi/mainboard.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#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"
}
}
9 changes: 9 additions & 0 deletions src/mainboard/system76/ptl/acpi/sleep.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */

External(\TBTS, MethodObj)

Method(MPTS, 1, Serialized) {
If (CondRefOf(\TBTS)) {
\TBTS()
}
}
6 changes: 6 additions & 0 deletions src/mainboard/system76/ptl/board_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vendor name: System76
Category: laptop
ROM package: WSON-8
ROM protocol: SPI
ROM socketed: n
Flashrom support: y
9 changes: 9 additions & 0 deletions src/mainboard/system76/ptl/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 <mainboard/gpio.h>

void bootblock_mainboard_early_init(void)
{
mainboard_configure_early_gpios();
}
5 changes: 5 additions & 0 deletions src/mainboard/system76/ptl/cmos.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## SPDX-License-Identifier: GPL-2.0-only

boot_option=Fallback
debug_level=Debug
me_state=Disable
43 changes: 43 additions & 0 deletions src/mainboard/system76/ptl/cmos.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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

# CMOS_VSTART_ramtop
800 80 r 0 ramtop

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 799 984
48 changes: 48 additions & 0 deletions src/mainboard/system76/ptl/devicetree.cb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-License-Identifier: GPL-2.0-only

chip soc/intel/pantherlake
register "common_soc_config" = "{
// Touchpad I2C bus
.i2c[0] = {
.speed = I2C_SPEED_FAST,
.rise_time_ns = 80,
.fall_time_ns = 110,
},
}"

# Enable Enhanced Intel SpeedStep
register "eist_enable" = "true"

# Thermal
register "tcc_offset" = "8"

device domain 0 on
device ref npu on end
device ref pmc_shared_sram on end
device ref cnvi_wifi on
register "cnvi_wifi_core" = "true"
register "cnvi_bt_core" = "true"
register "cnvi_bt_audio_offload" = "true"
chip drivers/wifi/generic
register "wake" = "GPE0_PME_B0"
device generic 0 on end
end
end
device ref soc_espi on
register "gen1_dec" = "0x00040069" # EC PM channel
register "gen2_dec" = "0x00fc0e01" # AP/EC command
register "gen3_dec" = "0x00fc0f01" # AP/EC debug
chip drivers/pc80/tpm
device pnp 0c31.0 on end
end
end
device ref hda on
register "pch_hda_audio_link_hda_enable" = "1"
register "pch_hda_sdi_enable[0]" = "true"
register "pch_hda_idisp_codec_enable" = "1"
register "pch_hda_idisp_link_frequency" = "HDA_LINKFREQ_96MHZ"
register "pch_hda_idisp_link_tmode" = "HDA_TMODE_8T"
end
device ref smbus on end
end
end
36 changes: 36 additions & 0 deletions src/mainboard/system76/ptl/dsdt.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* SPDX-License-Identifier: GPL-2.0-only */

//TODO: HACK FOR MISSING MISCCFG_GPIO_PM_CONFIG_BITS
#include <soc/gpio.h>

#include <acpi/acpi.h>
DefinitionBlock(
"dsdt.aml",
"DSDT",
ACPI_DSDT_REV_2,
OEM_ID,
ACPI_TABLE_CREATOR,
0x20110725
)
{
#include <acpi/dsdt_top.asl>
#include <soc/intel/common/block/acpi/acpi/platform.asl>
#include <soc/intel/common/block/acpi/acpi/globalnvs.asl>
#include <cpu/intel/common/acpi/cpu.asl>

Device (\_SB.PCI0)
{
#include <soc/intel/common/block/acpi/acpi/northbridge.asl>
#include <soc/intel/pantherlake/acpi/southbridge.asl>
#include <soc/intel/pantherlake/acpi/tcss.asl>
}

#include <southbridge/intel/common/acpi/sleepstates.asl>

Scope (\_SB.PCI0.LPCB)
{
#include <drivers/pc80/pc/ps2_controller.asl>
}

#include "acpi/mainboard.asl"
}
9 changes: 9 additions & 0 deletions src/mainboard/system76/ptl/include/mainboard/gpio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef MAINBOARD_GPIO_H
#define MAINBOARD_GPIO_H

void mainboard_configure_early_gpios(void);
void mainboard_configure_gpios(void);

#endif
13 changes: 13 additions & 0 deletions src/mainboard/system76/ptl/ramstage.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */

#include <mainboard/gpio.h>
#include <soc/ramstage.h>

static void mainboard_init(void *chip_info)
{
mainboard_configure_gpios();
}

struct chip_operations mainboard_ops = {
.init = mainboard_init,
};
33 changes: 33 additions & 0 deletions src/mainboard/system76/ptl/spd/Foresee-16GB-FX5P2004G-60.spd.hex
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Foresee-16GB-FX5P2004G-60
23 10 15 0e 86 22 95 08 00 40 00 00 02 01 00 00
48 00 09 ff 92 55 05 00 aa 00 90 a8 90 c0 08 60
04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 7f c6 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Loading