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>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/73290
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/util/manibuilder/Dockerfile.alpine b/util/manibuilder/Dockerfile.alpine
index 58d89c8..7f738e1 100644
--- a/util/manibuilder/Dockerfile.alpine
+++ b/util/manibuilder/Dockerfile.alpine
@@ -8,6 +8,8 @@
apk add ca-certificates build-base linux-headers git ccache \
pciutils-dev libusb-compat-dev libusb-dev
+RUN apk add libgpiod-dev || true
+
# fix weird permissions in armhf-v3.11
RUN [ -d /usr/share/git-core/templates ] && \
chmod -R a+r /usr/share/git-core/templates
diff --git a/util/manibuilder/Dockerfile.debian-debootstrap b/util/manibuilder/Dockerfile.debian-debootstrap
index e363fd2..3f5f0cb 100644
--- a/util/manibuilder/Dockerfile.debian-debootstrap
+++ b/util/manibuilder/Dockerfile.debian-debootstrap
@@ -6,7 +6,7 @@
apt-get -qq upgrade && \
apt-get -qqy install gcc make git doxygen ccache pkg-config \
libpci-dev libusb-dev libftdi-dev libusb-1.0-0-dev && \
- { apt-get -qqy install libjaylink-dev || true; } && \
+ { apt-get -qqy install libjaylink-dev libgpiod-dev || true; } && \
apt-get clean
ENV GIT_SSL_NO_VERIFY=1
diff --git a/util/manibuilder/Dockerfile.fedora b/util/manibuilder/Dockerfile.fedora
index 8a22fa8..179c45f 100644
--- a/util/manibuilder/Dockerfile.fedora
+++ b/util/manibuilder/Dockerfile.fedora
@@ -5,6 +5,7 @@
dnf install -q -y ca-certificates git gcc ccache make systemd-devel \
pciutils-devel libusb-devel libusbx-devel libftdi-devel \
libjaylink-devel && \
+ { dnf install -q -y libgpiod-devel || true; } && \
dnf clean -q -y all
ENV GIT_SSL_NO_VERIFY=1
diff --git a/util/manibuilder/Dockerfile.ubuntu-debootstrap b/util/manibuilder/Dockerfile.ubuntu-debootstrap
index f1088c5..c30a672 100644
--- a/util/manibuilder/Dockerfile.ubuntu-debootstrap
+++ b/util/manibuilder/Dockerfile.ubuntu-debootstrap
@@ -19,7 +19,7 @@
apt-get -qq upgrade && \
apt-get -qqy install gcc make git doxygen ccache pkg-config \
libpci-dev libusb-dev libftdi-dev libusb-1.0-0-dev && \
- { apt-get -qqy install libjaylink-dev || true; } && \
+ { apt-get -qqy install libjaylink-dev libgpiod-dev || true; } && \
apt-get clean
ENV GIT_SSL_NO_VERIFY=1