From patchwork Wed Dec 12 06:15:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anju T Sudhakar X-Patchwork-Id: 1011586 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43F65n5c8zz9s4s for ; Wed, 12 Dec 2018 17:16:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43F65n4FbSzDqjY for ; Wed, 12 Dec 2018 17:16:45 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=anju@linux.vnet.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.vnet.ibm.com 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 43F6504GL2zDqhl for ; Wed, 12 Dec 2018 17:16:04 +1100 (AEDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wBC69GC0186645 for ; Wed, 12 Dec 2018 01:16:01 -0500 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2pasjs6xap-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Dec 2018 01:16:01 -0500 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Dec 2018 06:16:00 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 12 Dec 2018 06:15:58 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wBC6Fvjf7209246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Dec 2018 06:15:57 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 10A2C4C040; Wed, 12 Dec 2018 06:15:57 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4B0244C050; Wed, 12 Dec 2018 06:15:56 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.0.138]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 12 Dec 2018 06:15:56 +0000 (GMT) From: Anju T Sudhakar To: stewart@linux.vnet.ibm.com Date: Wed, 12 Dec 2018 11:45:43 +0530 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181212061545.9756-1-anju@linux.vnet.ibm.com> References: <20181212061545.9756-1-anju@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18121206-0016-0000-0000-000002354733 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18121206-0017-0000-0000-0000328D7861 Message-Id: <20181212061545.9756-4-anju@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-12-12_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=888 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812120054 Subject: [Skiboot] [PATCH v2 3/5] skiboot: Trace IMC Macro definitions X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Add macros needed for Trace mode enablement of IMC(In-Memory Collection Counters). These macros are used to identify the trace node in the device-tree and to make appropriate scom calls to enable trace-mode in the hardware. Signed-off-by: Anju T Sudhakar Reviewed-by: Madhavan Srinivasan --- include/imc.h | 30 ++++++++++++++++++++++++++++++ include/opal-api.h | 1 + 2 files changed, 31 insertions(+) diff --git a/include/imc.h b/include/imc.h index f3d906ee..1f9f57ed 100644 --- a/include/imc.h +++ b/include/imc.h @@ -112,6 +112,7 @@ struct imc_chip_cb #define IMC_COUNTER_CHIP 0x10 #define IMC_COUNTER_CORE 0x4 #define IMC_COUNTER_THREAD 0x1 +#define IMC_COUNTER_TRACE 0x2 /* * Nest IMC operations @@ -128,6 +129,35 @@ struct imc_chip_cb #define CORE_IMC_HTM_MODE_ENABLE 0xE800000000000000ull #define CORE_IMC_HTM_MODE_DISABLE 0xE000000000000000ull +/* + * Trace IMC SCOMs for IMC trace-mode. + * + * TRACE_IMC_SCOM layout + * + * 0 4 8 12 16 20 24 28 + * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | + * [ ] [ CPMC_LOAD [2:33] + * | + * *SAMPSEL + * + * 32 36 40 44 48 52 56 60 + * | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | - - - - | + * ] [ ] [ ] [ ] [ RESERVED [51:63] ] + * | | | + * *CPMC1SEL *CPMC2SEL *BUFFERSIZE + */ +#define TRACE_IMC_ADDR 0x20010AA9ull +#define TRACE_IMC_SAMPLESEL(x) ((uint64_t)x << 62) +#define TRACE_IMC_CPMC_LOAD(x) ((0xffffffff - (uint64_t)x) << 30) +#define TRACE_IMC_CPMC1SEL(x) ((uint64_t)x << 23) +#define TRACE_IMC_CPMC2SEL(x) ((uint64_t)x << 16) +#define TRACE_IMC_BUFFERSIZE(x) ((uint64_t)x << 13) +#define TRACE_IMC_SCOM(a, b, c, d, e) (TRACE_IMC_SAMPLESEL(a) |\ + TRACE_IMC_CPMC_LOAD(b) |\ + TRACE_IMC_CPMC1SEL(c) |\ + TRACE_IMC_CPMC2SEL(d) |\ + TRACE_IMC_BUFFERSIZE(e)) + void imc_init(void); void imc_catalog_preload(void); diff --git a/include/opal-api.h b/include/opal-api.h index 5f397c8e..909a7fa8 100644 --- a/include/opal-api.h +++ b/include/opal-api.h @@ -1301,6 +1301,7 @@ enum { enum { OPAL_IMC_COUNTERS_NEST = 1, OPAL_IMC_COUNTERS_CORE = 2, + OPAL_IMC_COUNTERS_TRACE = 3, };