On 13/06/2018 11:47, Mark Cave-Ayland wrote: > + dev = qdev_create(NULL, TYPE_ESP); > + sysbus_esp = ESP_STATE(dev); > + esp = &sysbus_esp->esp; > + esp->dma_memory_read = rc4030_dma_read; > + esp->dma_memory_write = rc4030_dma_write; > + esp->dma_opaque = dmas[0];
Poking at the functions here is a bit ugly, and it's the last user of rc4030_dma_{read,write}. It would be nicer if ESP could get a memory region like it's done a bit above for the NIC. I guess it's not a big deal, but perhaps there could be a TODO comment. I'm mostly mentioning this because Hervé is copied and because SPARC DMA has the same issue of using function pointers instead of an IOMMU memory region... Thanks, Paolo > + sysbus_esp->it_shift = 0; > + /* XXX for now until rc4030 has been changed to use DMA enable signal */ > + esp->dma_enabled = 1; > + qdev_init_nofail(dev); > + > + sysbus = SYS_BUS_DEVICE(dev); > + sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(rc4030, 5)); > + sysbus_mmio_map(sysbus, 0, 0x80002000); > +