qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 94d5c7: esp: checkpatch fixes


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 94d5c7: esp: checkpatch fixes
Date: Tue, 09 Mar 2021 08:09:35 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 94d5c79d32fd9f17bfa26ddfbe56dcfbcef20d2c
      
https://github.com/qemu/qemu/commit/94d5c79d32fd9f17bfa26ddfbe56dcfbcef20d2c
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: checkpatch fixes

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-2-mark.cave-ayland@ilande.co.uk>


  Commit: 84fbefedfecafba2b339d17c9133225467b90c2e
      
https://github.com/qemu/qemu/commit/84fbefedfecafba2b339d17c9133225467b90c2e
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/dma/sparc32_dma.c
    M hw/m68k/q800.c
    M hw/mips/jazz.c
    M hw/scsi/esp.c
    M hw/sparc/sun4m.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: rename existing ESP QOM type to SYSBUS_ESP

The existing ESP QOM type currently represents a sysbus device with an embedded
ESP state. Rename the type to SYSBUS_ESP accordingly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-3-mark.cave-ayland@ilande.co.uk>


  Commit: eb169c76d092b289a6a150b725e8fb2de990379b
      
https://github.com/qemu/qemu/commit/eb169c76d092b289a6a150b725e8fb2de990379b
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp-pci.c
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: QOMify the internal ESP device state

Make this new QOM device state a child device of both the sysbus-esp and esp-pci
implementations.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-4-mark.cave-ayland@ilande.co.uk>


  Commit: 0bd005be782d9492afe3cc6fc494d8c3b477e5b8
      
https://github.com/qemu/qemu/commit/0bd005be782d9492afe3cc6fc494d8c3b477e5b8
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp-pci.c
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: add vmstate_esp version to embedded ESPState

The QOM object representing ESPState is currently embedded within both the
SYSBUS_ESP and PCI_ESP devices with migration state handled by embedding
vmstate_esp within each device using VMSTATE_STRUCT.

Since the vmstate_esp fields are embedded directly within the migration
stream, the incoming vmstate_esp version_id is lost. The only version 
information
available is that from vmstate_sysbus_esp_scsi and vmstate_esp_pci_scsi, but
those versions represent their respective devices and not that of the underlying
ESPState.

Resolve this by adding a new version-dependent field in vmstate_sysbus_esp_scsi
and vmstate_esp_pci_scsi which stores the vmstate_esp version_id field within
ESPState to be used to allow migration from older QEMU versions.

Finally bump the vmstate_esp version to 5 to cover the upcoming ESPState changes
within this patch series.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-5-mark.cave-ayland@ilande.co.uk>


  Commit: 0097d3ec17cf9e5a55dc33bee412a380f757ff23
      
https://github.com/qemu/qemu/commit/0097d3ec17cf9e5a55dc33bee412a380f757ff23
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M hw/scsi/trace-events

  Log Message:
  -----------
  esp: add trace event when receiving a TI command

This enables us to determine whether the command being issued is for a DMA or a
non-DMA transfer.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-6-mark.cave-ayland@ilande.co.uk>


  Commit: b630c075a24ee6b20890b32118de7ead4025a633
      
https://github.com/qemu/qemu/commit/b630c075a24ee6b20890b32118de7ead4025a633
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: fix esp_reg_read() trace event

Move the trace event to the end of the function so that it correctly reports
the returned value if it doesn't come directly from the rregs array.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-7-mark.cave-ayland@ilande.co.uk>


  Commit: 960ebfd94e8f6ea879472e7efb84b1704f685d39
      
https://github.com/qemu/qemu/commit/960ebfd94e8f6ea879472e7efb84b1704f685d39
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M hw/scsi/trace-events

  Log Message:
  -----------
  esp: add PDMA trace events

This will become more useful later when trying to debug mixed FIFO and PDMA
requests.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-8-mark.cave-ayland@ilande.co.uk>


  Commit: 4ca2ba6fb0bdf1099a742a361d1e2ad227c3bbf4
      
https://github.com/qemu/qemu/commit/4ca2ba6fb0bdf1099a742a361d1e2ad227c3bbf4
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: determine transfer direction directly from SCSI phase

The transfer direction is currently determined by checking the sign of ti_size
but as this series progresses ti_size can be zero at the end of the transfer.

Use the SCSI phase to determine the transfer direction as used in other SCSI
controller implementations.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-9-mark.cave-ayland@ilande.co.uk>


  Commit: c47b5835f5b8f971b10ecf5965117ffa3500d0ce
      
https://github.com/qemu/qemu/commit/c47b5835f5b8f971b10ecf5965117ffa3500d0ce
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: introduce esp_get_tc() and esp_set_tc()

These functions simplify reading and writing the TC register value without 
having to
manually shift each individual 8-bit value.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-10-mark.cave-ayland@ilande.co.uk>


  Commit: c04ed569b014126927760e4607385719bd66bff9
      
https://github.com/qemu/qemu/commit/c04ed569b014126927760e4607385719bd66bff9
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: introduce esp_get_stc()

This function simplifies reading the STC register value without having to 
manually
shift each individual 8-bit value.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-11-mark.cave-ayland@ilande.co.uk>


  Commit: 96676c2f749d9da99ee03ec0eee342bd7d09de26
      
https://github.com/qemu/qemu/commit/96676c2f749d9da99ee03ec0eee342bd7d09de26
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: apply transfer length adjustment when STC is zero at TC load time

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>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-12-mark.cave-ayland@ilande.co.uk>


  Commit: 5eb7a23fb22f10f09cecba61e7bf61cecaee3f96
      
https://github.com/qemu/qemu/commit/5eb7a23fb22f10f09cecba61e7bf61cecaee3f96
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: remove dma_counter from ESPState

The value of dma_counter is set once at the start of the transfer and remains
the same until the transfer is complete. This allows the check in 
esp_transfer_data
to be simplified since dma_left will always be non-zero until the transfer is
completed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-13-mark.cave-ayland@ilande.co.uk>


  Commit: 6cc88d6bf932a905ce36e933dc078eeb6b54ac92
      
https://github.com/qemu/qemu/commit/6cc88d6bf932a905ce36e933dc078eeb6b54ac92
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: remove dma_left from ESPState

The ESP device already keeps track of the remaining bytes left to transfer via
its TC (transfer counter) register which is decremented for each byte that
is transferred across the SCSI bus.

Switch the transfer logic to use the value of TC instead of dma_left and then
remove dma_left completely, adding logic to the vmstate_esp post_load() function
to transfer the old dma_left value to the TC register during migration from
older versions.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-14-mark.cave-ayland@ilande.co.uk>


  Commit: b76624de5062fdf874a377ade84af90c62903833
      
https://github.com/qemu/qemu/commit/b76624de5062fdf874a377ade84af90c62903833
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: remove minlen restriction in handle_ti

The limiting of DMA transfers to the maximum size of the available data is 
already
handled by esp_do_dma() and do_dma_pdma_cb().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-15-mark.cave-ayland@ilande.co.uk>


  Commit: 761bef75dd0bcad72e6041172f9bb573c9237ee4
      
https://github.com/qemu/qemu/commit/761bef75dd0bcad72e6041172f9bb573c9237ee4
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: introduce esp_pdma_read() and esp_pdma_write() functions

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-16-mark.cave-ayland@ilande.co.uk>


  Commit: 6e3fafa8bb0c22b57db1f7e2c7edf41545ba5294
      
https://github.com/qemu/qemu/commit/6e3fafa8bb0c22b57db1f7e2c7edf41545ba5294
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: use pdma_origin directly in esp_pdma_read()/esp_pdma_write()

This is the first step in removing get_pdma_buf() from esp.c.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-17-mark.cave-ayland@ilande.co.uk>


  Commit: 8da90e819452e77eefeedc38d1e00a03f2735ab2
      
https://github.com/qemu/qemu/commit/8da90e819452e77eefeedc38d1e00a03f2735ab2
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: move pdma_len and TC logic into esp_pdma_read()/esp_pdma_write()

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-18-mark.cave-ayland@ilande.co.uk>


  Commit: bb0bc7bbc9764a5e9e81756819838c5db88652b8
      
https://github.com/qemu/qemu/commit/bb0bc7bbc9764a5e9e81756819838c5db88652b8
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: accumulate SCSI commands for PDMA transfers in cmdbuf instead of pdma_buf

ESP SCSI commands are already accumulated in cmdbuf and so there is no need to
keep a separate pdma_buf buffer. Accumulate SCSI commands for PDMA transfers in
cmdbuf instead of pdma_buf so update cmdlen accordingly and change pdma_origin
for PDMA transfers to CMD which allows the PDMA origin to be removed.

This commit also removes a stray memcpy() from get_cmd() which is a no-op 
because
cmdlen is always zero at the start of a command.

Notionally the removal of pdma_buf from vmstate_esp_pdma also breaks migration
compatibility for the PDMA subsection until its complete removal by the end of
the series.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-19-mark.cave-ayland@ilande.co.uk>


  Commit: c959f218437c8828490267d42f42f9aa851dd8ea
      
https://github.com/qemu/qemu/commit/c959f218437c8828490267d42f42f9aa851dd8ea
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: remove buf parameter from do_cmd()

Now that all SCSI commands are accumulated in cmdbuf, remove the buf parameter
from do_cmd() since this always points to cmdbuf.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-20-mark.cave-ayland@ilande.co.uk>


  Commit: cfcea0f9d76f56d1a756a5ead28f5a8900b750e3
      
https://github.com/qemu/qemu/commit/cfcea0f9d76f56d1a756a5ead28f5a8900b750e3
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: remove the buf and buflen parameters from get_cmd()

Now that all SCSI commands are accumulated in cmdbuf, remove the buf and buflen
parameters from get_cmd() since these always reference cmdbuf and ESP_CMDBUF_SZ
respectively.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-21-mark.cave-ayland@ilande.co.uk>


  Commit: 2c573cfe19cd3f4cad7540ec542c40e54305d56a
      
https://github.com/qemu/qemu/commit/2c573cfe19cd3f4cad7540ec542c40e54305d56a
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: remove redundant pdma_start from ESPState

Now that PDMA SCSI commands are accumulated in cmdbuf in the same way as normal
commands, the existing logic for locating the start of the SCSI command in
cmdbuf via cmdlen can be used. This enables the PDMA-specific pdma_start and
also get_pdma_buf() to be removed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-22-mark.cave-ayland@ilande.co.uk>


  Commit: 93efe2e6243d0192ed0e383a3e3e91b0ce1d9063
      
https://github.com/qemu/qemu/commit/93efe2e6243d0192ed0e383a3e3e91b0ce1d9063
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: move PDMA length adjustments into esp_pdma_read()/esp_pdma_write()

Here the updates to async_len and ti_size are moved into the corresponding
esp_pdma_read()/esp_pdma_write() function to eliminate the reference to
pdma_cur in do_dma_pdma_cb().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-23-mark.cave-ayland@ilande.co.uk>


  Commit: ad7f468c4252ee83f6e150c11ae02f71f6d467ef
      
https://github.com/qemu/qemu/commit/ad7f468c4252ee83f6e150c11ae02f71f6d467ef
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: use ti_wptr/ti_rptr to manage the current FIFO position for PDMA

This eliminates the last user of the PDMA-specific pdma_cur variable which can
now be removed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-24-mark.cave-ayland@ilande.co.uk>


  Commit: 3c421400fff80054aec9b805a0622b63e372f572
      
https://github.com/qemu/qemu/commit/3c421400fff80054aec9b805a0622b63e372f572
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: use in-built TC to determine PDMA transfer length

Real hardware simply counts down using the in-built TC to determine when the
the PDMA request is complete. Use the TC to determine the PDMA transfer length
which then enables us to remove the redundant pdma_len variable.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-25-mark.cave-ayland@ilande.co.uk>


  Commit: 02abe246889398a108a3f92428b9f1f87e32de81
      
https://github.com/qemu/qemu/commit/02abe246889398a108a3f92428b9f1f87e32de81
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: remove CMD pdma_origin

The cmdbuf is really just a copy of FIFO data (including extra message phase
bytes) so its pdma_origin is effectively TI. Fortunately we already know when
we are receiving a SCSI command since do_cmd == 1 which enables us to
distinguish between the two cases in esp_pdma_read()/esp_pdma_write().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-26-mark.cave-ayland@ilande.co.uk>


  Commit: c7bce09c0595b235ad367a12bae54cb04b33025b
      
https://github.com/qemu/qemu/commit/c7bce09c0595b235ad367a12bae54cb04b33025b
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: rename get_cmd_cb() to esp_select()

This better describes the purpose of the function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-27-mark.cave-ayland@ilande.co.uk>


  Commit: 496913153a9d5d0b200c2ac30a541f9f294f55aa
      
https://github.com/qemu/qemu/commit/496913153a9d5d0b200c2ac30a541f9f294f55aa
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: fix PDMA target selection

Currently the target selection for PDMA is done after the SCSI command has been
delivered which is not correct. Perform target selection as part of the initial
get_cmd() call when the command is submitted: if no target is present, don't
raise DRQ.

If the target is present then switch to the command phase since the MacOS 
toolbox
ROM checks for this before attempting to submit the SCSI command.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-28-mark.cave-ayland@ilande.co.uk>


  Commit: 82141c8b2237d186177c430eba985dda54245ad9
      
https://github.com/qemu/qemu/commit/82141c8b2237d186177c430eba985dda54245ad9
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: use FIFO for PDMA transfers between initiator and device

PDMA as implemented on the Quadra 800 uses DREQ to load data into the FIFO
up to a maximum of 16 bytes at a time. The MacOS toolbox ROM requires this
because it mixes FIFO and PDMA transfers whilst checking the FIFO status
and counter registers to ensure success.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-29-mark.cave-ayland@ilande.co.uk>


  Commit: 43d02df31b8679dcc69c4ffcdb6cc658e1d348f7
      
https://github.com/qemu/qemu/commit/43d02df31b8679dcc69c4ffcdb6cc658e1d348f7
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: remove pdma_origin from ESPState

Now that all data is transferred via the FIFO (ti_buf) there is no need to track
the source buffer being used for the data transfer. This also eliminates the
need for a separate subsection for PDMA state migration.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-30-mark.cave-ayland@ilande.co.uk>


  Commit: cf1b8286007a5a12f7d42d484b8ac0e031038e2e
      
https://github.com/qemu/qemu/commit/cf1b8286007a5a12f7d42d484b8ac0e031038e2e
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: add 4 byte PDMA read and write transfers

The MacOS toolbox ROM performs 4 byte reads/writes when transferring data to
and from the target. Since the SCSI bus is 16-bits wide, use the memory API
to split a 4 byte access into 2 x 2 byte accesses.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-31-mark.cave-ayland@ilande.co.uk>


  Commit: bb27b13d183a4fdf8d63072861e03d320e41cb0e
      
https://github.com/qemu/qemu/commit/bb27b13d183a4fdf8d63072861e03d320e41cb0e
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: implement FIFO flush command

At this point it is now possible to properly implement the FIFO flush command
without causing guest errors.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-32-mark.cave-ayland@ilande.co.uk>


  Commit: cf47a41e055f6f90a2cecdb9eb3c4cebfde23f2a
      
https://github.com/qemu/qemu/commit/cf47a41e055f6f90a2cecdb9eb3c4cebfde23f2a
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: latch individual bits in ESP_RINTR register

Currently the ESP_RINTR register is set to a specific value as required within
the ESP state machine. In order to implement the upcoming deferred interrupt
functionality it is necessary to set individual bits within ESP_RINTR so that
a deferred interrupt will not overwrite the value of any other interrupt bits.

This also requires fixing up a few locations where the ESP_RINTR and ESP_RSEQ
registers are set/reset unexpectedly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-33-mark.cave-ayland@ilande.co.uk>


  Commit: 4e78f3bf357e0ef2f67e372097f2be8fe0521814
      
https://github.com/qemu/qemu/commit/4e78f3bf357e0ef2f67e372097f2be8fe0521814
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: defer command completion interrupt on incoming data transfers

The MacOS toolbox ROM issues a command to the ESP controller as part of its
"FAST" SCSI routines and then proceeds to read the incoming data soon after
receiving the command completion interrupt.

Unfortunately due to SCSI block transfers being asynchronous the incoming data
may not yet be present causing an underflow error. Resolve this by waiting for
the SCSI subsystem transfer_data callback before raising the command completion
interrupt.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-34-mark.cave-ayland@ilande.co.uk>


  Commit: 4aaa6ac38393e6657869da528ad8c35657e23f84
      
https://github.com/qemu/qemu/commit/4aaa6ac38393e6657869da528ad8c35657e23f84
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: remove old deferred command completion mechanism

Commit ea84a44250 "scsi: esp: Defer command completion until previous interrupts
have been handled" provided a mechanism to delay the command completion 
interrupt
until ESP_RINTR is read after the command has completed.

With the previous fixes for latching the ESP_RINTR bits and deferring the 
setting
of the command completion interrupt for incoming data to the SCSI callback, this
workaround is no longer required and can be removed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-35-mark.cave-ayland@ilande.co.uk>


  Commit: 4e0ed62937d0498295457c2e1d8282a24ba140cb
      
https://github.com/qemu/qemu/commit/4e0ed62937d0498295457c2e1d8282a24ba140cb
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: raise interrupt after every non-DMA byte transferred to the FIFO

This matches the description in the datasheet and is required as support for
non-DMA transfers is added.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-36-mark.cave-ayland@ilande.co.uk>


  Commit: 20c8d2ed6ae159b5840a46364bb679278f172576
      
https://github.com/qemu/qemu/commit/20c8d2ed6ae159b5840a46364bb679278f172576
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: add maxlen parameter to get_cmd()

Some guests use a mixture of DMA and non-DMA transfers in combination with the
SATN and stop command to transfer message out phase and command phase bytes to
the target. Prepare for the next commit by adding a maxlen parameter to
get_cmd() to allow partial transfers.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-37-mark.cave-ayland@ilande.co.uk>


  Commit: 799d90d818ba38997e9f5de2163bbfc96256ac0b
      
https://github.com/qemu/qemu/commit/799d90d818ba38997e9f5de2163bbfc96256ac0b
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: transition to message out phase after SATN and stop command

The SCSI bus should remain in the message out phase after the SATN and stop
command rather than transitioning to the command phase. A new ESPState variable
cmdbuf_cdb_offset is added which stores the offset of the CDB from the start
of cmdbuf when accumulating extended message out phase data.

Currently any extended message out data is discarded in do_cmd() before the CDB
is processed in do_busid_cmd().

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-38-mark.cave-ayland@ilande.co.uk>


  Commit: 042879fc3fc02b67d907b462020c975f6fb1f5ae
      
https://github.com/qemu/qemu/commit/042879fc3fc02b67d907b462020c975f6fb1f5ae
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: convert ti_buf from array to Fifo8

Rename TI_BUFSZ to ESP_FIFO_SZ since this constant is really describing the size
of the FIFO and is not directly related to the TI size.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-39-mark.cave-ayland@ilande.co.uk>


  Commit: 023666da792ac465e43dee3bacb21bb781de5cdb
      
https://github.com/qemu/qemu/commit/023666da792ac465e43dee3bacb21bb781de5cdb
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: convert cmdbuf from array to Fifo8

Rename ESP_CMDBUF_SZ to ESP_CMDFIFO_SZ and cmdbuf_cdb_offset to 
cmdfifo_cdb_offset
to indicate that the command buffer type has changed from an array to a Fifo8.

This also enables us to remove the ESPState field cmdlen since the command 
length
is now simply the number of elements used in cmdfifo.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-40-mark.cave-ayland@ilande.co.uk>


  Commit: 238ec4d7d4dba29c8d6d8766351d1dedf84008e0
      
https://github.com/qemu/qemu/commit/238ec4d7d4dba29c8d6d8766351d1dedf84008e0
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: add trivial implementation of the ESP_RFLAGS register

The bottom 5 bits contain the number of bytes remaining in the FIFO which is
trivial to implement with Fifo8 (the remaining bits are unimplemented and left
as 0 for now).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-41-mark.cave-ayland@ilande.co.uk>


  Commit: 1b9e48a5bdbc96833113f249909af0d30a76cc25
      
https://github.com/qemu/qemu/commit/1b9e48a5bdbc96833113f249909af0d30a76cc25
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  esp: implement non-DMA transfers in PDMA mode

The MacOS toolbox ROM uses non-DMA TI commands to handle the first/last byte
of an unaligned 16-bit transfer to memory.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-42-mark.cave-ayland@ilande.co.uk>


  Commit: 7aa6baee7c8a54473f28c6fa1e980a9ff7989036
      
https://github.com/qemu/qemu/commit/7aa6baee7c8a54473f28c6fa1e980a9ff7989036
  Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  Date:   2021-03-07 (Sun, 07 Mar 2021)

  Changed paths:
    M hw/scsi/esp.c

  Log Message:
  -----------
  esp: add support for unaligned accesses

When the MacOS toolbox ROM transfers data from a target device to an unaligned
memory address, the first/last byte of a 16-bit transfer needs to be handled
separately. This means that the first byte is preloaded into the FIFO before
the transfer, or the last byte remains in the FIFO after the transfer.

The result of this is that the PDMA routines must be updated so that the FIFO
is loaded/unloaded if the last 16-bit word is used (rather than the last byte)
and any remaining byte from a FIFO wraparound is handled correctly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210304221103.6369-43-mark.cave-ayland@ilande.co.uk>


  Commit: b2ae1009d7cca2701e17eae55ae2d44fd22c942a
      
https://github.com/qemu/qemu/commit/b2ae1009d7cca2701e17eae55ae2d44fd22c942a
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M hw/dma/sparc32_dma.c
    M hw/m68k/q800.c
    M hw/mips/jazz.c
    M hw/scsi/esp-pci.c
    M hw/scsi/esp.c
    M hw/scsi/trace-events
    M hw/sparc/sun4m.c
    M include/hw/scsi/esp.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20210307' into 
staging

qemu-sparc queue

# gpg: Signature made Sun 07 Mar 2021 12:07:13 GMT
# gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
# gpg:                issuer "mark.cave-ayland@ilande.co.uk"
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" 
[full]
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-sparc-20210307: (42 commits)
  esp: add support for unaligned accesses
  esp: implement non-DMA transfers in PDMA mode
  esp: add trivial implementation of the ESP_RFLAGS register
  esp: convert cmdbuf from array to Fifo8
  esp: convert ti_buf from array to Fifo8
  esp: transition to message out phase after SATN and stop command
  esp: add maxlen parameter to get_cmd()
  esp: raise interrupt after every non-DMA byte transferred to the FIFO
  esp: remove old deferred command completion mechanism
  esp: defer command completion interrupt on incoming data transfers
  esp: latch individual bits in ESP_RINTR register
  esp: implement FIFO flush command
  esp: add 4 byte PDMA read and write transfers
  esp: remove pdma_origin from ESPState
  esp: use FIFO for PDMA transfers between initiator and device
  esp: fix PDMA target selection
  esp: rename get_cmd_cb() to esp_select()
  esp: remove CMD pdma_origin
  esp: use in-built TC to determine PDMA transfer length
  esp: use ti_wptr/ti_rptr to manage the current FIFO position for PDMA
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/bb5643ff6129...b2ae1009d7cc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]