mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
xilinx_axi*: Re-implemented interconnect
Re-implemented the interconnect between the Xilinx AXI ethernet and DMA controllers. A QOM interface "stream" is created, for the two stream interfaces. As per Edgars request, this is designed to be more generic than AXI-stream, so in the future we may see more clients of this interface beyond AXI stream. This is based primarily on Paolos original refactoring of the interconnect. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
This commit is contained in:
parent
346fe0c4c0
commit
669b498301
8 changed files with 139 additions and 107 deletions
22
hw/xilinx.h
22
hw/xilinx.h
|
@ -1,3 +1,4 @@
|
|||
#include "stream.h"
|
||||
#include "qemu-common.h"
|
||||
#include "net.h"
|
||||
|
||||
|
@ -49,8 +50,8 @@ xilinx_ethlite_create(NICInfo *nd, target_phys_addr_t base, qemu_irq irq,
|
|||
}
|
||||
|
||||
static inline DeviceState *
|
||||
xilinx_axiethernet_create(void *dmach,
|
||||
NICInfo *nd, target_phys_addr_t base, qemu_irq irq,
|
||||
xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer,
|
||||
target_phys_addr_t base, qemu_irq irq,
|
||||
int txmem, int rxmem)
|
||||
{
|
||||
DeviceState *dev;
|
||||
|
@ -60,7 +61,7 @@ xilinx_axiethernet_create(void *dmach,
|
|||
qdev_set_nic_properties(dev, nd);
|
||||
qdev_prop_set_uint32(dev, "rxmem", rxmem);
|
||||
qdev_prop_set_uint32(dev, "txmem", txmem);
|
||||
qdev_prop_set_ptr(dev, "dmach", dmach);
|
||||
object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL);
|
||||
qdev_init_nofail(dev);
|
||||
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
|
||||
sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
|
||||
|
@ -68,21 +69,16 @@ xilinx_axiethernet_create(void *dmach,
|
|||
return dev;
|
||||
}
|
||||
|
||||
static inline DeviceState *
|
||||
xilinx_axiethernetdma_create(void *dmach,
|
||||
target_phys_addr_t base, qemu_irq irq,
|
||||
qemu_irq irq2, int freqhz)
|
||||
static inline void
|
||||
xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
|
||||
target_phys_addr_t base, qemu_irq irq,
|
||||
qemu_irq irq2, int freqhz)
|
||||
{
|
||||
DeviceState *dev = NULL;
|
||||
|
||||
dev = qdev_create(NULL, "xlnx.axi-dma");
|
||||
qdev_prop_set_uint32(dev, "freqhz", freqhz);
|
||||
qdev_prop_set_ptr(dev, "dmach", dmach);
|
||||
object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL);
|
||||
qdev_init_nofail(dev);
|
||||
|
||||
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
|
||||
sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
|
||||
sysbus_connect_irq(sysbus_from_qdev(dev), 1, irq2);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue