[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 62/88] esp.c: zero command register when TI command terminates du
|
From: |
Mark Cave-Ayland |
|
Subject: |
[PATCH 62/88] esp.c: zero command register when TI command terminates due to phase change |
|
Date: |
Fri, 12 Jan 2024 12:53:54 +0000 |
This is the behaviour documented in the datasheet and allows the state machine
to correctly process multiple consecutive TI commands.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/scsi/esp.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 4c1ca63a57..ccb8ad4bae 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -519,6 +519,7 @@ static void esp_do_dma(ESPState *s)
/* ATN remains asserted until TC == 0 */
if (esp_get_tc(s) == 0) {
esp_set_phase(s, STAT_CD);
+ s->rregs[ESP_CMD] = 0;
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
@@ -717,6 +718,7 @@ static void esp_do_nodma(ESPState *s)
*/
s->cmdfifo_cdb_offset = fifo8_num_used(&s->cmdfifo);
esp_set_phase(s, STAT_CD);
+ s->rregs[ESP_CMD] = 0;
s->rregs[ESP_RSEQ] = SEQ_CD;
s->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(s);
@@ -831,6 +833,11 @@ void esp_command_complete(SCSIRequest *req, size_t resid)
*/
s->rregs[ESP_RINTR] |= INTR_BS | INTR_FC;
break;
+
+ case CMD_TI | CMD_DMA:
+ case CMD_TI:
+ s->rregs[ESP_CMD] = 0;
+ break;
}
/* Raise bus service interrupt to indicate change to STATUS phase */
@@ -885,6 +892,7 @@ void esp_transfer_data(SCSIRequest *req, uint32_t len)
* Bus service interrupt raised because of initial change to
* DATA phase
*/
+ s->rregs[ESP_CMD] = 0;
s->rregs[ESP_RINTR] |= INTR_BS;
break;
}
--
2.39.2
- [PATCH 51/88] esp.c: don't use get_cmd() for CMD_SEL DMA commands, (continued)
- [PATCH 51/88] esp.c: don't use get_cmd() for CMD_SEL DMA commands, Mark Cave-Ayland, 2024/01/12
- [PATCH 65/88] esp.c: move non-DMA TI logic to separate esp_nodma_ti_dataout() function, Mark Cave-Ayland, 2024/01/12
- [PATCH 78/88] esp.c: consolidate DMA and PDMA logic in DATA OUT phase, Mark Cave-Ayland, 2024/01/12
- [PATCH 59/88] esp.c: separate logic based upon ESP command in esp_transfer_data(), Mark Cave-Ayland, 2024/01/12
- [PATCH 73/88] esp.c: remove restriction on FIFO read access when DMA memory routines defined, Mark Cave-Ayland, 2024/01/12
- [PATCH 84/88] esp.c: implement DMA Transfer Pad command for DATA phases, Mark Cave-Ayland, 2024/01/12
- [PATCH 53/88] esp.c: replace do_dma_pdma_cb() with esp_do_dma(), Mark Cave-Ayland, 2024/01/12
- [PATCH 58/88] esp.c: separate logic based upon ESP command in esp_command_complete(), Mark Cave-Ayland, 2024/01/12
- [PATCH 61/88] esp.c: remove DATA IN phase logic when reading from FIFO, Mark Cave-Ayland, 2024/01/12
- [PATCH 77/88] esp.c: only transfer non-DMA MESSAGE OUT phase data for specific commands, Mark Cave-Ayland, 2024/01/12
- [PATCH 62/88] esp.c: zero command register when TI command terminates due to phase change,
Mark Cave-Ayland <=
- [PATCH 63/88] esp.c: remove unneeded ti_cmd field, Mark Cave-Ayland, 2024/01/12
- [PATCH 82/88] esp.c: consolidate DMA and PDMA logic in STATUS and MESSAGE IN phases, Mark Cave-Ayland, 2024/01/12
- [PATCH 69/88] esp.c: consolidate end of command sequence after ICCS command, Mark Cave-Ayland, 2024/01/12
- [PATCH 52/88] esp.c: move CMD_SELATNS end of command logic to esp_do_dma() and do_dma_pdma_cb(), Mark Cave-Ayland, 2024/01/12
- [PATCH 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma(), Mark Cave-Ayland, 2024/01/12
- [PATCH 86/88] esp.c: keep track of the DRQ state during DMA, Mark Cave-Ayland, 2024/01/12
- [PATCH 88/88] esp.c: add my copyright to the file, Mark Cave-Ayland, 2024/01/12
- [PATCH 60/88] esp.c: use deferred interrupts for both DATA IN and DATA OUT phases, Mark Cave-Ayland, 2024/01/12
- [PATCH 85/88] esp.c: rename irq_data IRQ to drq_irq, Mark Cave-Ayland, 2024/01/12
- [PATCH 83/88] esp.c: replace n variable with len in esp_do_nodma(), Mark Cave-Ayland, 2024/01/12