Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-26 Thread Laurent Vivier
Le 25/10/2019 à 16:01, Paolo Bonzini a écrit : > On 22/10/19 13:17, Laurent Vivier wrote: >> +if (s->dma_memory_read) { >> +s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); >> +} else { >> +set_pdma(s, CMD, s->cmdlen, len); >> +s->pd

Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-26 Thread Laurent Vivier
Le 22/10/2019 à 14:21, Philippe Mathieu-Daudé a écrit : > Hi Laurent, > > On 10/22/19 1:17 PM, Laurent Vivier wrote: >> 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. >> >>

Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-25 Thread Laurent Vivier
Le 25/10/2019 à 16:54, Philippe Mathieu-Daudé a écrit : > On 10/25/19 4:01 PM, Paolo Bonzini wrote: >> On 22/10/19 13:17, Laurent Vivier wrote: >>> +    if (s->dma_memory_read) { >>> +    s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], >>> len); >>> +    } else { >>> + 

Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-25 Thread Philippe Mathieu-Daudé
On 10/25/19 4:01 PM, Paolo Bonzini wrote: On 22/10/19 13:17, Laurent Vivier wrote: +if (s->dma_memory_read) { +s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); +} else { +set_pdma(s, CMD, s->cmdlen, len); +s->pdma_cb = do_dma_pdma

Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-25 Thread Paolo Bonzini
On 22/10/19 13:17, Laurent Vivier wrote: > +if (s->dma_memory_read) { > +s->dma_memory_read(s->dma_opaque, &s->cmdbuf[s->cmdlen], len); > +} else { > +set_pdma(s, CMD, s->cmdlen, len); > +s->pdma_cb = do_dma_pdma_cb; > +esp_raise_drq(s

Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-22 Thread Laurent Vivier
Le 22/10/2019 à 14:21, Philippe Mathieu-Daudé a écrit : > Hi Laurent, > > On 10/22/19 1:17 PM, Laurent Vivier wrote: >> 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. >> >>

Re: [PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-22 Thread Philippe Mathieu-Daudé
Hi Laurent, On 10/22/19 1:17 PM, Laurent Vivier wrote: 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/

[PATCH v14 1/9] esp: add pseudo-DMA as used by Macintosh

2019-10-22 Thread Laurent Vivier
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 tran