diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-14 12:59:36 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2009-05-14 12:59:36 +0000 |
commit | bfe2e0cf677ef4609e3eacb337efc669c869f209 (patch) | |
tree | 6bd9710ba48b8b27fd99469669e6cc8925ab7043 /dummyflasher.c | |
parent | d02b73f9e9a717706dc820eca04128958238df37 (diff) | |
download | ast2050-flashrom-bfe2e0cf677ef4609e3eacb337efc669c869f209.zip ast2050-flashrom-bfe2e0cf677ef4609e3eacb337efc669c869f209.tar.gz |
Add a dummy SPI controller driver, similar to the dummy LPC/FWH/Parallel flasher driver
Does not support reading or writing the fake chip yet.
flashrom --programmer dummy
also enables the dummy SPI controller driver.
Testing the dummy SPI driver revealed a RDID debug printing bug in the
SPI core. Fix that as well.
Corresponding to flashrom svn r507.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'dummyflasher.c')
-rw-r--r-- | dummyflasher.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dummyflasher.c b/dummyflasher.c index ba54206..7e671b8 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -31,6 +31,7 @@ int dummy_init(void) { printf_debug("%s\n", __func__); + flashbus = BUS_TYPE_DUMMY_SPI; return 0; } @@ -86,3 +87,23 @@ uint32_t dummy_chip_readl(const volatile void *addr) return 0xffffffff; } +int dummy_spi_command(unsigned int writecnt, unsigned int readcnt, + const unsigned char *writearr, unsigned char *readarr) +{ + int i; + + printf_debug("%s:", __func__); + + printf_debug(" writing %u bytes:", writecnt); + for (i = 0; i < writecnt; i++) + printf_debug(" 0x%02x", writearr[i]); + + printf_debug(" reading %u bytes:", readcnt); + for (i = 0; i < readcnt; i++) { + printf_debug(" 0xff"); + readarr[i] = 0xff; + } + + printf_debug("\n"); + return 0; +} |