Skip to contentSkip to conversation

Define categories for some PPC devices

PATCH In review Laurent Vivier 4 participants 22 messages Sep 26, 2015 – Sep 30, 2015

lore
Share & tools
lore
#0 lore raw

cover Define categories for some PPC devices

Some PPC devices appear uncategorized in the output of "-device ?". This series tries to categorize some of them.

Laurent Vivier (10):
adb: add to input category
cmd646: add to storage category
escc: add to input category
grackle: add to bridge category
cuda: add to bridge category
macio-ide: add to storage category
uninorth: add to bridge category
macio: add to bridge category
macio-nvram: add to misc category
openpic: add to misc category

 hw/char/escc.c         | 1 +
 hw/ide/cmd646.c        | 1 +
 hw/ide/macio.c         | 1 +
 hw/input/adb.c         | 2 ++
 hw/intc/openpic.c      | 1 +
 hw/intc/openpic_kvm.c  | 1 +
 hw/misc/macio/cuda.c   | 1 +
 hw/misc/macio/macio.c  | 1 +
 hw/nvram/mac_nvram.c   | 1 +
 hw/pci-host/grackle.c  | 2 ++
 hw/pci-host/uninorth.c | 8 ++++++++
 11 files changed, 20 insertions(+)
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/10 adb: add to input category

The Apple Desktop Bus is used to connect a keyboard and a mouse, so add it to the input category.

---
 hw/input/adb.c | 2 ++
 1 file changed, 2 insertions(+)
hw/input/adb.c +2 -0
index a18eea2..09eead9 100644
@@ -362,6 +362,7 @@ static void adb_kbd_class_init(ObjectClass *oc, void *data)
 
     akc->parent_realize = dc->realize;
     dc->realize = adb_kbd_realizefn;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 
     adc->devreq = adb_kbd_request;
     dc->reset = adb_kbd_reset;
@@ -566,6 +567,7 @@ static void adb_mouse_class_init(ObjectClass *oc, void *data)
 
     amc->parent_realize = dc->realize;
     dc->realize = adb_mouse_realizefn;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 
     adc->devreq = adb_mouse_request;
     dc->reset = adb_mouse_reset;
Signature · 1 line
2.4.3
Reviewed-by on v1 1/10
#2 lore raw

Re: [Qemu-devel] [PATCH 01/10][TRIVIAL] adb: add to input category

Quoted 21 lines · Laurent Vivier

The Apple Desktop Bus is used to connect a keyboard and a mouse, so add it to the input category.

---
 hw/input/adb.c | 2 ++
 1 file changed, 2 insertions(+)
hw/input/adb.c +1 -0
index a18eea2..09eead9 100644
@@ -362,6 +362,7 @@ static void adb_kbd_class_init(ObjectClass *oc, void *data)
 
     akc->parent_realize = dc->realize;
     dc->realize = adb_kbd_realizefn;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 
     adc->devreq = adb_kbd_request;
     dc->reset = adb_kbd_reset;

hw/input/adb.c static void adb_mouse_class_init(ObjectClass *oc, void *data) · line 573

Quoted 7 lines
hw/input/adb.c +1 -0
@@ -566,6 +567,7 @@ static void adb_mouse_class_init(ObjectClass *oc, void *data)
 
     amc->parent_realize = dc->realize;
     dc->realize = adb_mouse_realizefn;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 
     adc->devreq = adb_mouse_request;
     dc->reset = adb_mouse_reset;
#3 lore raw

PATCH 2/10 cmd646: add to storage category

In reply to Laurent Vivier

cmd646 is an IDE controller, so add it to the
storage category.

---
 hw/ide/cmd646.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/cmd646.c +1 -0
index 66fb9d9..27f3da2 100644
@@ -417,6 +417,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data)
     k->config_read = cmd646_pci_config_read;
     k->config_write = cmd646_pci_config_write;
     dc->props = cmd646_ide_properties;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
 
 static const TypeInfo cmd646_ide_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 2/10
#4 lore raw

Re: [Qemu-devel] [PATCH 02/10][TRIVIAL] cmd646: add to storage category

Quoted 13 lines · Laurent Vivier

cmd646 is an IDE controller, so add it to the
storage category.

---
 hw/ide/cmd646.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/cmd646.c +0 -0
index 66fb9d9..27f3da2 100644

hw/ide/cmd646.c static void cmd646_ide_class_init(ObjectClass *klass, void *data) · line 421

Quoted 5 lines
hw/ide/cmd646.c +1 -0
@@ -417,6 +417,7 @@ static void cmd646_ide_class_init(ObjectClass *klass, void *data)
     k->config_read = cmd646_pci_config_read;
     k->config_write = cmd646_pci_config_write;
     dc->props = cmd646_ide_properties;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
#5 lore raw

PATCH 3/10 escc: add to input category

In reply to Laurent Vivier

ESCC is a serial port controller, so add it
to the input category.

---
 hw/char/escc.c | 1 +
 1 file changed, 1 insertion(+)
hw/char/escc.c +1 -0
index ba653ef..9816154 100644
@@ -1035,6 +1035,7 @@ static void escc_class_init(ObjectClass *klass, void *data)
     dc->reset = escc_reset;
     dc->vmsd = &vmstate_escc;
     dc->props = escc_properties;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
 
 static const TypeInfo escc_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 3/10
#6 lore raw

Re: [Qemu-devel] [PATCH 03/10][TRIVIAL] escc: add to input category

Quoted 13 lines · Laurent Vivier

ESCC is a serial port controller, so add it
to the input category.

---
 hw/char/escc.c | 1 +
 1 file changed, 1 insertion(+)
hw/char/escc.c +0 -0
index ba653ef..9816154 100644

hw/char/escc.c static void escc_class_init(ObjectClass *klass, void *data) · line 1039

Quoted 5 lines
hw/char/escc.c +1 -0
@@ -1035,6 +1035,7 @@ static void escc_class_init(ObjectClass *klass, void *data)
     dc->reset = escc_reset;
     dc->vmsd = &vmstate_escc;
     dc->props = escc_properties;
+    set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
 }
#7 lore raw

PATCH 4/10 grackle: add to bridge category

In reply to Laurent Vivier

Grackle is the PCI host controller of oldworld powermac, so add it to the bridge category.

---
 hw/pci-host/grackle.c | 2 ++
 1 file changed, 2 insertions(+)
hw/pci-host/grackle.c +2 -0
index bfe707a..ea31b72 100644
@@ -146,8 +146,10 @@ static const TypeInfo grackle_pci_info = {
 static void pci_grackle_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     k->init = pci_grackle_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo grackle_pci_host_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 4/10
#8 lore raw

Re: [Qemu-devel] [PATCH 04/10][TRIVIAL] grackle: add to bridge category

Quoted 13 lines · Laurent Vivier

Grackle is the PCI host controller of oldworld powermac, so add it to the bridge category.

---
 hw/pci-host/grackle.c | 2 ++
 1 file changed, 2 insertions(+)
hw/pci-host/grackle.c +0 -0
index bfe707a..ea31b72 100644

hw/pci-host/grackle.c static const TypeInfo grackle_pci_info = { · line 153

Quoted 8 lines
hw/pci-host/grackle.c +2 -0
@@ -146,8 +146,10 @@ static const TypeInfo grackle_pci_info = {
 static void pci_grackle_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     k->init = pci_grackle_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
#9 lore raw

PATCH 5/10 cuda: add to bridge category

In reply to Laurent Vivier

Cuda is a bridge between PowerMac system bus and the ADB controller, real-time clock, pram and the power management unit.

So add it to the bridge category.

---
 hw/misc/macio/cuda.c | 1 +
 1 file changed, 1 insertion(+)
hw/misc/macio/cuda.c +1 -0
index f3984e3..4648458 100644
@@ -738,6 +738,7 @@ static void cuda_class_init(ObjectClass *oc, void *data)
     dc->reset = cuda_reset;
     dc->vmsd = &vmstate_cuda;
     dc->props = cuda_properties;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo cuda_type_info = {
Signature · 1 line
2.4.3
#10 lore raw

PATCH 6/10 macio-ide: add to storage category

In reply to Laurent Vivier

macio-ide is an IDE controller, so add it
to the storage category.

---
 hw/ide/macio.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/macio.c +1 -0
index 66ac2ba..893c9b9 100644
@@ -590,6 +590,7 @@ static void macio_ide_class_init(ObjectClass *oc, void *data)
     dc->realize = macio_ide_realizefn;
     dc->reset = macio_ide_reset;
     dc->vmsd = &vmstate_pmac;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
 
 static const TypeInfo macio_ide_type_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 6/10
#11 lore raw

Re: [Qemu-devel] [PATCH 06/10][TRIVIAL] macio-ide: add to storage category

Quoted 13 lines · Laurent Vivier

macio-ide is an IDE controller, so add it
to the storage category.

---
 hw/ide/macio.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/macio.c +0 -0
index 66ac2ba..893c9b9 100644

hw/ide/macio.c static void macio_ide_class_init(ObjectClass *oc, void *data) · line 594

Quoted 5 lines
hw/ide/macio.c +1 -0
@@ -590,6 +590,7 @@ static void macio_ide_class_init(ObjectClass *oc, void *data)
     dc->realize = macio_ide_realizefn;
     dc->reset = macio_ide_reset;
     dc->vmsd = &vmstate_pmac;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
Reviewed-by on v1 6/10
#12 lore raw

Re: [Qemu-devel] [PATCH 06/10][TRIVIAL] macio-ide: add to storage category

In reply to Laurent Vivier
Quoted 14 lines · Laurent Vivier

macio-ide is an IDE controller, so add it
to the storage category.

---
 hw/ide/macio.c | 1 +
 1 file changed, 1 insertion(+)
hw/ide/macio.c +0 -0
index 66ac2ba..893c9b9 100644

hw/ide/macio.c static void macio_ide_class_init(ObjectClass *oc, void *data) · line 596

Quoted 7 lines
hw/ide/macio.c +1 -0
@@ -590,6 +590,7 @@ static void macio_ide_class_init(ObjectClass *oc, void *data)
     dc->realize = macio_ide_realizefn;
     dc->reset = macio_ide_reset;
     dc->vmsd = &vmstate_pmac;
+    set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
 }
 
 static const TypeInfo macio_ide_type_info = {

Thanks,

I'll leave this to be staged by whomever stages the entire series.

--js

#13 lore raw

PATCH 7/10 uninorth: add to bridge category

In reply to Laurent Vivier

Uninorth is the mac99 PCI host controller, so add
it to the bridge category.

---
 hw/pci-host/uninorth.c | 8 ++++++++
 1 file changed, 8 insertions(+)
hw/pci-host/uninorth.c +8 -0
index f0144eb..215b64f 100644
@@ -446,8 +446,10 @@ static const TypeInfo unin_internal_pci_host_info = {
 static void pci_unin_main_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_unin_main_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_unin_main_info = {
@@ -460,8 +462,10 @@ static const TypeInfo pci_unin_main_info = {
 static void pci_u3_agp_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_u3_agp_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_u3_agp_info = {
@@ -474,8 +478,10 @@ static const TypeInfo pci_u3_agp_info = {
 static void pci_unin_agp_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_unin_agp_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_unin_agp_info = {
@@ -488,8 +494,10 @@ static const TypeInfo pci_unin_agp_info = {
 static void pci_unin_internal_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_unin_internal_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_unin_internal_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 7/10
#14 lore raw

Re: [Qemu-devel] [PATCH 07/10][TRIVIAL] uninorth: add to bridge category

Quoted 46 lines · Laurent Vivier

Uninorth is the mac99 PCI host controller, so add
it to the bridge category.

---
 hw/pci-host/uninorth.c | 8 ++++++++
 1 file changed, 8 insertions(+)
hw/pci-host/uninorth.c +6 -0
index f0144eb..215b64f 100644
@@ -446,8 +446,10 @@ static const TypeInfo unin_internal_pci_host_info = {
 static void pci_unin_main_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_unin_main_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_unin_main_info = {
@@ -460,8 +462,10 @@ static const TypeInfo pci_unin_main_info = {
 static void pci_u3_agp_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_u3_agp_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_u3_agp_info = {
@@ -474,8 +478,10 @@ static const TypeInfo pci_u3_agp_info = {
 static void pci_unin_agp_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_unin_agp_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo pci_unin_agp_info = {

hw/pci-host/uninorth.c static const TypeInfo pci_unin_agp_info = { · line 501

Quoted 8 lines
hw/pci-host/uninorth.c +2 -0
@@ -488,8 +494,10 @@ static const TypeInfo pci_unin_agp_info = {
 static void pci_unin_internal_class_init(ObjectClass *klass, void *data)
 {
     SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
+    DeviceClass *dc = DEVICE_CLASS(klass);
 
     sbc->init = pci_unin_internal_init_device;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
#15 lore raw

PATCH 8/10 macio: add to bridge category

In reply to Laurent Vivier

macio is a bridge between the PCI bus and the Mac nvram, IDE controller and PIC, so add it to the bridge category.

---
 hw/misc/macio/macio.c | 1 +
 1 file changed, 1 insertion(+)
hw/misc/macio/macio.c +1 -0
index e3c0242..c0989a0 100644
@@ -393,6 +393,7 @@ static void macio_class_init(ObjectClass *klass, void *data)
     k->vendor_id = PCI_VENDOR_ID_APPLE;
     k->class_id = PCI_CLASS_OTHERS << 8;
     dc->props = macio_properties;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
 
 static const TypeInfo macio_oldworld_type_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 8/10
#16 lore raw

Re: [Qemu-devel] [PATCH 08/10][TRIVIAL] macio: add to bridge category

Quoted 13 lines · Laurent Vivier

macio is a bridge between the PCI bus and the Mac nvram, IDE controller and PIC, so add it to the bridge category.

---
 hw/misc/macio/macio.c | 1 +
 1 file changed, 1 insertion(+)
hw/misc/macio/macio.c +0 -0
index e3c0242..c0989a0 100644

hw/misc/macio/macio.c static void macio_class_init(ObjectClass *klass, void *data) · line 397

Quoted 5 lines
hw/misc/macio/macio.c +1 -0
@@ -393,6 +393,7 @@ static void macio_class_init(ObjectClass *klass, void *data)
     k->vendor_id = PCI_VENDOR_ID_APPLE;
     k->class_id = PCI_CLASS_OTHERS << 8;
     dc->props = macio_properties;
+    set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
 }
#17 lore raw

PATCH 9/10 macio-nvram: add to misc category

In reply to Laurent Vivier

The macio nvram is a non volatile RAM, so add it
the misc category.

---
 hw/nvram/mac_nvram.c | 1 +
 1 file changed, 1 insertion(+)
hw/nvram/mac_nvram.c +1 -0
index d35f8a3..9f16566 100644
@@ -123,6 +123,7 @@ static void macio_nvram_class_init(ObjectClass *oc, void *data)
     dc->reset = macio_nvram_reset;
     dc->vmsd = &vmstate_macio_nvram;
     dc->props = macio_nvram_properties;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo macio_nvram_type_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 9/10
#18 lore raw

Re: [Qemu-devel] [PATCH 09/10][TRIVIAL] macio-nvram: add to misc category

Quoted 13 lines · Laurent Vivier

The macio nvram is a non volatile RAM, so add it
the misc category.

---
 hw/nvram/mac_nvram.c | 1 +
 1 file changed, 1 insertion(+)
hw/nvram/mac_nvram.c +0 -0
index d35f8a3..9f16566 100644

hw/nvram/mac_nvram.c static void macio_nvram_class_init(ObjectClass *oc, void *data) · line 127

Quoted 5 lines
hw/nvram/mac_nvram.c +1 -0
@@ -123,6 +123,7 @@ static void macio_nvram_class_init(ObjectClass *oc, void *data)
     dc->reset = macio_nvram_reset;
     dc->vmsd = &vmstate_macio_nvram;
     dc->props = macio_nvram_properties;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
#19 lore raw

PATCH 10/10 openpic: add to misc category

In reply to Laurent Vivier

openpic is a programmable interrupt controller, so add it to the misc category.

---
 hw/intc/openpic.c     | 1 +
 hw/intc/openpic_kvm.c | 1 +
 2 files changed, 2 insertions(+)
hw/intc/openpic.c +1 -0
index 14ab0e3..bfcf155 100644
@@ -1643,6 +1643,7 @@ static void openpic_class_init(ObjectClass *oc, void *data)
     dc->props = openpic_properties;
     dc->reset = openpic_reset;
     dc->vmsd = &vmstate_openpic;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo openpic_info = {
hw/intc/openpic_kvm.c +1 -0
index f7cac58..649f476 100644
@@ -275,6 +275,7 @@ static void kvm_openpic_class_init(ObjectClass *oc, void *data)
     dc->realize = kvm_openpic_realize;
     dc->props = kvm_openpic_properties;
     dc->reset = kvm_openpic_reset;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo kvm_openpic_info = {
Signature · 1 line
2.4.3
Reviewed-by on v1 10/10
#20 lore raw

Re: [Qemu-devel] [PATCH 10/10][TRIVIAL] openpic: add to misc category

Quoted 26 lines · Laurent Vivier

openpic is a programmable interrupt controller, so add it to the misc category.

---
 hw/intc/openpic.c     | 1 +
 hw/intc/openpic_kvm.c | 1 +
 2 files changed, 2 insertions(+)
hw/intc/openpic.c +1 -0
index 14ab0e3..bfcf155 100644
@@ -1643,6 +1643,7 @@ static void openpic_class_init(ObjectClass *oc, void *data)
     dc->props = openpic_properties;
     dc->reset = openpic_reset;
     dc->vmsd = &vmstate_openpic;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo openpic_info = {
hw/intc/openpic_kvm.c +0 -0
index f7cac58..649f476 100644

hw/intc/openpic_kvm.c static void kvm_openpic_class_init(ObjectClass *oc, void *data) · line 279

Quoted 5 lines
hw/intc/openpic_kvm.c +1 -0
@@ -275,6 +275,7 @@ static void kvm_openpic_class_init(ObjectClass *oc, void *data)
     dc->realize = kvm_openpic_realize;
     dc->props = kvm_openpic_properties;
     dc->reset = kvm_openpic_reset;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
#21 lore raw
In reply to Laurent Vivier
Quoted 3 lines · Laurent Vivier

Some PPC devices appear uncategorized in the output of "-device ?". This series tries to categorize some of them.

These all look good to me.

I've merged them to a new 'ppc-next' staging branch at
git://github.com/dgibson/qemu.git

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson