From patchwork Wed Apr 29 19:20:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 466252 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2E3B61402BC for ; Thu, 30 Apr 2015 05:23:28 +1000 (AEST) Received: from localhost ([::1]:40700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnXZu-0005aj-BA for incoming@patchwork.ozlabs.org; Wed, 29 Apr 2015 15:23:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38819) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnXXb-00016u-G7 for qemu-devel@nongnu.org; Wed, 29 Apr 2015 15:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnXXV-00068A-7G for qemu-devel@nongnu.org; Wed, 29 Apr 2015 15:21:03 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:60034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnXXV-00067o-0E for qemu-devel@nongnu.org; Wed, 29 Apr 2015 15:20:57 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Apr 2015 13:20:56 -0600 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Apr 2015 13:20:54 -0600 Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 33C746E8047; Wed, 29 Apr 2015 15:12:42 -0400 (EDT) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3TJKrBI64618592; Wed, 29 Apr 2015 19:20:53 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3TJKqmg019086; Wed, 29 Apr 2015 15:20:53 -0400 Received: from localhost ([9.80.84.126]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t3TJKqEG019041; Wed, 29 Apr 2015 15:20:52 -0400 From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 29 Apr 2015 14:20:18 -0500 Message-Id: <1430335224-6716-10-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430335224-6716-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1430335224-6716-1-git-send-email-mdroth@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15042919-0033-0000-0000-0000046174B9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 32.97.110.160 Cc: aik@ozlabs.ru, nfont@linux.vnet.ibm.com, bharata@linux.vnet.ibm.com, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Subject: [Qemu-devel] [RFC PATCH 09/15] spapr: populate PHB DRC entries for root DT node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Nathan Fontenot 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 Signed-off-by: Michael Roth Reviewed-by: David Gibson --- 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"); + } + _FDT((fdt_pack(fdt))); if (fdt_totalsize(fdt) > FDT_MAX_SIZE) {