From patchwork Fri Mar 3 11:48:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ananth N Mavinakayanahalli X-Patchwork-Id: 735014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vZSCH5MzHz9s06 for ; Fri, 3 Mar 2017 22:49:31 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vZSCH4ddHzDqJ9 for ; Fri, 3 Mar 2017 22:49:31 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vZSC16ZKCzDq5x for ; Fri, 3 Mar 2017 22:49:17 +1100 (AEDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v23Bmb9v134378 for ; Fri, 3 Mar 2017 06:49:15 -0500 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by mx0a-001b2d01.pphosted.com with ESMTP id 28xs8e3u9b-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 03 Mar 2017 06:49:15 -0500 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 3 Mar 2017 21:49:11 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 3 Mar 2017 21:49:09 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 0FDB93578052 for ; Fri, 3 Mar 2017 22:49:09 +1100 (EST) Received: from d23av05.au.ibm.com (d23av05.au.ibm.com [9.190.234.119]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v23Bn0tK21889056 for ; Fri, 3 Mar 2017 22:49:08 +1100 Received: from d23av05.au.ibm.com (localhost [127.0.0.1]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v23BmaM9028142 for ; Fri, 3 Mar 2017 22:48:36 +1100 Received: from thinktux.in.ibm.com ([9.199.51.253]) by d23av05.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v23BmYlm027777 for ; Fri, 3 Mar 2017 22:48:35 +1100 From: Ananth N Mavinakayanahalli To: skiboot@lists.ozlabs.org Date: Fri, 03 Mar 2017 17:18:18 +0530 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17030311-0052-0000-0000-0000021E6A15 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17030311-0053-0000-0000-000007E4F175 Message-Id: <148854169808.28500.17194027943843855491.stgit@thinktux.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-03_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703030113 Subject: [Skiboot] [PATCH] hdata: Add BMC device-tree node for P9 OpenPOWER systems X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" On P8 Hostboot creates the node. On P9, OPAL needs to create the node. BMC information available in HDAT's SPINFO section. Signed-off-by: Ananth N Mavinakayanahalli Acked-by: Joel Stanley --- hdata/fsp.c | 17 ++++++++++++++++- hdata/spira.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hdata/fsp.c b/hdata/fsp.c index f44f6a9..3896dc4 100644 --- a/hdata/fsp.c +++ b/hdata/fsp.c @@ -279,11 +279,26 @@ static void add_uart(const struct spss_iopath *iopath, struct dt_node *lpc) static void bmc_create_node(const struct HDIF_common_hdr *sp) { + struct dt_node *bmc_node; u32 fw_bar, io_bar, mem_bar, internal_bar; const struct spss_iopath *iopath; + const struct spss_sp_impl *sp_impl; struct dt_node *lpcm, *lpc, *n; u64 lpcm_base, lpcm_end; - int chip_id; + int chip_id, size; + + bmc_node = dt_new(dt_root, "bmc"); + assert(bmc_node); + + dt_add_property_cells(bmc_node, "#address-cells", 1); + dt_add_property_cells(bmc_node, "#size-cells", 0); + + /* TODO: add sensor info under /bmc */ + sp_impl = HDIF_get_idata(sp, SPSS_IDATA_SP_IMPL, &size); + if (CHECK_SPPTR(sp_impl) && (size > 8)) { + dt_add_property_strings(bmc_node, "compatible", sp_impl->sp_family); + prlog(PR_INFO, "SP Family is %s\n", sp_impl->sp_family); + } iopath = HDIF_get_iarray_item(sp, SPSS_IDATA_SP_IOPATH, 0, NULL); diff --git a/hdata/spira.h b/hdata/spira.h index 01ce4cb..a9338ee 100644 --- a/hdata/spira.h +++ b/hdata/spira.h @@ -262,6 +262,7 @@ struct spss_sp_impl { #define SPSS_SP_IMPL_FLAGS_PRIMARY 0x2000 u8 chip_version; u8 reserved; + u8 sp_family[64]; }; /* Idata index 3 is deprecated */