@@ -38,6 +38,7 @@
#include "hw/vfio/vfio-amd-xgbe.h"
#include "hw/display/ramfb.h"
#include "hw/arm/fdt.h"
+#include "hw/misc/pvpanic.h"
/*
* internal struct that contains the information to create dynamic
@@ -459,6 +460,7 @@ static const BindingEntry bindings[] = {
VFIO_PLATFORM_BINDING("amd,xgbe-seattle-v1a", add_amd_xgbe_fdt_node),
#endif
TYPE_BINDING(TYPE_RAMFB_DEVICE, no_fdt_node),
+ TYPE_BINDING(TYPE_PVPANIC_MMIO, no_fdt_node),
TYPE_BINDING("", NULL), /* last element */
};
@@ -1783,6 +1783,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_CALXEDA_XGMAC);
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_AMD_XGBE);
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_RAMFB_DEVICE);
+ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_PVPANIC_MMIO);
machine_class_allow_dynamic_sysbus_dev(mc, TYPE_VFIO_PLATFORM);
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
@@ -67,7 +67,7 @@ typedef struct PVPanicISAState {
typedef struct PVPanicMMIOState {
SysBusDevice parent_obj;
/*<private>*/
-
+ uint32_t base;
/* public */
MemoryRegion mr;
} PVPanicMMIOState;
@@ -151,10 +151,18 @@ static void pvpanic_mmio_initfn(Object *obj)
sysbus_init_mmio(sbd, &s->mr);
}
+static Property pvpanic_mmio_properties[] = {
+ DEFINE_PROP_UINT32("mmio", PVPanicMMIOState, base, 0x09070000),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+
static void pvpanic_mmio_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ dc->user_creatable = true;
+ dc->props = pvpanic_mmio_properties;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
}
Prepare for pvpanic-mmio configure interface. Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> --- hw/arm/sysbus-fdt.c | 2 ++ hw/arm/virt.c | 1 + hw/misc/pvpanic.c | 10 +++++++++- 3 files changed, 12 insertions(+), 1 deletion(-)