From 4dcee4f21db560c42cb6d470857e4d8250fdd128 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Tue, 13 Apr 2021 09:46:12 -0600 Subject: [PATCH] mb/system76/lemp10: Add System76 Lemur Pro 10 https://tech-docs.system76.com/models/lemp10/README.html Tested with TianoCore (UefiPayloadPkg). Working: - PS/2 keyboard, touchpad - DIMM slot and onboard RAM - Both M.2 NVMe SSDs - MicroSD card reader - All USB ports - USB-PD - Webcam - WiFi/Bluetooth - Integrated graphics using Intel GOP driver - HDMI output - DP over USB-C output - Internal microphone - Internal speakers - Combined 3.5mm headphone/microphone jack - S0ix suspend* - Booting to Pop!_OS Linux 21.04 and Windows 10 - Flashing with flashrom Not working: - S0ix when a device is attached to the TBT port Change-Id: I15f7a3b6e9af07fcfde9a71d3f4a84ed625159b7 Signed-off-by: Jeremy Soller Signed-off-by: Tim Crawford Reviewed-on: https://review.coreboot.org/c/coreboot/+/52294 Tested-by: build bot (Jenkins) --- Documentation/mainboard/index.md | 3 +- Documentation/mainboard/system76/lemp10.md | 63 ++++ src/mainboard/system76/lemp10/Kconfig | 55 ++++ src/mainboard/system76/lemp10/Kconfig.name | 2 + src/mainboard/system76/lemp10/Makefile.inc | 10 + .../system76/lemp10/acpi/mainboard.asl | 9 + src/mainboard/system76/lemp10/acpi/sleep.asl | 46 +++ src/mainboard/system76/lemp10/board_info.txt | 8 + src/mainboard/system76/lemp10/bootblock.c | 10 + src/mainboard/system76/lemp10/cmos.default | 3 + src/mainboard/system76/lemp10/cmos.layout | 39 +++ src/mainboard/system76/lemp10/data.vbt | Bin 0 -> 8704 bytes src/mainboard/system76/lemp10/devicetree.cb | 304 ++++++++++++++++++ src/mainboard/system76/lemp10/dsdt.asl | 34 ++ src/mainboard/system76/lemp10/gpio.c | 217 +++++++++++++ src/mainboard/system76/lemp10/gpio_early.c | 14 + src/mainboard/system76/lemp10/hda_verb.c | 26 ++ .../system76/lemp10/include/mainboard/gpio.h | 9 + src/mainboard/system76/lemp10/ramstage.c | 13 + src/mainboard/system76/lemp10/romstage.c | 23 ++ .../spd/samsung-M471A1G44AB0-CWE.spd.hex | 33 ++ 21 files changed, 920 insertions(+), 1 deletion(-) create mode 100644 Documentation/mainboard/system76/lemp10.md create mode 100644 src/mainboard/system76/lemp10/Kconfig create mode 100644 src/mainboard/system76/lemp10/Kconfig.name create mode 100644 src/mainboard/system76/lemp10/Makefile.inc create mode 100644 src/mainboard/system76/lemp10/acpi/mainboard.asl create mode 100644 src/mainboard/system76/lemp10/acpi/sleep.asl create mode 100644 src/mainboard/system76/lemp10/board_info.txt create mode 100644 src/mainboard/system76/lemp10/bootblock.c create mode 100644 src/mainboard/system76/lemp10/cmos.default create mode 100644 src/mainboard/system76/lemp10/cmos.layout create mode 100644 src/mainboard/system76/lemp10/data.vbt create mode 100644 src/mainboard/system76/lemp10/devicetree.cb create mode 100644 src/mainboard/system76/lemp10/dsdt.asl create mode 100644 src/mainboard/system76/lemp10/gpio.c create mode 100644 src/mainboard/system76/lemp10/gpio_early.c create mode 100644 src/mainboard/system76/lemp10/hda_verb.c create mode 100644 src/mainboard/system76/lemp10/include/mainboard/gpio.h create mode 100644 src/mainboard/system76/lemp10/ramstage.c create mode 100644 src/mainboard/system76/lemp10/romstage.c create mode 100644 src/mainboard/system76/lemp10/spd/samsung-M471A1G44AB0-CWE.spd.hex diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md index 2e1d2941fc..a980c077dd 100644 --- a/Documentation/mainboard/index.md +++ b/Documentation/mainboard/index.md @@ -181,7 +181,8 @@ The boards in this section are not real mainboards, but emulators. ## System76 - [Gazelle 15](system76/gaze15.md) -- [Lemur Pro](system76/lemp9.md) +- [Lemur Pro 9](system76/lemp9.md) +- [Lemur Pro 10](system76/lemp10.md) - [Oryx Pro 5](system76/oryp5.md) - [Oryx Pro 6](system76/oryp6.md) diff --git a/Documentation/mainboard/system76/lemp10.md b/Documentation/mainboard/system76/lemp10.md new file mode 100644 index 0000000000..89e57b5225 --- /dev/null +++ b/Documentation/mainboard/system76/lemp10.md @@ -0,0 +1,63 @@ +# System76 Lemur Pro 10 (lemp10) + +## Specs + +- CPU + - Intel Core i7-1165G7 + - Intel Core i5-1135G7 +- EC + - ITE IT5570E running [System76 EC](https://github.com/system76/ec) +- Graphics + - Intel Iris Xe Graphics + - eDP 14.0" 1920x1080@60Hz LCD + - 1x HDMI + - 1x DisplayPort 1.4 over USB-C +- Memory + - Channel 0: 8-GB on-board DDR4 (Samsung K4AAG165WA-BCWE x 8) + - Channel 1: 8-GB/16-GB/32-GB DDR4 SO-DIMM @ 3200 MHz +- Networking + - M.2 PCIe/CNVi WiFi/Bluetooth + - Intel Wi-Fi 6 AX200/AX201 +- Power + - 65W (19V, 3.42A) AC barrel adapter + - Included: AcBel ADA012, using a C7 power cord + - USB-C charging compatible with 65W+ charger + - 73Wh 4-cell Lithium-Ion battery + - TI BQ24780S battery charge controller +- Sound + - Realtek ALC293 codec + - Internal speakers and microphone + - Combined 3.5 mm headphone/microphone jack + - HDMI, USB-C DisplayPort audio +- Storage + - M.2 PCIe NVMe Gen 4 SSD + - M.2 PCIe NVMe Gen 3 or SATA SSD + - MicroSD card reader (RTS5227S) +- USB + - 1x USB Type-C with Thunderbolt 4 + - 1x USB 3.1 (3.1 Gen 2) Type-A + - 1x USB 3.0 (3.2 Gen 1) Type-A + +## 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 (U33) is left of the DIMM slot. diff --git a/src/mainboard/system76/lemp10/Kconfig b/src/mainboard/system76/lemp10/Kconfig new file mode 100644 index 0000000000..637c90285d --- /dev/null +++ b/src/mainboard/system76/lemp10/Kconfig @@ -0,0 +1,55 @@ +if BOARD_SYSTEM76_LEMP10 + +config BOARD_SPECIFIC_OPTIONS + def_bool y + select BOARD_ROMSIZE_KB_16384 + select DRIVERS_I2C_HID + select DRIVERS_INTEL_PMC + select DRIVERS_INTEL_USB4_RETIMER + select EC_SYSTEM76_EC + select EC_SYSTEM76_EC_BAT_THRESHOLDS + select HAVE_ACPI_TABLES + select HAVE_CMOS_DEFAULT + select HAVE_OPTION_TABLE + select HAVE_SPD_IN_CBFS + 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_COMMON_BLOCK_HDA_VERB + select SPD_READ_BY_WORD + select SYSTEM_TYPE_LAPTOP + select TPM_RDRESP_NEED_DELAY + +config MAINBOARD_DIR + default "system76/lemp10" + +config MAINBOARD_PART_NUMBER + default "lemp10" + +config MAINBOARD_SMBIOS_PRODUCT_NAME + default "Lemur Pro" + +config MAINBOARD_VERSION + default "lemp10" + +config CBFS_SIZE + default 0xA00000 + +config CONSOLE_POST + default y + +config DIMM_SPD_SIZE + default 512 + +config POST_DEVICE + default n + +config UART_FOR_CONSOLE + default 2 + +endif diff --git a/src/mainboard/system76/lemp10/Kconfig.name b/src/mainboard/system76/lemp10/Kconfig.name new file mode 100644 index 0000000000..43aae91b99 --- /dev/null +++ b/src/mainboard/system76/lemp10/Kconfig.name @@ -0,0 +1,2 @@ +config BOARD_SYSTEM76_LEMP10 + bool "lemp10" diff --git a/src/mainboard/system76/lemp10/Makefile.inc b/src/mainboard/system76/lemp10/Makefile.inc new file mode 100644 index 0000000000..c92ea5b939 --- /dev/null +++ b/src/mainboard/system76/lemp10/Makefile.inc @@ -0,0 +1,10 @@ +CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include + +bootblock-y += bootblock.c +bootblock-y += gpio_early.c + +ramstage-y += ramstage.c +ramstage-y += gpio.c +ramstage-y += hda_verb.c + +SPD_SOURCES = samsung-M471A1G44AB0-CWE diff --git a/src/mainboard/system76/lemp10/acpi/mainboard.asl b/src/mainboard/system76/lemp10/acpi/mainboard.asl new file mode 100644 index 0000000000..9261e7aac9 --- /dev/null +++ b/src/mainboard/system76/lemp10/acpi/mainboard.asl @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#define EC_GPE_SCI 0x6E /* GPP_E15 */ +#define EC_GPE_SWI 0x6E /* GPP_E20 */ +#include + +Scope (\_SB) { + #include "sleep.asl" +} diff --git a/src/mainboard/system76/lemp10/acpi/sleep.asl b/src/mainboard/system76/lemp10/acpi/sleep.asl new file mode 100644 index 0000000000..83888f3e59 --- /dev/null +++ b/src/mainboard/system76/lemp10/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/lemp10/board_info.txt b/src/mainboard/system76/lemp10/board_info.txt new file mode 100644 index 0000000000..511458fec5 --- /dev/null +++ b/src/mainboard/system76/lemp10/board_info.txt @@ -0,0 +1,8 @@ +Vendor name: System76 +Board name: lemp10 +Category: laptop +Release year: 2020 +ROM package: SOIC-8 +ROM protocol: SPI +ROM socketed: n +Flashrom support: y diff --git a/src/mainboard/system76/lemp10/bootblock.c b/src/mainboard/system76/lemp10/bootblock.c new file mode 100644 index 0000000000..ae416b4e77 --- /dev/null +++ b/src/mainboard/system76/lemp10/bootblock.c @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include + +void bootblock_mainboard_early_init(void) +{ + mainboard_configure_early_gpios(); +} diff --git a/src/mainboard/system76/lemp10/cmos.default b/src/mainboard/system76/lemp10/cmos.default new file mode 100644 index 0000000000..d56495357c --- /dev/null +++ b/src/mainboard/system76/lemp10/cmos.default @@ -0,0 +1,3 @@ +boot_option=Fallback +debug_level=Debug +power_on_after_fail=Enable diff --git a/src/mainboard/system76/lemp10/cmos.layout b/src/mainboard/system76/lemp10/cmos.layout new file mode 100644 index 0000000000..ca7c7a4c5c --- /dev/null +++ b/src/mainboard/system76/lemp10/cmos.layout @@ -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 + +409 2 e 7 power_on_after_fail +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 + +7 0 Disable +7 1 Enable +7 2 Keep + +checksums + +checksum 408 983 984 diff --git a/src/mainboard/system76/lemp10/data.vbt b/src/mainboard/system76/lemp10/data.vbt new file mode 100644 index 0000000000000000000000000000000000000000..7c29ceda62490e790cf65d196758481c99e282fd GIT binary patch literal 8704 zcmeHMO-vg{6n?Yzt{umeMWDo?2_2G%01dD>2_?u9>mMLaAlQZwN2-J&b{iB2Tp$(w zk=RNc=xwD+5lLIcs#LY|iJp4s#g|q{y;!MK_0R*yC~DP9j!E4&vulj`32xLhrSh}h z?99Gz-hS`R?9S}^(6XHxIYPQ86&o;Lei zs2i`-#{F{2)IT$uYNy_0l13P2jz$u5iP?7(@%AbQbCd
    iVCsp;n0bQX5a!pAs*s%%C`agpJvr z&ljTDuQg{aT*SM|V)rZ^<*{4=$ltHafMhhm<|%}@{rKOoz3Q~&Y-{ku{+KM+K2Oa7 zIh)b*4w)HM&ydKy-D1~8^w7$B0iXv_=gX-xEiRQYqwck&bK#}qO6ab+CqoYwz^xK;P^EG_D6Q&R zY$>j|!fZ2%!aX=y&B<26y=V2dImtcXK8$$~X&D|K)k8W&4=YZ^&w3dgbi5yVCd;`u zg&xiIPIsFcZ7Yt21#pwcIN&aK?^)fVLQI3&m@L<@US=NnX3^PyAz++i<<;oOfVa@( z4Y%1sSfL7VWpf{F6fJ}Oq4ChfbRv0q;#T6NG`7IQ+PBE*9{8;v`v!5#d>Ucl%N1JhOqs-@fF~b1tA<9_h_)22D zB33WH)?0@I#s+RT@p!=Qo@(mvB5-1A+Kn%B*F4!(-*j#oSf0{m;*^$He$8 z*Z%!lab!ws5|{1=z}NCp+dgldk2plWOWNmgROnYSP{}|g1C-t6XB!e`U6H5``7CHI>+M3j(N; zBBJsBb}CT2)K=*Xo3ZN|4j4X^i0j({$uK>>-X)#Aaa2J*=$I++pj?HW=231-E7lhFkXJ}L-zTNVYMf=GrmX|cX(jyzo yVeD1ROI?6*abfIj&~0ri;d$>P0Y8!Bf7SQ{sTR4QACxTWv&QfLU}JH