-
Notifications
You must be signed in to change notification settings - Fork 23
X200 X201 Hardware Flashing with Raspeberry Pi
If you already have libreboot installed, and have not write protected the rom then you can use the flashrom utility included with libreboot_bin.tar.xz It can be invoked as follows.
./flashrom --programmer internal
Otherwise you may flash the rom with a raspberry pi using the instructions below.
- An x86, x86_64, or arm7l (for changing the libreboot.rom image mac address)
- Raspberry Pi and peripherals
- Relevant SOIC clip
- 6 female - female jumpers
- Internet connection
- Screw drivers
Follow the ThinkPad X200: Initial installation guide to disassemble the laptop, and access the BIOS rom chip.
Note:
x86#
refers to commands to be run on the x86 computer, andpi#
refers to commands to be run on the pi. A good practice is to make a work directory to keep your libreboot stuff inside.
x86# mkdir ~/work
Download NOOBS from The Raspberry Pi Foundation. Torrent download recommended, and remember to seed. :)
Download Libreboot from their releases page. For your safety, verify the GPG signature as well.
x86# gpg --keyserver prefered.keyserver.org --recv-keys 0x656F212E
x86# for signature in $(ls *.sig); do gpg --verify $signature; done
Extract NOOBS and libreboot.
x86# mkdir ~/work/noobs
x86# unzip ~/Downloads/NOOBS_v1_4_1.zip -d ~/work/noobs/
x86# cd ~/work && tar -xvJf ~/Downloads/libreboot_bin.tar.xz
Install Noobs to your fat32 formatted SD card
x86# cp -R ~/work/noobs/* /path/to/mounted/SDcard/
Plug in the NOOBs SDCard to your Raspberry Pi, and enable the following under 'Advanced Options':
SSH server
SPI
I2C
On first boot
pi# sudo apt-get update && sudo apt-get dist-upgrade && reboot
On second boot
pi# sudo apt-get update && sudo apt-get install libftdi1 libftdi-dev libusb-dev libpci-dev subversion
Other dependencies that should already be installed with the noobs base install include:
pciutils, zlib, libusb, build-essential
If they are missing then install them.
Download and build flashrom.
pi# svn co svn://flashrom.org/flashrom/trunk ~/flashrom
pi# cd ~/flashrom
pi# make
pi# sudo make install
On your x86 box change the libreboot.rom mac address
x86# cd ~/work/libreboot_bin/
Change the mac address on the libreboot images to match yours.
x86# ./ich9macchange XX:XX:XX:XX:XX:XX
Write the mac address change onto the correct libreboot image
x86# sudo dd if=ich9fdgbe_8m.bin of=/directory/of/libreboot.rom bs=1 count=12k conv=notrunc
Move the libreboot.rom image over to your pi
x86# scp ~/work/libreboot_bin/<path_to_your_bin> pi@your.pi.address:~/flashrom/libreboot.rom
Shutdown your pi, write down your rom chip model, and wire up the clip
pi# sudo shutdown now -hP
Chip model name
Pinout. You may want to download the image so you can zoom in on the text.
Pin # | SPI Pin Name | Raspberry Pi Pin # |
---|---|---|
1 | not used | not used |
2 | 3.3V | 1 |
3 | not used | not used |
4 | not used | not used |
5 | not used | not used |
6 | not used | not used |
7 | CS# | 24 |
8 | S0/SIO1 | 21 |
9 | not used | not used |
10 | GND | 25 |
11 | not used | not used |
12 | not used | not used |
13 | not used | not used |
14 | not used | not used |
15 | S1/SIO0 | 19 |
16 | SCLK | 23 |
Note: The raspberry pi 3.3V rail should be sufficient to power the chip during flashing, so no external power supply should be required; however, at the time of writing that has only been tested and confirmed for one chip, the MX25L6405D.
Macronix Spec sheet so you can adjust your pinout for 8 pin 4Mb chips as necessary
At this point connect your SOIC clip to the rom chip before powering on your PI.
Power on your Pi, and run the following. Ensure you swap out "your_chip_name" with the proper name/model of your chip. Check that it can be read successfully. If you cannot read the chip and receive an error similar to "no EEPROM Detected" or "0x0 Chip detected" then you may want to try powering off your PI, and switching the two pins which are connected to the IO ports. I.E. Connect pins (clip)8 to (pi)19 and pins (clip)15 to (pi)21
pi# cd ~/flashrom
pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -r romread1.rom
pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -r romread2.rom
pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -r romread3.rom
pi# sha512sum romread*.rom
If they are identical sha512 hashes then you can generally assume that it's safe to flash your rom.
pi# ./flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip <your_chip_name> -w libreboot.rom
It may fail a couple times, but keep at it and when you get the message Verifying flash... Verified
or Warning: Chip content is identical to the requested image
then you're done.
Shut down your pi, put your box back together, and install a libre OS for great good!
This tutorial, with exceptions noted, is licensed under the Creative Commons 0 license.
Exceptions:
- The Macronix Specification Sheet copyright is not held by the author of this write up and does not fall under the Creative Commons 0 license.
Written by: snuffeluffegus
Coreboot is an open source, user configurable BIOS. However, it does use a few proprietary blobs here and there.
These require hardware flashing. Due to Intel Management Firmware, proprietary blobs are required for newer Intel motherboards to even power up.
-
ThinkPad T430/X230
- xx30 BIOS Whitelist Removal
- xx30 BIOS Mod with Old Keyboard - Since Libreboot's ROMs each can use a different keyboard layout, would it be possible to modify Coreboot to work with the old xx20 keyboard? Or just mod the official BIOS to do so?
- ThinkPad X201
- ThinkPad T60p (ATI GPU)
- ThinkPad T22 - Back when Coreboot was known as "LinuxBIOS", they installed it on a ThinkPad T22 for Richard Stallman.
Most Intel Chromebooks come with Coreboot preinstalled. SeaBIOS can optionally be installed to add Windows support.
Just use John Lewis's Installation Script for All Models to autoinstall.
-
Chromebook Coreboot Installation - Install Coreboot + SeaBIOS for 2nd gen laptops. Not necessary for 3rd gen.
- Acer C7 Chromebook
- Toshiba Chromebook 2 - The only 13-inch model around with an FHD 1920x1080 IPS screen.
- Samsung Series 5 550
- Acer C720 Chromebook
- ThinkPad X131e Chromebook
- Install Typical BIOS
- Chromebook Pixel
NOTE: The Libreboot components of this wiki was divested into the Official Libreboot Documentation here. Please use that from now on.
Libreboot laptops are certified by the FSF to protect your freedom.
They contain no proprietary blobs of any kind, and have the best support for FSF certified GNU/LInux.
- Customizing Libreboot
- X60 T60 Hardware Flashing
- X200 X201 Hardware Flashing
- Installing Trisquel with Full Disk Encryption
- BIOS Flashchip Identification Method
- Phoenix BIOS Crisis Recovery - (under research) Software method for recovering the factory BIOS, even if you lost the original dump.