Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message

Coreboot on the X210

Old(er) Thinkpads with New(er) Intestines: X62/T50/T70/X210/X330 etc.
Message
Author
mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Coreboot on the X210

#1 Post by mjg59 » Tue Jul 31, 2018 4:52 am

Hi! I've just finished a first attempt at a port of Coreboot (www.coreboot.org) to the X210. For those who are unaware, Coreboot is a (mostly) open source firmware implementation that replaces the system firmware. I'm running it as my primary firmware now, and it boots Linux happily but probably wouldn't work so well with Windows at the moment. The source code is at github.com/mjg59/coreboot, but please bear in mind that making any kind of mistake during the build or flash process (such as not including the embedded controller firmware) will render your machine unbootable and you'll need additional hardware to recover it. This is primarily something I've done for my own interest, but if anyone else is enthusiastic about running it I'll see if I can make some binaries available and provide instructions for flashing it.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: Coreboot on the X210

#2 Post by flyingfishfinger » Thu Aug 02, 2018 11:09 am

Very nice project!

Personally I'd be more interested in an X62 variant, but I wish you the best with the completion of this one. Can't help you test due to lack of X210 though, sorry.

R

tadfisher
Posts: 3
Joined: Sun Feb 11, 2018 9:59 pm
Location: Portland, OR

Re: Coreboot on the X210

#3 Post by tadfisher » Sat Aug 18, 2018 3:36 pm

Very cool! I'd love binaries as building coreboot is quite involved if the distribution doesn't provide the build infrastructure for it (e.g. NixOS).

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#4 Post by mjg59 » Mon Aug 20, 2018 1:06 am

I'll post binaries shortly - I'm just trying to track down an issue where everything works fine on my machine but wlan doesn't show up on another (nominally identical) board.

jlee
Posts: 12
Joined: Fri Mar 31, 2017 2:34 pm
Location: West Covina, California

Re: Coreboot on the X210

#5 Post by jlee » Tue Aug 28, 2018 11:42 pm

Wow. this is pretty cool. How's battery life comparing coreboot to the default bios?

L29Ah
Sophomore Member
Posts: 180
Joined: Fri Sep 06, 2013 2:25 pm
Location: Montenegro

Re: Coreboot on the X210

#6 Post by L29Ah » Tue Jan 08, 2019 9:47 pm

Do you plan pushing it to the upstream?
51nb X210 with community EC mod, me_cleaner and recelled 99W*h battery; X230 with coreboot, me_cleaner and nitrocaster's FHD mod as a backup; R500 for guests; T60 just for the looks.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: Coreboot on the X210

#7 Post by flyingfishfinger » Fri Mar 22, 2019 4:20 am

What flash chip is used on the X210?

R

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#8 Post by mjg59 » Mon Apr 29, 2019 4:47 pm

The issue with the wifi card turned out to be mechanical. I'm in the process of rebasing this on current upstream and will post some binaries once I'm done.

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#9 Post by mjg59 » Mon Apr 29, 2019 8:45 pm

Ok, uploaded stuff to https://github.com/mjg59/coreboot/releases/tag/x210_1.0 - the coreboot.rom image there can be flashed directly using Flashrom with current git:

sudo flashrom -p internal:laptop=force_I_want_a_brick -w coreboot.rom

Note that, as the argument suggests, this might go horribly wrong and you'll need an external programmer to rescue you. If you build from source, no matter what you do ensure that you include the embedded controller firmware otherwise the machine will end up completely broken and very hard to re-flash. The blobs.zip file contains the device-specific binaries that are required during the build.

This image will give you a UEFI system with no BIOS support. It boots Linux fine - I have no idea whether it will boot Windows. I've only tested this with a batch 2 device, I don't know what it'll do on batch 1 boards given the SATA/NVMe issues. Batch 3 boards seem to use the same firmware as batch 2, so maybe that'll work, but don't blame me if it doesn't.

skx
Sophomore Member
Posts: 242
Joined: Mon Jul 09, 2018 6:25 pm
Location: Colombia

Re: Coreboot on the X210

#10 Post by skx » Tue Apr 30, 2019 6:45 pm

mjg59 wrote:
Mon Apr 29, 2019 8:45 pm
Ok, uploaded stuff to https://github.com/mjg59/coreboot/releases/tag/x210_1.0 - the coreboot.rom image there can be flashed directly using Flashrom with current git:

sudo flashrom -p internal:laptop=force_I_want_a_brick -w coreboot.rom
WARNING: do not internal flash your device with stock bios as I will rather sooner than not end up in a non booting machine and if you do not have a dump of your bios it will be a paper weight. internal flashing only works as soon as you did your initial coreboot flash with external flasher

mjg59: how did you flash your initial flashed coreboot rom? external flashing, right?
ThinkPad X220: i5-2520M CPU 2.5GHz - 8GB RAM 1333 MHz - SSD 860 EVO 250GB - Debian - ME_cleaned
ThinkPad X230: i5-3320M CPU 3.3GHz - 8GB RAM 1600 MHz - SSD 860 EVO 500GB - Debian - ME_cleaned

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#11 Post by mjg59 » Tue Apr 30, 2019 9:32 pm

No, this machine has never had an external flasher connected (we did the initial port on another machine and did use a flasher there). I've switched between stock and coreboot several times using -p internal.

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#12 Post by mjg59 » Tue Apr 30, 2019 9:35 pm

(Oops, duplicate)

harryK
Sophomore Member
Posts: 172
Joined: Fri Jun 13, 2014 6:28 pm
Location: Glasgow, Scotland

Re: Coreboot on the X210

#13 Post by harryK » Thu May 23, 2019 5:22 am

mjg59 wrote:
Mon Apr 29, 2019 8:45 pm
Ok, uploaded stuff to https://github.com/mjg59/coreboot/releases/tag/x210_1.0 - the coreboot.rom image there can be flashed directly using Flashrom with current git:

sudo flashrom -p internal:laptop=force_I_want_a_brick -w coreboot.rom

Note that, as the argument suggests, this might go horribly wrong and you'll need an external programmer to rescue you. If you build from source, no matter what you do ensure that you include the embedded controller firmware otherwise the machine will end up completely broken and very hard to re-flash. The blobs.zip file contains the device-specific binaries that are required during the build.

This image will give you a UEFI system with no BIOS support. It boots Linux fine - I have no idea whether it will boot Windows. I've only tested this with a batch 2 device, I don't know what it'll do on batch 1 boards given the SATA/NVMe issues. Batch 3 boards seem to use the same firmware as batch 2, so maybe that'll work, but don't blame me if it doesn't.
Ok, I got impatient and built coreboot from your source with vladislav's modified ec.bin from viewtopic.php?p=833699#p833699, added seabios as payload, flashed my third batch machine and now it doesn't boot :-)

It is not completely dead: the battery is charging, the status lights work and correctly signal whether ac is attached, but if I press the power button the screen stays off and I don't think that anything is happening.

I have a backup of the stock bios and a SOIC8 clip, so I should be able to rescue it. Here's my .config https://pastebin.com/NaXYfZiP. Any idea of what I could be missing in my build?

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#14 Post by mjg59 » Fri May 24, 2019 3:15 am

First boot after reflashing may take up to a minute for RAM link calibration - how long did you wait?

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#15 Post by mjg59 » Fri May 24, 2019 3:23 am

But also you have:

+# CONFIG_DRIVERS_PS2_KEYBOARD is not set

which is definitely a problem :) You probably also want

CONFIG_RUN_FSP_GOP=y

if you're running Tiano as a payload, along with:

CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_LINEAR_FRAMEBUFFER=y

I basically haven't tested SeaBIOS as a payload, so things could definitely be weird in that respect.

harryK
Sophomore Member
Posts: 172
Joined: Fri Jun 13, 2014 6:28 pm
Location: Glasgow, Scotland

Re: Coreboot on the X210

#16 Post by harryK » Thu Jul 11, 2019 4:21 am

mjg59 wrote:
Fri May 24, 2019 3:23 am
But also you have:

+# CONFIG_DRIVERS_PS2_KEYBOARD is not set

which is definitely a problem :) You probably also want

CONFIG_RUN_FSP_GOP=y

if you're running Tiano as a payload, along with:

CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
CONFIG_LINEAR_FRAMEBUFFER=y

I basically haven't tested SeaBIOS as a payload, so things could definitely be weird in that respect.
Hi Matthew,

I saw that you committed some changes to the repo in the last few days and gave it another go at building it from your x210_test branch with Vladislav's patched EC. All seems to be working well on batch three, bar a couple of glitches.

1. ASPM L1 substates are not enabled. The PCI root ports don't show the capability at all

***** EDIT ******
L1 substates can be enabled turning on support for the esoteric ClkReqNumber in devicetree.cb The following configuration works:

Code: Select all

register "PcieRpEnable[2]" = "1"
	register "PcieRpClkReqSupport[2]" = "1"
	register "PcieRpClkReqNumber[2]" = "0"
	register "PcieRpClkSrcNumber[2]" = "0"
	register "PcieRpAdvancedErrorReporting[2]" = "1"
	register "PcieRpLtrEnable[2]" = "1"

	register "PcieRpEnable[3]" = "1"
	register "PcieRpClkReqSupport[3]" = "1"
	register "PcieRpClkReqNumber[3]" = "1"
	register "PcieRpClkSrcNumber[3]" = "1"
	register "PcieRpAdvancedErrorReporting[3]" = "1"
	register "PcieRpLtrEnable[3]" = "1"

	register "PcieRpEnable[8]" = "1"
	register "PcieRpClkReqSupport[8]" = "0"     # L1 substates have to be switched off for the nvme port. No drive ever booted if active. Tried several clkreq numbers.
	register "PcieRpClkReqNumber[8]" = "2"
	register "PcieRpClkSrcNumber[8]" = "2"
	register "PcieRpAdvancedErrorReporting[8]" = "1"
	register "PcieRpLtrEnable[8]" = "1"
2. Another strange thing is that the processor seems to have lost support for Energy performance bias:

Code: Select all

# x86_energy_perf_policy power
x86_energy_perf_policy: EPB not enabled on this platform
Setting HWP policy works though.

Anyway, power consumption doesn't seem to be suffering. The machine idles at 3.2W with brightness 5/15.

3. One annoying bug is that the machine seems to turn on whenever a power source is attached.

4. Linux ME module doesn't seem to be playing well with the ME, however I disabled it in the stock bios, so I don't know if this was also the case before.

Code: Select all

mei_me 0000:00:16.0: wait hw ready failed
[    7.234911] mei_me 0000:00:16.0: hw_start failed ret = -62
[    7.234919] mei_me 0000:00:16.0: H_RST is set = 0x80070731
[    9.250907] mei_me 0000:00:16.0: wait hw ready failed
[    9.250910] mei_me 0000:00:16.0: hw_start failed ret = -62
[    9.250918] mei_me 0000:00:16.0: H_RST is set = 0x80070731
[   11.266907] mei_me 0000:00:16.0: wait hw ready failed
[   11.266911] mei_me 0000:00:16.0: hw_start failed ret = -62
[   11.266915] mei_me 0000:00:16.0: reset: reached maximal consecutive resets: disabling the device
[   11.266917] mei_me 0000:00:16.0: reset failed ret = -19
[   11.266918] mei_me 0000:00:16.0: link layer initialization failed.
[   11.266920] mei_me 0000:00:16.0: init hw failure.
[   11.266966] mei_me 0000:00:16.0: initialization failed.

Hope this helps!

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#17 Post by mjg59 » Fri Jul 19, 2019 4:33 pm

harryK wrote:
Thu Jul 11, 2019 4:21 am
L1 substates can be enabled turning on support for the esoteric ClkReqNumber in devicetree.cb The following configuration works:
Thanks! I'll merge that.
2. Another strange thing is that the processor seems to have lost support for Energy performance bias:
Huh weird. There's presumably some setup required that Coreboot's not doing - I'll look into that.
3. One annoying bug is that the machine seems to turn on whenever a power source is attached.
There's a Coreboot config option for what should happen when power is attached, try switching that?
4. Linux ME module doesn't seem to be playing well with the ME, however I disabled it in the stock bios, so I don't know if this was also the case before.
Hmm, I don't see those errors - did you use a fresh ME image, or did you extract your existing one? I'm not an ME expert, so not sure why that might happen (although I think I did see the same at some point)

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#18 Post by mjg59 » Fri Jul 19, 2019 7:07 pm

mjg59 wrote:
Fri Jul 19, 2019 4:33 pm
harryK wrote:
Thu Jul 11, 2019 4:21 am
2. Another strange thing is that the processor seems to have lost support for Energy performance bias:
Huh weird. There's presumably some setup required that Coreboot's not doing - I'll look into that.
darn Intel. https://review.coreboot.org/c/coreboot/+/34458 should fix that.

harryK
Sophomore Member
Posts: 172
Joined: Fri Jun 13, 2014 6:28 pm
Location: Glasgow, Scotland

Re: Coreboot on the X210

#19 Post by harryK » Sun Jul 21, 2019 4:10 am

mjg59 wrote:
Fri Jul 19, 2019 4:33 pm
harryK wrote:
Thu Jul 11, 2019 4:21 am
2. Another strange thing is that the processor seems to have lost support for Energy performance bias:
Huh weird. There's presumably some setup required that Coreboot's not doing - I'll look into that.
Your patch makes the trick. Thanks!
3. One annoying bug is that the machine seems to turn on whenever a power source is attached.
There's a Coreboot config option for what should happen when power is attached, try switching that?
There's no obvious option in menuconfig. Do you have an idea of what that could be?

Also, cold boot is very slow. I have

Code: Select all

$systemd-analyze
Startup finished in 32.368s (firmware) 
whereas reboot is instant. It's as if it does the memory training bit every time

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: Coreboot on the X210

#20 Post by flyingfishfinger » Tue Jul 23, 2019 12:07 pm

Slightly OT: After nearly 4 months of bothering Jacky on WeChat my X210 full machine is finally in the mail !

Can't wait to play with the goodies in this thread :D

verynice
Posts: 41
Joined: Wed May 22, 2019 1:59 pm
Location: Moscow, Russia

Re: Coreboot on the X210

#21 Post by verynice » Thu Jul 25, 2019 5:06 am

Is it possible to add fn+ctrl swap?
Also, could https://github.com/harrykipper/x210
coreboot.rom image be updated with latest changes, please.
And the last one, has anyone tried the libgfxinit (there are
some pending patches, but still)?

harryK
Sophomore Member
Posts: 172
Joined: Fri Jun 13, 2014 6:28 pm
Location: Glasgow, Scotland

Re: Coreboot on the X210

#22 Post by harryK » Fri Jul 26, 2019 4:54 am

verynice wrote:
Thu Jul 25, 2019 5:06 am
Is it possible to add fn+ctrl swap?
Also, could https://github.com/harrykipper/x210
coreboot.rom image be updated with latest changes, please.
And the last one, has anyone tried the libgfxinit (there are
some pending patches, but still)?
Hi,
I updated the coreboot image syncing it with the latest coreboot source, which contains Matthew's patch to enable EPB. I also enabled SATA ALPM and Dev Sleep and a couple of other things for power saving, and included the latest CPU microcode from Intel. BTW note that this version of coreboot sets the TDP to 25W / 44W. It should also be possible to undervolt the processor, but I don't know how :-D Also, I don't know how to change the keyboard mapping. Sorry, I am still learning..

Please be careful when flashing and have a backup and hardware flasher at hand in case things go wrong.
Last edited by harryK on Fri Jul 26, 2019 7:46 am, edited 1 time in total.

verynice
Posts: 41
Joined: Wed May 22, 2019 1:59 pm
Location: Moscow, Russia

Re: Coreboot on the X210

#23 Post by verynice » Fri Jul 26, 2019 6:46 am

harryK wrote:
Fri Jul 26, 2019 4:54 am
verynice wrote:
Thu Jul 25, 2019 5:06 am
Is it possible to add fn+ctrl swap?
Also, could https://github.com/harrykipper/x210
coreboot.rom image be updated with latest changes, please.
And the last one, has anyone tried the libgfxinit (there are
some pending patches, but still)?
Hi,
I updated the coreboot image syncing it with the latest coreboot source, which contains Michael's patch to enable EPB. I also enabled SATA ALPM and Dev Sleep and a couple of other things for power saving, and included the latest CPU microcode from Intel. BTW note that this version of coreboot sets the TDP to 25W / 44W. It should also be possible to undervolt the processor, but I don't know how :-D Also, I don't know how to change the keyboard mapping. Sorry, I am still learning..

Please be careful when flashing and have a backup and hardware flasher at hand in case things go wrong.
I get programmer error when I try flashrom -p internal -w from the old coreboot.rom

harryK
Sophomore Member
Posts: 172
Joined: Fri Jun 13, 2014 6:28 pm
Location: Glasgow, Scotland

Re: Coreboot on the X210

#24 Post by harryK » Fri Jul 26, 2019 7:45 am

verynice wrote:
Fri Jul 26, 2019 6:46 am
harryK wrote:
Fri Jul 26, 2019 4:54 am


Hi,
I updated the coreboot image syncing it with the latest coreboot source, which contains Matthew's patch to enable EPB. I also enabled SATA ALPM and Dev Sleep and a couple of other things for power saving, and included the latest CPU microcode from Intel. BTW note that this version of coreboot sets the TDP to 25W / 44W. It should also be possible to undervolt the processor, but I don't know how :-D Also, I don't know how to change the keyboard mapping. Sorry, I am still learning..

Please be careful when flashing and have a backup and hardware flasher at hand in case things go wrong.
I get programmer error when I try flashrom -p internal -w from the old coreboot.rom
you need

Code: Select all

flashrom -p internal:laptop=force_I_want_a_brick -w coreboot.rom

verynice
Posts: 41
Joined: Wed May 22, 2019 1:59 pm
Location: Moscow, Russia

Re: Coreboot on the X210

#25 Post by verynice » Fri Jul 26, 2019 9:10 am

This is great release, but...
I can't boot my nvme drive:
DMAR-IR: [Firmware Bug]: ioapic has no mapping iommu, interrupt remapping will be disabled
DMAR: Failed to create 0-16MiB identity map
nvme DMAR: allocating domain failed

harryK
Sophomore Member
Posts: 172
Joined: Fri Jun 13, 2014 6:28 pm
Location: Glasgow, Scotland

Re: Coreboot on the X210

#26 Post by harryK » Fri Jul 26, 2019 9:49 am

verynice wrote:
Fri Jul 26, 2019 9:10 am
This is great release, but...
I can't boot my nvme drive:
DMAR-IR: [Firmware Bug]: ioapic has no mapping iommu, interrupt remapping will be disabled
DMAR: Failed to create 0-16MiB identity map
nvme DMAR: allocating domain failed
Strange. Try booting with intel_iommu=off maybe?
Also, I just realised that I killed the ME with me_cleaner in this release, that could be related to the issue. I'll reupload the image with the full ME in a bit.
FWIW everything works well for me with the deactivated ME, but I don't enable IOMMU and DMAR in my kernel

verynice
Posts: 41
Joined: Wed May 22, 2019 1:59 pm
Location: Moscow, Russia

Re: Coreboot on the X210

#27 Post by verynice » Fri Jul 26, 2019 10:53 am

harryK wrote:
Fri Jul 26, 2019 9:49 am
verynice wrote:
Fri Jul 26, 2019 9:10 am
This is great release, but...
I can't boot my nvme drive:
DMAR-IR: [Firmware Bug]: ioapic has no mapping iommu, interrupt remapping will be disabled
DMAR: Failed to create 0-16MiB identity map
nvme DMAR: allocating domain failed
Strange. Try booting with intel_iommu=off maybe?
Also, I just realised that I killed the ME with me_cleaner in this release, that could be related to the issue. I'll reupload the image with the full ME in a bit.
FWIW everything works well for me with the deactivated ME, but I don't enable IOMMU and DMAR in my kernel
I'd like to boot with iommu as i use iommu for device pass through and virtualization.
I don't think that ME is related, I think it's one of the changes in the policies.

flyingfishfinger
Junior Member
Junior Member
Posts: 404
Joined: Sun Nov 18, 2012 5:42 pm
Location: San Francisco Bay Area

Re: Coreboot on the X210

#28 Post by flyingfishfinger » Fri Jul 26, 2019 12:56 pm

harryK wrote:
Fri Jul 26, 2019 4:54 am
Hi,
I updated the coreboot image syncing it with the latest coreboot source, which contains Matthew's patch to enable EPB. I also enabled SATA ALPM and Dev Sleep and a couple of other things for power saving, and included the latest CPU microcode from Intel. BTW note that this version of coreboot sets the TDP to 25W / 44W. It should also be possible to undervolt the processor, but I don't know how
Wow this sounds awesome! Have Matthew's changes been merged into coreboot master? His own Github master latest is 3 months old...

Since I want to build my own version with SeaBIOS & Tinycore Linux as a payload (!), can you give some tips as to what specific power saving things you've enabled and how to do the Intel microcode update? I've done a build of coreboot before but not to this level of customization so might need some guidance here.

Unless they're named differently in Menuconfig, the actual .config file makes no mention of Dev Sleep and ALPM, for example. Where are these options usually configured?

Thanks,
R

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#29 Post by mjg59 » Fri Jul 26, 2019 1:01 pm

verynice wrote:
Thu Jul 25, 2019 5:06 am
Is it possible to add fn+ctrl swap?
No, that's a function of the embedded controller, which is still running proprietary firmware.
And the last one, has anyone tried the libgfxinit (there are
some pending patches, but still)?
libgfxinit works for cold boots, but fails to reinitialise the screen on reboots. I'm working with the maintainer to try to figure that out.

mjg59
Posts: 40
Joined: Sat Aug 21, 2004 7:53 am

Re: Coreboot on the X210

#30 Post by mjg59 » Fri Jul 26, 2019 1:02 pm

flyingfishfinger wrote:
Fri Jul 26, 2019 12:56 pm
Wow this sounds awesome! Have Matthew's changes been merged into coreboot master? His own Github master latest is 3 months old...
https://review.coreboot.org/c/coreboot/+/32531 is the ongoing review.

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “51nb and other modded Thinkpads”

Who is online

Users browsing this forum: No registered users and 10 guests