return;
}
-static void aspeed_pcie_cfg_reset(DeviceState *dev)
+static void aspeed_pcie_cfg_reset_hold(Object *obj, ResetType type)
{
- AspeedPCIECfgState *s = ASPEED_PCIE_CFG(dev);
+ AspeedPCIECfgState *s = ASPEED_PCIE_CFG(obj);
AspeedPCIECfgClass *apc = ASPEED_PCIE_CFG_GET_CLASS(s);
memset(s->regs, 0, apc->nr_regs << 2);
static void aspeed_pcie_cfg_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
AspeedPCIECfgClass *apc = ASPEED_PCIE_CFG_CLASS(klass);
dc->desc = "ASPEED PCIe Config";
dc->realize = aspeed_pcie_cfg_realize;
dc->unrealize = aspeed_pcie_cfg_unrealize;
- device_class_set_legacy_reset(dc, aspeed_pcie_cfg_reset);
+ rc->phases.hold = aspeed_pcie_cfg_reset_hold;
device_class_set_props(dc, aspeed_pcie_cfg_props);
apc->reg_ops = &aspeed_pcie_cfg_ops;
},
};
-static void aspeed_pcie_phy_reset(DeviceState *dev)
+static void aspeed_pcie_phy_reset_hold(Object *obj, ResetType type)
{
- AspeedPCIEPhyState *s = ASPEED_PCIE_PHY(dev);
+ AspeedPCIEPhyState *s = ASPEED_PCIE_PHY(obj);
AspeedPCIEPhyClass *apc = ASPEED_PCIE_PHY_GET_CLASS(s);
memset(s->regs, 0, apc->nr_regs << 2);
static void aspeed_pcie_phy_class_init(ObjectClass *klass, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
AspeedPCIEPhyClass *apc = ASPEED_PCIE_PHY_CLASS(klass);
dc->desc = "ASPEED PCIe Phy";
dc->realize = aspeed_pcie_phy_realize;
dc->unrealize = aspeed_pcie_phy_unrealize;
- device_class_set_legacy_reset(dc, aspeed_pcie_phy_reset);
+ rc->phases.hold = aspeed_pcie_phy_reset_hold;
device_class_set_props(dc, aspeed_pcie_phy_props);
apc->nr_regs = 0x100 >> 2;
.class_size = sizeof(AspeedPCIEPhyClass),
};
-static void aspeed_2700_pcie_phy_reset(DeviceState *dev)
+static void aspeed_2700_pcie_phy_reset_hold(Object *obj, ResetType type)
{
- AspeedPCIEPhyState *s = ASPEED_PCIE_PHY(dev);
+ AspeedPCIEPhyState *s = ASPEED_PCIE_PHY(obj);
AspeedPCIEPhyClass *apc = ASPEED_PCIE_PHY_GET_CLASS(s);
memset(s->regs, 0, apc->nr_regs << 2);
const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
AspeedPCIEPhyClass *apc = ASPEED_PCIE_PHY_CLASS(klass);
dc->desc = "ASPEED AST2700 PCIe Phy";
- device_class_set_legacy_reset(dc, aspeed_2700_pcie_phy_reset);
+ rc->phases.hold = aspeed_2700_pcie_phy_reset_hold;
apc->nr_regs = 0x800 >> 2;
}