root / hw / xilinx.h @ 067d01de
History | View | Annotate | Download (1.5 kB)
1 | 6a8b1ae2 | Edgar E. Iglesias | |
---|---|---|---|
2 | 6a8b1ae2 | Edgar E. Iglesias | /* OPB Interrupt Controller. */
|
3 | 6a8b1ae2 | Edgar E. Iglesias | qemu_irq *microblaze_pic_init_cpu(CPUState *env); |
4 | 6a8b1ae2 | Edgar E. Iglesias | |
5 | 6a8b1ae2 | Edgar E. Iglesias | static inline DeviceState * |
6 | 6a8b1ae2 | Edgar E. Iglesias | xilinx_intc_create(target_phys_addr_t base, qemu_irq irq, int kind_of_intr)
|
7 | 6a8b1ae2 | Edgar E. Iglesias | { |
8 | 6a8b1ae2 | Edgar E. Iglesias | DeviceState *dev; |
9 | 6a8b1ae2 | Edgar E. Iglesias | |
10 | 6a8b1ae2 | Edgar E. Iglesias | dev = qdev_create(NULL, "xilinx,intc"); |
11 | ee6847d1 | Gerd Hoffmann | qdev_prop_set_uint32(dev, "kind-of-intr", kind_of_intr);
|
12 | 6a8b1ae2 | Edgar E. Iglesias | qdev_init(dev); |
13 | 6a8b1ae2 | Edgar E. Iglesias | sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
|
14 | 6a8b1ae2 | Edgar E. Iglesias | sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
|
15 | 6a8b1ae2 | Edgar E. Iglesias | return dev;
|
16 | 6a8b1ae2 | Edgar E. Iglesias | } |
17 | 6a8b1ae2 | Edgar E. Iglesias | |
18 | 6a8b1ae2 | Edgar E. Iglesias | /* OPB Timer/Counter. */
|
19 | 6a8b1ae2 | Edgar E. Iglesias | static inline DeviceState * |
20 | 6a8b1ae2 | Edgar E. Iglesias | xilinx_timer_create(target_phys_addr_t base, qemu_irq irq, int nr, int freq) |
21 | 6a8b1ae2 | Edgar E. Iglesias | { |
22 | 6a8b1ae2 | Edgar E. Iglesias | DeviceState *dev; |
23 | 6a8b1ae2 | Edgar E. Iglesias | |
24 | 6a8b1ae2 | Edgar E. Iglesias | dev = qdev_create(NULL, "xilinx,timer"); |
25 | ee6847d1 | Gerd Hoffmann | qdev_prop_set_uint32(dev, "nr-timers", nr);
|
26 | ee6847d1 | Gerd Hoffmann | qdev_prop_set_uint32(dev, "frequency", freq);
|
27 | 6a8b1ae2 | Edgar E. Iglesias | qdev_init(dev); |
28 | 6a8b1ae2 | Edgar E. Iglesias | sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
|
29 | 6a8b1ae2 | Edgar E. Iglesias | sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
|
30 | 6a8b1ae2 | Edgar E. Iglesias | return dev;
|
31 | 6a8b1ae2 | Edgar E. Iglesias | } |
32 | 6a8b1ae2 | Edgar E. Iglesias | |
33 | 6a8b1ae2 | Edgar E. Iglesias | /* XPS Ethernet Lite MAC. */
|
34 | 6a8b1ae2 | Edgar E. Iglesias | static inline DeviceState * |
35 | 6a8b1ae2 | Edgar E. Iglesias | xilinx_ethlite_create(NICInfo *nd, target_phys_addr_t base, qemu_irq irq, |
36 | 6a8b1ae2 | Edgar E. Iglesias | int txpingpong, int rxpingpong) |
37 | 6a8b1ae2 | Edgar E. Iglesias | { |
38 | 6a8b1ae2 | Edgar E. Iglesias | DeviceState *dev; |
39 | 6a8b1ae2 | Edgar E. Iglesias | |
40 | 6a8b1ae2 | Edgar E. Iglesias | qemu_check_nic_model(nd, "xilinx-ethlite");
|
41 | 6a8b1ae2 | Edgar E. Iglesias | |
42 | 6a8b1ae2 | Edgar E. Iglesias | dev = qdev_create(NULL, "xilinx,ethlite"); |
43 | ee6847d1 | Gerd Hoffmann | dev->nd = nd; |
44 | ee6847d1 | Gerd Hoffmann | qdev_prop_set_uint32(dev, "txpingpong", txpingpong);
|
45 | ee6847d1 | Gerd Hoffmann | qdev_prop_set_uint32(dev, "rxpingpong", rxpingpong);
|
46 | 6a8b1ae2 | Edgar E. Iglesias | qdev_init(dev); |
47 | 6a8b1ae2 | Edgar E. Iglesias | sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
|
48 | 6a8b1ae2 | Edgar E. Iglesias | sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
|
49 | 6a8b1ae2 | Edgar E. Iglesias | return dev;
|
50 | 6a8b1ae2 | Edgar E. Iglesias | } |