qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Thomas Huth <huth@tuxfamily.org>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, kwolf@redhat.com, famz@redhat.com,
	qemu-block@nongnu.org, jasowang@redhat.com, dgilbert@redhat.com,
	mreitz@redhat.com, hpoussin@reactos.org, kraxel@redhat.com,
	pbonzini@redhat.com, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v6 05/10] esp: add pseudo-DMA as used by Macintosh
Date: Fri, 24 May 2019 21:00:43 +0200	[thread overview]
Message-ID: <e1c4101c-81a9-396e-af5a-995349e50a49@vivier.eu> (raw)
In-Reply-To: <839269a0-4b07-a084-8e9a-fcffa76bc658@tuxfamily.org>

On 25/01/2019 06:48, Thomas Huth wrote:
> On 2018-11-02 16:22, Mark Cave-Ayland wrote:
>> From: Laurent Vivier <laurent@vivier.eu>
> 
> I'd suggest to add a patch description that contains the text that
> Laurent provided as a reply to this patch in v5:
> 
> ---------------------------- 8< --------------------------------------
> There is no DMA in Quadra 800, so the CPU reads/writes the data from the
> PDMA register (offset 0x100, ESP_PDMA in hw/m68k/q800.c) and copies them
> to/from the memory.
> 
> There is a nice assembly loop in the kernel to do that, see
> linux/drivers/scsi/mac_esp.c:MAC_ESP_PDMA_LOOP().
> 
> The start of the transfer is triggered by the DREQ interrupt (see linux
> mac_esp_send_pdma_cmd()), the CPU polls on the IRQ flag to start the
> transfer after a SCSI command has been sent (in Quadra 800 it goes
> through the VIA2, the via2-irq line and the vIFR register)
> 
> The Macintosh hardware includes hardware handshaking to prevent the CPU
> from reading invalid data or writing data faster than the peripheral
> device can accept it.
> 
> This is the "blind mode", and from the doc:
> "Approximate maximum SCSI transfer rates within a blocks are 1.4 MB per
> second for blind transfers in the Macintosh II"
> 
> Some references can be found in:
>    Apple Macintosh Family Hardware Reference, ISBN 0-201-19255-1
>    Guide to the Macintosh Family Hardware, ISBN-0-201-52405-8
> ---------------------------- >8 --------------------------------------
> 
> ?
> 
>> Co-developed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
>> ---
>>   hw/scsi/esp.c         | 291 +++++++++++++++++++++++++++++++++++++++++++++-----
>>   include/hw/scsi/esp.h |   7 ++
>>   2 files changed, 269 insertions(+), 29 deletions(-)
>>
>> diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
>> index 630d923623..8e9e27e479 100644
>> --- a/hw/scsi/esp.c
>> +++ b/hw/scsi/esp.c
> [...]
>> @@ -356,8 +511,7 @@ static void handle_ti(ESPState *s)
>>           s->dma_left = minlen;
>>           s->rregs[ESP_RSTAT] &= ~STAT_TC;
>>           esp_do_dma(s);
>> -    }
>> -    if (s->do_cmd) {
>> +    } else if (s->do_cmd) {
> 
> I'm not sure about this change... is it required? It could also change
> the behavior of the other users of this device...?
> 

The "else" is needed because this code has been duplicated inside 
esp_do_dma() to be executed only in the case of "real" dma and not for 
pseudo-dma.

Thanks,
Laurent



  reply	other threads:[~2019-05-24 19:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-02 15:22 [Qemu-devel] [PATCH v6 00/10] hw/m68k: add Apple Machintosh Quadra 800 machine Mark Cave-Ayland
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 01/10] hw/m68k: add via support Mark Cave-Ayland
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 02/10] hw/m68k: implement ADB bus support for via Mark Cave-Ayland
2018-11-06 14:59   ` Thomas Huth
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 03/10] escc: introduce a selector for the register bit Mark Cave-Ayland
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 04/10] hw/m68k: add macfb video card Mark Cave-Ayland
2018-11-06 15:03   ` Thomas Huth
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 05/10] esp: add pseudo-DMA as used by Macintosh Mark Cave-Ayland
2019-01-25  5:48   ` Thomas Huth
2019-05-24 19:00     ` Laurent Vivier [this message]
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 06/10] hw/m68k: add Nubus support Mark Cave-Ayland
2018-11-06 15:42   ` Thomas Huth
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 07/10] hw/m68k: add Nubus support for macfb video card Mark Cave-Ayland
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 08/10] hw/m68k: add a dummy SWIM floppy controller Mark Cave-Ayland
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 09/10] dp8393x: manage big endian bus Mark Cave-Ayland
2018-11-02 15:22 ` [Qemu-devel] [PATCH v6 10/10] hw/m68k: define Macintosh Quadra 800 Mark Cave-Ayland
2018-11-04  6:53 ` [Qemu-devel] [PATCH v6 00/10] hw/m68k: add Apple Machintosh Quadra 800 machine no-reply
2018-11-04 13:41   ` Mark Cave-Ayland
2018-11-06 14:57     ` Thomas Huth
2018-11-07 12:02 ` no-reply
2019-01-24 17:02 ` Thomas Huth
2019-01-24 17:15   ` Laurent Vivier
2019-01-24 17:37     ` Mark Cave-Ayland
2019-01-25  5:55       ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1c4101c-81a9-396e-af5a-995349e50a49@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=aurelien@aurel32.net \
    --cc=dgilbert@redhat.com \
    --cc=famz@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=huth@tuxfamily.org \
    --cc=jasowang@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).