diff options
Diffstat (limited to 'docs/install/rpi_setup.md')
-rw-r--r-- | docs/install/rpi_setup.md | 130 |
1 files changed, 44 insertions, 86 deletions
diff --git a/docs/install/rpi_setup.md b/docs/install/rpi_setup.md index 64389a78..e74432d4 100644 --- a/docs/install/rpi_setup.md +++ b/docs/install/rpi_setup.md @@ -2,33 +2,29 @@ title: How to program an SPI flash chip with the Raspberry Pi ... -This document exists as a guide for reading from or writing to an SPI -flash chip with the Raspberry Pi, using the -[flashrom](http://flashrom.org/Flashrom) software. Most revisions of the -RPi should work. +This document exists as a guide for reading from or writing to an SPI flash +chip with the Raspberry Pi, using the [flashrom](http://flashrom.org/Flashrom) +software. Most revisions of the RPi should work. The Libreboot project recommends using [blobless GNU+Linux](https://blog.rosenzweig.io/blobless-linux-on-the-pi.html) -on the Raspberry Pi, to avoid having to run non-free software. This -only became possible in February 2017 and the instructions below are -not yet updated with the necessary steps, so please do not follow the -steps below unless you are willing to run non-free software on your -Raspberry Pi. +on the Raspberry Pi, to avoid having to run non-free software. This only became +possible in February 2017 and the instructions below are not yet updated with +the necessary steps, so please do not follow the steps below unless you are +willing to run non-free software on your Raspberry Pi. -This only covers SOIC-8 flash chips, for now. SOIC-16 guide coming later -(for now, it should be easy enough for you to figure this out for -SOIC-16). +This only covers SOIC-8 flash chips, for now. SOIC-16 guide coming later (for +now, it should be easy enough for you to figure this out for SOIC-16). -[](#raspberry-pi-thinkpad-x60t60-and-macbook-21){#user-content-raspberry-pi-thinkpad-x60t60-and-macbook-21 .anchor}Raspberry Pi (ThinkPad X60/T60 and Macbook 2,1) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- +Raspberry Pi (ThinkPad X60/T60 and Macbook 2,1) +------------------------------------------------ The Raspberry Pi (a multipurpose \$25 GNU+Linux computer) can be used as a BIOS flashing tool, thanks to its GPIO pins and SPI support. -> **Note:** The Raspberry Pi Model A is not supported, since it has no -> GPIO pins. +Note: The Raspberry Pi Model A is not supported, since it has no GPIO pins. -### [](#disassembling-the-thinkpad){#user-content-disassembling-the-thinkpad .anchor}Disassembling the ThinkPad +### Disassembling the ThinkPad Follow the [X60 Hardware Maintenance Manual](http://download.lenovo.com/ibmdl/pub/pc/pccbbs/mobiles_pdf/42x3550_04.pdf) @@ -45,7 +41,7 @@ Guide](t60_unbrick.md). - On the T60, the BIOS chip is just under the palmrest, but blocked by a magnesium frame (which you will have to remove). -### [](#pomona-clip-pinout){#user-content-pomona-clip-pinout .anchor}Pomona Clip Pinout +### Pomona Clip Pinout Diagram of the 26 GPIO Pins of the Raspberry Pi Model B (for the Model B+ with 40 pins, start counting from the right and leave 14 pins): @@ -78,7 +74,7 @@ detect a chip, or it will "detect" a `0x0` chip. Finally, make sure that the Pomona clip makes contact with the metal wires of the chip. It can be a challenge, but keep trying. -### [](#how-to-supply-power-to-the-flashchip){#user-content-how-to-supply-power-to-the-flashchip .anchor}How to supply power to the flashchip +### How to supply power to the flashchip There are two ways to supply power to the chip: plugging in an AC adapter (without turning the laptop on), and using the 8th 3.3v pin. @@ -86,12 +82,12 @@ adapter (without turning the laptop on), and using the 8th 3.3v pin. I have found that the SST chips work best with the 8th pin, while the Macronix chips require an AC Adapter to power up. -**Never connect both the 8th pin and the AC adapter at the same time.** +*Never connect both the 8th pin and the AC adapter at the same time.* Your results may vary. -[](#reading-the-flashchip){#user-content-reading-the-flashchip .anchor}Reading the Flashchip --------------------------------------------------------------------------------------------- +Reading the Flashchip +---------------------- First, visually inspect (with a magnifying glass) the type of flashchip on the motherboard. @@ -99,7 +95,7 @@ on the motherboard. Next, download and compile the latest Flashrom source code on the Raspberry Pi. - sudo apt-get install build-essential pciutils usbutils libpci-dev libusb-dev libftdi1 libftdi-dev zlib1g-dev subversion + sudo apt-get install build-essential pciutils usbutils libpci-dev libusb-dev libftdi1 libftdi-dev zlib1g-dev subversion libusb-1.0-0-dev svn co svn://flashrom.org/flashrom/trunk flashrom cd flashrom make @@ -127,11 +123,11 @@ If the md5sums match after three tries, `flashrom` has managed to read the flashchip precisely (but not always accurately). You may try and flash Libreboot now. -[](#flashing-libreboot){#user-content-flashing-libreboot .anchor}Flashing Libreboot ------------------------------------------------------------------------------------ +Flashing Libreboot +------------------- -> **Note:** replace `/path/to/libreboot.rom` with the location of your -> chosen ROM, such as `../bin/x60/libreboot_usqwerty.rom`): +Note: replace `/path/to/libreboot.rom` with the location of your chosen ROM, +such as `../bin/x60/libreboot_usqwerty.rom`): If your chip is an SST, run this command: @@ -148,14 +144,14 @@ successfully. If not, just flash again. Erasing and writing flash chip... Erase/write done. Verifying flash... VERIFIED. -### [](#sources){#user-content-sources .anchor}Sources +### Sources - [Scruss - Simple ADC with the Raspberry Pi](http://scruss.com/blog/2013/02/02/simple-adc-with-the-raspberry-pi/) - [Flashing coreboot on a T60 with a Raspberry Pi - the\_unconventional's blog](https://blogs.fsfe.org/the_unconventional/2015/05/08/flashing-coreboot-on-a-t60-with-a-raspberry-pi/) -- **Pomona SOIC Clip flashing** +- *Pomona SOIC Clip flashing* - [Arch Linux Wiki - Installing Arch Linux on Chromebook](https://wiki.archlinux.org/index.php/Chromebook) - [Google Drive - Raspberry Pi SOIC Clip @@ -163,7 +159,7 @@ successfully. If not, just flash again. - [rPI with Flashrom and SOIC Clip Powerpoint](http://satxhackers.org/wp/hack-content/uploads/2013/04/rPI_flashrom.pdf) -### [](#raspberry-pi-pinout-diagrams){#user-content-raspberry-pi-pinout-diagrams .anchor}Raspberry Pi Pinout Diagrams +### Raspberry Pi Pinout Diagrams MCP 3008 Pin Pi GPIO Pin \# Pi Pin Name ----- ---------- ---------------- -------------------- @@ -179,10 +175,10 @@ successfully. If not, just flash again. - Source: [Perl & Raspberry Pi - Raspberry Pi GPIO Pinout](http://raspberrypi.znix.com/hipidocs/topic_gpiopins.htm) -[](#raspberry-pi-thinkpad-x200){#user-content-raspberry-pi-thinkpad-x200 .anchor}Raspberry Pi (ThinkPad X200) -------------------------------------------------------------------------------------------------------------- +Raspberry Pi (ThinkPad X200) +----------------------------- -### [](#requirements){#user-content-requirements .anchor}Requirements: +### Requirements: - An x86, x86\_64, or arm7l (for changing the libreboot.rom image mac address) @@ -196,16 +192,12 @@ Follow the [ThinkPad X200: Initial installation guide](x200_external.md) to disassemble the laptop, and access the BIOS rom chip. -> **Note:** `x86#` refers to commands to be run on the x86 computer, and -> `pi#` refers to commands to be run on the pi. A good practice is to -> make a work directory to keep your libreboot stuff inside. +Note: `x86#` refers to commands to be run on the x86 computer, and `pi#` 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.](https://www.raspberrypi.org/downloads/) Torrent download -recommended, and remember to seed. :) - If you're running Raspian, you can do **sudo raspi-config**, enable SPI under Advanced and then spidev will be enabled. Simple, eh? @@ -217,43 +209,9 @@ GPG signature as well. 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/ - -### [](#set-up-noobs-on-raspberry-pi){#user-content-set-up-noobs-on-raspberry-pi .anchor}Set up NOOBS on Raspberry Pi - -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 +Install dependencies: -If they are missing then install them. + pi# sudo apt-get update && sudo apt-get install libftdi1 libftdi-dev libusb-dev libpci-dev subversion libusb-1.0-0-dev pciutils, zlib, libusb, build-essential Download and build flashrom. @@ -309,10 +267,10 @@ text. 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. +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 @@ -353,8 +311,8 @@ done. Shut down your pi, put your box back together, and install a libre OS for great good! -[](#raspberry-pi-c720-chromebook){#user-content-raspberry-pi-c720-chromebook .anchor}Raspberry Pi (C720 Chromebook) -------------------------------------------------------------------------------------------------------------------- +Raspberry Pi (C720 Chromebook) +------------------------------- The Raspberry Pi (a multipurpose \$25 GNU+Linux computer) can be used as a BIOS flashing tool, thanks to its GPIO pins and SPI support. @@ -408,14 +366,14 @@ Finally, put the Pomona SOIC clip on the chip: ![Pomona Clip Connected](images/rpi/0008.jpg) -### [](#flashrom){#user-content-flashrom .anchor}Flashrom +### Flashrom [Once it's all set up, flashrom works out of the box.](http://www.flashrom.org/RaspberryPi) -### [](#sources-1){#user-content-sources-1 .anchor}Sources +### Sources -- **Pomona SOIC Clip flashing** +- *Pomona SOIC Clip flashing* - [Arch Linux Wiki - Installing Arch Linux on Chromebook](https://wiki.archlinux.org/index.php/Chromebook) - [Google Drive - Raspberry Pi SOIC Clip @@ -424,7 +382,7 @@ box.](http://www.flashrom.org/RaspberryPi) Powerpoint](http://satxhackers.org/wp/hack-content/uploads/2013/04/rPI_flashrom.pdf) - [Tnhh - Unbricking Chromebook with Beaglebone](http://www.tnhh.net/2014/08/25/unbricking-chromebook-with-beaglebone.md) -- **Use a DIY DIP System to flash an desoldered BIOS chip** +- *Use a DIY DIP System to flash an desoldered BIOS chip* - [Viktak - How to recover laptop after failed BIOS flash](http://diy.viktak.com/2014/07/how-to-recover-laptop-after-failed-bios.md) - [Win-Raid - Recover from Failed BIOS Flashing using Raspberry |