Skip to content

Bump T480 (and t480s) to merged coreboot upstream patchset #1989

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Jul 18, 2025

https://review.coreboot.org/c/coreboot/+/83274 was merged.

  • remove old patch adding t480s from prior WiP state (patches/coreboot-24.12/0003-mb-lenovo-Add-ThinkPad-T480-and-ThinkPad-T480s.patch)
  • remove patch against previous patch previously needed so that other Thinkpads continue to build from same source tree (patches/coreboot-24.12/0004-do-not-break-building-other-thinkpads-with-the-hacks.patch)
  • modify and save oldconfig changes on t480 coreboot config file with Heads helper without changing any config setting (new defaults)

See commit logs for more details.

--

Needs to be tested for regressions from current BOARDS_AND_TESTERS.md testers:

xx8x (Kaby Lake Refresh: Intel 8th Gen Mobile : ESU ended 12/31/2024)

tlaurion added 2 commits July 18, 2025 09:39
repro:

git fetch origin #make sure we are on master
git checkout origin/master
git reset --hard
git checkout -b t480_t480s_merged_upstream #make changes in branch
git fetch https://review.coreboot.org/coreboot refs/changes/74/83274/42 && git format-patch -1 --stdout FETCH_HEAD > patches/coreboot-24.12/0003-mb-lenovo-Add-ThinkPad-T480-and-ThinkPad-T480s.patch #replace patch from upstream download section of https://review.coreboot.org/c/coreboot/+/83274
echo "bogus" |sudo tee build/x86/coreboot-24.12/.canary > /dev/null #overwrite cloned git canary with bad commit revision so repo is synced and patched clean
./docker_repro.sh make BOARD=EOL_t480-maximized #Build to see it fail with now unneeded patch
rm patches/coreboot-24.12/0004-do-not-break-building-other-thinkpads-with-the-hacks.patch #remove now uneeded hack on previous WiP coreboot patches for t480/t480s
echo "bogus" |sudo tee build/x86/coreboot-24.12/.canary > /dev/null #overwrite cloned git canary with bad commit revision so repo is synced and patched clean
./docker_repro.sh make BOARD=EOL_t480-maximized #builds successfully with newly merged https://review.coreboot.org/c/coreboot/+/83274

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…changes in oldconfig format

Repro:
./docker_repro.sh make BOARD=EOL_t480-maximized coreboot.modify_and_save_oldconfig_in_place

Note that if config in defconfig format to show only changes vs defaults (not saved; Heads still has olfconfigs in tree):
./docker_repro.sh make BOARD=EOL_t480-maximized coreboot.modify_defconfig_in_place
user@heads-master:~/heads$ cat config/coreboot-t480-maximized.config
CONFIG_BOOTSPLASH_IMAGE=y
CONFIG_BOOTSPLASH_FILE="@BRAND_DIR@/bootsplash.jpg"
CONFIG_BOOTSPLASH_CONVERT=y
CONFIG_BOOTSPLASH_CONVERT_QUALITY=90
CONFIG_VENDOR_LENOVO=y
CONFIG_CBFS_SIZE=0xEEC000
CONFIG_ONBOARD_VGA_IS_PRIMARY=y
CONFIG_USE_LEGACY_8254_TIMER=y
CONFIG_IFD_BIN_PATH="@BLOB_DIR@/xx80/ifd.bin"
CONFIG_ME_BIN_PATH="@BLOB_DIR@/xx80/me.bin"
CONFIG_GBE_BIN_PATH="@BLOB_DIR@/xx80/gbe.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_LENOVO_T480=y
CONFIG_TPM_MEASURED_BOOT=y
CONFIG_LINUX_COMMAND_LINE="quiet loglevel=2"
CONFIG_POWER_STATE_OFF_AFTER_FAILURE=y
CONFIG_SOC_INTEL_COMMON_SPI_LOCKDOWN_SMM=y
CONFIG_PCIEXP_HOTPLUG=y
CONFIG_HAVE_ME_BIN=y
CONFIG_HAVE_GBE_BIN=y
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_BOOTSPLASH=y
CONFIG_BOOTMEDIA_LOCK_CONTROLLER=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="@BOARD_BUILD_DIR@/bzImage"
CONFIG_LINUX_INITRD="@BOARD_BUILD_DIR@/initrd.cpio.xz"

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion tlaurion force-pushed the t480_t480s_merged_upstream branch from 4527b6c to 8fb2269 Compare July 18, 2025 13:43
@tlaurion
Copy link
Collaborator Author

Sorry for the noise; 48e2911 commit log was incomplete with repro notes since whatever starting with '#' is wiped. Added comments after each command in commit log instead for repro (knowledge transfer for anyone wanting to understand ports/maintenance and contribute in code if not money)

@tlaurion tlaurion changed the title Bump T480 (and t480s) to merged upstream patchset Bump T480 (and t480s) to merged coreboot upstream patchset Jul 18, 2025
@gaspar-ilom
Copy link
Contributor

@tlaurion thanks for maintaining this! Can you re-trigger the ci run for 8fb2269 Then I will test it.

@tlaurion
Copy link
Collaborator Author

@tlaurion thanks for maintaining this! Can you re-trigger the ci run for 8fb2269 Then I will test it.

For now, ~defconfig fails with

Jul 20 02:02:38 src/mainboard/lenovo/sklkbl_thinkpad/dgpu.c: In function 'ssdt_add_dgpu':
Jul 20 02:02:38 src/mainboard/lenovo/sklkbl_thinkpad/dgpu.c:23:19: error: 'struct device' has no member named 'pci_vga_option_rom'
Jul 20 02:02:38    23 |         rom = dgpu->pci_vga_option_rom;
Jul 20 02:02:38       |                   ^~
Jul 20 02:02:38 make[1]: *** [Makefile:430: EOL_t480-hotp-maximized/ramstage/mainboard/lenovo/sklkbl_thinkpad/dgpu.o] Error 1
Jul 20 02:02:38 make[1]: *** Waiting for unfinished jobs....

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
@tlaurion tlaurion marked this pull request as draft July 21, 2025 16:34
@tlaurion
Copy link
Collaborator Author

@tlaurion thanks for maintaining this! Can you re-trigger the ci run for 8fb2269 Then I will test it.

For now, ~defconfig fails with

Jul 20 02:02:38 src/mainboard/lenovo/sklkbl_thinkpad/dgpu.c: In function 'ssdt_add_dgpu':
Jul 20 02:02:38 src/mainboard/lenovo/sklkbl_thinkpad/dgpu.c:23:19: error: 'struct device' has no member named 'pci_vga_option_rom'
Jul 20 02:02:38    23 |         rom = dgpu->pci_vga_option_rom;
Jul 20 02:02:38       |                   ^~
Jul 20 02:02:38 make[1]: *** [Makefile:430: EOL_t480-hotp-maximized/ramstage/mainboard/lenovo/sklkbl_thinkpad/dgpu.o] Error 1
Jul 20 02:02:38 make[1]: *** Waiting for unfinished jobs....

@gaspar-ilom this was fixed with 7448bf8 but there are other things missing under coreboot 24.12 it seems. Local build now complains about

    CC         bootblock/mainboard/lenovo/sklkbl_thinkpad/bootblock.o
/home/user/heads/build/x86/coreboot-24.12/util/crossgcc/xgcc/bin/i386-elf-gcc -MMD -Isrc -Isrc/include -Isrc/commonlib/include -Isrc/commonlib/bsd/include -IEOL_t480-maximized -I3rdparty/vboot/firmware/include -include src/include/kconfig.h -include src/include/rules.h -include src/commonlib/bsd/include/commonlib/bsd/compiler.h -I3rdparty -D__BUILD_DIR__=\"EOL_t480-maximized\" -D__COREBOOT__ -D__TIMELESS__ -Isrc/ec/intel -Isrc/soc/intel/skylake -Isrc/soc/intel/skylake/include -Isrc/drivers/intel/fsp2_0/include -I"3rdparty/fsp/KabylakeFspBinPkg/Include/" -Isrc/mainboard/lenovo/sklkbl_thinkpad/variants/t480/include -Isrc/soc/intel/common/basecode/include/ -Isrc/soc/intel/common/block/include/ -Isrc/soc/intel/common/pch/include/ -Isrc/vendorcode/intel/edk2/UDK2017/MdePkg/Include -Isrc/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include -Isrc/vendorcode/intel/edk2/UDK2017/MdeModulePkg/Include -Isrc/soc/intel/common/block/fast_spi -Isrc/arch/x86/include -Isrc/vendorcode/intel/edk2/UDK2017/MdePkg/Include/Ia32 -D__ARCH_x86_32__ -pipe -g -nostdinc -std=gnu11 -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wimplicit-fallthrough -Wshadow -Wdate-time -Wtype-limits -Wvla -Wold-style-definition -Wdangling-else -Wmissing-include-dirs -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie -Wstring-compare -Wold-style-declaration -Wcast-function-type -Wno-packed-not-aligned -fconserve-stack -Wnull-dereference -Wlogical-op -Wduplicated-cond -Wno-array-compare -Werror -Os -Wno-address-of-packed-member --param=min-pagesize=1024 -Wflex-array-member-not-at-end -Wcalloc-transposed-args -Wno-unused-parameter -Wno-sign-compare -Wno-empty-body -Wno-missing-field-initializers -Wno-override-init -Wno-ignored-qualifiers -Wno-shift-negative-value -Wno-unused-but-set-parameter -Wno-type-limits -Wno-cast-function-type -Wextra  -m32  -fuse-ld=bfd -fno-stack-protector -Wl,--build-id=none -fno-delete-null-pointer-checks -Wlogical-op -march=i686 -mno-mmx -mno-sse -MT EOL_t480-maximized/bootblock/mainboard/lenovo/sklkbl_thinkpad/bootblock.o -D__BOOTBLOCK__ -c -o EOL_t480-maximized/bootblock/mainboard/lenovo/sklkbl_thinkpad/bootblock.o src/mainboard/lenovo/sklkbl_thinkpad/bootblock.c 
src/mainboard/lenovo/sklkbl_thinkpad/bootblock.c:4:10: fatal error: ec/lenovo/mec1653/mec1653.h: No such file or directory
    4 | #include <ec/lenovo/mec1653/mec1653.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:430: EOL_t480-maximized/bootblock/mainboard/lenovo/sklkbl_thinkpad/bootblock.o] Error 1
make[1]: Leaving directory '/home/user/heads/build/x86/coreboot-24.12'
make: *** [Makefile:625: /home/user/heads/build/x86/coreboot-24.12/EOL_t480-maximized/.build] Error 1

So other pathces will need to be added for t480s/t480 to build with coreboot 24.12 current base. (Not trivial as I thought it would be sorry). Putting this PR as draft.

Also note that https://review.coreboot.org/c/coreboot/+/88490 is not merged yet and would be needed to fix USBC issue still unfixed under coreboot merged state. Maybe we should iterate, or make this PR bigger. Do you have time to tackle this @gaspar-ilom ?

@drkhsh
Copy link

drkhsh commented Jul 21, 2025

@tlaurion chiming in, running the latest working state of heads on my t480, and i'm motivated to help porting the latest changes from coreboot. let me know if i can help with anything. 👍

@tlaurion
Copy link
Collaborator Author

tlaurion commented Jul 21, 2025

@tlaurion chiming in, running the latest working state of heads on my t480, and i'm motivated to help porting the latest changes from coreboot. let me know if i can help with anything. 👍

@drkhsh it is not clear as of now if needed patches (whole patch train of t480/t480s related work merged upstream) from can be applied cleanly on top of current 24.12 coreboot commit ( modules/coreboot 24.12 coreboot buildstack is shared between Dasharo and Purism forks) without bumping modules/coreboot to newer release on which newer patch train was merged against.

I talked off channel with @MrChromebox which hinted for 7448bf8 fix, but I haven't continued adding patches under patches/coreboot-24.12/* related to https://review.coreboot.org/c/coreboot/+/88395/7 nor anything else needed to build and be functional.

If we cannot reuse current 24.12 release commit for all boards + adding t480/t480s patches needed, then we would need to add current coreboot version under modules/coreboot + patches and change .circleci/config.yml build board dependencies so that t480 is alone after musl-cross-make-x86 being built to produce roms. Feel free to clone and work in your branch and or push changes in this branch whn things build and boot locally, or push changes in a branch of your fork and point this PR to there for comments/discussions etc :)

@gaspar-ilom
Copy link
Contributor

Also note that https://review.coreboot.org/c/coreboot/+/88490 is not merged yet and would be needed to fix USBC issue still unfixed under coreboot merged state. Maybe we should iterate, or make this PR bigger.

I would love to see the changes integrated. Not sure how mature the USB-C patchset is already and how long it might take until it is merged, though. Would you mind pulling this as a patch again or too much effort to maintain?

Do you have time to tackle this @gaspar-ilom ?

@tlaurion I will take a look at the problem when I have time, but I am quite busy, so if someone else is faster I am happy, too @drkhsh .

@tlaurion
Copy link
Collaborator Author

tlaurion commented Jul 23, 2025

All of those patches would need to be applied on top of 24.12 (unsure patches will apply clean) or latest 25.06 (this is coreboot release scheme : YY.MM).

Note that some patches under patches/coreboot-24.12/* were not merged upstream still... Including PR0. This means they will need to be ported downstream here under heads since not fully upstreamed yet....

Who takes the lead?

@drkhsh
Copy link

drkhsh commented Jul 25, 2025

@tlaurion thanks for your summary. I can have a look these weeks. I'm just checking to organize another board just for testing - which would simplify things as this is currently my main machine. 👍

@tlaurion tlaurion mentioned this pull request Jul 25, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants