spi_master: Introduce SPI_MASTER_4BA feature flag
Backport upstream `commit 1cf407b4f8`.
Add a feature flag SPI_MASTER_4BA to `struct spi_master` that advertises
programmer-side support for 4-byte addresses in generic commands (and
read/write commands if the master uses the default implementations). Set
it for all masters that handle commands address-agnostic.
Don't prefer native 4BA instructions if the master doesn't support them.
BUG=chromium:478356
BRANCH=none
TEST=still builds
Change-Id: I3ee46ae7502e2f0d986a2f101a1e7135fb5c54df
Signed-off-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/1710339
Reviewed-by: Sam McNally <sammc@chromium.org>
diff --git a/serprog.c b/serprog.c
index a37288c..a8352a8 100644
--- a/serprog.c
+++ b/serprog.c
@@ -281,6 +281,7 @@
unsigned int start, unsigned int len);
static struct spi_master spi_master_serprog = {
.type = SPI_CONTROLLER_SERPROG,
+ .features = SPI_MASTER_4BA,
.max_data_read = MAX_DATA_READ_UNLIMITED,
.max_data_write = MAX_DATA_WRITE_UNLIMITED,
.command = serprog_spi_send_command,