From 0cf0bab887ac2b126c14d1159531c38be7b55655 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Thu, 6 Feb 2020 15:19:43 -0700 Subject: [PATCH 1/3] scripts: Add spipi.sh from the private repo --- scripts/spipi.sh | 1 + 1 file changed, 1 insertion(+) create mode 100755 scripts/spipi.sh diff --git a/scripts/spipi.sh b/scripts/spipi.sh new file mode 100755 index 0000000..2e6ead4 --- /dev/null +++ b/scripts/spipi.sh @@ -0,0 +1 @@ +sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=24000 "$@" From 672648dcf0a997f5daed34a539da17dbbdda2c4f Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Thu, 6 Feb 2020 15:31:21 -0700 Subject: [PATCH 2/3] scripts: Update spipi.sh path to use this repo --- scripts/_spipi.sh | 2 +- scripts/spipi-dump.sh | 2 +- scripts/spipi-erase.sh | 2 +- scripts/spipi-flash.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_spipi.sh b/scripts/_spipi.sh index 8792cfc..c6a2585 100644 --- a/scripts/_spipi.sh +++ b/scripts/_spipi.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SPIPI="ubuntu@10.17.89.179" +SPIPI=${SPIPI:-"ubuntu@10.17.89.179"} if [ ! -d "models/${MODEL}" ] then diff --git a/scripts/spipi-dump.sh b/scripts/spipi-dump.sh index db99993..a90c642 100755 --- a/scripts/spipi-dump.sh +++ b/scripts/spipi-dump.sh @@ -13,7 +13,7 @@ source scripts/_spipi.sh ssh -T "${SPIPI}" < Date: Thu, 6 Feb 2020 15:42:01 -0700 Subject: [PATCH 3/3] readme: Add more information for flashing Document the steps needed to create a SPI Pi and to flash the ROM. --- README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- README.md.in | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ac07c64..310c57f 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,57 @@ source ~/.cargo/env ./scripts/qemu.sh ``` -### Flashing firmware manually is not recommended for the normal user. For the advanced user, there is a script flash.sh which takes the same arguments as build.sh +## Flashing + +**Flashing firmware manually is *not* recommended for the normal user!** + +### Internal programmer + +Use this method for flashing a system already running System76 Open Firmware. + +``` +./scripts/flash.sh +``` + +### External programmer + +Use this method for first-time flashing or flashing a bricked system. + +#### Creating a SPI Pi + +SPI Pi is a Raspberry Pi used to flash the SPI ROM. To create a SPI Pi: + +- Get a Raspberry Pi 2 or 3 with Ubuntu 16.04 +- Hook up a SPI clip to the SPI Pi + - The SPI Pi's SPI pinout can be found here: https://pinout.xyz/pinout/spi# + - The pinout of a SPI rom can be found here: https://www.totalphase.com/media/wysiwyg/soic8-pinout.png + - If you need more instructions, you should not be hooking up the SPI clip +- Connect the SPI Pi's SPI clip to the SPI ROM, ensuring pin 1 of the clip aligns with pin 1 on the ROM +- On the SPI Pi, run the following commands: + +``` +sudo apt install flashrom +git clone https://github.com/system76/firmware-open.git firmware +``` + +#### Flashing with a SPI Pi + +1. Turn off the computer +2. Remove the bottom panel +3. Attach the clip to the SPI ROM chip +4. Connect to the Raspberry Pi and wait it for boot +``` +sudo tio -b 115200 /dev/ttyUSB0 +``` +5. From the RPi session, test that the chip is detected. +``` +cd firmware +./scripts/spipi.sh -r backup.rom +``` +6. From the host, flash the firmware +``` +SPIPI= ./scripts/spipi-flash.sh +``` ## Contents diff --git a/README.md.in b/README.md.in index 9932236..e483c78 100644 --- a/README.md.in +++ b/README.md.in @@ -28,4 +28,54 @@ source ~/.cargo/env ./scripts/qemu.sh ``` -### Flashing firmware manually is not recommended for the normal user. For the advanced user, there is a script flash.sh which takes the same arguments as build.sh +## Flashing + +**Flashing firmware manually is *not* recommended for the normal user!** + +### Internal programmer + +Use this method for flashing a system already running System76 Open Firmware. + +``` +./scripts/flash.sh +``` + +### External programmer + +Use this method for first-time flashing or flashing a bricked system. + +#### Creating a SPI Pi + +SPI Pi is a Raspberry Pi used to flash the SPI ROM. To create a SPI Pi: + +- Get a Raspberry Pi 2 or 3 with Ubuntu 16.04 +- Hook up a SPI clip to the SPI Pi + - The SPI Pi's SPI pinout can be found here: https://pinout.xyz/pinout/spi# + - The pinout of a SPI rom can be found here: https://www.totalphase.com/media/wysiwyg/soic8-pinout.png + - If you need more instructions, you should not be hooking up the SPI clip +- Connect the SPI Pi's SPI clip to the SPI ROM, ensuring pin 1 of the clip aligns with pin 1 on the ROM +- On the SPI Pi, run the following commands: + +``` +sudo apt install flashrom +git clone https://github.com/system76/firmware-open.git firmware +``` + +#### Flashing with a SPI Pi + +1. Turn off the computer +2. Remove the bottom panel +3. Attach the clip to the SPI ROM chip +4. Connect to the Raspberry Pi and wait it for boot +``` +sudo tio -b 115200 /dev/ttyUSB0 +``` +5. From the RPi session, test that the chip is detected. +``` +cd firmware +./scripts/spipi.sh -r backup.rom +``` +6. From the host, flash the firmware +``` +SPIPI= ./scripts/spipi-flash.sh +```