DataHoarder
c0d6478623
All checks were successful
continuous-integration/drone/push Build is passing
Moved FM10K SPI functions to its own files Added register of known devices New tool: fm10k-flash Added COPYING file Moved code under src/ Add functions to enable/disable sector protection on flash Add CS release and sleep to finish write(?) Co-authored-by: WeebDataHoarder <57538841+weebdatahoarder@users.noreply.github.com> Reviewed-on: #1 Co-Authored-By: DataHoarder <weebdatahoarder@noreply.gammaspectra.live> Co-Committed-By: DataHoarder <weebdatahoarder@noreply.gammaspectra.live> |
||
---|---|---|
src | ||
.drone.yml | ||
.gitignore | ||
COPYING | ||
Makefile | ||
README.md |
fm10k-dump & fm10k-flash
Utility that allows dumping/flashing the SPI Flash Non-Volatile Memory of the FM10000 family of cards.
Requirements
- GCC >= 4.4.0 or clang
- make
- fm10k kernel module compiled with UIO.
# cd src && make clean && make -j $(nproc) CONFIG_UIO=1 && make install CONFIG_UIO=1
# rmmod fm10k && modprobe uio && modprobe fm10k
- If this works an UIO device (
/dev/uio0
) will exist. If not, check your bifurcation settings and/or whether the slot supports 16x PCIe 3.0
Compilation
$ make clean && make
- You can specify whether to use gcc or clang this way:
$ make CC=gcc
/$ make CC=clang
- Two executables named
./fm10k-dump
and./fm10k-flash
should now exist.
fm10k-dump usage example
- If the chip on the card is known to the tool, it'll set the image size to match. Alternatively it will use the platform minimum of 8Mbit.
# ./fm10k-dump /dev/uio0 outputImage.bin
- You can also force the image/chip size:
# ./fm10k-dump /dev/uio0 outputImage.bin 32
fm10k-flash usage example
- fm10k-flash requires a backup of the existing image before flashing a new one, for safety measures. Use fm10k-dump to take a backup copy of the current state before flashing.
# ./fm10k-dump /dev/uio0 backupImage.bin
# ./fm10k-flash /dev/uio0 inputImage.bin backupImage.bin
License
- BSD-3-Clause
- See COPYING for the full license.