@@ -213,6 +213,30 @@ bool CologneChip::dumpFlash(uint32_t base_addr, uint32_t len)
213213 return post_flash_access ();
214214}
215215
216+ /* *
217+ * Set QE bit, if available. Works in both SPI and JTAG-SPI-bypass mode.
218+ */
219+ bool CologneChip::set_quad_bit (bool set_quad)
220+ {
221+ if (!SPIInterface::set_quad_bit (set_quad)) {
222+ return false ;
223+ }
224+
225+ return true ;
226+ }
227+
228+ /* *
229+ * Peform bulk erase. Works in both SPI and JTAG-SPI-bypass mode.
230+ */
231+ bool CologneChip::bulk_erase_flash ()
232+ {
233+ if (!SPIInterface::bulk_erase_flash ()) {
234+ return false ;
235+ }
236+
237+ return true ;
238+ }
239+
216240/* *
217241 * Parse bitstream from *.bit or *.cfg and program FPGA in SPI or JTAG mode
218242 * or write configuration to external flash via SPI or JTAG-SPI-bypass.
@@ -450,15 +474,10 @@ int CologneChip::spi_wait(uint8_t cmd, uint8_t mask, uint8_t cond,
450474 _jtag->read_write (&tx, NULL , 8 , 0 );
451475
452476 do {
453- if (count == 0 ) {
454- _jtag->read_write (dummy, rx, 16 , 0 );
455- uint8_t b0 = ConfigBitstreamParser::reverseByte (rx[0 ]);
456- uint8_t b1 = ConfigBitstreamParser::reverseByte (rx[1 ]);
457- tmp = (b0 << 1 ) | ((b1 >> 7 ) & 0x01 );
458- } else {
459- _jtag->read_write (dummy, rx, 8 , 0 );
460- tmp = ConfigBitstreamParser::reverseByte (rx[0 ]);
461- }
477+ _jtag->read_write (dummy, rx, 16 , 0 );
478+ uint8_t b0 = ConfigBitstreamParser::reverseByte (rx[0 ]);
479+ uint8_t b1 = ConfigBitstreamParser::reverseByte (rx[1 ]);
480+ tmp = (b0 << 1 ) | ((b1 >> 7 ) & 0x01 );
462481
463482 count++;
464483 if (count == timeout) {
0 commit comments