mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
hw/pci-host/bonito: Convert to 3-phase reset
Convert the TYPE_PCI_BONITO class to use 3-phase reset. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230105130710.49264-2-philmd@linaro.org>
This commit is contained in:
parent
e8dc34196b
commit
4dd5cb5d84
1 changed files with 4 additions and 5 deletions
|
@ -47,7 +47,6 @@
|
||||||
#include "hw/mips/mips.h"
|
#include "hw/mips/mips.h"
|
||||||
#include "hw/pci/pci_host.h"
|
#include "hw/pci/pci_host.h"
|
||||||
#include "migration/vmstate.h"
|
#include "migration/vmstate.h"
|
||||||
#include "sysemu/reset.h"
|
|
||||||
#include "sysemu/runstate.h"
|
#include "sysemu/runstate.h"
|
||||||
#include "hw/misc/unimp.h"
|
#include "hw/misc/unimp.h"
|
||||||
#include "hw/registerfields.h"
|
#include "hw/registerfields.h"
|
||||||
|
@ -593,9 +592,9 @@ static int pci_bonito_map_irq(PCIDevice *pci_dev, int irq_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bonito_reset(void *opaque)
|
static void bonito_reset_hold(Object *obj)
|
||||||
{
|
{
|
||||||
PCIBonitoState *s = opaque;
|
PCIBonitoState *s = PCI_BONITO(obj);
|
||||||
uint32_t val = 0;
|
uint32_t val = 0;
|
||||||
|
|
||||||
/* set the default value of north bridge registers */
|
/* set the default value of north bridge registers */
|
||||||
|
@ -739,8 +738,6 @@ static void bonito_realize(PCIDevice *dev, Error **errp)
|
||||||
|
|
||||||
pci_set_byte(dev->config + PCI_MIN_GNT, 0x3c);
|
pci_set_byte(dev->config + PCI_MIN_GNT, 0x3c);
|
||||||
pci_set_byte(dev->config + PCI_MAX_LAT, 0x00);
|
pci_set_byte(dev->config + PCI_MAX_LAT, 0x00);
|
||||||
|
|
||||||
qemu_register_reset(bonito_reset, s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PCIBus *bonito_init(qemu_irq *pic)
|
PCIBus *bonito_init(qemu_irq *pic)
|
||||||
|
@ -770,7 +767,9 @@ static void bonito_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||||
|
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||||
|
|
||||||
|
rc->phases.hold = bonito_reset_hold;
|
||||||
k->realize = bonito_realize;
|
k->realize = bonito_realize;
|
||||||
k->vendor_id = 0xdf53;
|
k->vendor_id = 0xdf53;
|
||||||
k->device_id = 0x00d5;
|
k->device_id = 0x00d5;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue