[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/25] esp: apply transfer length adjustment when STC is zero at
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 08/25] esp: apply transfer length adjustment when STC is zero at TC load time |
Date: |
Wed, 30 Dec 2020 15:37:28 +0000 |
Perform the length adjustment whereby a value of 0 in the STC represents
a transfer length of 0x10000 at the point where the TC is loaded at the
start of a DMA command rather than just when a TI (Transfer Information)
command is executed. This better matches the description as given in the
datasheet.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/scsi/esp.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index c716a97847..f38b4a2ecd 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -564,9 +564,6 @@ static void handle_ti(ESPState *s)
}
dmalen = esp_get_tc(s);
- if (dmalen == 0) {
- dmalen = 0x10000;
- }
s->dma_counter = dmalen;
if (s->do_cmd) {
@@ -701,7 +698,11 @@ void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t
val)
if (val & CMD_DMA) {
s->dma = 1;
/* Reload DMA counter. */
- esp_set_tc(s, esp_get_stc(s));
+ if (esp_get_stc(s) == 0) {
+ esp_set_tc(s, 0x10000);
+ } else {
+ esp_set_tc(s, esp_get_stc(s));
+ }
} else {
s->dma = 0;
}
--
2.20.1
- [PATCH 00/25] esp: consolidate PDMA transfer buffers, Mark Cave-Ayland, 2020/12/30
- [PATCH 02/25] esp: add trace event when receiving a TI command, Mark Cave-Ayland, 2020/12/30
- [PATCH 01/25] esp: checkpatch fixes, Mark Cave-Ayland, 2020/12/30
- [PATCH 03/25] esp: fix esp_reg_read() trace event, Mark Cave-Ayland, 2020/12/30
- [PATCH 04/25] esp: add PDMA trace events, Mark Cave-Ayland, 2020/12/30
- [PATCH 07/25] esp: introduce esp_get_stc(), Mark Cave-Ayland, 2020/12/30
- [PATCH 05/25] esp: determine transfer direction directly from SCSI phase, Mark Cave-Ayland, 2020/12/30
- [PATCH 06/25] esp: introduce esp_get_tc() and esp_set_tc(), Mark Cave-Ayland, 2020/12/30
- [PATCH 08/25] esp: apply transfer length adjustment when STC is zero at TC load time,
Mark Cave-Ayland <=
- [PATCH 09/25] esp: remove dma_counter from ESPState, Mark Cave-Ayland, 2020/12/30
- [PATCH 10/25] esp: remove dma_left from ESPState, Mark Cave-Ayland, 2020/12/30
- [PATCH 11/25] esp: remove minlen restriction in handle_ti, Mark Cave-Ayland, 2020/12/30
- [PATCH 12/25] esp: introduce esp_pdma_read() and esp_pdma_write() functions, Mark Cave-Ayland, 2020/12/30
- [PATCH 14/25] esp: move pdma_len and TC logic into esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2020/12/30
- [PATCH 13/25] esp: use pdma_origin directly in esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2020/12/30
- [PATCH 16/25] esp: remove redundant pdma_start from ESPState, Mark Cave-Ayland, 2020/12/30
- [PATCH 15/25] esp: accumulate SCSI commands for PDMA transfers in cmdbuf instead of pdma_buf, Mark Cave-Ayland, 2020/12/30
- [PATCH 17/25] esp: move PDMA length adjustments into esp_pdma_read()/esp_pdma_write(), Mark Cave-Ayland, 2020/12/30
- [PATCH 18/25] esp: use ti_wptr/ti_rptr to manage the current FIFO position for PDMA, Mark Cave-Ayland, 2020/12/30