From patchwork Thu Jan 26 01:32:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sukadev Bhattiprolu X-Patchwork-Id: 719927 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 3v84Dr3h97z9s9Y for ; Thu, 26 Jan 2017 12:33:16 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3v84Dr0srHzDq8b for ; Thu, 26 Jan 2017 12:33:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 3v84DW5LQKzDq5s for ; Thu, 26 Jan 2017 12:32:59 +1100 (AEDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0Q1Sd18121900 for ; Wed, 25 Jan 2017 20:32:57 -0500 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2874nkw2t8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Jan 2017 20:32:56 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Jan 2017 20:32:56 -0500 Received: from d01dlp03.pok.ibm.com (9.56.250.168) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Jan 2017 20:32:52 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 05AC2C90043; Wed, 25 Jan 2017 20:32:34 -0500 (EST) Received: from b01ledav03.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0Q1Wemq4129232; Thu, 26 Jan 2017 01:32:42 GMT Received: from b01ledav03.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 544DFB2046; Wed, 25 Jan 2017 20:32:42 -0500 (EST) Received: from suka-w540.usor.ibm.com (unknown [9.70.94.25]) by b01ledav03.gho.pok.ibm.com (Postfix) with ESMTP id 763AAB2056; Wed, 25 Jan 2017 20:32:41 -0500 (EST) From: Sukadev Bhattiprolu To: stewart@linux.vnet.ibm.com Date: Wed, 25 Jan 2017 17:32:27 -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-0056-0000-0000-000002930C92 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:32:54 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17012601-0057-0000-0000-000006C80C98 Message-Id: <1485394353-30319-2-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 1/7] Define helpers to extract P9 node/chip ids 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" VAS needs the node and chip ids to compute the "paste address" of a window. Signed-off-by: Sukadev Bhattiprolu --- include/chip.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/chip.h b/include/chip.h index 61b413c..f16f00b 100644 --- a/include/chip.h +++ b/include/chip.h @@ -98,6 +98,10 @@ #define P9_PIR2THREADID(pir) ((pir) & 0x3) +#define P9_GCID2NODEID(gcid) (((gcid) >> 3) & 0xf) + +#define P9_GCID2CHIPID(gcid) ((gcid) & 0x7) + /* P9 specific ones mostly used by XIVE */ #define P9_PIR2LOCALCPU(pir) ((pir) & 0xff) #define P9_PIRFROMLOCALCPU(chip, cpu) (((chip) << 8) | (cpu))