summaryrefslogtreecommitdiffstats
path: root/programmer.h
diff options
context:
space:
mode:
authorUrja Rannikko <urjaman@gmail.com>2011-09-15 23:38:14 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2011-09-15 23:38:14 +0000
commitc93f5f123239121fdeba03c02f9e448ed97c52a4 (patch)
tree977910ff6ca9a2f736a5fc5103cab30663912582 /programmer.h
parentf74a7b9c4f43445c8116533b1593ecef4459b114 (diff)
downloadast2050-flashrom-c93f5f123239121fdeba03c02f9e448ed97c52a4.zip
ast2050-flashrom-c93f5f123239121fdeba03c02f9e448ed97c52a4.tar.gz
serprog: add SPI support
Adds a new opcode (0x13) that just relays SPI bytes and wires it up to be usable within serprog.c. Checks for mandatory opcodes are moved around and changed a bit, but non-SPI programmers should not be harmed by this patch. Corresponding to flashrom svn r1442. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'programmer.h')
-rw-r--r--programmer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/programmer.h b/programmer.h
index 1283909..73b94c1 100644
--- a/programmer.h
+++ b/programmer.h
@@ -545,6 +545,9 @@ enum spi_controller {
#if CONFIG_LINUX_SPI == 1
SPI_CONTROLLER_LINUX,
#endif
+#if CONFIG_SERPROG == 1
+ SPI_CONTROLLER_SERPROG,
+#endif
};
extern const int spi_programmer_count;
@@ -605,6 +608,9 @@ void serprog_chip_writeb(uint8_t val, chipaddr addr);
uint8_t serprog_chip_readb(const chipaddr addr);
void serprog_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
void serprog_delay(int delay);
+int serprog_spi_send_command(unsigned int writecnt, unsigned int readcnt,
+ const unsigned char *writearr, unsigned char *readarr);
+int serprog_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len);
#endif
/* serial.c */
OpenPOWER on IntegriCloud