Requirements
Pi
Configuration
Install Raspbian
Update Raspbian packages
-
Pins
Physical
The physical numbering and order of the pins on a Pi
[ ] represents a pin
O represents a mounting hole
The
ASCII art assumes the I/O ports are on the right-side and the pins are at the top
1, 2, 3, 4, 37, 38, 39, and 40 are unused and only provided for reference as to pin order
----------------------------------------------------------------------------------------------------- ----------
| [ 2] [ 4] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [24] [ ] [ ] [ ] [ ] [ ] [ ] [38] [40] | | |
O [ 1] [ 3] [ ] [ ] [ ] [ ] [ ] [ ] [17] [19] [21] [23] [25] [ ] [ ] [ ] [ ] [ ] [37] [39] O | USB |
| | | |
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV (chips and other stuff below) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
GPIO
-
The GPIO numbering and order of the pins on a Pi
[ ] represents a pin
O represents a mounting hole
The
ASCII art assumes the I/O ports are on the right-side and the pins are at the top
5v, far-left 3.3v, 21, and far-right GND are unused and only provided for reference
----------------------------------------------------------------------------------------------------------- ----------
| [5v ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ 8] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [21 ] | | |
O [3.3V] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [3.3V] [10] [ 9] [11] [GND] [ ] [ ] [ ] [ ] [ ] [ ] [GND] O | USB |
| | | |
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV (chips and other stuff below) VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
W25Q64FV
Pins
Numbering of the pins on the chip according to the
spec sheet
--------
[1]__|O |__[8]
[2]__| Chip |__[7]
[3]__| |__[6]
[4]__| |__[5]
--------
Pin Descriptions
--------
[/CS]__|O |__[VCC]
[DO]__| Chip |__[/HOLD]
[/WP]__| |__[CLK]
[GND]__| |__[DI]
--------
SOIC Clip to Pi Pins
[24] [17]
[21] \ \ [ ]
[ ] \ \ [23]
[25] [19]
flashrom
Install
Pre-compiled
sudo apt install 'flashrom'
Git Compile
Dependencies
sudo apt install libpci-dev libftdi-dev libusb-1.0-0-dev git-core build-essential
Get Source
rm -Rf ~/'flashrom' && git clone -b 'master' 'https://github.com/flashrom/flashrom.git' ~/'flashrom' --depth '1'
Build
cd ~/'flashrom' && make --jobs='4' && sync
Test Chip Read
Assumes the SOIC clip is connected to the Pi correctly and that SPI is enabled
All 3 md5sums need to match to ensure consistent read/write to the chip
spispeed=8000 is necessary for reading from a W25Q64FV chip
sudo flashrom --programmer 'linux_spi':'dev=/dev/spidev0.0,spispeed=8000' --read ~/'test1.bin' && sudo flashrom --programmer 'linux_spi':'dev=/dev/spidev0.0,spispeed=8000' --read ~/'test2.bin' && sudo flashrom --programmer 'linux_spi':'dev=/dev/spidev0.0,spispeed=8000' --read ~/'test3.bin' && sync
md5sum ~/'test1.bin' && md5sum ~/'test2.bin' && md5sum ~/'test3.bin'
rm -fv ~/'test2.bin' ~/'test3.bin' && sync
Backup

Super-important to have a checksum-verified back-up to fall-back to when doing BIOS modifications
Back this up somewhere external before doing anything else
To be extra safe, also md5sum it and compare to above tests
spispeed=8000 is necessary for reading from a
W25Q64FV chip
sudo flashrom --programmer 'linux_spi':'dev=/dev/spidev0.0,spispeed=8000' --read ~/'backup-original.bin' && sync
md5sum ~/'test1.bin' && md5sum ~/'backup-original.bin'
rm -fv ~/'test1.bin' && sync
Flash
sync && sudo flashrom --programmer 'linux_spi':'dev=/dev/spidev0.0,spispeed=8000' --write x
me_cleaner
Get Source
git clone -b 'master' 'https://github.com/corna/me_cleaner.git' ~/'me_cleaner' --depth '1'
Check Original BIOS
python ~/'me_cleaner/me_cleaner.py' --check ~/'backup-original.bin'
Clean ME
python ~/'me_cleaner/me_cleaner.py' --soft-disable --descriptor --output ~/'me_cleaner-soft-disable-descriptor.bin' ~/'backup-original.bin'
Flash Modified BIOS
sync && sudo flashrom --programmer 'linux_spi':'dev=/dev/spidev0.0,spispeed=8000' --write ~/'me_cleaner-soft-disable-descriptor.bin'
Clean-up
cd ~ && rm -Rf ~/'flashrom' && sync
Verifying ME
Windows
Linux
Coreboot
cd ~ && mkdir -p ~/'Projects' && rm -Rf ~/'Projects/coreboot/src' && git clone --branch 'master' --depth '1' 'https://github.com/coreboot/coreboot.git' ~/'Projects/coreboot/src' && sync
Dependencies
sudo dnf install 'pciutils-devel'
Compile
cd ~/'Projects/coreboot/src/util/intelmetool' && make --jobs='3' && sync
Run
cd ~/'Projects/coreboot/src/util/intelmetool' && sudo ~/'Projects/coreboot/src/util/intelmetool/intelmetool' --help
Dependencies
sudo dnf install 'pciutils-devel'
Compile
cd ~/'Projects/coreboot/src/util/ifdtool' && make --jobs='3' && sync
Notes
Can be used to set the HAP bit, similar to me_cleaner's --soft-disable-only
Can be used to dump information about ME on a BIOS image, good for checking if it's a valid dump like me_cleaner's --check option
Can unlock R/W on chip areas much more thoroughly than me_cleaner
Run
cd ~/'Projects/coreboot/src/util/ifdtool' && ~/'Projects/coreboot/src/util/ifdtool/ifdtool' --help