I Ported Coreboot to the ThinkPad X270

2026-02-2323:5829765dork.dev

Posted on: 2026-02-20T17:39:00Z Tags: Content warnings: None In my post from 2026-02-11, I committed myself towards helping work on coreboot + libreboot with the goal of porting it to the X270. It’s…

Posted on:
Tags:
Content warnings:
None

In my post from 2026-02-11, I committed myself towards helping work on coreboot + libreboot with the goal of porting it to the X270. It’s less than a month later and I have done it. My X270 is a 20HM model and this means that it is a Kaby Lake CPU (and chipset), not Skylake.

I started by dumping the BIOS image from the X270, initially for two reasons (although there are more):

  • to have a backup in case anything went wrong
  • to obtain the Intel Management Engine section to produce deltas for deguard

Remaining reasons that are important later are:

  • the GbE section of the BIOS is necessary for ethernet
  • the IFD (Intel Flash Descriptor) is necessary for producing a finished image

I set up pico-serprog on an RP2040-zero, which I found builds for from the Libreboot project website. This, in combination with flashprog is what I used to dump and write to the SPI flash for the X270.

Setup for flashing; a SOIC-8 chip clip and an RP2040 zero.
Setup for flashing; a SOIC-8 chip clip and an RP2040 zero.

It turns out, in the process of attempting to clip onto the laptop, I knocked off a capacitor.

A capacitor missing from where it’s supposed to be
A capacitor missing from where it’s supposed to be

I didn’t know what capacitor, either, because trying to resolder it in place, it pinged off of my tweezers into orbit to never be seen again.

I used silkscreen markings and referenced a schematic (which I obtained for the purpose of fixing this missing capacitor to begin with) to find the area of the board I had likely damaged. The marking “PJ304” came in helpful.

The relevant part of the schematic for the board section
The relevant part of the schematic for the board section
The component in question, a 10uF 0603 format 6.3V capacitor
The component in question, a 10uF 0603 format 6.3V capacitor

By checking what pin on the chip below the tweezers went to the leads on the capacitor that had been accidentally ripped off and the neighbouring capacitors, it was possible to determine these capacitors were put in parallel between ground and a particular pin of the chip, allowing me to narrow it down to the above.

Digikey, then, comes in clutch at like C$10 for 10 capacitors and next day shipping.

I wanted to make sure that I had something valid so I checked the string content of the flash.

Strings from the BIOS dump
Strings from the BIOS dump

Sure, seems coherent. I then examined the file with ifdtool, using the dump switch.

ifdtool showing an Intel Flash Descriptor
ifdtool showing an Intel Flash Descriptor

From here, I followed the instructions in the deguard README, producing this commit in the process. You can use a patched version of the Intel Management Engine to produce the deltas and this was something prior that was unclear to me, and an interpretation another friend of mine had. It isn’t the case that it has to also be vulnerable, at all!

ifdtool being used to extract regions of the image
ifdtool being used to extract regions of the image

These regions being extracted separately is quite important, the flash descriptor and GbE are both very necessary to produce a final image that functions. I had also tried to figure out how deguard worked being applied to the donor image, to understand the whole system better.

Now, I knew the X280 and X270 differed by two things, initially:

  • The X270 lacks Thunderbolt (TBT).
  • The X280 has some form of soldered RAM, the X270 has a single SODIMM slot.

We will see some problems later, but initially, basing my work off of the X280 variant, I made changes to it where I disabled the Thunderbolt-related pins (while regarding the official Intel documentation for the generation of chipset; for example one of the TBT pins was thermal management for my machine, so it was fine to set the pin to NONE instead of something more complicated.

I was seeing things lining up on the GPIO pins (gpio.h), aside from the Thunderbolt controller related pins.

Referencing the schematic gpio.h contents

I did notice during this experience, referencing between the X280 and X270 schematics that the MEC1653 was something the X270 had, but the X280 had the MEC1663. This meant that WWAN_DISABLE was one of the only lines coming off of the Wireless section of the MEC1663 on the X280, but there were more lines on the X270 than that. This is unrelated, I just thought it was neat that there were so many different versions of the MEC16xx, lots of derivatives? They all seem well supported by the same MEC1653 driver in coreboot.

I got something to build and then I decided to go to bed for the night.

A built libreboot imageset
A built libreboot imageset

The next day, I went with my wife to pick up my capacitors (I had missed them the day prior, whoops).

A suspiciously shitty looking capacitor
A suspiciously shitty looking capacitor

Wow, a suspiciously shitty looking capacitor. To be fair, that is 0.8x1.6mm? It’s pretty small. (This was not the only time this capacitor fell off, I had to fix it again afterwards at least 8 attempts of flashing later.)

Libreboot, SeaBIOS payload Libreboot, GRUB payload

I had something that would actually get to payloads, but when I would select the NVMe NS 1 it would very, very quickly fail out. When I went back to the SeaBIOS menu, I noticed the NVMe NS 1 option then missing. Booting into a LiveUSB, I discovered I had neither the WiFi card or the NVMe present in lspci.

I had posted in #libreboot on liberachat a little earlier that I had the X270 booting, however I realized pretty quickly after that it was not all sunshine and rainbows.

After a while of talking about the X270 and potential need for upstreaming now, I started speaking about the issue and Leah Rowe, founder of Libreboot (and CanoeBoot and Minifree Ltd) worked with me on attempting to diagnose and fix the problem, producing several ROMs for me given that I potentially may have done things incorrectly. In the end, even with a mostly intact (albeit HAP-bit and Deguarded) Intel Management Engine, it was likely not anything to do with the IME like I was theorizing (I had read an issue for the t470s about being careful with me_cleaner and how truncation caused problems with NVMe and WiFi dropouts. I have to assume this was actually something that could’ve been mitigated with --whitelist MFS).

I’m very thankful for the patience shown towards me, to be frank. ^^;

I was pretty upset by this point, but I woke up to give it a try the next day. At this point, we had figured that the problem was likely to do with PCIe allocations and perhaps the overridetree.cb?

Looking into this and the schematic later in the day together with my wife, I ended up noticing that CLKREQ4 on the X280 schematic led nowhere. On the X270, the WLAN card had two CLKOUT and CLKREQ connections. Looking deeper into this, there was a table showing the separation of the WiGig and WiFi card into two separate PCIe devices despite being contained within the one card. Going down this route, I figured that using CLKREQ1 for WiFi was incorrect and that CLKREQ2 was the appropriate one. Given this, it also made the rest of the CLKREQ selections then further by one, too.

Adjusting for this and regarding the WWAN allocation within the schematic, I made a new build with these adjustments and flashed it. I was greeted with… a working GRUB.

GRUB prompt with a cleaner screen
GRUB prompt with a cleaner screen
A full disk encryption prompt from Guix’s GRUB
A full disk encryption prompt from Guix’s GRUB
A Guix system booted, showing cbmem -1 on one half of the screen
A Guix system booted, showing cbmem -1 on one half of the screen

Guix booted and I was able to read cbmem -1 from within Guix System, showing the Libreboot console log. Wireless (albeit, proprietary) worked! NVMe worked!

I am starting to upstream my changes:

For the X270 in particular, I got an ath9k wireless dongle so I should now be able to move to linux-libre on my Guix install. I’d like to build it into the laptop if possible in the future through some means and I’ll see about doing that, honestly?

I can’t recommend libreboot enough, or even heads if libreboot isn’t your speed. A big thanks to Leah Rowe for their assistance and the work they have done for libreboot over the years.


Read the original article

Comments

  • By amiga-workbench 2026-02-242:029 reply

    I wonder if this can help with the extremely irritating bug (intentional?) on the X270 where if you give it a third party 9-cell battery, it will raise CPU_PROCHOT all the damn time, and my processor would drop to below 1Ghz clock speeds.

    Back when I used to have an X270 I had a shell script that ran on boot which poked a register to disable thermal throttling handling. Not at all ideal, but it made the machine usable in the absence of official Lenovo batteries which they stopped manufacturing pretty damn quickly.

    • By lstolcman 2026-02-2410:534 reply

      You can use ThrottleStop[1] to disable PROCHOT on non-standard battery. I encountered similar issue with throttling on my Dell Precision laptop when I was charging it via 60 W USB-C charger instead of proprietary barrel-type 130 W plug. The system triggered a warning about low power charger and initiated aggressive cpu frequency scaling. By using ThrottleStop, I was able to use type-c 60W charger on lightweight tasks (such as web browsing, older games) just fine.

      [1]: https://www.techpowerup.com/download/techpowerup-throttlesto...

      • By nhubbard 2026-02-2414:15

        Dell likes to pull this stunt on other devices too. Like their 1L desktops in the OptiPlex line that I managed for many years. Even though we were using genuine Dell power adapters, if they became slightly unplugged but remained powered, they would enable PROCHOT.

        This was fine until the machines randomly started setting PROCHOT on genuine power adapters that were fully plugged in. Eventually I just deployed a configuration with PDQ to all the machines that ran ThrottleStop in the background with a configuration that disabled PROCHOT on login.

        Unfortunately, I couldn't get it to consistently disable PROCHOT pre-login, so students and teachers in my labs would consistently wait 3-4 minutes while the machines chugged along at 700 MHz as they prepared their accounts.

      • By joe_mamba 2026-02-2416:24

        >You can use ThrottleStop[1] to disable PROCHOT

        Dell disables that tinkering on some models of XPS in BIOS/EC so ThrottleStop won't to jack.

      • By TiredOfLife 2026-02-2412:26

        On my non Thinkpad lenovo yoga (Whiskey Lake) disabling bd_prochot leads to crash.

      • By rasz 2026-02-2523:14

        >ThrottleStop[1] to disable PROCHOT

        can confirm, works great to bypass throttling when 60W supply on X230

    • By muniter 2026-02-244:02

      Nice to finally know what was happening to my x270 after so many years. Well good thing it doesn't happen when connected to power nowadays is my home server

    • By gritzko 2026-02-248:15

      I was the happy owner of ThinkPad X1 Extreme g1. It had that bug out of the box, new original battery. Once it thermal throttles, it never goes back to full GHz. It throttled pretty soon, cause big CPU small chassis. Yes, I had a script like that.

      It is still somewhere on a shelf, so maybe its day will come again.

    • By rasz 2026-02-245:40

      Thinkpads do same thing when detecting 65W supply instead of 90W despite you only need 90W if running full tilt while charging.

    • By inamberclad 2026-02-245:37

      Oh almost certainly. PROCHOT is programmable.

    • By 65a 2026-02-243:31

      Possibly. Usually this is handled by the embedded controller, and not sure if that was reversed or not. You may be able to tristate the GPIO line that tells the CPU that a pin means PROCHOT, which would allow you to ignore the ECs attempts to do this.

    • By hypercube33 2026-02-2413:24

      I wonder now if a similar problem is present in the A285 which is a cousin of the x270

    • By Kiboneu 2026-02-2414:38

      Yeah, I wrote a similar script. Run it once I see the clock going to 400, but wait for eternity for the sudo prompt emerge before running it.

    • By nxobject 2026-02-243:302 reply

      Do you think it could also be due to an ACPI table?

      • By amiga-workbench 2026-02-243:31

        Its possible. I know from the BIOS revision changelogs that the T470 did get a patch to fix this, but the X270 never did.

      • By p_l 2026-02-2416:27

        Not sure if battery issue is fully related but...

        As a former owner of a T470, Lenovo included a pretty beefy component from intel that was supposed to be feature complete by itself for dynamically managing thermals, including funky ideas like detecting if you were potentially using the laptop on your legs etc. and reducing thermals then, but giving full power when running plugged on the desk.

        Time comes for delivery, Lenovo finds out that intel did a half-assed job (not the first time, compare Rapid Start "hibernation" driver earlier) and the result is kabylake T470 (and X270 which share most of the design) having broken thermals when running anything other than windows without special intel driver, thus leading to funny tools that run in a loop picking at an MSR in the CPU in a constant whack-a-mole with piece of code deep in firmware.

  • By merpkz 2026-02-249:133 reply

    > I can’t recommend libreboot enough, or even heads if libreboot isn’t your speed.

    Why though? Not a single reason mentioned in post about why would it be better than whatever stock BIOS the laptop is shipped with.

    • By adrian_b 2026-02-2413:011 reply

      Some people prefer to know exactly what their computer does, either to enable debugging in obscure cases or due to security concerns.

      Thanks to Intel, who has invented the completely unnecessary System Management Mode, to compensate for the laziness of Microsoft, who could not be bothered to update MS-DOS and Windows with some features required in modern computers, now the BIOS has the ability to do whatever it wants on your computer, without this being detectable by the owner.

      Hopefully the BIOS writers do not abuse this, and the many problems caused by BIOSes are due to unintentional bugs and not due to malice, but it would still better to be certain that your firmware does not do anything nefarious.

      When debugging hardware problems, it is also much simpler when you are certain about what the computer really does, instead of not knowing whether the BIOS takes control when certain hardware events happen, overriding any policies that you may try to implement in your operating system.

      Replacing the proprietary BIOS still does not provide complete control over what you own, as there are auxiliary CPUs with their own agenda, but it is still much closer to full control than when you do not know what the BIOS does.

    • By hypfer 2026-02-249:231 reply

      The goal of that blog post is not to sell you something.

      This can be confusing on HN, I know.

      • By normie3000 2026-02-2410:042 reply

        A recommendation without context is pointless. A recommendation with context could be very helpful!

        • By maxerickson 2026-02-2411:501 reply

          Burma Shave.

          • By miscellanemone 2026-02-2421:07

            You've unlocked a hilarious memory of driving through southern California and seeing all these signs as a kind of one-word-at-a-time advertisement back in the 90s. Someone had to have recreated them as some kind of joke because all the original signs had been gone for decades.

        • By hypfer 2026-02-2411:031 reply

          [flagged]

    • By alias_neo 2026-02-249:302 reply

      It replaces a proprietary component of your system with an open source one.

      Reading https://libreboot.org/#why-use-libreboot might provide further enlightenment.

      • By close04 2026-02-2410:401 reply

        This answer is "do it out of principle". OP is looking for the practical considerations.

        • By alias_neo 2026-02-2413:351 reply

          As far as I can tell, this is the only reason, you'll likely lose a bunch of functionality (that's been my experience); so "principle" is the only reason I'm aware of (or minimalism, but that's a principle too is it not?).

          I suppose if nothing else, you can run a more up to date firmware if the vendor stopped supporting yours, but I have no idea what that means in a practical sense.

          • By katdork 2026-02-2423:46

            I don't really feel like I've lost any functionality, personally?

            If I weren't using binary blobs in the firmware, I think I would have more trouble, but that is Canoeboot to my knowledge, not Libreboot. ^^

      • By ktm5j 2026-02-2410:104 reply

        That still doesn't answer the question of why it's better. Unless you're paranoid about an OEM backdoor, I think this is cool but not worth the effort.

        • By joe_mamba 2026-02-2410:131 reply

          I think firstly is the FOSS obsession and backdoor paranoia from evangelists, and secondly and the more practical one is that the proprietary IBM BIOS is full of bugs and anti-consumer blacklists and whitelists designed to limit repairability and upgradeability, which stil boggle my mind on how those laptops got such a good image on that front.

          • By ktm5j 2026-02-2414:211 reply

            I mean, maybe paranoia is the wrong word.. it's not something that I'm personally worried about, but stuff like that has actually happened.

            • By joe_mamba 2026-02-2414:251 reply

              >but stuff like that has actually happened

              Yes, if you live and organize your life around things that are unlikely to happen to you, but only because they've happened ONCE to someone else, typically a high value target by state actors, that's called paranoia.

              Most people are not gonna be targeted via BIOS hacks. From state actors to online scammers they all have easier ways to getting your data remotely.

        • By yjftsjthsd-h 2026-02-2416:521 reply

          I'm not sure that's paranoia (as others have pointed out, OEM firmwares have had security problems before), but sure, let's ignore security problems for a moment.

          1. Firmware contains bugs. Old proprietary firmware tends to not get fixes. If you switch to an open source version, you can get the bugs fixed.

          (Edit) 1.a. Old proprietary firmware also doesn't tend to get new features, and open source replacements can cover that. (eg. booting over HTTP(S) or security features to help against Evil Maid attacks)

          2. Libreboot claims to be faster to boot than the vendor firmware. Depending on the particular device/firmware, that wouldn't surprise me at all.

          • By ktm5j 2026-02-2418:11

            Yes, I said in another comment that I might have used the wrong word. It's still not something I have a lot of motivation to do something about. At least not until the process is easy.

        • By nix0n 2026-02-2415:49

          > Unless you're paranoid about an OEM backdoor

          Lenovo does have a history with installing a very obvious spyware rootkit on their consumer PCs[0].

          [0]https://support.lenovo.com/us/en/product_security/ps500035-s...

        • By alias_neo 2026-02-2413:47

          I think you've pretty much summed it up.

          As far as I'm aware, it has less functionality than the OEM, so you use it to _remove_ features (good and/or bad).

          Aside from that, I suppose it means you can run a more up to date firmware if yours is no longer maintained, but I'm not sure what that means in practical terms.

          There's also the "hyper paranoid" fork "canoeboot" which has no proprietary blobs, and presumably _even less_ functionality.

          The short answer is; if you don't know why you want it or need it, you probably don't.

  • By BobbyTables2 2026-02-243:282 reply

    How did OP debug this without a serial port?

    I’ve messed around with porting coreboot on two desktop platforms but always had the benefit of a HW serial port…

    • By katdork 2026-02-244:22

      because the x280 and x270 are similar enough I didn't need to try very hard to get it to post or boot a live USB to further investigate (effectively acting as a decent template for me to work off of)

      The console viewing itself was provided by `cbmem -1`, which I could run via a NixOS live USB with nixpkgs#coreboot-utils

    • By 65a 2026-02-243:34

      You can sometimes find the serial lines if you are careful. Otherwise you can use the flashrom to store the output, and read it back out after each failure. It is much easier to just poke around and find the serial if you can, either from schematics (it seems the author has these) or by hand with a lot of patience or board scrying.

HackerNews