Skip to content

Commit

Permalink
mb/system76/meer9: Add Meerkat 9
Browse files Browse the repository at this point in the history
The Meerkat 9 is an Intel Meteor Lake-H based small form factor desktop
computer.

Change-Id: I37a0b808cf383379b8e284831644c824c0d4817e
Signed-off-by: Jeremy Soller <[email protected]>
Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
jackpot51 authored and crawfxrd committed Dec 6, 2024
1 parent d0cab05 commit a63b044
Show file tree
Hide file tree
Showing 24 changed files with 1,055 additions and 0 deletions.
83 changes: 83 additions & 0 deletions src/mainboard/system76/meer9/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
## SPDX-License-Identifier: GPL-2.0-only

config BOARD_SYSTEM76_MEER9_COMMON
def_bool n
select BOARD_ROMSIZE_KB_32768
select CRB_TPM
select DRIVERS_GENERIC_CBFS_SERIAL
select DRIVERS_GENERIC_CBFS_UUID
select DRIVERS_UART_8250IO
select HAVE_ACPI_RESUME
select HAVE_ACPI_TABLES
select HAVE_CMOS_DEFAULT
select HAVE_INTEL_PTT
select HAVE_OPTION_TABLE
select INTEL_GMA_HAVE_VBT
select MAINBOARD_HAS_TPM2
select NO_UART_ON_SUPERIO
select PCIEXP_SUPPORT_RESIZABLE_BARS
select SOC_INTEL_COMMON_BLOCK_HDA_VERB
select SOC_INTEL_CRASHLOG
select SOC_INTEL_METEORLAKE
select SPD_READ_BY_WORD

config BOARD_SYSTEM76_MEER9
select BOARD_SYSTEM76_MEER9_COMMON
select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES
select SOC_INTEL_METEORLAKE_U_H

if BOARD_SYSTEM76_MEER9_COMMON

config MAINBOARD_DIR
default "system76/meer9"

config VARIANT_DIR
default "meer9" if BOARD_SYSTEM76_MEER9

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

config MAINBOARD_PART_NUMBER
default "meer9" if BOARD_SYSTEM76_MEER9

config MAINBOARD_SMBIOS_PRODUCT_NAME
default "Meerkat" if BOARD_SYSTEM76_MEER9

config MAINBOARD_VERSION
default "meer9" if BOARD_SYSTEM76_MEER9

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 1024

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

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

// Notifications:
// 0x80 - hardware backlight toggle
// 0x81 - backlight toggle
// 0x82 - backlight down
// 0x83 - backlight up
// 0x84 - backlight color change
// 0x85 - OLED screen toggle
Device (S76D) {
Name (_HID, "17761776")
Name (_UID, 0)
// Hide the device so that Windows does not warn about a missing driver.
Name (_STA, 0xB)

OperationRegion (HMIO, SystemIO, 0x295, 0x02)
Field (HMIO, ByteAcc, NoLock, Preserve) {
// Hardware manager index
HMID, 8,
// Hardware manager data
HMDT, 8,
}

Method (INIT, 0, Serialized) {
Printf ("S76D: INIT")
Return (0)
}

Method (FINI, 0, Serialized) {
Printf ("S76D: FINI")
Return (0)
}

// Get Airplane LED
Method (GAPL, 0, Serialized) {
Return (0)
}

// Set Airplane LED
Method (SAPL, 1, Serialized) {}

// Get Keyboard Backlight Kind
// 0 - No backlight
// 1 - White backlight
// 2 - RGB backlight
Method (GKBK, 0, Serialized) {
Return (0)
}

// Get Keyboard Brightness
Method (GKBB, 0, Serialized) {
Return (0)
}

// Set Keyboard Brightness
Method (SKBB, 1, Serialized) {}

// Get Keyboard Color
Method (GKBC, 0, Serialized) {
Return (0)
}

// Set Keyboard Color
Method (SKBC, 1, Serialized) {}

// Fan names
Method (NFAN, 0, Serialized) {
Return (Package() {
"CPU fan"
})
}

// Get fan duty cycle and RPM as a single value
Method (GFAN, 1, Serialized) {
// Set bank 0
HMID = 0x4E
HMDT = 0x80

// Read fan duty cycle
HMID = 0x4B
Local0 = HMDT

// Read fan RPM (low)
HMID = 0x33
Local1 = HMDT

// Read fan RPM (high)
HMID = 0x32
Local2 = HMDT

Return ((Local2 << 16) | (Local1 << 8) | Local0)
}

// Temperature names
Method (NTMP, 0, Serialized) {
Return (Package() {
"CPU temp"
})
}

// Get temperature
Method (GTMP, 1, Serialized) {
// Set bank 0
HMID = 0x4E
HMDT = 0x80

// Read temperature
HMID = 0x19
Local0 = HMDT

Return (Local0)
}
}
49 changes: 49 additions & 0 deletions src/mainboard/system76/meer9/acpi/sio.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* SPDX-License-Identifier: GPL-2.0-only */

Device (SIO) {
Name (_ADR, 0x2E)
OperationRegion (SIOA, SystemIO, 0x2E, 0x02)
Field (SIOA, ByteAcc, NoLock, Preserve)
{
SI2E, 8,
SI2F, 8,
}
IndexField (SI2E, SI2F, ByteAcc, NoLock, Preserve)
{
Offset (0x07),
SLDN, 8, /* Logical Device Number */
Offset(0xE5),
SRE5, 8, /* Register 0xE5 */
}

Method (ENTR, 0, Serialized) {
// Enter config mode
SI2E = 0x87
SI2E = 0x87
}

Method (EXIT, 0, Serialized) {
// Exit config mode
SI2E = 0xAA
}

Method (PTS, 0, Serialized) {
ENTR()

// Turn on fading LED
SLDN = 0x15
SRE5 = 0x43

EXIT()
}

Method (WAK, 0, Serialized) {
ENTR()

// Turn off fading LED
SLDN = 0x15
SRE5 = 0x42

EXIT()
}
}
11 changes: 11 additions & 0 deletions src/mainboard/system76/meer9/acpi/sleep.asl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */

/* Method called from _PTS prior to enter sleep state */
Method (MPTS, 1) {
\_SB.SIO.PTS()
}

/* Method called from _WAK prior to wakeup */
Method (MWAK, 1) {
\_SB.SIO.WAK()
}
6 changes: 6 additions & 0 deletions src/mainboard/system76/meer9/board_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Vendor name: System76
Category: desktop
ROM package: WSON-8
ROM protocol: SPI
ROM socketed: y
Flashrom support: y
Loading

0 comments on commit a63b044

Please sign in to comment.