Skip to content

Commit

Permalink
hdd: use QSPI on Minimig for CDROM data transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
gyurco committed Jun 15, 2024
1 parent cef4886 commit 494f448
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions hdd.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,26 @@ static void WritePacket(unsigned char unit, const unsigned char *buf, unsigned s
while (!(GetFPGAStatus() & CMD_IDECMD)); // wait for empty sector buffer
WriteTaskFile(0, 0x02, 0, bytes & 0xff, (bytes>>8) & 0xff, 0xa0 | ((unit & 0x01)<<4));
if (bytes) {
EnableFpga();
SPI(CMD_IDE_DATA_WR); // write data command
SPI(0x00);
SPI(0x00);
SPI(0x00);
SPI(0x00);
SPI(0x00);
spi_write(buf, bytes);
DisableFpga();
#ifdef HAVE_QSPI
if(minimig_v2()) {
qspi_start_write();
qspi_write_block(buf, bytes);
qspi_end();
} else {
#else
EnableFpga();
SPI(CMD_IDE_DATA_WR); // write data command
SPI(0x00);
SPI(0x00);
SPI(0x00);
SPI(0x00);
SPI(0x00);
spi_write(buf, bytes);
DisableFpga();
#endif
#ifdef HAVE_QSPI
}
#endif
}
buf += bytes;
bufsize -= bytes;
Expand Down

0 comments on commit 494f448

Please sign in to comment.