From: Laurent Vivier <laurent@vivier.eu>
To: "Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Hervé Poussineau" <hpoussin@reactos.org>,
qemu-devel@nongnu.org, kwolf@redhat.com, famz@redhat.com,
qemu-block@nongnu.org, jasowang@redhat.com, dgilbert@redhat.com,
mreitz@redhat.com, kraxel@redhat.com, pbonzini@redhat.com,
aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH v5 06/11] esp: add pseudo-DMA as used by Macintosh
Date: Tue, 30 Oct 2018 21:08:05 +0100 [thread overview]
Message-ID: <af7fa5d2-7da4-0827-9e7c-e210ca78b82f@vivier.eu> (raw)
In-Reply-To: <02f4cde5-e82b-ed63-5e02-ff83d591f05d@ilande.co.uk>
On 30/10/2018 11:09, Mark Cave-Ayland wrote:
> On 30/10/2018 06:47, Hervé Poussineau wrote:
>
>> Le 29/10/2018 à 14:39, Mark Cave-Ayland a écrit :
>>> From: Laurent Vivier <laurent@vivier.eu>
>>>
>>> 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 | 292 +++++++++++++++++++++++++++++++++++++++++++++-----
>>> include/hw/scsi/esp.h | 7 ++
>>> 2 files changed, 270 insertions(+), 29 deletions(-)
>>>
>>
>> [...]
>>
>>> @@ -409,6 +564,7 @@ uint64_t esp_reg_read(ESPState *s, uint32_t saddr)
>>> s->ti_size--;
>>> s->rregs[ESP_FIFO] = s->ti_buf[s->ti_rptr++];
>>> }
>>> + esp_raise_irq(s);
>>> if (s->ti_rptr == s->ti_wptr) {
>>> s->ti_rptr = 0;
>>> s->ti_wptr = 0;
>>
>> You're now raising irq (not drq) when reading registers. In my opinion, this deserves
>> its own patch with an explanation.
This line must be removed.
> Oooh good spot. Laurent, can you explain a bit more as to how the pseudo-DMA is wired
> up for ESP?
>
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
Thanks,
Laurent
next prev parent reply other threads:[~2018-10-30 20:08 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 13:39 [Qemu-devel] [PATCH v5 00/11] hw/m68k: add Apple Machintosh Quadra 800 machine Mark Cave-Ayland
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 01/11] hw/m68k: add via support Mark Cave-Ayland
2018-10-30 6:46 ` Hervé Poussineau
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 02/11] hw/m68k: implement ADB bus support for via Mark Cave-Ayland
2018-10-30 6:46 ` Hervé Poussineau
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 03/11] escc: introduce a selector for the register bit Mark Cave-Ayland
2018-10-29 23:36 ` Philippe Mathieu-Daudé
2018-10-30 9:38 ` Mark Cave-Ayland
2018-10-30 6:46 ` Hervé Poussineau
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 04/11] hw/m68k: add macfb video card Mark Cave-Ayland
2018-10-30 6:46 ` Hervé Poussineau
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 05/11] hw/m68k: Apple Sound Chip (ASC) emulation Mark Cave-Ayland
2018-10-30 6:46 ` Hervé Poussineau
2018-10-30 10:46 ` Mark Cave-Ayland
2018-10-30 12:05 ` Laurent Vivier
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 06/11] esp: add pseudo-DMA as used by Macintosh Mark Cave-Ayland
2018-10-30 6:47 ` Hervé Poussineau
2018-10-30 10:09 ` Mark Cave-Ayland
2018-10-30 20:08 ` Laurent Vivier [this message]
2018-10-30 18:02 ` Laurent Vivier
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 07/11] hw/m68k: add Nubus support Mark Cave-Ayland
2018-10-30 6:47 ` Hervé Poussineau
2018-10-30 10:23 ` Mark Cave-Ayland
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 08/11] hw/m68k: add Nubus support for macfb video card Mark Cave-Ayland
2018-10-30 6:47 ` Hervé Poussineau
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 09/11] hw/m68k: add a dummy SWIM floppy controller Mark Cave-Ayland
2018-10-30 6:48 ` Hervé Poussineau
2018-10-30 10:25 ` Mark Cave-Ayland
2018-10-29 13:39 ` [Qemu-devel] [PATCH v5 10/11] dp8393x: manage big endian bus Mark Cave-Ayland
2018-10-30 6:48 ` Hervé Poussineau
2018-10-29 13:40 ` [Qemu-devel] [PATCH v5 11/11] hw/m68k: define Macintosh Quadra 800 Mark Cave-Ayland
2018-10-30 8:15 ` [Qemu-devel] [PATCH v5 00/11] hw/m68k: add Apple Machintosh Quadra 800 machine Richard Henderson
2018-10-30 11:48 ` Mark Cave-Ayland
2018-10-30 12:49 ` Laurent Vivier
2018-10-30 13:12 ` Mark Cave-Ayland
2018-10-30 13:39 ` Laurent Vivier
2018-11-02 0:32 ` Thomas Huth
2018-11-02 11:25 ` Laurent Vivier
2018-11-19 2:30 ` Rob Landley
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=af7fa5d2-7da4-0827-9e7c-e210ca78b82f@vivier.eu \
--to=laurent@vivier.eu \
--cc=aurelien@aurel32.net \
--cc=dgilbert@redhat.com \
--cc=famz@redhat.com \
--cc=hpoussin@reactos.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).