[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 38/47] ppc/pnv: scan ISA bus to populate device tree
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 38/47] ppc/pnv: scan ISA bus to populate device tree |
Date: |
Mon, 24 Apr 2017 11:59:18 +1000 |
From: Cédric Le Goater <address@hidden>
This is an empty shell that we will use to include nodes in the device
tree for ISA devices. We expect RTC, UART and IPMI BT devices.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/pnv.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index 9468e99..c445906 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -303,6 +303,29 @@ static void powernv_populate_chip(PnvChip *chip, void *fdt)
g_free(typename);
}
+typedef struct ForeachPopulateArgs {
+ void *fdt;
+ int offset;
+} ForeachPopulateArgs;
+
+static int powernv_populate_isa_device(DeviceState *dev, void *opaque)
+{
+ return 0;
+}
+
+static void powernv_populate_isa(ISABus *bus, void *fdt, int lpc_offset)
+{
+ ForeachPopulateArgs args = {
+ .fdt = fdt,
+ .offset = lpc_offset,
+ };
+
+ /* ISA devices are not necessarily parented to the ISA bus so we
+ * can not use object_child_foreach() */
+ qbus_walk_children(BUS(bus), powernv_populate_isa_device,
+ NULL, NULL, NULL, &args);
+}
+
static void *powernv_create_fdt(MachineState *machine)
{
const char plat_compat[] = "qemu,powernv\0ibm,powernv";
@@ -311,6 +334,7 @@ static void *powernv_create_fdt(MachineState *machine)
char *buf;
int off;
int i;
+ int lpc_offset;
fdt = g_malloc0(FDT_MAX_SIZE);
_FDT((fdt_create_empty_tree(fdt, FDT_MAX_SIZE)));
@@ -350,6 +374,10 @@ static void *powernv_create_fdt(MachineState *machine)
for (i = 0; i < pnv->num_chips; i++) {
powernv_populate_chip(pnv->chips[i], fdt);
}
+
+ /* Populate ISA devices on chip 0 */
+ lpc_offset = pnv_chip_lpc_offset(pnv->chips[0], fdt);
+ powernv_populate_isa(pnv->isa_bus, fdt, lpc_offset);
return fdt;
}
--
2.9.3
- [Qemu-ppc] [PULL 27/47] ppc/pnv: Add cut down PSI bridge model and hookup external interrupt, (continued)
- [Qemu-ppc] [PULL 27/47] ppc/pnv: Add cut down PSI bridge model and hookup external interrupt, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 45/47] target/ppc: Flush TLB on write to PIDR, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 19/47] spapr: allocate the ICPState object from under sPAPRCPUCore, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 17/47] ppc/xics: introduce an 'intc' backlink under PowerPCCPU, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 25/47] ppc/pnv: add a helper to calculate MMIO addresses registers, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 26/47] ppc/pnv: add memory regions for the ICP registers, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 44/47] spapr-cpu-core: Release ICPState object during CPU unrealization, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 22/47] ppc/pnv: extend the machine with a XICSFabric interface, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 41/47] ppc/pnv: populate device tree for IPMI BT devices, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 35/47] spapr: remove the 'nr_servers' field from the machine, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 38/47] ppc/pnv: scan ISA bus to populate device tree,
David Gibson <=
- [Qemu-ppc] [PULL 37/47] ppc/pnv: enable only one LPC bus, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 46/47] e500, book3s: mfspr 259: Register mapped/aliased SPRG3 user read, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 34/47] target/ppc: Fix size of struct PPCElfPrstatus, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 31/47] ipmi: provide support for FRUs, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 39/47] ppc/pnv: populate device tree for RTC devices, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 36/47] ppc/pnv: Add support for POWER8+ LPC Controller, David Gibson, 2017/04/23
- [Qemu-ppc] [PULL 47/47] target/ppc: Style fixes, David Gibson, 2017/04/23
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/47] ppc-for-2.10 queue 20170424, no-reply, 2017/04/23
- Re: [Qemu-ppc] [PULL 00/47] ppc-for-2.10 queue 20170424, Peter Maydell, 2017/04/24