qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] hw/mips/jazz: create ESP device directly vi


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/mips/jazz: create ESP device directly via qdev
Date: Wed, 13 Jun 2018 12:06:20 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

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);
> +




reply via email to

[Prev in Thread] Current Thread [Next in Thread]