From patchwork Thu Jan 26 01:32:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sukadev Bhattiprolu X-Patchwork-Id: 719932 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 3v84FX3CSMz9t0v for ; Thu, 26 Jan 2017 12:33:52 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3v84FX2PNRzDqGD for ; Thu, 26 Jan 2017 12:33:52 +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 3v84Dj1hCBzDq6N for ; Thu, 26 Jan 2017 12:33:09 +1100 (AEDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0Q1SbwF013605 for ; Wed, 25 Jan 2017 20:33:07 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0a-001b2d01.pphosted.com with ESMTP id 2872ru93cm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Jan 2017 20:33:07 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Jan 2017 20:33:05 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Jan 2017 20:33:02 -0500 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id E1DFD6E801D; Wed, 25 Jan 2017 20:32:33 -0500 (EST) Received: from b01ledav03.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0Q1WqKI47251602; Thu, 26 Jan 2017 01:32:52 GMT Received: from b01ledav03.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4A978B2056; Wed, 25 Jan 2017 20:32:52 -0500 (EST) Received: from suka-w540.usor.ibm.com (unknown [9.70.94.25]) by b01ledav03.gho.pok.ibm.com (Postfix) with ESMTP id 620CBB204E; Wed, 25 Jan 2017 20:32:51 -0500 (EST) From: Sukadev Bhattiprolu To: stewart@linux.vnet.ibm.com Date: Wed, 25 Jan 2017 17:32:32 -0800 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485394353-30319-1-git-send-email-sukadev@linux.vnet.ibm.com> References: <1485394353-30319-1-git-send-email-sukadev@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17012601-0044-0000-0000-0000026111EF X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006499; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000200; SDB=6.00812734; UDB=6.00396396; IPR=6.00590152; BA=6.00005090; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014050; XFM=3.00000011; UTC=2017-01-26 01:33:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012601-0045-0000-0000-0000068E11B4 Message-Id: <1485394353-30319-7-git-send-email-sukadev@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-25_18:, , 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-1612050000 definitions=main-1701260012 Subject: [Skiboot] [PATCH v5 6/7] vas: Define vas_get_hvwc_mmio_bar interface 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: , Cc: hbabu@us.ibm.com, apopple@au1.ibm.com, skiboot@lists.ozlabs.org, michael.neuling@au1.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The nest accelerator (NX) will need this interface to initialize its UMAC MMIO BAR. Signed-off-by: Sukadev Bhattiprolu --- Changelog[v4]: [Balbir Singh] Make the new interface inline. --- core/vas.c | 9 +++++++++ include/vas.h | 1 + 2 files changed, 10 insertions(+) diff --git a/core/vas.c b/core/vas.c index 688fa0f..a86444e 100644 --- a/core/vas.c +++ b/core/vas.c @@ -33,6 +33,15 @@ static inline uint64_t get_hvwc_mmio_bar(const int chipid) return VAS_HVWC_MMIO_BAR_BASE + chipid * VAS_HVWC_MMIO_BAR_SIZE; } +/* Interface for NX - make sure VAS is fully initialized first */ +__attrconst inline uint64_t vas_get_hvwc_mmio_bar(const int chipid) +{ + if (!vas_initialized) + return 0ULL; + + return get_hvwc_mmio_bar(chipid); +} + static inline uint64_t get_uwc_mmio_bar(int chipid) { return VAS_UWC_MMIO_BAR_BASE + chipid * VAS_UWC_MMIO_BAR_SIZE; diff --git a/include/vas.h b/include/vas.h index 56e8a13..904c663 100644 --- a/include/vas.h +++ b/include/vas.h @@ -37,6 +37,7 @@ */ extern void vas_init(void); +extern __attrconst uint64_t vas_get_hvwc_mmio_bar(const int chipid); /* * HVWC and UWC BAR.