mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +02:00
Add SPI chip read support to the dummy flasher
This allows using the dummy flasher for SPI read debugging. Corresponding to flashrom svn r1053. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Sean Nelson <audiohacked@gmail.com>
This commit is contained in:
parent
9c62d11d55
commit
1b0ba89352
@ -23,6 +23,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "flash.h"
|
#include "flash.h"
|
||||||
|
#include "chipdrivers.h"
|
||||||
|
|
||||||
int dummy_init(void)
|
int dummy_init(void)
|
||||||
{
|
{
|
||||||
@ -157,3 +158,10 @@ int dummy_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
|||||||
msg_pspew("\n");
|
msg_pspew("\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dummy_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len)
|
||||||
|
{
|
||||||
|
/* Maximum read length is unlimited, use 64kB. */
|
||||||
|
return spi_read_chunked(flash, buf, start, len, 64 * 1024);
|
||||||
|
}
|
||||||
|
|
||||||
|
1
flash.h
1
flash.h
@ -454,6 +454,7 @@ uint32_t dummy_chip_readl(const chipaddr addr);
|
|||||||
void dummy_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
|
void dummy_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
|
||||||
int dummy_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
int dummy_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
||||||
const unsigned char *writearr, unsigned char *readarr);
|
const unsigned char *writearr, unsigned char *readarr);
|
||||||
|
int dummy_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* nic3com.c */
|
/* nic3com.c */
|
||||||
|
2
spi.c
2
spi.c
@ -99,7 +99,7 @@ const struct spi_programmer spi_programmer[] = {
|
|||||||
{ /* SPI_CONTROLLER_DUMMY */
|
{ /* SPI_CONTROLLER_DUMMY */
|
||||||
.command = dummy_spi_send_command,
|
.command = dummy_spi_send_command,
|
||||||
.multicommand = default_spi_send_multicommand,
|
.multicommand = default_spi_send_multicommand,
|
||||||
.read = NULL,
|
.read = dummy_spi_read,
|
||||||
.write_256 = NULL,
|
.write_256 = NULL,
|
||||||
},
|
},
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user