1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

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>
This commit is contained in:
Urja Rannikko
2011-09-15 23:38:14 +00:00
committed by Stefan Tauner
parent f74a7b9c4f
commit c93f5f1232
3 changed files with 207 additions and 74 deletions

View File

@ -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 */