How I Corebooted my thinkpad x220t
Note: I ordered my SOIC8 test clip from China, but it never came and so this guide is a theoretical write up of how I wouldāve done this had it arrived. This was very unfortunate as I had everything else prepared.
This is a guide on how to coreboot a thinkpad x220t. Most thinkpads are pretty similar so this guide can also be used for an x200-x230, though you should still google for any model specific details.
Also backup your BIOS for the love of god, and donāt panic if you brick it, just reflash with your backup. And be careful not to fry the flash chip, if you do, you might be able to desolder and replace it.
This guide comes with no warranty, proceed at your own risk.
A linux computer to SSH into the Pi
Female jumper leads (to connect the Pi and the test clip)
SOIC 8 pin test clip (like this)
Download and flash Raspbian Lite to a micro SD card.
Make a file called ssh in the root directory (to enable SSH)
Follow the directions here to set up wifi on the Pi so you can access it remotely (you can use a wired connection if you want)
Use nmap or check your router to find the ip address of the Pi
SSH into the pi (default user and pw is pi and raspberry)
Prepare the Pi for flashing by updating it and installing everything with the following commands
sudo apt-get update && sudo apt-get dist-upgrade && sudo reboot
sudo apt-get update && sudo apt-get install libftdi1 libftdi-dev libusb-dev libpci-dev subversion
sudo apt-get install build-essential pciutils usbutils libpci-dev libusb-dev libftdi1 libftdi-dev zlib1g-dev subversion
svn co svn://flashrom.org/flashrom/trunk flashrom
Use the following commands to add the SPI kernal modules to /etc/modules so they persist between boots.
sudo modprobe spi_bcm2835
Shutdown the Pi, unplug the x220t and remove the batteries.
Remove the palmrest and keyboard from the x220t (consult the hardware maintenance manual for instructions on how to) and expose the flash chip (see image 1 in the appendix)
Hook up the test clip to the Pi (see image 2 in the appendix for a wiring diagram)
Connect the clip to the motherboard then turn the Pi on
Read the contents of the flash chip with the following command (do this several times and make sure the hash matches
sudo flashrom -p linux_spi:dev=/dev/spidev0.0 -r read01.bin
Download coreboot and use the ifdtool to extract whats need from the stock rom
git clone http://review.coreboot.org/coreboot.git ~/coreboot
git submodule update --init --recursive
cd ~/coreboot/util/ifdtool
mkdir -p ~/coreboot/3rdparty/blobs/mainboard/lenovo/x220
cd ~/coreboot/3rdparty/blobs/mainboard/lenovo/x220
mv ~/flashregion_0_flashdescriptor.bin descriptor.bin
mv ~/flashregion_2_intel_me.bin me.bin
mv ~/flashregion_3_gbe.bin gbe.bin
Use me_cleaner to neutralize the Intel ME
git clone https://github.com/corna/me_cleaner ~/me_cleaner
sudo apt-get install python3
./me_cleaner.py ~/coreboot/3rdparty/blobs/mainboard/lenovo/x220/me.bin
make crossgcc-i386 CPUS=4 -b
sudo flashrom -p linux_spi:dev=/dev/spidev0.0 -w ~/coreboot/build/coreboot.rom -c flashChipModel
Disconnect the clip and power up the laptop, it should boot to SeaBIOS
image 1 - Flash chip on the motherboard
image 2 - Wiring diagram for the Pi
https://github.com/grisu48/Coreboot/tree/master/x220t
https://karlcordes.com/coreboot-x220/
https://tylercipriani.com/blog/2016/11/13/coreboot-on-the-thinkpad-x220-with-a-raspberry-pi/
https://wej.k.vu/coreboot/coreboot_on_the_lenovo_thinkpad_x220/
https://github.com/thetarkus/x220-coreboot-guide