Skip to content

Commit

Permalink
esp.c: consolidate end of command sequence after ICCS command
Browse files Browse the repository at this point in the history
The end of command sequences for the ICCS command are currently different
between the DMA and non-DMA versions, and also different from the description
in the datasheet.

Update the sequence so that only INTR_FC is asserted in both cases, and keep
all the logic in esp_do_dma() and esp_do_nodma() rather than having some of
it within esp_run_cmd().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240112125420.514425-70-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
mcayland committed Feb 13, 2024
1 parent 83428f7 commit 0ee71db
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hw/scsi/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,7 @@ static void esp_do_dma(ESPState *s)
}

/* Raise end of command interrupt */
s->rregs[ESP_RINTR] |= INTR_BS | INTR_FC;
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_FC;
esp_raise_irq(s);
}
break;
Expand Down Expand Up @@ -825,6 +824,8 @@ static void esp_do_nodma(ESPState *s)
case CMD_ICCS:
fifo8_push(&s->fifo, 0);

/* Raise end of command interrupt */
s->rregs[ESP_RINTR] |= INTR_FC;
esp_raise_irq(s);
break;
}
Expand Down Expand Up @@ -1056,8 +1057,6 @@ static void esp_run_cmd(ESPState *s)
case CMD_ICCS:
trace_esp_mem_writeb_cmd_iccs(cmd);
write_response(s);
s->rregs[ESP_RINTR] |= INTR_FC;
esp_set_phase(s, STAT_MI);
break;
case CMD_MSGACC:
trace_esp_mem_writeb_cmd_msgacc(cmd);
Expand Down

0 comments on commit 0ee71db

Please sign in to comment.