From 10e47d80cbe5bb2464931a0c6c6d5a7f7077b28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Niew=C3=B6hner?= Date: Tue, 1 Mar 2022 20:47:43 +0100 Subject: [PATCH] mb/clevo/tgl-u: add new board L14xMU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add new board Clevo L14xMU (TGL). GPIOs were configured based on schematics. Tested and working: - On-board RAM (M471A1G44AB0-CWE) - DIMM slot (tested Crucial CT16G4SFD8266.16FJ1 / MTA16ATF2G64HZ-2G6J1) - Graphics (GOP driver), including HDMI - Keyboard - I2C touchpad (including interrupt) - TPM (with interrupt on Windows, only polling on Linux [1]) - microSD Card reader - both NVME ports - Speakers - Microphone - Camera - WLAN/BT (CNVi) - All USB2/3 ports including Type-C - Thunderbolt detects my work laptop in TB Control Center (I couldn't test anything more due to security policy.) - TianoCore - internal flashing with flashrom on vendor firmware Note on TPM: The vendor sets Intel PTT to default-on in newer CSME images, which conflicts with the dTPM. Currently, there are two ways to make it work: 1) Boot vendor firmware once to let it disable PTT via CSME firmware feature override. 2) Use Intel Flash Image Tool (FIT) to set "initial power-up state" to disabled. Boots fine: - Debian testing, unstable (Linux 5.16.14, 5.17.0-rc6) - Windows 10 21H2 (Build 19044.1586) Untested: - Thunderbolt (see above) - Type-C DisplayPort - S-ATA Doesn't work: - TPM interrupt on Linux [1] - All EC related functions - EC driver is WIP - WLAN/BT (PCIe) - gets detected but can't be enabled - 3G/LTE (not powered without EC driver) - Fn-Keys - S0ix - UCSI - Fan control - Battery info [1] https://lkml.org/lkml/2021/5/1/103 Change-Id: I4c4bef3827da10241e9b01e12ecc4276e131a620 Signed-off-by: Michael Niewöhner Reviewed-on: https://review.coreboot.org/c/coreboot/+/59548 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/mainboard/clevo/tgl-u/Kconfig | 63 +++++ src/mainboard/clevo/tgl-u/Kconfig.name | 4 + src/mainboard/clevo/tgl-u/Makefile.inc | 14 + src/mainboard/clevo/tgl-u/board_info.txt | 6 + src/mainboard/clevo/tgl-u/bootblock.c | 9 + src/mainboard/clevo/tgl-u/cmos.default | 3 + src/mainboard/clevo/tgl-u/cmos.layout | 57 ++++ src/mainboard/clevo/tgl-u/dsdt.asl | 32 +++ .../clevo/tgl-u/include/variant/gpio.h | 9 + .../clevo/tgl-u/include/variant/ramstage.h | 8 + .../clevo/tgl-u/include/variant/romstage.h | 8 + src/mainboard/clevo/tgl-u/ramstage.c | 20 ++ src/mainboard/clevo/tgl-u/romstage.c | 9 + .../spd/samsung-M471A1G44AB0-CWE.spd.hex | 32 +++ .../clevo/tgl-u/variants/l140mu/Makefile.inc | 1 + .../tgl-u/variants/l140mu/board_info.txt | 2 + .../clevo/tgl-u/variants/l140mu/data.vbt | Bin 0 -> 8704 bytes .../clevo/tgl-u/variants/l140mu/devicetree.cb | 249 ++++++++++++++++++ .../clevo/tgl-u/variants/l140mu/gpio.c | 235 +++++++++++++++++ .../clevo/tgl-u/variants/l140mu/gpio_early.c | 15 ++ .../clevo/tgl-u/variants/l140mu/hda_verb.c | 82 ++++++ .../clevo/tgl-u/variants/l140mu/ramstage.c | 11 + .../clevo/tgl-u/variants/l140mu/romstage.c | 19 ++ 23 files changed, 888 insertions(+) create mode 100644 src/mainboard/clevo/tgl-u/Kconfig create mode 100644 src/mainboard/clevo/tgl-u/Kconfig.name create mode 100644 src/mainboard/clevo/tgl-u/Makefile.inc create mode 100644 src/mainboard/clevo/tgl-u/board_info.txt create mode 100644 src/mainboard/clevo/tgl-u/bootblock.c create mode 100644 src/mainboard/clevo/tgl-u/cmos.default create mode 100644 src/mainboard/clevo/tgl-u/cmos.layout create mode 100644 src/mainboard/clevo/tgl-u/dsdt.asl create mode 100644 src/mainboard/clevo/tgl-u/include/variant/gpio.h create mode 100644 src/mainboard/clevo/tgl-u/include/variant/ramstage.h create mode 100644 src/mainboard/clevo/tgl-u/include/variant/romstage.h create mode 100644 src/mainboard/clevo/tgl-u/ramstage.c create mode 100644 src/mainboard/clevo/tgl-u/romstage.c create mode 100644 src/mainboard/clevo/tgl-u/spd/samsung-M471A1G44AB0-CWE.spd.hex create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/Makefile.inc create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/board_info.txt create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/data.vbt create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/devicetree.cb create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/gpio.c create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/gpio_early.c create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/hda_verb.c create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/ramstage.c create mode 100644 src/mainboard/clevo/tgl-u/variants/l140mu/romstage.c diff --git a/src/mainboard/clevo/tgl-u/Kconfig b/src/mainboard/clevo/tgl-u/Kconfig new file mode 100644 index 0000000000..a97d3d849b --- /dev/null +++ b/src/mainboard/clevo/tgl-u/Kconfig @@ -0,0 +1,63 @@ +config BOARD_CLEVO_TGLU_COMMON + def_bool n + select BOARD_ROMSIZE_KB_16384 + select DRIVERS_I2C_HID + select DRIVERS_INTEL_PMC + select DRIVERS_INTEL_USB4_RETIMER + 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_COMMON_BLOCK_HDA_VERB + select SOC_INTEL_ENABLE_USB4_PCIE_RESOURCES + select SOC_INTEL_TIGERLAKE + select SPD_READ_BY_WORD + select SYSTEM_TYPE_LAPTOP + +config BOARD_CLEVO_L140MU + select BOARD_CLEVO_TGLU_COMMON + select HAVE_SPD_IN_CBFS + +if BOARD_CLEVO_TGLU_COMMON + +config MAINBOARD_DIR + default "clevo/tgl-u" + +config VARIANT_DIR + default "l140mu" if BOARD_CLEVO_L140MU + +config MAINBOARD_PART_NUMBER + default "L140MU" if BOARD_CLEVO_L140MU + +config MAINBOARD_VERSION + default "2.2A" if BOARD_CLEVO_L140MU + +config DEVICETREE + default "variants/\$(CONFIG_VARIANT_DIR)/devicetree.cb" + +config CBFS_SIZE + default 0xb00000 if BOARD_CLEVO_L140MU + +config CONSOLE_POST + default y + +config UART_FOR_CONSOLE + default 2 + +config TPM_PIRQ + default 0x77 if BOARD_CLEVO_L140MU # GPP_C9_IRQ + +config POST_DEVICE + default n + +config SEABIOS_PS2_TIMEOUT + default 500 + +config USE_PM_ACPI_TIMER + default n + +endif diff --git a/src/mainboard/clevo/tgl-u/Kconfig.name b/src/mainboard/clevo/tgl-u/Kconfig.name new file mode 100644 index 0000000000..97d2874747 --- /dev/null +++ b/src/mainboard/clevo/tgl-u/Kconfig.name @@ -0,0 +1,4 @@ +comment "Tiger Lake U" + +config BOARD_CLEVO_L140MU + bool "L140MU / L141MU / L142MU" diff --git a/src/mainboard/clevo/tgl-u/Makefile.inc b/src/mainboard/clevo/tgl-u/Makefile.inc new file mode 100644 index 0000000000..2909300f64 --- /dev/null +++ b/src/mainboard/clevo/tgl-u/Makefile.inc @@ -0,0 +1,14 @@ +CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/include + +bootblock-y += bootblock.c +bootblock-y += variants/$(VARIANT_DIR)/gpio_early.c + +romstage-y += romstage.c +romstage-y += variants/$(VARIANT_DIR)/romstage.c + +ramstage-y += ramstage.c +ramstage-y += variants/$(VARIANT_DIR)/ramstage.c +ramstage-y += variants/$(VARIANT_DIR)/gpio.c +ramstage-y += variants/$(VARIANT_DIR)/hda_verb.c + +subdirs-y += variants/$(VARIANT_DIR) diff --git a/src/mainboard/clevo/tgl-u/board_info.txt b/src/mainboard/clevo/tgl-u/board_info.txt new file mode 100644 index 0000000000..67109938da --- /dev/null +++ b/src/mainboard/clevo/tgl-u/board_info.txt @@ -0,0 +1,6 @@ +Vendor name: Clevo +Category: laptop +ROM package: SOIC-8 +ROM protocol: SPI +ROM socketed: n +Flashrom support: y diff --git a/src/mainboard/clevo/tgl-u/bootblock.c b/src/mainboard/clevo/tgl-u/bootblock.c new file mode 100644 index 0000000000..b351fbd8ef --- /dev/null +++ b/src/mainboard/clevo/tgl-u/bootblock.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include + +void bootblock_mainboard_early_init(void) +{ + variant_configure_early_gpios(); +} diff --git a/src/mainboard/clevo/tgl-u/cmos.default b/src/mainboard/clevo/tgl-u/cmos.default new file mode 100644 index 0000000000..f3330e5070 --- /dev/null +++ b/src/mainboard/clevo/tgl-u/cmos.default @@ -0,0 +1,3 @@ +boot_option=Fallback +debug_level=Debug +power_on_after_fail=Disable diff --git a/src/mainboard/clevo/tgl-u/cmos.layout b/src/mainboard/clevo/tgl-u/cmos.layout new file mode 100644 index 0000000000..4f76221f91 --- /dev/null +++ b/src/mainboard/clevo/tgl-u/cmos.layout @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: GPL-2.0-only + +# ----------------------------------------------------------------- +entries + +# start-bit length config config-ID name +0 120 r 0 reserved_memory + +# ----------------------------------------------------------------- +# RTC_BOOT_BYTE (coreboot hardcoded) +384 1 e 4 boot_option +388 4 h 0 reboot_counter + +# ----------------------------------------------------------------- +# coreboot config options: console +395 4 e 6 debug_level + +# ----------------------------------------------------------------- +# coreboot config options: southbridge +410 2 e 7 power_on_after_fail + +# ----------------------------------------------------------------- +# vboot nv area +800 128 r 0 vbnv + +# ----------------------------------------------------------------- +# coreboot config options: check sums +984 16 h 0 check_sum + +# ----------------------------------------------------------------- + +enumerations + +#ID value text +1 0 Disable +1 1 Enable +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 +7 0 Disable +7 1 Enable +7 2 Keep + +# ----------------------------------------------------------------- +checksums + +checksum 392 799 984 diff --git a/src/mainboard/clevo/tgl-u/dsdt.asl b/src/mainboard/clevo/tgl-u/dsdt.asl new file mode 100644 index 0000000000..ac02fe9d6d --- /dev/null +++ b/src/mainboard/clevo/tgl-u/dsdt.asl @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +DefinitionBlock( + "dsdt.aml", + "DSDT", + ACPI_DSDT_REV_2, + OEM_ID, + ACPI_TABLE_CREATOR, + 0x20110725 +) +{ + #include + #include + #include + #include + + Device (\_SB.PCI0) + { + #include + #include + #include + #include + } + + Scope (\_SB.PCI0.LPCB) + { + #include + } + + #include +} diff --git a/src/mainboard/clevo/tgl-u/include/variant/gpio.h b/src/mainboard/clevo/tgl-u/include/variant/gpio.h new file mode 100644 index 0000000000..95d576294f --- /dev/null +++ b/src/mainboard/clevo/tgl-u/include/variant/gpio.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef VARIANT_GPIO_H +#define VARIANT_GPIO_H + +void variant_configure_early_gpios(void); +void variant_configure_gpios(void); + +#endif diff --git a/src/mainboard/clevo/tgl-u/include/variant/ramstage.h b/src/mainboard/clevo/tgl-u/include/variant/ramstage.h new file mode 100644 index 0000000000..4b5b29db0a --- /dev/null +++ b/src/mainboard/clevo/tgl-u/include/variant/ramstage.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef VARIANT_RAMSTAGE_H +#define VARIANT_RAMSTAGE_H + +void variant_configure_fsps(FSP_S_CONFIG *params); + +#endif diff --git a/src/mainboard/clevo/tgl-u/include/variant/romstage.h b/src/mainboard/clevo/tgl-u/include/variant/romstage.h new file mode 100644 index 0000000000..cfcc6ab08d --- /dev/null +++ b/src/mainboard/clevo/tgl-u/include/variant/romstage.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef VARIANT_ROMSTAGE_H +#define VARIANT_ROMSTAGE_H + +void variant_configure_fspm(FSPM_UPD *memupd); + +#endif diff --git a/src/mainboard/clevo/tgl-u/ramstage.c b/src/mainboard/clevo/tgl-u/ramstage.c new file mode 100644 index 0000000000..0768e515c9 --- /dev/null +++ b/src/mainboard/clevo/tgl-u/ramstage.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +void mainboard_silicon_init_params(FSP_S_CONFIG *params) +{ + variant_configure_fsps(params); +} + +static void init_mainboard(void *chip_info) +{ + variant_configure_gpios(); +} + +struct chip_operations mainboard_ops = { + .init = init_mainboard, +}; diff --git a/src/mainboard/clevo/tgl-u/romstage.c b/src/mainboard/clevo/tgl-u/romstage.c new file mode 100644 index 0000000000..5ba6c5676a --- /dev/null +++ b/src/mainboard/clevo/tgl-u/romstage.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include + +void mainboard_memory_init_params(FSPM_UPD *memupd) +{ + variant_configure_fspm(memupd); +} diff --git a/src/mainboard/clevo/tgl-u/spd/samsung-M471A1G44AB0-CWE.spd.hex b/src/mainboard/clevo/tgl-u/spd/samsung-M471A1G44AB0-CWE.spd.hex new file mode 100644 index 0000000000..91442caf3a --- /dev/null +++ b/src/mainboard/clevo/tgl-u/spd/samsung-M471A1G44AB0-CWE.spd.hex @@ -0,0 +1,32 @@ +23 11 0C 03 46 29 00 08 00 60 00 03 02 03 00 00 +00 00 05 0D F8 FF 01 00 6E 6E 6E 11 00 6E F0 0A +20 08 00 05 00 F0 2B 34 28 00 78 00 14 3C 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 16 36 0B 35 +16 36 0B 35 00 00 16 36 0B 35 16 36 0B 35 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 9C B5 00 00 00 00 E7 00 E8 F5 +0F 11 02 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 DB 08 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +80 CE 00 00 00 00 00 00 00 4D 34 37 31 41 31 47 +34 34 41 42 30 2D 43 57 45 20 20 20 20 00 80 CE +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 diff --git a/src/mainboard/clevo/tgl-u/variants/l140mu/Makefile.inc b/src/mainboard/clevo/tgl-u/variants/l140mu/Makefile.inc new file mode 100644 index 0000000000..10cb4fb8af --- /dev/null +++ b/src/mainboard/clevo/tgl-u/variants/l140mu/Makefile.inc @@ -0,0 +1 @@ +SPD_SOURCES = samsung-M471A1G44AB0-CWE diff --git a/src/mainboard/clevo/tgl-u/variants/l140mu/board_info.txt b/src/mainboard/clevo/tgl-u/variants/l140mu/board_info.txt new file mode 100644 index 0000000000..764bb688a0 --- /dev/null +++ b/src/mainboard/clevo/tgl-u/variants/l140mu/board_info.txt @@ -0,0 +1,2 @@ +Board name: L140MU +Release year: 2021 diff --git a/src/mainboard/clevo/tgl-u/variants/l140mu/data.vbt b/src/mainboard/clevo/tgl-u/variants/l140mu/data.vbt new file mode 100644 index 0000000000000000000000000000000000000000..f8c0444f234cc4f972440e237ff1d14dff443b86 GIT binary patch literal 8704 zcmeHML2MI86#cX7T^rYF7C8cwLOKByoRlPM18ImXv9^K|IDs&90(ZHv;_HE ze|L8Oo4@b>nVp#(A07z})8WYJo_K%oY!Bs<0u^pG_Tlkq2}K5nM!SQ9vVE8Qk z3--WdQqRq}#jGGgoG(vNRfw(BQ?3=}dZhY&M;u zLnEhyl=-W1hOSLyQuN%ltK;eEE{aZ6L{s1KwqwUB^}pY)9&7ijz7uHa@^y5bI9cQD z?gQ^18fRGu;i>GW(-W62&r)x= znfmcLt=uoCOv6*t*)|%?WN4gWW@tP;lb-%0oocIbGDoZ6un_vSlz%6Si`tYq19f5`YJeKnSg-f@X}`x-oSJRpni zyxj?T`|DPEI(1v!d0g0S2}4Z6^{s%_`_&9QGXvg(IH%2&neMQ03#D|kWmwYfoi=^< z+k66aOuO){NeC`}en1pFOSMO!Q22G1ZqW4uiX(|`nKX3Ffu$IznwoW+ z9xw{5$jYucslFl)b2L`3Xvzi;#E@RX!=3iI^;mtAmRKrrAco96X!1%09L}85)bSO+ zrmdDd$ZXMpQH)5HWb&iNk>waPsJ({O7A%tnTU-HBsU#1dw;8!)eS@Y_t1U2-HUn2Q z$U(PP5`{OQ=dvq@&_fHW#ruO~@F~@mlNKuI4>y~0`PjliHG0EZmmvocaJhsWG`SKF zYKyj(Tu7;&81Dm|gNWUcd3eP>$vNO!jCqh~1yS6uhg_8IRb6VB)iOC4_&)MXR`PBN zUApJv&Q>kaT51asaG}RI;7XUhS->3hQiN#HVM1mrV?0uB0HmKW~2D!@SmTL@xj_8al8Yk zO#|O|KJ;yBrb6KqW*C4CvW#V(&ot&|WbORBr|Pi5Si@~4fdDxC6HUDx1P)D1`tgHr z)EfXl!ue+*o~utT<*u6Tf4_%4Am(q;{qm(!%aoU7E}eIQ&-LZD9e#B(?v(i|YKO;B zrC-fJH3QWQR5MV`Ks5u^3{*4lKW3oowy+;Q90$+^12?6TuucwG|I)F)dI7Yr0jLPX z3pykaOU!*)ZoBsg0XB_zU=jDJn{dxp=Ar0#T>ln#bfhJsLKZP9*28aElvPw_o0BL} z&{l6#%526T%(hMvu!OdzGFyI508Lf}4ZW<`{AIR>0|Z8-Wzq`