Re: [PATCH 0/2] Experimental Amiga Zorro ESP driver

Michael Schmitz
2013-08-20T09:36:34Z

Tuomas,

> I guess those two bytes have something to do with target
> (re)selection... There are two different ways of attempting to read
> these bytes in the code, one is reading them from the FIFO byte by
> byte, and the other way is to setup a DMA read (write from device).
> The two different schemes are used in two different functions, and I
> do not understand why one method would be preferred over the other
> when comparing these functions.

What the driver attempts to read on reselection are the tag bytes that
were used in the previous disconnect. These have to match otherwise we
are not reselecting the command we need.

No idea which functions you refer to regarding PIO (reading from FIFO).
Anyway, the DMA will read from the same FIFO that the CPU would, if I
understand DMA correctly. There really should be no difference-

> I think I managed to find these two bytes; They are not ready for DMA,
> but are sitting in the FIFO waiting to be read.
> So the loop before the "IRQ2 timeout" is waiting for an interrupt that
> would tell that the DMA transfer has finished.

The loop checks whether the ESP status indicates the transfer is done -
if the bytes are still stuck in the FIFO I'd guess the DMA does not
bother to transfer for such small transfer counts.

The DMA transfer function can be changed to fetch less than seven bytes
from the FIFO by PIO instead of setting up DMA transfer (just poll the
FIFO after sending the command to the ESP, instead of first setting up
the DMA then sending the command),

I haven't yet merged your changes into my source - will try to do that
tomorrow.

Cheers,

Michael

> ...
>
> [13433.390000] ESP: Disconnecting tgt[1] tag[20:0]
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x97, 2 bytes in
> FIFO.
> [13433.400000] ESP: intr sreg[97] seqreg[04] sreg2[00] ireg[0c]
> [13433.400000] ESP: reconnect tag, zorro_esp_irq_pending(): ESP_STATUS
> = 0x97, 0 bytes in FIFO.
> [13433.400000] IRQ(0:10:97), zorro_esp: esp_count = 2, dma_count = 2,
> addr = 0x7fa59000. Writing.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> [13433.400000] zorro_esp_irq_pending(): ESP_STATUS = 0x17, 2 bytes in
> FIFO.
> ...
> Remember that write is read :)
>
> Now, I guess, I have to check whether those two bytes contain the
> right information...
>
> -Tuomas
> <zesp014.cap.gz>