dummyflasher.c: Upstream ChromiumOS 'freq' param feature

This allows the dummyflasher to emulate a bus/chip frequency
by passing a delay parameter.

TEST=builds and ran with freq passed,
   └──╼ dd if=/dev/urandom of=/tmp/bar bs=2K count=1
   1+0 records in
   1+0 records out
   2048 bytes (2.0 kB, 2.0 KiB) copied, 0.000583308 s, 3.5 MB/s

   └──╼ ./flashrom -p dummy:image=/tmp/foo,bus=spi,freq=100Hz,size=2048,emulate=VARIABLE_SIZE -w /tmp/bar
   flashrom v1.2-105-g702c58a-dirty on Linux 5.7.10-1rodete2-amd64 (x86_64)
   flashrom is free software, get the source code at https://flashrom.org

   Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
   Found Generic flash chip "Variable Size SPI chip" (2 kB, SPI) on dummy.
   Reading old flash chip contents... done.
   Erasing and writing flash chip... Erase/write done.
   Verifying flash... VERIFIED.

Change-Id: I1c2702b9e0cae860f5f03114e307707d4d3219af
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/45461
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
1 file changed