4 #include "hw/char/lm32_juart.h"
5 #include "hw/qdev-properties.h"
6 #include "qapi/error.h"
8 static inline DeviceState
*lm32_pic_init(qemu_irq cpu_irq
)
13 dev
= qdev_new("lm32-pic");
14 d
= SYS_BUS_DEVICE(dev
);
15 sysbus_realize_and_unref(d
, &error_fatal
);
16 sysbus_connect_irq(d
, 0, cpu_irq
);
21 static inline DeviceState
*lm32_juart_init(Chardev
*chr
)
25 dev
= qdev_new(TYPE_LM32_JUART
);
26 qdev_prop_set_chr(dev
, "chardev", chr
);
27 sysbus_realize_and_unref(SYS_BUS_DEVICE(dev
), &error_fatal
);
32 static inline DeviceState
*lm32_uart_create(hwaddr addr
,
39 dev
= qdev_new("lm32-uart");
40 s
= SYS_BUS_DEVICE(dev
);
41 qdev_prop_set_chr(dev
, "chardev", chr
);
42 sysbus_realize_and_unref(s
, &error_fatal
);
43 sysbus_mmio_map(s
, 0, addr
);
44 sysbus_connect_irq(s
, 0, irq
);