[PULL 14/88] esp.c: introduce esp_set_phase() helper function

2024-02-13 Thread Mark Cave-Ayland
This function is used to set the current SCSI bus phase in the ESP_RSTAT register without affecting any of flag bits. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-15-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mar

[PULL 40/88] esp.c: convert esp_do_nodma() to switch statement based upon SCSI phase

2024-02-13 Thread Mark Cave-Ayland
Currently only the DATA IN and DATA OUT phases are supported. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-41-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 27/88] esp.c: update end of transfer logic at the end of esp_transfer_data()

2024-02-13 Thread Mark Cave-Ayland
Since esp_dma_done() is called in both cases, and ti_size cannot be zero (otherwise esp_command_complete() would have been called instead), replace the conditional logic with a single call to esp_dma_done(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message

[PULL 18/88] esp.c: don't clear RFLAGS register when DMA is complete

2024-02-13 Thread Mark Cave-Ayland
The internal state of the ESP sequencer is not affected when raising an interrupt to indicate the end of a DMA transfer. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-19-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mar

[PULL 36/88] esp.c: remove s_without_satn_pdma_cb() PDMA callback

2024-02-13 Thread Mark Cave-Ayland
This can now be handled by the existing do_dma_pdma_cb() function. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-37-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c

[PULL 45/88] esp.c: remove do_cmd from ESPState

2024-02-13 Thread Mark Cave-Ayland
Now that the accumulation of the CDB is handled by SCSI phase, there is no need for a separate variable to control it. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-46-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mar

[PULL 33/88] esp.c: copy logic for do_cmd transfers from do_dma_pdma_cb() to esp_do_dma()

2024-02-13 Thread Mark Cave-Ayland
This is so that PDMA transfers can be performend by esp_do_dma() as well as do_dma_pdma_cb(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-34-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi

[PULL 11/88] esp.c: remove unused case from esp_pdma_read()

2024-02-13 Thread Mark Cave-Ayland
The do_cmd variable is only set for the MESSAGE OUT and COMMAND phases i.e. those which involve transfers from the host to the SCSI bus, and so the unused case can be removed. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425

[PULL 05/88] esp.c: move esp_select() to ESP selection commands from get_cmd()

2024-02-13 Thread Mark Cave-Ayland
Since the DREQ value depends upon the result of the selection process, add a workaround to each esp_select() to manually assert DREQ durring the MESSAGE OUT and COMMAND phases. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.51442

[PULL 20/88] esp.c: update condition for esp_dma_done() in esp_do_dma() from device path

2024-02-13 Thread Mark Cave-Ayland
No change to the condition itself, other than to clarify that esp_dma_done() must be called when TC is zero. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-21-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-

[PULL 38/88] esp.c: convert esp_do_dma() to switch statement based upon SCSI phase

2024-02-13 Thread Mark Cave-Ayland
Currently only the DATA IN and DATA OUT phases are supported. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-39-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 47/88] esp.c: untangle MESSAGE OUT and COMMAND phase logic in do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
This makes it clearer that ATN is asserted until the end of the next TI command in the MESSAGE OUT phase. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-48-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland -

[PULL 01/88] esp.c: don't clear cmdfifo when esp_select() fails in get_cmd()

2024-02-13 Thread Mark Cave-Ayland
The FIFO contents should not be affected if the target selection fails. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-2-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 --- 1 file c

[PULL 46/88] esp.c: untangle MESSAGE OUT and COMMAND phase logic in esp_do_dma()

2024-02-13 Thread Mark Cave-Ayland
This makes it clearer that ATN is asserted until the end of the next TI command in the MESSAGE OUT phase. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-47-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland -

[PULL 49/88] esp.c: move CMD_SELATN end of message phase detection to esp_do_dma() and do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
The special logic in satn_pdma_cb() is now no longer required since esp_do_dma() can be used as a direct replacement. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-50-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mar

[PULL 78/88] esp.c: consolidate DMA and PDMA logic in DATA OUT phase

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514

[PULL 69/88] esp.c: consolidate end of command sequence after ICCS command

2024-02-13 Thread Mark Cave-Ayland
() rather than having some of it within esp_run_cmd(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-70-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 7 +++ 1 file changed, 3 inse

[PULL 70/88] esp.c: ensure that STAT_INT is cleared when reading ESP_RINTR

2024-02-13 Thread Mark Cave-Ayland
asserted beforehand then the esp_lower_irq() would have no effect. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-71-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 2 +- 1 file chan

[PULL 64/88] esp.c: don't raise INTR_BS interrupt in DATA IN phase until TI command issued

2024-02-13 Thread Mark Cave-Ayland
rrupt can confuse the host. In particular this is needed to prevent the MacOS Disk Utility from failing when switching non-DMA transfers to use esp_do_nodma(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-65-mark.

[PULL 54/88] esp.c: move CMD_ICCS command logic to esp_do_dma()

2024-02-13 Thread Mark Cave-Ayland
The special logic in write_response_pdma_cb() is now no longer required since esp_do_dma() can be used as a direct replacement. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-55-mark.cave-ayl...@ilande.co.uk> Signed-

[PULL 79/88] esp.c: consolidate DMA and PDMA logic in DATA IN phase

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514

[PULL 81/88] esp.c: remove redundant n variable in PDMA COMMAND phase

2024-02-13 Thread Mark Cave-Ayland
This variable can be replaced by the existing len variable. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-82-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 8 +++- 1 file chan

[PULL 63/88] esp.c: remove unneeded ti_cmd field

2024-02-13 Thread Mark Cave-Ayland
, remove the unneeded ti_cmd field and access the ESP_CMD register directly instead. Bump the vmstate_esp version to indicate that the ti_cmd field is no longer included. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425

[PULL 51/88] esp.c: don't use get_cmd() for CMD_SEL DMA commands

2024-02-13 Thread Mark Cave-Ayland
This can now be done using the existing logic in esp_do_dma() and do_dma_pdma_cb(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-52-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 57/88] esp.c: rename data_in_ready to to data_ready

2024-02-13 Thread Mark Cave-Ayland
This field is currently used to handle deferred interrupts for the DATA IN phase but the code will soon be updated to do the same for the DATA OUT phase. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-58-mark.cave-

[PULL 88/88] esp.c: add my copyright to the file

2024-02-13 Thread Mark Cave-Ayland
This series has involved rewriting and/or updating a considerable part of the ESP emulation so update the copyright in esp.c to reflect this. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-89-mark.cave-ayl...@ilande.co

[PULL 67/88] esp.c: replace get_cmd() with esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
Now that the esp_do_nodma() state machine correctly handles incoming FIFO data, all remaining users of get_cmd() can be replaced with esp_do_nodma() and the get_cmd() function removed completely. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id

[PULL 83/88] esp.c: replace n variable with len in esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
This brings esp_do_nodma() in line with esp_do_dma(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-84-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 71/88] esp.c: don't clear the SCSI phase when reading ESP_RINTR

2024-02-13 Thread Mark Cave-Ayland
Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-72-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 604f

[PULL 82/88] esp.c: consolidate DMA and PDMA logic in STATUS and MESSAGE IN phases

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514

[PULL 84/88] esp.c: implement DMA Transfer Pad command for DATA phases

2024-02-13 Thread Mark Cave-Ayland
part of the incoming SCSI data as it is copied into memory. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-85-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 55/88] esp.c: always use esp_do_dma() in pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
There is now only a single implementation contained within esp_do_dma() so call it directly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-56-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi

[PULL 50/88] esp.c: move CMD_TI end of message phase detection to esp_do_dma() and do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
The existing check for TC == 0 is only valid during a TI command. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-51-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 77/88] esp.c: only transfer non-DMA MESSAGE OUT phase data for specific commands

2024-02-13 Thread Mark Cave-Ayland
. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-78-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --gi

[PULL 59/88] esp.c: separate logic based upon ESP command in esp_transfer_data()

2024-02-13 Thread Mark Cave-Ayland
The handling of the INTR_FC and INTR_BS bits is different depending upon the last command executed by the ESP. Note that currently INTR_FC is managed elsewhere, but that will change soon. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id

[PULL 61/88] esp.c: remove DATA IN phase logic when reading from FIFO

2024-02-13 Thread Mark Cave-Ayland
Whilst the FIFO is used a storage buffer for both DMA and non-DMA requests, the loading and unloading is managed directly issuing commands to the ESP. As a result there is no need to manually invoke the non-DMA command handler. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by

[PULL 76/88] esp.c: only transfer non-DMA COMMAND phase data for specific commands

2024-02-13 Thread Mark Cave-Ayland
Aurelien's debian_etch_sparc_small.qcow2 test image. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-77-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 21 +++-- 1 f

[PULL 74/88] esp.c: handle non-DMA FIFO writes used to terminate DMA commands

2024-02-13 Thread Mark Cave-Ayland
remainder of the CDB using the ESP TI command. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-75-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 ++ 1 file changed, 10 inse

[PULL 72/88] esp.c: handle TC underflow for DMA SCSI requests

2024-02-13 Thread Mark Cave-Ayland
. Note that handling the premature SCSI bus phase change in the case of TC underflow fixes booting EMILE on m68k once again. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-73-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mar

[PULL 65/88] esp.c: move non-DMA TI logic to separate esp_nodma_ti_dataout() function

2024-02-13 Thread Mark Cave-Ayland
This is to allow the logic to be moved during the next commit. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-66-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.

[PULL 56/88] esp.c: remove unused PDMA callback implementation

2024-02-13 Thread Mark Cave-Ayland
Note that this is a migration break for the q800 machine because the extra PDMA information is no longer included. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-57-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-

[PULL 85/88] esp.c: rename irq_data IRQ to drq_irq

2024-02-13 Thread Mark Cave-Ayland
The IRQ represented by irq_data is actually the DRQ (DMA request) line so rename it accordingly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-86-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- h

[PULL 75/88] esp.c: improve ESP_RSEQ logic consolidation

2024-02-13 Thread Mark Cave-Ayland
mmand completes. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-76-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --gi

[PULL 58/88] esp.c: separate logic based upon ESP command in esp_command_complete()

2024-02-13 Thread Mark Cave-Ayland
The handling of the INTR_FC and INTR_BS bits is different depending upon the last command executed by the ESP. Note that currently INTR_FC is managed elsewhere, but that will change soon. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id

[PULL 80/88] esp.c: consolidate DMA and PDMA logic in MESSAGE OUT phase

2024-02-13 Thread Mark Cave-Ayland
This allows the removal of duplicate logic shared between the two implementations. Note that we restrict esp_raise_drq() to PDMA to help reduce the log verbosity for normal DMA. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514

[PULL 53/88] esp.c: replace do_dma_pdma_cb() with esp_do_dma()

2024-02-13 Thread Mark Cave-Ayland
Now that the DMA logic is identical between do_dma_pdma_cb() and esp_do_dma() we can replace do_dma_pdma_cb() with esp_do_dma(). Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-54-mark.cave-ayl...@ilande.co.uk> Signed-

[PULL 86/88] esp.c: keep track of the DRQ state during DMA

2024-02-13 Thread Mark Cave-Ayland
version number has already been increased earlier in the series, there is no need to repeat it again here. The DRQ IRQ is (currently) only used for PDMA transfers which already have a migration break in this series so there are no problems setting its value post-load. Signed-off-by: Mark Cave-Ayland

[PULL 68/88] esp.c: move write_response() non-DMA logic to esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
This moves the remaining non-DMA STATUS and MESSAGE IN phase logic from write_response() to esp_do_nodma(). Note that we can also now drop the extra fifo_reset() which is no longer required. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id

Re: [PATCH v4 10/12] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_set_pil_in()

2024-02-13 Thread Mark Cave-Ayland
On 13/02/2024 13:03, Philippe Mathieu-Daudé wrote: By passing a DeviceState context to a QDev IRQ handler, we can simplify and use qdev_init_gpio_in_named() instead of qdev_init_gpio_in_named_with_opaque(). Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc

Re: [PATCH v4 11/12] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-13 Thread Mark Cave-Ayland
qdev_init_gpio_in_named() in the commit message above instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index d2be900988

[PULL 87/88] esp.c: switch TypeInfo registration to use DEFINE_TYPES() macro

2024-02-13 Thread Mark Cave-Ayland
The use of the DEFINE_TYPES() macro will soon be recommended over the use of calling type_init() directly. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20240112125420.514425-88-mark.cave-ayl...@ilande.co

[PULL 52/88] esp.c: move CMD_SELATNS end of command logic to esp_do_dma() and do_dma_pdma_cb()

2024-02-13 Thread Mark Cave-Ayland
The special logic in satn_stop_pdma_cb() is now no longer required since esp_do_dma() can be used as a direct replacement. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-53-mark.cave-ayl...@ilande.co.uk> Signed-off-by

[PULL 66/88] esp.c: process non-DMA FIFO writes in esp_do_nodma()

2024-02-13 Thread Mark Cave-Ayland
byte. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-67-mark.cave-ayl...@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 121 +++--- 1 file changed, 86 inse

[PULL 73/88] esp.c: remove restriction on FIFO read access when DMA memory routines defined

2024-02-13 Thread Mark Cave-Ayland
manually manipulate the FIFO during a DMA transfer. Remove the restriction on FIFO read access when DMA memory routines are defined which also allows the NeXTCube machine to pass its self-test. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id

[PULL 60/88] esp.c: use deferred interrupts for both DATA IN and DATA OUT phases

2024-02-13 Thread Mark Cave-Ayland
This brings DATA OUT transfers in line with DATA IN transfers by ensuring that the guest visible function complete interrupt is only set once the SCSI layer has returned. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425

[PULL 62/88] esp.c: zero command register when TI command terminates due to phase change

2024-02-13 Thread Mark Cave-Ayland
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 Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-63-mark.cave-ayl...@ilande.co.uk> Sign

Re: [PATCH v5 1/3] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_set_pil_in()

2024-02-15 Thread Mark Cave-Ayland
On 15/02/2024 14:46, Philippe Mathieu-Daudé wrote: By passing a DeviceState context to a QDev IRQ handler, we can simplify and use qdev_init_gpio_in_named() instead of qdev_init_gpio_in_named_with_opaque(). Suggested-by: Mark Cave-Ayland Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc

Re: [PATCH v5 2/3] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_start_cpu()

2024-02-15 Thread Mark Cave-Ayland
qdev_init_gpio_in_named(DEVICE(cpu), leon3_start_cpu, "start_cpu", 1); qdev_connect_gpio_out_named(irqmpdev, "grlib-start-cpu", i, qdev_get_gpio_in_named(DEVICE(cpu),

[PATCH 10/13] esp.c: introduce esp_update_drq() and update esp_fifo_{push, pop}_buf() to use it

2024-02-16 Thread Mark Cave-Ayland
This new function sets the DRQ line correctly according to the current transfer mode, direction and FIFO contents. Update esp_fifo_push_buf() and esp_fifo_pop_buf() to use it so that DRQ is always set correctly when reading/writing multiple bytes to/from the FIFO. Signed-off-by: Mark Cave

[PATCH 13/13] esp.c: remove explicit setting of DRQ within ESP state machine

2024-02-16 Thread Mark Cave-Ayland
Now the esp_update_drq() is called for all reads/writes to the FIFO, there is no need to manually raise and lower the DRQ signal. Signed-off-by: Mark Cave-Ayland Fixes: https://gitlab.com/qemu-project/qemu/-/issues/611 Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1831 --- hw/scsi/esp.c

[PATCH 11/13] esp.c: update esp_fifo_{push, pop}() to call esp_update_drq()

2024-02-16 Thread Mark Cave-Ayland
This ensures that the DRQ line is always set correctly when reading/writing single bytes to/from the FIFO. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index ca0fa5098d

[PATCH 04/13] esp.c: change esp_fifo_push() to take ESPState

2024-02-16 Thread Mark Cave-Ayland
Now that all users of esp_fifo_push() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 7a24515bb9

[PATCH 01/13] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase()

2024-02-16 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_command_phase() use the underlying Fifo8 functions directly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 02/13] esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase()

2024-02-16 Thread Mark Cave-Ayland
The aim is to restrict the esp_fifo_*() functions so that they only operate on the hardware FIFO. When reading from cmdfifo in do_message_phase() use the underlying Fifo8 functions directly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH 06/13] esp.c: use esp_fifo_push() instead of fifo8_push()

2024-02-16 Thread Mark Cave-Ayland
There are still a few places that use fifo8_push() instead of esp_fifo_push() in order to push a value into the FIFO. Update those places to use esp_fifo_push() instead. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH 08/13] esp.c: introduce esp_fifo_push_buf() function for pushing to the FIFO

2024-02-16 Thread Mark Cave-Ayland
Instead of pushing data into the FIFO directly with fifo8_push_all(), add a new esp_fifo_push_buf() function and use it accordingly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH 12/13] esp.c: ensure esp_pdma_write() always calls esp_fifo_push()

2024-02-16 Thread Mark Cave-Ayland
This ensures that esp_update_drq() is called via esp_fifo_push() whenever the host uses PDMA to transfer data to a SCSI device. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index

[PATCH 00/13] esp: avoid explicit setting of DRQ within ESP state machine

2024-02-16 Thread Mark Cave-Ayland
nce the DRQ signal is now updated correctly upon each FIFO read/write access. Signed-off-by: Mark Cave-Ayland Mark Cave-Ayland (13): esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_command_phase() esp.c: replace cmdfifo use of esp_fifo_pop_buf() in do_message_phase() esp.c: replace cm

[PATCH 05/13] esp.c: change esp_fifo_pop() to take ESPState

2024-02-16 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index b898e43e2b..0e42ff50e7

[PATCH 03/13] esp.c: replace cmdfifo use of esp_fifo_pop() in do_message_phase()

2024-02-16 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 100560244b..7a24515bb9 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -312,7 +312,8 @@ static void do_message_phase(ESPState *s

[PATCH 09/13] esp.c: move esp_set_phase() and esp_get_phase() towards the beginning of the file

2024-02-16 Thread Mark Cave-Ayland
This allows these functions to be used earlier in the file without needing a separate forward declaration. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

[PATCH 07/13] esp.c: change esp_fifo_pop_buf() to take ESPState

2024-02-16 Thread Mark Cave-Ayland
Now that all users of esp_fifo_pop_buf() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-19 Thread Mark Cave-Ayland
On 19/02/2024 12:00, BALATON Zoltan wrote: On Mon, 19 Feb 2024, Philippe Mathieu-Daudé wrote: On 19/2/24 12:27, BALATON Zoltan wrote: On Mon, 19 Feb 2024, Philippe Mathieu-Daudé wrote: On 16/2/24 20:54, Philippe Mathieu-Daudé wrote: On 16/2/24 18:14, BALATON Zoltan wrote: On Fri, 16 Feb 202

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-19 Thread Mark Cave-Ayland
On 19/02/2024 13:05, Peter Maydell wrote: On Mon, 19 Feb 2024 at 12:49, Mark Cave-Ayland wrote: On 19/02/2024 12:00, BALATON Zoltan wrote: For new people trying to contribute to QEMU QDev is overwhelming so having some way to need less of it to do simple things would help them to get

Re: [PATCH 2/5] hw/i386/port92: Allow for TYPE_PORT92 to be embedded in devices

2024-02-21 Thread Mark Cave-Ayland
37c669-superio.c')) system_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686.c')) diff --git a/hw/isa/trace-events b/hw/isa/trace-events index 1816e8307a..bb5d9f1078 100644 --- a/hw/isa/trace-events +++ b/hw/isa/trace-events @@ -10,6 +10,10 @@ superio_create_ide(int id, uint16_t base, unsigned int irq) "id=%d, base 0x%03x, pc87312_io_read(uint32_t addr, uint32_t val) "read addr=0x%x val=0x%x" pc87312_io_write(uint32_t addr, uint32_t val) "write addr=0x%x val=0x%x" +# port92.c +port92_read(uint8_t val) "port92: read 0x%02x" +port92_write(uint8_t val) "port92: write 0x%02x" + # apm.c apm_io_read(uint8_t addr, uint8_t val) "read addr=0x%x val=0x%02x" apm_io_write(uint8_t addr, uint8_t val) "write addr=0x%x val=0x%02x" Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [RFC PATCH 0/2] hw: Replace cpu_interrupt() calls by qemu_irq(QDev GPIO)

2024-02-21 Thread Mark Cave-Ayland
On 20/02/2024 19:26, Philippe Mathieu-Daudé wrote: Hi, cpu_interrupt() doesn't scale well with heterogenous machines because its mask is target specific (defined in target/ARCH/cpu.h). While it is (often...) used by target-specific hw to notify cpu, there is no restriction to use such target-s

Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

2024-02-21 Thread Mark Cave-Ayland
On 19/02/2024 13:35, Peter Maydell wrote: On Mon, 19 Feb 2024 at 13:33, Mark Cave-Ayland wrote: On 19/02/2024 13:05, Peter Maydell wrote: On Mon, 19 Feb 2024 at 12:49, Mark Cave-Ayland wrote: On 19/02/2024 12:00, BALATON Zoltan wrote: For new people trying to contribute to QEMU QDev is

Re: [PATCH 1/5] hw/isa/meson.build: Sort alphabetically

2024-02-21 Thread Mark Cave-Ayland
2', if_true: files('pc87312.c')) system_ss.add(when: 'CONFIG_PIIX', if_true: files('piix.c')) -system_ss.add(when: 'CONFIG_FDC37M81X', if_true: files('fdc37m81x-superio.c')) system_ss.add(when: 'CONFIG_SMC37C669', if_true: files('smc37c669-superio.c')) system_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686.c')) Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 00/10] reset: Make whole system three-phase-reset aware

2024-02-21 Thread Mark Cave-Ayland
On 20/02/2024 16:06, Peter Maydell wrote: This patchset is an incremental improvement to our reset handling that tries to roll out the "three-phase-reset" design we have for devices to a wider scope. At the moment devices and buses have a three-phase reset system, with separate 'enter', 'hold'

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-21 Thread Mark Cave-Ayland
On 18/02/2024 13:16, Bernhard Beschow wrote: Port 92 is an integral part of the PIIX and ICH south bridges, so instantiate it there. The isapc machine now needs to instantiate it explicitly, analoguous to the RTC. Note that due to migration compatibility, port92 is optional in the south bridges

Re: [PATCH v2 0/7] hw/ide: Clean up hw/ide/qdev.c and include/hw/ide/internal.h

2024-02-21 Thread Mark Cave-Ayland
ooks like a good tidy-up to me so: Acked-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH] target/m68k: Fix exception frame format for 68010

2024-02-22 Thread Mark Cave-Ayland
On 22/02/2024 09:57, Thomas Huth wrote: On 15/01/2024 11.16, Daniel Palmer wrote:  From the 68010 a word with the frame format and exception vector are placed on the stack before the PC and SR. M68K_FEATURE_QUAD_MULDIV is currently checked to workout if to do this or not for the configured CPU

Re: [PATCH] target/m68k: Fix exception frame format for 68010

2024-02-22 Thread Mark Cave-Ayland
On 22/02/2024 13:37, Peter Maydell wrote: On Thu, 22 Feb 2024 at 13:34, Mark Cave-Ayland wrote: This is also: Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2164 "Resolves:" for gitlab bug URLs; "Fixes:" is for git commits. I think GitLab will happily accept eit

Re: [PATCH 3/5] adb: Switch bus reset to 3-phase-reset

2024-01-29 Thread Mark Cave-Ayland
lize; -k->reset = adb_bus_reset; +rc->phases.hold = adb_bus_reset_hold; } static const TypeInfo adb_bus_type_info = { Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH v2 23/23] target/sparc: Prefer fast cpu_env() over slower CPU QOM cast macro

2024-01-29 Thread Mark Cave-Ayland
d1b66 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5406,8 +5406,7 @@ void sparc_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) { - SPARCCPU *cpu = SPARC_CPU(cs); -CPUSPARCState *env = &cpu->env; +CPUSPARCState *env = cpu_env(cs); target_ulong pc = data[0]; target_ulong npc = data[1]; Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 00/22] target/sparc: floating-point cleanup

2024-01-29 Thread Mark Cave-Ayland
On 28/01/2024 06:49, Richard Henderson wrote: On 11/4/23 03:38, Richard Henderson wrote: Major changes: (1) Get rid of the env->qt[01] temporaries and use TCGv_i128 for float128. (2) Perform ieee exception check within the helpers, before any writeback to the floating point registers. (3)

Re: [PATCH 00/22] target/sparc: floating-point cleanup

2024-01-31 Thread Mark Cave-Ayland
rence,   https://gitlab.com/rth7680/qemu/-/commits/tgt-sparc-fp r~ I've tested the above branch on my SPARC32 and SPARC64 images, and whilst I don't think they particularly exercise FP instructions, I don't see any regressions so: Tested-by: Mark Cave-Ayland Acked-by: Mark Cav

Re: [PATCH 09/88] esp: update TC check logic in do_dma_pdma_cb() to check for TC == 0

2024-02-01 Thread Mark Cave-Ayland
On 01/02/2024 10:46, Paolo Bonzini wrote: On Fri, Jan 12, 2024 at 1:55 PM Mark Cave-Ayland wrote: Invert the logic so that the end of DMA transfer check becomes one that checks for TC == 0 in the from device path in do_dma_pdma_cb(). Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c | 24

Re: [PATCH 09/88] esp: update TC check logic in do_dma_pdma_cb() to check for TC == 0

2024-02-08 Thread Mark Cave-Ayland
On 01/02/2024 11:36, Paolo Bonzini wrote: Il gio 1 feb 2024, 12:25 Mark Cave-Ayland <mailto:mark.cave-ayl...@ilande.co.uk>> ha scritto: On 01/02/2024 10:46, Paolo Bonzini wrote: > On Fri, Jan 12, 2024 at 1:55 PM Mark Cave-Ayland > mailto:mark.cave-ayl...@ilande

Re: [PATCH v3 05/11] hw/ppc/prep: Realize ISA bridge before accessing it

2024-02-09 Thread Mark Cave-Ayland
us(i82378_dev, "isa.0")); Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH 09/88] esp: update TC check logic in do_dma_pdma_cb() to check for TC == 0

2024-02-09 Thread Mark Cave-Ayland
On 08/02/2024 18:11, Paolo Bonzini wrote: On Thu, Feb 8, 2024 at 10:46 AM Mark Cave-Ayland wrote: On 01/02/2024 11:36, Paolo Bonzini wrote: Il gio 1 feb 2024, 12:25 Mark Cave-Ayland mailto:mark.cave-ayl...@ilande.co.uk>> ha scritto: On 01/02/2024 10:46, Paolo Bonzini

Re: [PATCH v3 06/11] hw/misc/macio: Realize IDE controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
d_realize(PCIDevice *d, Error **errp) I see that Zoltan has already commented about checking the success of qdev_realise() before wiring the sysbus IRQs, so with that fixed: Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
_unref(SYS_BUS_DEVICE(dma), &error_fatal); + +sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq); + +sysbus_connect_irq(SYS_BUS_DEVICE(ledma), 0, ledma_irq); + sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, dma_base); sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base); Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH v3 09/11] hw/sparc/leon3: Realize GRLIB IRQ controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
ntry(apb_pnp, LEON3_IRQMP_OFFSET, 0xFFF, Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH v3 10/11] hw/sparc/leon3: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Mark Cave-Ayland
sysbus_mmio_map(SYS_BUS_DEVICE(irqmpdev), 0, LEON3_IRQMP_OFFSET); qdev_connect_gpio_out_named(irqmpdev, "grlib-irq", 0, Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Mark Cave-Ayland
ject_new(cpu_type)); qdev_init_gpio_in_named(DEVICE(cpu), sparc64_cpu_set_ivec_irq, "ivec-irq", IVEC_MAX); +qdev_realize(DEVICE(cpu), NULL, &error_fatal); env = &cpu->env; env->tick = cpu_timer_create("tick", cpu, tick_irq, Reviewed-by: Mark Cave-Ayland ATB, Mark.

Re: [PATCH v3 11/11] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-09 Thread Mark Cave-Ayland
On 09/02/2024 11:34, Peter Maydell wrote: On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: Inline cpu_create() in order to call qdev_init_gpio_in_named_with_opaque() before the CPU is realized. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc64/sparc64.c | 4 +++- 1 file chan

Re: [PATCH v3 08/11] hw/sparc/sun4m: Realize DMA controller before accessing it

2024-02-09 Thread Mark Cave-Ayland
On 09/02/2024 11:37, Peter Maydell wrote: On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé wrote: We should not wire IRQs on unrealized device. Signed-off-by: Philippe Mathieu-Daudé --- hw/sparc/sun4m.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/spar

[PATCH v3 05/17] esp.c: change esp_fifo_push() to take ESPState

2024-03-24 Thread Mark Cave-Ayland
Now that all users of esp_fifo_push() operate on the main FIFO there is no need to pass the FIFO explicitly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/scsi/esp.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/scsi/esp.c b/hw

[PATCH v3 00/17] [for-9.0] esp: avoid explicit setting of DRQ within ESP state machine

2024-03-24 Thread Mark Cave-Ayland
ly patch 17 removes all manual calls to esp_raise_drq() and esp_lower_drq() since the DRQ signal is now updated correctly upon each FIFO read/write access. Signed-off-by: Mark Cave-Ayland v3: - Rebase onto master - Add patch 1 to move the internals of esp_fifo_pop_buf() to a new esp_fifo8_pop_b

<    4   5   6   7   8   9   10   11   12   13   >