diff --git a/site/docs/install/t480-thunderbolt-20241206-unstable.patch b/site/docs/install/t480-thunderbolt-20241206-unstable.patch new file mode 100644 index 0000000..d69c343 --- /dev/null +++ b/site/docs/install/t480-thunderbolt-20241206-unstable.patch @@ -0,0 +1,136 @@ +From 67b0219a665462ae71f6ba5104edc55ad6245ca7 Mon Sep 17 00:00:00 2001 +From: Mate Kukri +Date: Thu, 5 Dec 2024 20:42:40 +0000 +Subject: [PATCH] thunderbolt fix-ish + +it shows up, but resume is no dice. + +Change-Id: I2d91a1d290b35e7ea3a1193b4be7b4ba936e4a15 +--- + src/mainboard/lenovo/sklkbl_thinkpad/Kconfig | 1 + + src/mainboard/lenovo/sklkbl_thinkpad/dsdt.asl | 13 +++++++++++++ + .../lenovo/sklkbl_thinkpad/variants/t480/gpio.c | 8 ++++---- + .../sklkbl_thinkpad/variants/t480/overridetree.cb | 4 ++++ + .../lenovo/sklkbl_thinkpad/variants/t480s/gpio.c | 8 ++++---- + .../sklkbl_thinkpad/variants/t480s/overridetree.cb | 4 ++++ + 6 files changed, 30 insertions(+), 8 deletions(-) + +diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/Kconfig b/src/mainboard/lenovo/sklkbl_thinkpad/Kconfig +index 21076315ab..0766c03716 100644 +--- a/src/mainboard/lenovo/sklkbl_thinkpad/Kconfig ++++ b/src/mainboard/lenovo/sklkbl_thinkpad/Kconfig +@@ -19,6 +19,7 @@ config BOARD_LENOVO_SKLKBL_THINKPAD_COMMON + select SOC_INTEL_COMMON_BLOCK_HDA_VERB + select SPD_READ_BY_WORD + select SYSTEM_TYPE_LAPTOP ++ select DRIVERS_INTEL_DTBT + + config BOARD_LENOVO_E460 + bool +diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/dsdt.asl b/src/mainboard/lenovo/sklkbl_thinkpad/dsdt.asl +index 237500775f..849540d32d 100644 +--- a/src/mainboard/lenovo/sklkbl_thinkpad/dsdt.asl ++++ b/src/mainboard/lenovo/sklkbl_thinkpad/dsdt.asl +@@ -35,4 +35,17 @@ DefinitionBlock( + } + + #include ++ ++ Scope (\_SB) ++ { ++ External (\TBTS, MethodObj) ++ ++ Method (MPTS, 1, Serialized) ++ { ++ If (CondRefOf (\TBTS)) ++ { ++ \TBTS() ++ } ++ } ++ } + } +diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/gpio.c b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/gpio.c +index f7c29e1f39..edfa09fbb7 100644 +--- a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/gpio.c ++++ b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/gpio.c +@@ -86,7 +86,7 @@ static const struct pad_config gpio_table[] = { + PAD_NC(GPP_C18, NONE), + PAD_NC(GPP_C19, NONE), + PAD_CFG_GPO(GPP_C20, 0, DEEP), /* EPRIVACY_ON */ +- PAD_CFG_GPO(GPP_C21, 0, DEEP), /* TBT_FORCE_PWR */ ++ PAD_CFG_GPO(GPP_C21, 1, DEEP), /* TBT_FORCE_PWR */ + PAD_CFG_GPI_SCI(GPP_C22, NONE, DEEP, EDGE_SINGLE, INVERT), /* -EC_SCI */ + PAD_CFG_GPI_SCI(GPP_C23, NONE, DEEP, EDGE_SINGLE, INVERT), /* -EC_WAKE */ + +@@ -191,9 +191,9 @@ static const struct pad_config gpio_table[] = { + PAD_NC(GPP_G1, NONE), + PAD_NC(GPP_G2, NONE), + PAD_NC(GPP_G3, NONE), +- PAD_CFG_GPO(GPP_G4, 0, DEEP), /* TBT_RTD3_PWR_EN */ +- PAD_CFG_GPO(GPP_G5, 0, DEEP), /* TBT_FORCE_USB_PWR */ +- PAD_CFG_GPO(GPP_G6, 0, DEEP), /* -TBT_PERST */ ++ PAD_CFG_GPO(GPP_G4, 1, DEEP), /* TBT_RTD3_PWR_EN */ ++ PAD_CFG_GPO(GPP_G5, 1, DEEP), /* TBT_FORCE_USB_PWR (TBT_RTD3_USB_PWR_EN) */ ++ PAD_CFG_GPO(GPP_G6, 1, DEEP), /* -TBT_PERST */ + PAD_CFG_GPI_SCI(GPP_G7, NONE, DEEP, LEVEL, INVERT), /* -TBT_PCIE_WAKE */ + }; + +diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/overridetree.cb b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/overridetree.cb +index 2f0b20d91a..6d8725ad5a 100644 +--- a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/overridetree.cb ++++ b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480/overridetree.cb +@@ -106,6 +106,10 @@ chip soc/intel/skylake + register "PcieRpAdvancedErrorReporting[8]" = "1" + register "PcieRpLtrEnable[8]" = "1" + register "PcieRpHotPlug[8]" = "1" ++ ++ chip drivers/intel/dtbt ++ device pci 0.0 on end ++ end + end + + # M.2 2280 caddy - x2 +diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/gpio.c b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/gpio.c +index a98dd2bc4e..732917ebfa 100644 +--- a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/gpio.c ++++ b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/gpio.c +@@ -82,7 +82,7 @@ static const struct pad_config gpio_table[] = { + PAD_NC(GPP_C18, NONE), + PAD_NC(GPP_C19, NONE), + PAD_CFG_GPO(GPP_C20, 0, DEEP), /* EPRIVACY_ON */ +- PAD_CFG_GPO(GPP_C21, 0, DEEP), /* TBT_FORCE_PWR */ ++ PAD_CFG_GPO(GPP_C21, 1, DEEP), /* TBT_FORCE_PWR */ + PAD_CFG_GPI_SCI(GPP_C22, NONE, DEEP, EDGE_SINGLE, INVERT), /* -EC_SCI */ + PAD_CFG_GPI_SCI(GPP_C23, NONE, DEEP, EDGE_SINGLE, INVERT), /* -EC_WAKE */ + +@@ -187,9 +187,9 @@ static const struct pad_config gpio_table[] = { + PAD_NC(GPP_G1, NONE), + PAD_NC(GPP_G2, NONE), + PAD_NC(GPP_G3, NONE), +- PAD_CFG_GPO(GPP_G4, 0, DEEP), /* TBT_RTD3_PWR_EN */ +- PAD_CFG_GPO(GPP_G5, 0, DEEP), /* TBT_FORCE_USB_PWR */ +- PAD_CFG_GPO(GPP_G6, 0, DEEP), /* -TBT_PERST */ ++ PAD_CFG_GPO(GPP_G4, 1, DEEP), /* TBT_RTD3_PWR_EN */ ++ PAD_CFG_GPO(GPP_G5, 1, DEEP), /* TBT_FORCE_USB_PWR (TBT_RTD3_USB_PWR_EN) */ ++ PAD_CFG_GPO(GPP_G6, 1, DEEP), /* -TBT_PERST */ + PAD_CFG_GPI_SCI(GPP_G7, NONE, DEEP, LEVEL, INVERT), /* -TBT_PCIE_WAKE */ + }; + +diff --git a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/overridetree.cb b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/overridetree.cb +index cea5e485d2..9b952215c5 100644 +--- a/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/overridetree.cb ++++ b/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480s/overridetree.cb +@@ -106,6 +106,10 @@ chip soc/intel/skylake + register "PcieRpAdvancedErrorReporting[4]" = "1" + register "PcieRpLtrEnable[4]" = "1" + register "PcieRpHotPlug[4]" = "1" ++ ++ chip drivers/intel/dtbt ++ device pci 0.0 on end ++ end + end + + # M.2 2280 SSD - x2 +-- +2.39.5 + diff --git a/site/docs/install/t480.md b/site/docs/install/t480.md index fc6fa2f..e76ecc6 100644 --- a/site/docs/install/t480.md +++ b/site/docs/install/t480.md @@ -81,6 +81,27 @@ This port is implemented in Libreboot by merging Mate Kukri's T480/T480s patchset. See: - as of 5 December 2024, Libreboot's code matches that of patchset 22. +Absolutely unsigned Intel ME! +----------------------------- + +Libreboot already disables the Intel ME by default, using `me_cleaner`, but +the T480/T480s specifically have an additional quirk: + +One of the benefits of [deguard](deguard.md) for Intel MEv11 is that it sets +the ME in such a state where you can run unsigned code in there. This is how +the Intel Boot Guard was disabled, because it is the ME that enforces such +restrictions; more information about deguard is available on a dedicated page. + +The deguard utility could also be used to enable the red-unlock hack, which +would permit unsigned execution of new CPU microcode, though much more +research is needed. Because of these two facts, this makes the T480/T480s the +most freedom-feasible of all relatively modern x86 laptops. + +With deguard, you have complete control of the flash. This is unprecedented on +recent Intel systems in Libreboot, so it's certainly a very interesting port! + +Libreboot uses both `me_cleaner` *and* `deguard` on the T480/T480s. + What works in this port: ----------------------- @@ -90,46 +111,13 @@ External video outputs and webcam also work. Microphone works, line-out works... everything works. UART also available via line-out jack (jumpers required on the mainboard). -The thunderbolt controller is currently unconfigured, so you can't use -Thunderbolt, but the thunderbolt and regular USB-C connector can both be -used for charging, and both can be used for video output (it shows up in xrandr -as a DisplayPort). NOTE: - is the patchset enabling -Thunderbolt, but it currently breaks on S3 resume from sleep, so it's not -included yet. This will be added to the Libreboot 20241206 release as a hotpatch -when it's ready, and in the next testing release after Libreboot 20241206. This -is true as of 6 December 2024. +There *are* a few minor exceptions as to what works; this will be covered in +other sections of this page. This port is *almost* perfect, but with some caveats. -Backlight controls work, via software control (e.g. `xbacklight` utility), but -the Fn keys for it don't currently work, as of 6 December 2024. +Build images from source +======================== -Nvidia dGPU doesn't work and is disabled as of 6 December 2024; the Intel graphics -are still available even on Nvidia models, so Intel graphics are used. - -WWAN slot untested. - -Headphone jack --------------- - -Sometimes the headphone jack might not work automatically. Simply install -the `pavucontrol` program. Under Output Devices, you can select the headphones -you've inserted manually. - -If it says "Unplugged", try it anyway. The HDA Verb may be incorrect. This -will be investigated and a hotfix patch made to the Libreboot 20241206 images. - -`thinkpad_acpi` issues {#thinkpad-acpi} ---------------------------------------- - -It has been reported that `thinkpad_acpi` does not load correctly on the T480. -This should also be the case for the T480s. - -If you encounter this issue, check\ -[this page](../../faq.md#thinkpad-acpi) -for details as to how to fix this. - -Build ROM image from source ---------------------------- +Please refer to the standard [build instructions](../build/) first. The build target, when building from source, is thus: @@ -167,25 +155,6 @@ If you're [building from source](../build/) via Libreboot's build system, these files are inserted during build. You only need to manually insert them, using the above linked guide, on the pre-compiled release images! -Absolutely unsigned Intel ME! ------------------------------ - -Libreboot already disables the Intel ME by default, using `me_cleaner`, but -the T480/T480s specifically have an additional quirk: - -One of the benefits of [deguard](deguard.md) for Intel MEv11 is that it sets -the ME in such a state where you can run unsigned code in there. This is how -the Intel Boot Guard was disabled, because it is the ME that enforces such -restrictions; more information about deguard is available on a dedicated page. - -The deguard utility could also be used to enable the red-unlock hack, which -would permit unsigned execution of new CPU microcode, though much more -research is needed. Because of these two facts, this makes the T480/T480s the -most freedom-feasible of all relatively modern x86 laptops. - -With deguard, you have complete control of the flash. This is unprecedented on -recent Intel systems in Libreboot, so it's certainly a very interesting port! - Set MAC address --------------- @@ -197,22 +166,6 @@ change the MAC address, please read [nvmutil documentation](../install/nvmutil.m argument when using it: `--platform sklkbl`** - otherwise, ifdtool will handle the IFD incorrectly! -WARNING about GPU compatibility -------------------------------- - -The Nvidia GPUs were tested, on models that have them. It is completely -dysfunctional and currently disabled in Libreboot. On models that have Nvidia, -the Intel graphics is still available so Libreboot uses Intel graphics -exclusively. - -The Intel GPU is fully supported with native source code (libgfxinit) in -coreboot, which Libreboot uses for initialisation. - -Use of Intel graphics is recommended, because it has much better (and libre) -driver support in Linux, and free initialisation code in coreboot, whereas -Nvidia is mostly all binary blobs (unless perhaps you use the nouveau driver in -Linux). - Thunderbolt issue (READ THIS BEFORE FLASHING) ------------------ @@ -316,19 +269,45 @@ On the T480s (S model), the flashes are in slightly different places but in both machines, the system flash (for Libreboot) is toward the centre, near the memory. -Backlight controls -------------------- +Post-installation +================= -The `xbacklight` (or equivalent in Wayland) can be used to manually control -the backlight; the buttons on the keyboard do not currently work, at least as -of 6 December 2024. +These next sections will tell you how to use certain hardware features, which +work a little bit differently due to idiosyncrasies of coreboot. -You could map the appropriate xbacklight command in Linux to a hotkey combo, -depending on your window manager or desktop environment. +How to use the headphone jack +-------------- + +Sometimes the headphone jack might not work automatically. Simply install +the `pavucontrol` program. Under Output Devices, you can select the headphones +you've inserted manually. + +If it says "Unplugged", try it anyway. The HDA Verb may be incorrect. This +will be investigated and a hotfix patch made to the Libreboot 20241206 images. + +How to use HDMI audio +------------------ + +You can get audio from Displayport/HDMI, but you must select it manually. +For example, you can select it in `pavucontrol` if you're using PulseAudio or +PipeWire. + +How to use backlight controls +----------------------------- + +Backlight controls work, via software control (e.g. `xbacklight` utility), but +the Fn keys for it don't currently work, as of 6 December 2024. + +You can set the backlight manually, or use a hotkey, depending on your window +manager or desktop environment. UART ---- +To our knowledge, this functionality is *only* available in coreboot-based +firmware such as Libreboot. It is completely unsupported on the original +firmware! + A serial console is possible via the line-out (headphone jack). Not yet tested on the T480s (S model), nor implemented, but it is working on the regular T480 (non-S model). @@ -377,12 +356,104 @@ regular T480, the existing caddy area could easily fit two NVMe drives. Errata ====== -On ThinkPad T480/T480s, headphone output works; the internal speaker is disabled -but audio is not automatically redirected to the headphone jack. This switching -can be done manually, for example in the `pavucontrol` utility: +Some features either don't work, or are untested, when running Libreboot on +the ThinkPad T480 or T480s. -Output Devices -> Select Headphones on the built-in audio. +NFC support in T480 +------------------- + +Some T480 models might have NFC support but this is untested in Libreboot, and +probably dosen't work in current Libreboot releases. + +The PCH's NFC device is unsupported in Linux anyway. + +Touchscreen on T480 +------------------- + +Some T480 machines have touchscreens. These are untested; the touch functionality +probably doesn't work yet, in Libreboot. + +The digitizer is simply a USB device, which *is* enabled, but it's just untested. + +Smartcard reader +---------------- + +The smartcard reader is enabled but it is still untested. If you have one, +please test it and report back to the Libreboot project. + +Thunderbolt not supported yet +----------------------------- + +Thunderbolt is a way to get PCI-E on a USB port. With it, you can use +high-bandwidth devices such as 10Gbps network interfaces. + +The thunderbolt controller is currently unconfigured, so you can't use +Thunderbolt, but the thunderbolt and regular USB-C connector can both be +used for charging, and both can be used for video output (it shows up in xrandr +as a DisplayPort). + +[t480-thunderbolt-20241206-unstable.patch](This patch) can be added, enabling +Thunderbolt, but be warned: it is completely untested, as of Libreboot 20241206. +This patch is *NOT* included in the release, because it breaks on S3 resume, +and may cause a kernel panic. Also: currently testing only reveals that the +ThunderBolt controller shows up, and it was confirmed that USB devices do +work on the port, but everything else is UNTESTED. + +You also need the [gerrit patch](https://review.coreboot.org/c/coreboot/+/75286) +adding a Thunderbolt driver to coreboot. + +To apply these patches, do the following in a fresh clone of `lbmk.git`: + +``` +git reset --hard b910424b5df8ed7c931a7b8f5cc8e34eacf0ca3e # 20241206rev2 +./mk -f coreboot next +cd src/coreboot/next +wget https://libreboot.org/docs/install/t480-thunderbolt-20241206-unstable.patch +git fetch https://review.coreboot.org/coreboot refs/changes/86/75286/12 && git cherry-pick FETCH_HEAD +git am t480-thunderbolt-20241206-unstable.patch +cd - +./mk -u coreboot t480s_fsp_16mb +./mk -u coreboot t480_fsp_16mb +``` + +You can now follow standard [build instructions](../build/). + +NOTE: If you remove src/coreboot/next, you must apply the patches again. +To make it easier, you can instead do this from a fresh `lbmk.git` (do this +instead of running the commands above): + +``` +git checkout 20241206-t480-thunderbolt-unstable +``` + +The branch named `20241206-t480-thunderbolt-unstable` already has the above +patches applied, including the configuration changes made by `./mk -u`, and +you can follow the same build instructions. In this lbmk branch, that +gerrit patch above (`refs/changes/86/75286/12`) is already included. + +Whether you use the lbmk branch, or you add the patches manually as above, +you can then flash the resulting image and boot it. + +**AGAIN: This will likely cause kernel panics, and it will break on resume +from S3 (resume from sleep). If you do test this, please report whether +the Thunderbolt devices actually work, but remember that you must NOT suspend +or put your machine to sleep.** + +Nvidia dGPU not supported +------------------------- + +Nvidia dGPU doesn't work and is disabled as of 6 December 2024; the Intel graphics +are still available even on Nvidia models, so Intel graphics are used. + +WWAN slot untested. + +`thinkpad_acpi` issues {#thinkpad-acpi} +--------------------------------------- + +It has been reported that `thinkpad_acpi` does not load correctly on the T480. +This should also be the case for the T480s. + +If you encounter this issue, check\ +[this page](../../faq.md#thinkpad-acpi) +for details as to how to fix this. -Pavucontrol will specify that the headphones are not connected, but you can -select it anyway and it will work. This will be fixed in a subsequent revision, -and the corrected images re-uploaded to the existing Libreboot 20241206 release.