-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
t480 port #1906
t480 port #1906
Conversation
Signed-off-by: Thierry Laurion <[email protected]>
Signed-off-by: Thierry Laurion <[email protected]>
Signed-off-by: Thierry Laurion <[email protected]>
Signed-off-by: Thierry Laurion <[email protected]>
Signed-off-by: Thierry Laurion <[email protected]>
…for t480 Signed-off-by: Thierry Laurion <[email protected]>
Signed-off-by: Thierry Laurion <[email protected]>
…ce its not sharing the same coreboot buildstack (something 25.X.X, need to check) Signed-off-by: Thierry Laurion <[email protected]>
…ack, since its not sharing the same coreboot buildstack (something 25.X.X, need to check)" This reverts commit b1f279354388fd8e71abd9f1514246d7e9f6ed1c. Hmmm.... WGET="" bin/fetch_coreboot_crossgcc_archive.sh "/home/user/heads/build/x86/coreboot-t480" "binutils" "/home/user/heads/packages/x86" --2025-02-11 14:46:38-- https://ftpmirror.gnu.org/binutils/binutils-2.43.1.tar.xz Resolving ftpmirror.gnu.org (ftpmirror.gnu.org)... 209.51.188.200, 2001:470:142:5::200 Connecting to ftpmirror.gnu.org (ftpmirror.gnu.org)|209.51.188.200|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://mirror.csclub.uwaterloo.ca/gnu/binutils/binutils-2.43.1.tar.xz [following] --2025-02-11 14:46:40-- https://mirror.csclub.uwaterloo.ca/gnu/binutils/binutils-2.43.1.tar.xz Resolving mirror.csclub.uwaterloo.ca (mirror.csclub.uwaterloo.ca)... 129.97.134.71, 2620:101:f000:4901:c5c:0:f:1055 Connecting to mirror.csclub.uwaterloo.ca (mirror.csclub.uwaterloo.ca)|129.97.134.71|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 28174300 (27M) [text/plain] Saving to: '/home/user/heads/packages/x86/coreboot-crossgcc-binutils-2.43.1.tar.xz.tmp' /home/user/heads/packages/x86/coreboot-crossgcc-binu 100%[=====================================================================================================================>] 26.87M 8.88MB/s in 3.0s 2025-02-11 14:46:44 (8.88 MB/s) - '/home/user/heads/packages/x86/coreboot-crossgcc-binutils-2.43.1.tar.xz.tmp' saved [28174300/28174300] /home/user/heads/packages/x86/coreboot-crossgcc-binutils-2.43.1.tar.xz.tmp: OK touch "/home/user/heads/build/x86/coreboot-t480/.heads-crossgcc-pkg-binutils" WGET="" bin/fetch_coreboot_crossgcc_archive.sh "/home/user/heads/build/x86/coreboot-t480" "gcc" "/home/user/heads/packages/x86" --2025-02-11 14:46:44-- https://ftpmirror.gnu.org/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz Resolving ftpmirror.gnu.org (ftpmirror.gnu.org)... 209.51.188.200, 2001:470:142:5::200 Connecting to ftpmirror.gnu.org (ftpmirror.gnu.org)|209.51.188.200|:443... connected. HTTP request sent, awaiting response... 302 Moved Temporarily Location: https://mirror2.evolution-host.com/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz [following] --2025-02-11 14:46:44-- https://mirror2.evolution-host.com/gnu/gcc/gcc-14.2.0/gcc-14.2.0.tar.xz Resolving mirror2.evolution-host.com (mirror2.evolution-host.com)... 167.114.8.249, 2607:5300:60:450d:c259:13f4:6df0:1 Connecting to mirror2.evolution-host.com (mirror2.evolution-host.com)|167.114.8.249|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 92306460 (88M) [application/x-xz] Saving to: '/home/user/heads/packages/x86/coreboot-crossgcc-gcc-14.2.0.tar.xz.tmp' /home/user/heads/packages/x86/coreboot-crossgcc-gcc- 100%[=====================================================================================================================>] 88.03M 32.9MB/s in 2.7s 2025-02-11 14:46:48 (32.9 MB/s) - '/home/user/heads/packages/x86/coreboot-crossgcc-gcc-14.2.0.tar.xz.tmp' saved [92306460/92306460] /home/user/heads/packages/x86/coreboot-crossgcc-gcc-14.2.0.tar.xz.tmp: OK touch "/home/user/heads/build/x86/coreboot-t480/.heads-crossgcc-pkg-gcc" WGET="" bin/fetch_coreboot_crossgcc_archive.sh "/home/user/heads/build/x86/coreboot-t480" "nasm" "/home/user/heads/packages/x86" --2025-02-11 14:46:48-- https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/nasm-2.16.03.tar.bz2 Resolving www.nasm.us (www.nasm.us)... 198.137.202.136, 2607:7c80:54:3::136 Connecting to www.nasm.us (www.nasm.us)|198.137.202.136|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1361988 (1.3M) [application/x-bzip2] Saving to: '/home/user/heads/packages/x86/coreboot-crossgcc-nasm-2.16.03.tar.bz2.tmp' /home/user/heads/packages/x86/coreboot-crossgcc-nasm 100%[=====================================================================================================================>] 1.30M 2.90MB/s in 0.4s 2025-02-11 14:46:49 (2.90 MB/s) - '/home/user/heads/packages/x86/coreboot-crossgcc-nasm-2.16.03.tar.bz2.tmp' saved [1361988/1361988] /home/user/heads/packages/x86/coreboot-crossgcc-nasm-2.16.03.tar.bz2.tmp: OK touch "/home/user/heads/build/x86/coreboot-t480/.heads-crossgcc-pkg-nasm" WGET="" bin/fetch_coreboot_crossgcc_archive.sh "/home/user/heads/build/x86/coreboot-t480" "iasl" "/home/user/heads/packages/x86" --2025-02-11 14:46:49-- https://distfiles.macports.org/acpica/acpica-unix-20241212.tar.gz Resolving distfiles.macports.org (distfiles.macports.org)... 151.101.138.132 Connecting to distfiles.macports.org (distfiles.macports.org)|151.101.138.132|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-02-11 14:46:50 ERROR 404: Not Found. Failed to download https://distfiles.macports.org/acpica/acpica-unix-20241212.tar.gz Try mirrors for coreboot-crossgcc-acpica-unix-20241212.tar.gz --2025-02-11 14:46:50-- https://storage.puri.st/heads-packages/coreboot-crossgcc-acpica-unix-20241212.tar.gz Resolving storage.puri.st (storage.puri.st)... 146.190.140.226 Connecting to storage.puri.st (storage.puri.st)|146.190.140.226|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-02-11 14:46:51 ERROR 404: Not Found. Failed to download https://storage.puri.st/heads-packages/coreboot-crossgcc-acpica-unix-20241212.tar.gz --2025-02-11 14:46:51-- https://storage.puri.sm/heads-packages/coreboot-crossgcc-acpica-unix-20241212.tar.gz Resolving storage.puri.sm (storage.puri.sm)... 146.190.140.226 Connecting to storage.puri.sm (storage.puri.sm)|146.190.140.226|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2025-02-11 14:46:52 ERROR 404: Not Found. Failed to download https://storage.puri.sm/heads-packages/coreboot-crossgcc-acpica-unix-20241212.tar.gz Signed-off-by: Thierry Laurion <[email protected]>
…hon when used under nix docker Signed-off-by: Thierry Laurion <[email protected]>
…ls blobs scripts Signed-off-by: Thierry Laurion <[email protected]>
… as base Signed-off-by: Thierry Laurion <[email protected]>
…onfig and config/coreboot-novacustom-nv4x_adl.config Then saved back in oldconfig with ./docker_repro.sh make BOARD=t480-maximized coreboot.modify_and_save_oldconfig_in_place Notes: - Pr0 requirements don't stick, investigate - real quick overview of config, just rying to get thing build here Signed-off-by: Thierry Laurion <[email protected]>
…EURL to use one of libreboot web mirror Signed-off-by: Thierry Laurion <[email protected]>
…ot 24.02 buildstack) Signed-off-by: Thierry Laurion <[email protected]>
…les in tree as per http://web.archive.org/web/20250211155526/https://notgivenby.github.io/heads-wiki/t480-port/#coreboot-config-for-t480 : No joy building, but will dump progress for others to pickup Signed-off-by: Thierry Laurion <[email protected]>
…ake first layer Will fail at Updating git submodules. payloads/external/Makefile.mk:399: "Using host toolchain to build Linuxboot" GEN build.h IFDTOOL -p sklkbl -F t480-maximized/fmap-template.fmd ../../../blobs/t480/ifd_16 HOSTCC cbfstool/fmd_parser.o HOSTCC cbfstool/fmd_scanner.o make[1]: *** No rule to make target '../../../vendorfiles/kabylake/Fsp_M.fd', needed by 't480-maximized/coreboot.pre'. Stop. make[1]: *** Waiting for unfinished jobs.... File ../../../blobs/t480/ifd_16 is 4096 bytes Wrote layout to t480-maximized/fmap-template.fmd Signed-off-by: Thierry Laurion <[email protected]>
…iles exist For repro: - To remove all files created by patches (would error to help dev remove them manually) - echo "bogus" | tee build/x86/coreboot-t480/.canary - sudo rm -rf build/x86/coreboot-t480/src/mainboard/lenovo/sklkbl_thinkpad/variants/t480* - sudo rm build/x86/libgpg-error-1.46/src/syscfg/lock-obj-pub.powerpc64le-unknown-linux-musl.h - Remove all .canary files, outside of detected git forks to speedup local builds, rebuilding only new files with make magic - ./docker_repro.sh make BOARD=t480-maximized real.remove_canary_files-extract_patch_rebuild_what_changed - Rebuild from sources: unpack archives/git clone, patch, build from source - ./docker_repro.sh make BOARD=t480-maximized Signed-off-by: Thierry Laurion <[email protected]>
…ream PR0 patchset https://review.coreboot.org/c/coreboot/+/85278 Repro: git fetch https://review.coreboot.org/coreboot refs/changes/78/85278/3 && git format-patch -1 --stdout FETCH_HEAD > patches/coreboot-t480/85278-post-skylake-pr0.patch Unfortunately Applying patch file : patches/coreboot-t480/85278-post-skylake-pr0.patch Checking patch build/x86/coreboot-t480/src/soc/intel/alderlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/cannonlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/common/block/lpc/Makefile.mk... Checking patch build/x86/coreboot-t480/src/soc/intel/common/block/smm/smihandler.c... Checking patch build/x86/coreboot-t480/src/soc/intel/common/pch/include/intelpch/lockdown.h... Checking patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/Kconfig... Checking patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/Makefile.mk... Checking patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/lockdown.c... Checking patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/lockdown_lpc.c... Checking patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/lockdown_spi.c... Checking patch build/x86/coreboot-t480/src/soc/intel/denverton_ns/lpc.c... Checking patch build/x86/coreboot-t480/src/soc/intel/elkhartlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/jasperlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/meteorlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/pantherlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/skylake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/tigerlake/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/xeon_sp/finalize.c... Checking patch build/x86/coreboot-t480/src/soc/intel/xeon_sp/lockdown.c... error: while searching for: static void lpc_lockdown_config(void) { /* Set BIOS Interface Lock, BIOS Lock */ lpc_set_bios_interface_lock_down(); /* Only allow writes in SMM */ if (CONFIG(BOOTMEDIA_SMM_BWP)) { lpc_set_eiss(); lpc_enable_wp(); } lpc_set_lock_enable(); } void soc_lockdown_config(int chipset_lockdown) { if (chipset_lockdown == CHIPSET_LOCKDOWN_FSP) return; lpc_lockdown_config(); pmc_lockdown_config(); sata_lockdown_config(chipset_lockdown); spi_lockdown_config(chipset_lockdown); error: patch failed: build/x86/coreboot-t480/src/soc/intel/xeon_sp/lockdown.c:6 Applied patch build/x86/coreboot-t480/src/soc/intel/alderlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/cannonlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/block/lpc/Makefile.mk cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/block/smm/smihandler.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/pch/include/intelpch/lockdown.h cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/Kconfig cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/Makefile.mk cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/lockdown.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/lockdown_lpc.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/common/pch/lockdown/lockdown_spi.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/denverton_ns/lpc.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/elkhartlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/jasperlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/meteorlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/pantherlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/skylake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/tigerlake/finalize.c cleanly. Applied patch build/x86/coreboot-t480/src/soc/intel/xeon_sp/finalize.c cleanly. Applying patch build/x86/coreboot-t480/src/soc/intel/xeon_sp/lockdown.c with 1 reject... Rejected hunk #1. make: *** [Makefile:570: /home/user/heads/build/x86/coreboot-t480/.canary] Error 1 Will have to edit patch Signed-off-by: Thierry Laurion <[email protected]>
…we are not interested into which are conflicting against coreboot upstream commit 2f1e4e5e8515dd350cc9d68b48d32a5b6b02ae6a Signed-off-by: Thierry Laurion <[email protected]>
…config Signed-off-by: Thierry Laurion <[email protected]>
…herwise build error Signed-off-by: Thierry Laurion <[email protected]>
002d107 adds PR0 (to be tested) and fix build issues. time spent total 3h |
… after kexec call to final OS. Otherwise, problem with coreboot config) Signed-off-by: Thierry Laurion <[email protected]>
@tlaurion please delete p from the folder name /boards/t480p-hotp-maximized . It should read t480-hotp-maximized. I believe the "p" was left from t440p. |
Signed-off-by: gaspar-ilom <[email protected]>
…d error Signed-off-by: Thierry Laurion <[email protected]>
So this shows that current PR is in good state ( tlaurion@438a061 is latest commit of this PR at this state) You flashed tb or not? |
Originally posted by @tlaurion in #1908 (comment) |
Yes, I did flash tb.bin from that same commit (and to add to the "to erase TB chip first or not" - my flasher initially states that it erases the chip before writing.) |
I technically see the heads splash screen and then it's flashes some thermal warning text and shuts off. UPDATE: I just flashed g438a061, didn't not flash the TB file yet. Was able to boot the computer back up. |
I did an internal flash with that build. Saw heads Splash screen and the thermal warning text for 1/2 a second then it shut off. |
@rafaelsgirao Congrats!
But you did not erase the TB first correct? Did you first flash the Heads and then tb.bin or other way around? Did you use flashrom? |
@MattClifton76 The board is bricked. You can externally flash last commit tlaurion@438a061 |
I
|
Thanks! First time flashing, glad it was a success. I flashed with a Flipper Zero (using SPI Mem Manager app). According to what's shown on screen, the Flipper automatically erases the the chip first before starting to write (and then verifies the image was written correctly). |
Done |
I figured it was bricked, the Flash was successful, computer boots fine. Checking TB hashes at the moment |
@rafaelsgirao You have flashed both chips right? In which order? And can you actually confirm that your USB-C ports are working, not just charging but also data? Please test both of them. @tlaurion I do believe that some parts of voodoo dance matter. After all my USB-C ports did not come back to live when re-flashing the original firmware which I had read with the programmer. I did that with both heads and the Lenovo bios. No luck. It is possible that there is some issue with my read. I did multiple consistent reads, though and one USB-C port was working before. So it is unlikely that just flashing the new TL;DR Someone need to test it. Sorry, I am only moderately motivated to brick my USB ports again, especially because the voodoo dance takes a fair amount of time. |
I am back on Lenovo firmware 1.52, EC 1.22, TB 23. I have reflashed everything that I can. The Charge port USBc charges and recognizes drives, the other one to the right does not recognize my apricorn external hard drive, but it does recognize my nitrokey this was confirmed with the nitrokey app. I will add screenshots. |
Have you just reflashed the If not done yet it would be nice if you could flash heads first and then the tb.bin blob from this PR without doing any steps of the dance. Just to confirm that the dance is not necessary in case the Thunderbolt port is not yet broken by the bug. Anyway, in order to properly confirm whether the dance is necessary we would need a board where the bug has already rendered Thunderbolt unusable and then try fixing it without any voodoo dance, ideally with heads already on the main SPI. We might have a hard time finding such boards, though... EDIT: I will also report the issues with the second USB-C port upstream. I do not believe they are aware of the details?! |
Yes, I flashed both. First the Thunderbolt chip, then bios. Afterwards I re-flashed my original bios read but left the Thunderbolt one flashed with tb.in and it also works just fine. I also tested plugging in a USB-C monitor and it worked in all cases. Not entirely sure if that's equivalent to Thunderbolt chip working, though. |
@notgivenby unfortunately, url doesn't show your picture under https://review.coreboot.org/c/coreboot/+/83274/25/src/ec/lenovo/h8/acpi/ec.asl#b334 should be
@notgivenby unfortunately, image doesn't resolve. Should point to #1908 (comment) |
@tlaurion Oh…Sorry…my bad. Corrected. |
@gaspar-ilom My machine is on again. Do you still need original tb.bin? |
No thanks. As mentioned I have already recovered by flashing the tb.bin blob from libreboot after doing the voodoo dance. |
Looks like the current tb.bin blob works without a voodoo dance and even with coreboot already flashed. @rafaelsgirao or did you reboot after flashing tb.bin and before flashing heads? |
I didn't boot between flashing Thunderbolt chip and flashing bios chip |
@MattClifton76 You can find the tb.bin blob in circleci. This blob can be flashed externally. If you are willing to help with testing it would be great if you flash it externally (this is a different SPI chip) while heads is on the main SPI chip. |
@rafaelsgirao Great and thanks for the feedback. Seems like no dancing needed. @tlaurion It would be great though to confirm that this is the same for someone with a Thunderbolt chip where the bug has already kicked in. Anyway, for the time being I would consider it safe to just flash both chips at the same time without any voodoo dance. Can you update the documentation accordingly @notgivenby ? Or are there any concerns? |
@gaspar-ilom your changes conficts with coreboot config for v540tu when attemping to merge your latest pr and i'm getting tired. Testing of both t480 and other thinkpads should continue under #1908 at this point, i'm tited of the duplicated effort. At this point if this PR worksm issue to be resolved is making sure there is no regression if all board that were 24.02.01 are now 24.12 as for t480 under #1908 Pr associated work on my side bumped from OP 20h to 30h with all cat hurdling, social media related work and upstream (libreboot) aborted collaboration, Editing OP |
Lets close this PR then in favor of #1908 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Barring the missing patch to make the code work with other thinkpads I believe it can be merged as part of #1908
Superseded by #1908 |
Disclaimer: This PR picks https://review.coreboot.org/c/coreboot/+/83274 and patches added by libreboot as coreboot 24.12 release commit as a base. Whatever is not fixed in WiP support of coreboot should be discussed on that patchset.
This PR should build, but is incomplete as of now. This PR is a draft permitting to review under this PR what needs to be changed to have complete t480 support.
It merges the prior work of @akunterkontrolle and @notgivenby and @gaspar-ilom from #1885 and #1907
From notes under #1885 (comment)
My total 30h contribution (and counting) for now is at https://github.com/tlaurion/heads/tree/poc_t480
target/t480-> adapted https://github.com/gaspar-ilom/heads/tree/t480 work, which calls blobs scripts from targets/xx80_me_blobs.mkfixes blob download script needing to call python directly (nix has environment paths, need to call python, cannot call python script directly): blobs/xx80/download_clean_deguard_me.sh is used instead from @gaspar-ilomTODO: