mac_newworld: add PMU device
The PMU device supercedes the CUDA device found on older New World Macs and
is supported by a larger number of guest OSs from OS 9 to OS X 10.5.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index ca21d47..ff715ff 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -399,11 +399,19 @@
macio_ide_init_drives(macio_ide, &hd[MAX_IDE_DEVS]);
if (has_adb) {
- dev = DEVICE(object_resolve_path_component(OBJECT(macio), "cuda"));
+ if (has_pmu) {
+ dev = DEVICE(object_resolve_path_component(OBJECT(macio), "pmu"));
+ } else {
+ dev = DEVICE(object_resolve_path_component(OBJECT(macio), "cuda"));
+ }
+
adb_bus = qdev_get_child_bus(dev, "adb.0");
dev = qdev_create(adb_bus, TYPE_ADB_KEYBOARD);
+ qdev_prop_set_bit(dev, "disable-direct-reg3-writes", has_pmu);
qdev_init_nofail(dev);
+
dev = qdev_create(adb_bus, TYPE_ADB_MOUSE);
+ qdev_prop_set_bit(dev, "disable-direct-reg3-writes", has_pmu);
qdev_init_nofail(dev);
}