From 61151b46183d5731391b495fec25ad7676ab665d Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 26 Feb 2019 13:01:04 +0800 Subject: [PATCH] fomu-flash: add debug hack to fix ice40 stuff This will write data to a file, rather than to SPI. Signed-off-by: Sean Cross --- fomu-flash.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fomu-flash.c b/fomu-flash.c index 718036c..ce3d81a 100755 --- a/fomu-flash.c +++ b/fomu-flash.c @@ -25,6 +25,8 @@ static unsigned int F_RESET = 27; #define F_DONE 17 +#define DEBUG_ICE40_PATCH + static int spi_irw_readb(void *data) { return spiRx(data); } @@ -516,7 +518,11 @@ offset, file_src[offset], spi_src[offset]); perror("unable to open fpga bitstream"); break; } +#ifdef DEBUG_ICE40_PATCH + IRW_FILE *spidev = irw_open("foboot-patched-broken.bin", "w"); +#else IRW_FILE *spidev = irw_open_fake(spi, spi_irw_readb, spi_irw_writeb); +#endif ice40_patch(bitstream, replacement_rom, spidev, 8192); } else {