From edcea80d68e0f029b79bc273ba622dc4a3e6cb2b Mon Sep 17 00:00:00 2001 From: Aarya Chaumal Date: Mon, 4 Jul 2022 18:21:50 +0530 Subject: spi: Add function to probe erase command opcode for all spi_master Add a field, probe_opcode, to struct spi_master which points to a function returning a bool by checking if a given command is supported by the programmer in use. This is used for getting a whitelist of commands supported by the programmer, as some programmers like ichspi don't support all opcodes. Most programmers use the default function, which just returns true. ICHSPI and dummyflasher use their specialized function. Change-Id: I6852ef92788221f471a859c879f8aff42558d36d Signed-off-by: Aarya Chaumal Reviewed-on: https://review.coreboot.org/c/flashrom/+/65183 Reviewed-by: Thomas Heijligen Reviewed-by: Anastasia Klimchuk Reviewed-by: Nico Huber Reviewed-by: Felix Singer Tested-by: build bot (Jenkins) --- ni845x_spi.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ni845x_spi.c') diff --git a/ni845x_spi.c b/ni845x_spi.c index 30ef61c0e..14bebce8f 100644 --- a/ni845x_spi.c +++ b/ni845x_spi.c @@ -537,6 +537,7 @@ static const struct spi_master spi_programmer_ni845x = { .write_256 = default_spi_write_256, .write_aai = default_spi_write_aai, .shutdown = ni845x_spi_shutdown, + .probe_opcode = default_spi_probe_opcode, }; static int ni845x_spi_init(void) -- cgit v1.2.3