programmer: Add bitbanging programmer driver for Linux libgpiod
With this driver, any single board computer, old smartphone, etc. with
a few spare GPIOs can be used for flashrom.
Tested by reading of a 2048 kB flash chip on a Qualcomm MSM8916 SoC
@800 MHz, ran the following command:
time flashrom -p linux_gpiod:gpiochip=0,cs=18,sck=19,mosi=13,miso=56 -r test.bin
This command uses /dev/gpiochip0 with the specified GPIO numbers for the
SPI lines. All arguments are mandatory.
Output:
[...]
Found GigaDevice flash chip "GD25LQ16" (2048 kB, SPI) on linux_gpiod.
[...]
real 1m 33.96s
Change-Id: Icad3eb7764f28feaea51bda3a7893da724c86d06
Signed-off-by: Steve Markgraf <steve@steve-m.de>
Signed-off-by: Nico Huber <nico.h@gmx.de>
diff --git a/Documentation/building_meson.md b/Documentation/building_meson.md
index 21d400e..74dc65b 100644
--- a/Documentation/building_meson.md
+++ b/Documentation/building_meson.md
@@ -11,6 +11,7 @@
* libusb1 >=1.0.9 ***
* libftdi1 ***
* libjaylink ***
+ * libgpiod (Linux only) ***
\* Compile time dependency
\*** Runtime / Programmer specific
@@ -46,14 +47,14 @@
```
apt-get install -y gcc meson ninja-build pkg-config \
linux-headers-generic libpci-dev libusb-1.0-0-dev libftdi1-dev \
- libjaylink-dev
+ libjaylink-dev libgpiod-dev
```
### ArchLinux / Manjaro
* __libjaylink__ is not available through the package manager
```
pacman -S --noconfirm gcc meson ninja pkg-config \
- pciutils libusb libftdi
+ pciutils libusb libftdi libgpiod
```
### NixOS / Nixpkgs
@@ -62,20 +63,20 @@
```
or
```
-nix-shell -p meson ninja pkg-config pciutils libusb1 libftdi1 libjaylink
+nix-shell -p meson ninja pkg-config pciutils libusb1 libftdi1 libjaylink libgpiod
```
### OpenSUSE
```
zypper install -y gcc meson ninja pkg-config \
pciutils-devel libusb-1_0-devel libftdi1-devel \
- libjaylink-devel
+ libjaylink-devel libgpiod-devel
```
### Alpine
```
apk add build-base meson ninja pkgconf pciutils-dev libusb-dev \
- libftdi1-dev libjaylink-dev linux-headers
+ libftdi1-dev libjaylink-dev linux-headers libgpiod-dev
```
### Freebsd / DragonFly BSD