aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r--hw/ppc/spapr.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 08f57f9164..68a3ceb927 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1120,6 +1120,7 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
MachineState *machine = MACHINE(spapr);
MachineClass *mc = MACHINE_GET_CLASS(machine);
SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine);
+ uint32_t root_drc_type_mask = 0;
int ret;
void *fdt;
SpaprPhbState *phb;
@@ -1194,8 +1195,18 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
spapr_dt_cpus(fdt, spapr);
+ /* ibm,drc-indexes and friends */
if (smc->dr_lmb_enabled) {
- _FDT(spapr_dt_drc(fdt, 0, NULL, SPAPR_DR_CONNECTOR_TYPE_LMB));
+ root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_LMB;
+ }
+ if (smc->dr_phb_enabled) {
+ root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PHB;
+ }
+ if (mc->nvdimm_supported) {
+ root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PMEM;
+ }
+ if (root_drc_type_mask) {
+ _FDT(spapr_dt_drc(fdt, 0, NULL, root_drc_type_mask));
}
if (mc->has_hotpluggable_cpus) {
@@ -1233,14 +1244,6 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
}
}
- if (smc->dr_phb_enabled) {
- ret = spapr_dt_drc(fdt, 0, NULL, SPAPR_DR_CONNECTOR_TYPE_PHB);
- if (ret < 0) {
- error_report("Couldn't set up PHB DR device tree properties");
- exit(1);
- }
- }
-
/* NVDIMM devices */
if (mc->nvdimm_supported) {
spapr_dt_persistent_memory(spapr, fdt);