From 654edb0243410959ecd504795312bd665474dcfc Mon Sep 17 00:00:00 2001 From: hailfinger Date: Fri, 15 Jun 2012 22:28:12 +0000 Subject: Let the programmer driver decide how to do AAI transfers Currently spi_aai_write() is implemented without an abstraction mechanism for the programmer driver. This adds another function pointer 'write_aai' to struct spi_programmer, which is set to default_spi_write_aai (renamed spi_aai_write) for all programmers for now. A patch which utilises this abstraction in the dediprog driver will follow. Signed-off-by: Nico Huber Acked-by: Carl-Daniel Hailfinger git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1543 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- spi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'spi.c') diff --git a/spi.c b/spi.c index b2d3eb0..62e1430 100644 --- a/spi.c +++ b/spi.c @@ -161,11 +161,17 @@ uint32_t spi_get_valid_read_addr(struct flashctx *flash) } } +int spi_aai_write(struct flashctx *flash, uint8_t *buf, + unsigned int start, unsigned int len) +{ + return flash->pgm->spi.write_aai(flash, buf, start, len); +} + int register_spi_programmer(const struct spi_programmer *pgm) { struct registered_programmer rpgm; - if (!pgm->write_256 || !pgm->read || !pgm->command || + if (!pgm->write_aai || !pgm->write_256 || !pgm->read || !pgm->command || !pgm->multicommand || ((pgm->command == default_spi_send_command) && (pgm->multicommand == default_spi_send_multicommand))) { -- cgit v1.2.1