hw/isa/piix4: Factor out ISABus retrieval from piix4_create()
Modernizes the code. Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220603185045.143789-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
c397a2d3e4
commit
e3d198eed1
|
@ -312,7 +312,7 @@ static void piix4_register_types(void)
|
||||||
|
|
||||||
type_init(piix4_register_types)
|
type_init(piix4_register_types)
|
||||||
|
|
||||||
DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus)
|
DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus)
|
||||||
{
|
{
|
||||||
PCIDevice *pci;
|
PCIDevice *pci;
|
||||||
DeviceState *dev;
|
DeviceState *dev;
|
||||||
|
@ -322,10 +322,6 @@ DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus)
|
||||||
TYPE_PIIX4_PCI_DEVICE);
|
TYPE_PIIX4_PCI_DEVICE);
|
||||||
dev = DEVICE(pci);
|
dev = DEVICE(pci);
|
||||||
|
|
||||||
if (isa_bus) {
|
|
||||||
*isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (smbus) {
|
if (smbus) {
|
||||||
pci = pci_new(devfn + 3, TYPE_PIIX4_PM);
|
pci = pci_new(devfn + 3, TYPE_PIIX4_PM);
|
||||||
qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100);
|
qdev_prop_set_uint32(DEVICE(pci), "smb_io_base", 0x1100);
|
||||||
|
|
|
@ -1399,7 +1399,8 @@ void mips_malta_init(MachineState *machine)
|
||||||
empty_slot_init("GT64120", 0, 0x20000000);
|
empty_slot_init("GT64120", 0, 0x20000000);
|
||||||
|
|
||||||
/* Southbridge */
|
/* Southbridge */
|
||||||
dev = piix4_create(pci_bus, &isa_bus, &smbus);
|
dev = piix4_create(pci_bus, &smbus);
|
||||||
|
isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0"));
|
||||||
|
|
||||||
/* Interrupt controller */
|
/* Interrupt controller */
|
||||||
qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq);
|
qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq);
|
||||||
|
|
|
@ -70,6 +70,6 @@ DECLARE_INSTANCE_CHECKER(PIIX3State, PIIX3_PCI_DEVICE,
|
||||||
|
|
||||||
PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus);
|
PIIX3State *piix3_create(PCIBus *pci_bus, ISABus **isa_bus);
|
||||||
|
|
||||||
DeviceState *piix4_create(PCIBus *pci_bus, ISABus **isa_bus, I2CBus **smbus);
|
DeviceState *piix4_create(PCIBus *pci_bus, I2CBus **smbus);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue