mirror of https://github.com/xqemu/xqemu.git
grackle: set device fw_name and address for correct fw path generation
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
5c8e3d17ed
commit
ac43eb2e13
|
@ -37,6 +37,7 @@
|
||||||
typedef struct GrackleState {
|
typedef struct GrackleState {
|
||||||
PCIHostState parent_obj;
|
PCIHostState parent_obj;
|
||||||
|
|
||||||
|
uint32_t ofw_addr;
|
||||||
HeathrowState *pic;
|
HeathrowState *pic;
|
||||||
qemu_irq irqs[4];
|
qemu_irq irqs[4];
|
||||||
MemoryRegion pci_mmio;
|
MemoryRegion pci_mmio;
|
||||||
|
@ -146,12 +147,28 @@ static const TypeInfo grackle_pci_info = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char *grackle_ofw_unit_address(const SysBusDevice *dev)
|
||||||
|
{
|
||||||
|
GrackleState *s = GRACKLE_PCI_HOST_BRIDGE(dev);
|
||||||
|
|
||||||
|
return g_strdup_printf("%x", s->ofw_addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Property grackle_properties[] = {
|
||||||
|
DEFINE_PROP_UINT32("ofw-addr", GrackleState, ofw_addr, -1),
|
||||||
|
DEFINE_PROP_END_OF_LIST()
|
||||||
|
};
|
||||||
|
|
||||||
static void grackle_class_init(ObjectClass *klass, void *data)
|
static void grackle_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
|
SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
|
||||||
|
|
||||||
dc->realize = grackle_realize;
|
dc->realize = grackle_realize;
|
||||||
|
dc->props = grackle_properties;
|
||||||
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
|
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
|
||||||
|
dc->fw_name = "pci";
|
||||||
|
sbc->explicit_ofw_unit_address = grackle_ofw_unit_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo grackle_host_info = {
|
static const TypeInfo grackle_host_info = {
|
||||||
|
|
|
@ -254,6 +254,7 @@ static void ppc_heathrow_init(MachineState *machine)
|
||||||
|
|
||||||
/* Grackle PCI host bridge */
|
/* Grackle PCI host bridge */
|
||||||
dev = qdev_create(NULL, TYPE_GRACKLE_PCI_HOST_BRIDGE);
|
dev = qdev_create(NULL, TYPE_GRACKLE_PCI_HOST_BRIDGE);
|
||||||
|
qdev_prop_set_uint32(dev, "ofw-addr", 0x80000000);
|
||||||
object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
|
object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic",
|
||||||
&error_abort);
|
&error_abort);
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
|
|
Loading…
Reference in New Issue