@@ -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 */
};
@@ -1785,6 +1785,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
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_VFIO_PLATFORM);
+ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_PVPANIC_MMIO);
mc->block_default_type = IF_VIRTIO;
mc->no_cdrom = 1;
mc->pci_allow_0_address = true;
@@ -121,10 +121,17 @@ 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);
}
@@ -37,7 +37,7 @@ typedef struct PVPanicISAState {
typedef struct PVPanicMMIOState {
SysBusDevice parent_obj;
/*<private>*/
-
+ uint32_t base;
/* public */
MemoryRegion mr;
} PVPanicMMIOState;
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 | 7 +++++++ include/hw/misc/pvpanic.h | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-)