From patchwork Sun Jul 23 11:30:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 792552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xFj552Y3kz9s78 for ; Sun, 23 Jul 2017 21:31:37 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xFj550qNpzDrGr for ; Sun, 23 Jul 2017 21:31:37 +1000 (AEST) 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 3xFj4j1tr8zDrFt for ; Sun, 23 Jul 2017 21:31:17 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v6NBSifb084091 for ; Sun, 23 Jul 2017 07:31:15 -0400 Received: from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148]) by mx0a-001b2d01.pphosted.com with ESMTP id 2bv2112p0n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 23 Jul 2017 07:31:14 -0400 Received: from localhost by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 23 Jul 2017 21:31:12 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 23 Jul 2017 21:31:09 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v6NBV9fg26869994 for ; Sun, 23 Jul 2017 21:31:09 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v6NBV0g1002288 for ; Sun, 23 Jul 2017 21:31:00 +1000 Received: from hegdevasant.domain.name ([9.85.146.212]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v6NBUlip001858; Sun, 23 Jul 2017 21:30:56 +1000 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Sun, 23 Jul 2017 17:00:47 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170723113050.8815-1-hegdevasant@linux.vnet.ibm.com> References: <20170723113050.8815-1-hegdevasant@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17072311-0040-0000-0000-0000034A52FF X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17072311-0041-0000-0000-00000CC6648C Message-Id: <20170723113050.8815-3-hegdevasant@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-23_07:, , 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-1706020000 definitions=main-1707230182 Subject: [Skiboot] [PATCH v5 2/5] hdata: Add 'primary' property to master chip xscom node 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: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Needed for SBE communication as some of the SBE MBOX commands has to be sent to SBE on master chip only. Signed-off-by: Vasant Hegde --- hdata/spira.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hdata/spira.c b/hdata/spira.c index d09dbfe..e6fbf0e 100644 --- a/hdata/spira.c +++ b/hdata/spira.c @@ -401,6 +401,20 @@ static void add_xscom_add_pcia_assoc(struct dt_node *np, uint32_t pcid) } } +static void add_xscom_primary_property(const struct HDIF_common_hdr *hdif, + struct dt_node *xscom) +{ + const void *pnor; + uint32_t size = 0; + + pnor = HDIF_get_idata(hdif, SPPCRD_IDATA_PNOR_INFO, &size); + /* PNOR is attached to master chip only */ + if (pnor && size > 0) { + dt_add_property(xscom, "primary", NULL, 0); + prlog(PR_DEBUG, "XSCOM: Found primary chip ID\n"); + } +} + static bool add_xscom_sppcrd(uint64_t xscom_base) { const struct HDIF_common_hdr *hdif; @@ -471,6 +485,7 @@ static bool add_xscom_sppcrd(uint64_t xscom_base) if (proc_gen >= proc_gen_p9) { add_xive_node(np); parse_i2c_devs(hdif, SPPCRD_IDATA_HOST_I2C, np); + add_xscom_primary_property(hdif, np); } }