Message ID | 1430335224-6716-10-git-send-email-mdroth@linux.vnet.ibm.com |
---|---|
State | New |
Headers | show |
On Wed, Apr 29, 2015 at 02:20:18PM -0500, Michael Roth wrote: > From: Nathan Fontenot <nfont@linux.vnet.ibm.com> > > This add entries to the root OF node to advertise our PHBs as being > DR-capable in accordance with PAPR specification. > > Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> > --- > hw/ppc/spapr.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index c539932..a7af332 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -57,6 +57,7 @@ > #include "qemu/error-report.h" > #include "trace.h" > #include "hw/nmi.h" > +#include "hw/ppc/spapr_drc.h" > > #include "hw/compat.h" > > @@ -745,6 +746,7 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, > size_t cb = 0; > char *bootlist; > void *fdt; > + int fdt_offset; > sPAPRPHBState *phb; > > fdt = g_malloc(FDT_MAX_SIZE); > @@ -804,6 +806,13 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, > spapr_populate_chosen_stdout(fdt, spapr->vio_bus); > } > > + fdt_offset = fdt_path_offset(fdt, "/"); > + ret = spapr_drc_populate_dt(fdt, fdt_offset, NULL, > + SPAPR_DR_CONNECTOR_TYPE_PHB); > + if (ret < 0) { > + fprintf(stderr, "Couldn't set up RTAS device tree properties\n"); This error message isn't right. Otherwise, Reviewed-by: David Gibson <david@gibson.dropbear.id.au> > + } > + > _FDT((fdt_pack(fdt))); > > if (fdt_totalsize(fdt) > FDT_MAX_SIZE) {
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c539932..a7af332 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -57,6 +57,7 @@ #include "qemu/error-report.h" #include "trace.h" #include "hw/nmi.h" +#include "hw/ppc/spapr_drc.h" #include "hw/compat.h" @@ -745,6 +746,7 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, size_t cb = 0; char *bootlist; void *fdt; + int fdt_offset; sPAPRPHBState *phb; fdt = g_malloc(FDT_MAX_SIZE); @@ -804,6 +806,13 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr, spapr_populate_chosen_stdout(fdt, spapr->vio_bus); } + fdt_offset = fdt_path_offset(fdt, "/"); + ret = spapr_drc_populate_dt(fdt, fdt_offset, NULL, + SPAPR_DR_CONNECTOR_TYPE_PHB); + if (ret < 0) { + fprintf(stderr, "Couldn't set up RTAS device tree properties\n"); + } + _FDT((fdt_pack(fdt))); if (fdt_totalsize(fdt) > FDT_MAX_SIZE) {