From patchwork Wed Jan 31 05:58:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 194490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1692057dyb; Tue, 30 Jan 2024 21:52:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfjU0Ri6RIRMGM/FEwcKIzhChtea7DmRP8pw8i9R6L6BQZkx7QqyGrn7CYX03ImZfScu6U X-Received: by 2002:a17:906:7d46:b0:a35:ad04:dcbc with SMTP id l6-20020a1709067d4600b00a35ad04dcbcmr243981ejp.32.1706680331754; Tue, 30 Jan 2024 21:52:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUp+JK7xFmBn924+V9R550APM4lH9/iQ+TQKxM3HCV/WMnNu9eg8czMkLFzrRXaPZXw1G6Sg4u5+JQjAs0L6I2n1Ykdew== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z25-20020a1709060ad900b00a34a0163f84si5159696ejf.762.2024.01.30.21.52.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 21:52:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45784-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QpB6I2oy; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45784-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3910B1F27A42 for ; Wed, 31 Jan 2024 05:52:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76C523E476; Wed, 31 Jan 2024 05:51:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="QpB6I2oy" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDBD23D992; Wed, 31 Jan 2024 05:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680310; cv=fail; b=dz6bX5745dGWCyv1XWR++Kma9w5oBZ0oegct7x1lYpJf/DdJAuPbJa8d6yA7kNTXTDfEXjsuODwHIzW2v/oOxkuZzzyz+Ofd82WcoS+HquEqIxhQCy23Oi2YBHhvUX6p3P/z+Ua16cTJxJfSfl+AYDeNtF4mhbx9O3jULTAlK5c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680310; c=relaxed/simple; bh=cVde6WZZ8HsLk4X6eY3reZNfLaR+niSzWXpEPHurGp8=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=rsp8eDwGAHcLsK8bYL4KjaT+MSTNWg/P1sJrfbizd6U3NGjbve5jOUVCeWLR5/ZoTsOUr9wZchVQf4IqTobE+80EoHZxtAPHJ9w9hfxc8zRufD5PztRlgG3Rf/WGBa5KGLOag/r4AzwxpXP8cgPbpSuT6NZtAAwCZDqCIQsuMbk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=QpB6I2oy; arc=fail smtp.client-ip=40.107.20.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MasTtyNuOeKw+W+iLydfrl2yy+eiMTVqhtkdhWHpS0bIVgmL3xP1i/+Fki9LnRth6gFYvxpEjO51506fCB4wrOqZJE+T/hCT1rPLbSAJP+YIL6pTZdHUcuOtlwfebHwbcfHoZ+dJeKrr6mwN+TJNwENqSxLmsp9FLTOiDSAgVO6Vqcb4Gj8W0OBWA0hFA0JwG162go++fCnBFCjd+R2ji/iA5XeSLQ/plHWjFVVO8fIKLLH8O3c3uT6nbEeZ/T9faXiUDB1xoRcOwX67PTnSAjUabSjfnBIjFD8UnRG3xDY2uqRFrxDEWlQwdtPeB24UfouCXlk9bBrHl72uzN6Rug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6MQpKWNCIPIQeFKh55xXavHzqCezMgCyVlcBJTQ6oqs=; b=oP3I/b+CKR6+9kfrR7Gaua/va4sUeTfGV+avHiApSZQwdx4zOVU80QPraATdRC6+H2vkDSVrNtYXhnHS1UxuKCvYTV8V9VDl9BEF5QyiFUt4YdAxi0F5auCSVWI2gbML4cbQlTBRqTRVxrXHw0z1Pqs0AT/BR7U1Bt/z7N3NP+wy5EFiAejE6DxOi6rvEbtIQ4F3i4ZHRqCRpQPx+1c4YfXDD/rQ39vM6w3A0oc/DwzHWcqQRMNLqMLAqFr7Rmhw8WnBGwjg0bN5p4irDSA2Zg+ilFadhyWxWqvGHAyR+YWOsElfGO9/iSG1ZypCDhqpOc4hrI0j9OHJNJik2+KYPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6MQpKWNCIPIQeFKh55xXavHzqCezMgCyVlcBJTQ6oqs=; b=QpB6I2oyVK2Qi/U2iDBnS26Szzj4eUJNmbN+ge3AFtdi3I6kXCDwC/Q6gPorDcWH8nh2rAQU2EE4bZNIOpdnEdEZcCqiNxeBBlMFRQGtJxxhj8P0szIUuKHHBssQmbevhokXRFZC10IhV5jzXvgVjP6TjRsQ/zF7lxGPzxSIyYE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by DU2PR04MB8917.eurprd04.prod.outlook.com (2603:10a6:10:2e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 05:51:44 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7228.029; Wed, 31 Jan 2024 05:51:44 +0000 From: Xu Yang To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: linux-imx@nxp.com, mike.leach@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, xu.yang_2@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v4 1/6] dt-bindings: perf: fsl-imx-ddr: Add i.MX95 compatible Date: Wed, 31 Jan 2024 13:58:06 +0800 Message-Id: <20240131055811.3035741-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:4:196::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DU2PR04MB8917:EE_ X-MS-Office365-Filtering-Correlation-Id: 5660fbae-b455-46f8-8f8a-08dc2220b455 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AP2FutxDVWCvW5zf9KoRUYeEb41kOdeXJsS8Jji4e8f5hTuKfcYFwDtgzoG/fO/RwEPiDVdO1CVjX6qxRRK3e7hyAnmQ+kQj4jRoJ5YJoHQNRTqJaThVGwxom3pdyk4S7ADxr6FTqneAbf7e0+1+bVI/oOXklR6OS/IZ4hxYp7bXGXhnl+OWcFu07+XL2B3I5JasGG3a/1SmuOvltnOoyS8gu5UvkZ5ZklT9h1XjGmH4Je3BumckOt3AwU7RPshOM17M/fW0xHvsaAkSKytWN4WF3GqEnB1BxUqRDhGpJFQohN5+9JQ7C3/DgbW36QcUg2HhamQSuGCYZ4Na/2V9z9P9PALujA47aXfnEAj+u4LyxyGiRBREBlL6MadoPTxlu1j89yJKM0k3pE4jXqXrIRjcq68e8tIoNJiMlVIiwh5yVkEOfd+4ozhbWQc7iTIj0XcXl0UId6aCsrWzXS76Fpl/fEXKRa8HsEUViIthdgI0MVOVz5pY+gytUCkVOsG4uJeM77vtZpmgmpno0kIQwHlF7e7dVtnqSUpkmifpjwiEuyUg01VsjLRfPOs9w71ZNa3n2EbGwaxL4gwcESuLGI8qA5gWaJZk3OtZrpYNLGN1Erwh/HV8MhskUOVvX0cXjQdsFVKrruO6kVOcMrWqqQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(4744005)(2906002)(36756003)(41300700001)(921011)(66946007)(66556008)(66476007)(316002)(86362001)(6666004)(2616005)(1076003)(6512007)(52116002)(6506007)(26005)(478600001)(6486002)(5660300002)(38100700002)(8936002)(8676002)(7416002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jE0yb2WGKtQYB+7gvOKfWe0WEb1f2YvtcbBOelACBvWbfjrYrbqHl3Wszln8D/M19Upqi0tESLbkgIIl7fr3UpdwiSaujsrCcl+Q/fuMJsdoli0Y9b+XwhOB7gBq+LyvLVDVYrN3Yx//FiUj/PdV+NdTynPHrEJSUv9rYQN7TxhDPfVvMLSihry9VEs23qL2BA1A0sIe47bmIshfmpEBjjP14LHy+mvbklR+uU9xBUPisan+OvQ444sS3G/UjC7h5V3dBOi2HO8U8XRsKlt3NLE+aVL6rNb/kWjxANuiirIw3WlOtVafO98cHFhC/5vLmyv6tdN2AGBtU+Zy/dWbRxfce2RANWVvE3N+nTYrQPIgfQp4OEqLiFdsxIFiDTwOxFHNzQnlE+OdlhNmR8CMBYqMlScYurC/lqVPGP+mDjIn51pAp/tAXGMEPBUwrB9CYHVD/pLIkBLZlqchar3feKx7jECoBcyqbV2syg+KDwjwHJWb49loLfCNH/O+ycVRFAWWOeLlOun0hhktyTVVoQNXNX/uMcQ386f1YAv6N2tPaUYdKeHFezfInSwhRj5ePWGg6tZNOFQkLTT7kniwB97k3Asv+08vuJEgDvvKXx6owd1qXQN3XO/j6XzbupNeJ28bZnTgQZ86XDgWrI83JaAyPZUNYfWXRZnRnqfW8DD8v0RTc9Vuv+K8YC6m1KJ9WvI80H3Spikwbp7E/soOWgA8YgRGa28TTzKAUY0ERHLMOr2QWbaaSUc+7E2RZWc0Ri3f8z9kY8Mib7KdVh83nnYOuFOYF2wCD7jaPW6F281lvL8zzFyFPHreWCoAgstICdMDV2DA2WmZxjLMfRK6gPnD/A/eF9y6pFDlFHnGFXFeJVX5jhkP0J8zniKYYGBPOCfGlyiE1x4qya4n6BeikboMK8qFPo0HjvDZ3RdTZHQuXP/37X34z/+YPq0XWYnsKibtrqoC/e++v1EXuy8FEzYIWBRqPIPZMtkObq8MxKYjo/Ucq3jKFVQZg3Z7MpWUoNOk5vqXDjcNIorP5q/hqKSDxoeirmthDMywNP+QboXdv6nCbSctSP/FT2ooZsvPwWR/+mhr6HcmXfjp/8LiAHJULnYU/vmEZqExS1gclKEpidjQN05jIfK84/1ZcFvcaS5rq/Pn07ZIL+kZrMv7sYWhMgpjET2vQuR14x1suKv6MXkRPVFcKjTz8LgYHrSr73N/TMVInE2cOiqRCgaJrfviPsVmZ9Or3UcSiWwMikqBLVWmLYsZx6PcvcDfdWuCT7D1mLPVj3C2YQVUdxgm62as/vkDziwitaD95dLAm393XCpKAAj+ia+D/rewyPS+20g8DE2jjdHhhz9OE9oGyBkYzHuv4RzTF33M1dc9phggMvgYByEFTHmcGiplKhYsdCluTrjQE1EfjCyNT9i39wHpkw86QJaXHziBnlWoHXv95ImV593U+hjfzAH6KSuq/B2jSwsh+uZ+SuDUdg4oRkfrPSaWINFvWp99+89h9gmNUWW9vsQOFKMba/dSJbpGjsRzk2MA7wbcytrA0rGNEovzkseGj/48K4Fo43xcgMIjU5OEnYWfuyEk7TuW3Wd+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5660fbae-b455-46f8-8f8a-08dc2220b455 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:51:44.3016 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /8Mt7/Q0rNPdy1oPbiNLy7RoeP+/aqHP66WaiezrkREs/F3mMQI1s0kr3a27neRL1puOYbrEEw9rOzfJmdVZ+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8917 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789584035353279676 X-GMAIL-MSGID: 1789584035353279676 i.MX95 has a DDR pmu. This will add a compatible for it. Acked-by: Conor Dooley Signed-off-by: Xu Yang --- Changes in v2: - no changes Changes in v3: - let imx95 compatilbe with imx93 Changes in v4: - add Acked-by tag --- Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml b/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml index 6c96a4204e5d..37e8b98f2cdc 100644 --- a/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml +++ b/Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml @@ -30,6 +30,9 @@ properties: - items: - const: fsl,imx8dxl-ddr-pmu - const: fsl,imx8-ddr-pmu + - items: + - const: fsl,imx95-ddr-pmu + - const: fsl,imx93-ddr-pmu reg: maxItems: 1 From patchwork Wed Jan 31 05:58:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 194492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1692375dyb; Tue, 30 Jan 2024 21:53:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjyLO4Ab4ygG8MxNms882LcyJCK/IFHZZpmxd0lcJQzNNXKlfpNCeWjbid+k+CDaXRs322 X-Received: by 2002:a05:6a21:8017:b0:199:31af:9207 with SMTP id ou23-20020a056a21801700b0019931af9207mr528363pzb.52.1706680397834; Tue, 30 Jan 2024 21:53:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWSkSxC+LoMurdh9KhuOCd6LfH6QG5KWVwaz+tLb+7aedwteLkGAGyfF9k8o+E11RuBY+ZXdkT1sJzN2Pu6fu2FIIsozw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k6-20020a17090a514600b00295d223fe70si486500pjm.180.2024.01.30.21.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 21:53:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45785-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=plI84fsv; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45785-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45785-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4C8DD28861E for ; Wed, 31 Jan 2024 05:52:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E15D3EA72; Wed, 31 Jan 2024 05:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="plI84fsv" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47EE13E481; Wed, 31 Jan 2024 05:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680317; cv=fail; b=NU2N8Md2VJj4QeI6X6d/yjUIG13hmgjPL/UyY2XKFeIa7iK77IYIE8z4JaZ7k/aritXaBmGU8rGECm8V7RvG1rtfocqdj2YUPY1xPnuVKpWZe3HfBjXzR9/Nkgrrjiw+gQDgmDuL7mhYcbkfYmueXbWSLsqjW8ocKzDqNTXqNxw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680317; c=relaxed/simple; bh=e1+Gr6O5Rq5dDxl2J4FxwaG/SQZgkYxWEys7XxggBRo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=bVZltho2yOoh6bkkK0yB1SH6tw/nI46AHCkKWDqpUD+Z8GhWj1ay++xLXY1mHxREGa7xA0np/ACn97yMCwXyrsTrRtc/t2Gpc7ergxuzrtsQqCAoCmTwJfIc5ZY+0JBTU5QlQOMXWZrenbaFbZp3gHKRsgrcNstiEW5ZQF6OHQI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=plI84fsv; arc=fail smtp.client-ip=40.107.20.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZpRAzMzS3mnam0hEL/VsgvJEpa4F5xO4tYWBiAqmQbZ0eoqORmvCh2B5xZqnNvx6bCKnswT9gyfaoKq1JHlZF7NMQR0yLvr/mzXJCayqm7s8fZ/qL2U9Fy3Gion+x/B6SGKUefW/KHjX4zxKb14zMbXNFJuVORkKpW+GB0BrT/BluYwZywQR/1dk3I0kYdtLGYsgmU28ZG8+6sNT0ZTfhHnlch2Ou+0pZBNZDL13pwlFxS75iuU6ykukcrcmn20VK1dB/SUYtCPjlh663Lbc4zWxnWeoJjrwAEpMaU4NscQ729FTAELf7FBazjr/19RQwowVVyfplOzGjUxiyaG//w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6UPtYkEoPdypkuvdXdJNYM7uRMKl+NJ/DGucqE5TkSk=; b=RptRjWx4eMmQSyNhivIfZtUkIQb4nMcq4timNvEWgqFv1vaLTWxHLaz4PxAxD0djwc5sP9D2tTMFuQN5eJ8FUaXHtydHAZ+rvH4izLfuHIfmVybFeKwlfbR0t9TrceOPPbN4UeucZcuEscl7849JCsSUxAQkNHuRf6wzIymSivPjotYruJwEO9bmGUtu/tn23A15U/Q8QzXkw3HJditYbc1T7j6VqJ9dWL7sKQfOedSxkjUzdno5esrUldp1vzXSYjireZ+KRr9BUfGsxL+/4tK+4v/h2fgOMEmsXSYN6CEJpV1aQhtxliK2pMth+0p5VBSV2JFr/L18ZSLut61Vvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6UPtYkEoPdypkuvdXdJNYM7uRMKl+NJ/DGucqE5TkSk=; b=plI84fsvQdZCIor28qBhJhybrZOCubuzNVqmVGVgsuBrOOK4jWCms72LkGtYDkEUDCdrsa8RWxFswDFUy7wqjBefetTyj6rZKb5TC0cDGWs5lPWDw3QVze+JX9cnedFRaNxQwpuniNtiLtu0T33Y3D03NeuvovXIAvG0Ptwktlg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by DU2PR04MB8917.eurprd04.prod.outlook.com (2603:10a6:10:2e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 05:51:52 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7228.029; Wed, 31 Jan 2024 05:51:52 +0000 From: Xu Yang To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: linux-imx@nxp.com, mike.leach@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, xu.yang_2@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v4 2/6] perf: imx_perf: refactor driver for imx93 Date: Wed, 31 Jan 2024 13:58:07 +0800 Message-Id: <20240131055811.3035741-2-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131055811.3035741-1-xu.yang_2@nxp.com> References: <20240131055811.3035741-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:4:196::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DU2PR04MB8917:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ee530a6-e1c3-41ff-7f2c-08dc2220b94e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XxuA95nfhVvrirhpYVjxnlKyJUa9B3ArFgpIFGD+foX+x6+za5AI8s0l7gOES8Kvzt26dCONxisX2RasxB3TGmOQWit1fr18iK3qid1+hxRlsfgkizTKR6b2Ccm1QYecGWqN/cWsuNWrKxPRXdlT3YjHcz0GmnVDyzdL88BwX+wZB1mJkxZfbozJYoK4Fi7JBYbmEOtg/KfaytMUZAQ3kUMHcZTrFCZ5CAsonH0r8VaLd195dD4iNZ9sm3aTmQRTHkQzy77DLK1P2RRrLq4jh1fVulDCOSnTgL3D2UbVyN3dGi/JsH4S+d3CXomobXpeWJD8rstylu6KZpy9qcE3rLVAfp+iU27Bdk5cy3o6CLRQh9nCOQJxwboYDdPcLQ+GOF8ju6VAtuYJtWJj9qBY5MOqNcW8fkkfQW/bq8AXqKe2ukaAzj2zNQIqGkuC3rmCw/MldrNgxKx1UsVeK3dNDClf3tGjkMCi3UOdB5vyPIKWQhTsxD+AsRX6j2tbPcDvM2+CjnyTYgsU6R6+tmlO7XHLPPM7B7OAus0ev/ByGaG7TozLc1run7BFXdwCOP8vGdAchI0sautMNSBkEXZmAeqUyhQFK1YSBbJom2TapHzcc76Fdx2m/Y6/1ZZFFTLiB4VMJKt4fZX6zyGEAuLA7w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(2906002)(36756003)(41300700001)(921011)(66946007)(66556008)(66476007)(316002)(86362001)(6666004)(2616005)(1076003)(6512007)(52116002)(6506007)(26005)(478600001)(83380400001)(6486002)(5660300002)(38100700002)(8936002)(8676002)(7416002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jWIQS6Avhtp+FvKqVao79wNzY3thIcFxv9Ey4AfLbei2/Zk1P8gvZmd1cnaJjAi3fd1Y7jf3aC1yBnIK7BoO9syRYar85k20ZKkEuJyxECQK6uNhd5Z+afAnwkmOTItzYq0CypRbRtRjdAHjZyVzTDDfWqTU4KRqKcrACIOx6G6j0U/ky4YoBTZo+2hf61j3oBFnDu6Ojwn6/NiU0k+X/mz4tJl2wLCRhUtDa87FgBLSi9iuhKoC3/NQpnuRn7sXt5NsYyKImdA4/bzfzt0vpUN+O0+y5dPgMacIxrTpkd3uVWui2YKSxOcqfXz+8x/P87lmyrL6D6E8pBsRsHjJj0R6UGUm5TzjfF9QuyKq/Uyyqw0V5gOcIyPBKduaex/PZZNAO68ydHPuStPoCpb0ZInS6LOGz8lJZwWWoz40fQgwd8FiuTuhlzBm+N1uzDN0k8urzlihAu20YHAAd3n2PKuikbu9W2Bj+ko+I82SgHu8P9rd545Zt6+wRS4iD9w30k9EM8/WBFFtZQN01rr0g7j4ZrrQuYBrHWfFxt1NsiCqA9D92fOnWtLr1+5r7Bs2fEqegPlkPUv/QPaFW22F6ONNVygc7CvcLLbuKUGfDOJXO4+K9RdNNJHFO7AlAmrEBx7hR4UvYhVUVKE9OjW+it1ouQNxkOtJgOs1yt2tnm1gBIdrRYSP+wOEvMHspBtxyzAnyYSWFEQL0rHPqSqQM4AVuOo2Lyh9W1sKB954aR6G6ZbhbulgySjlIA/LbcRRfXRezrHpE23kTGy68mDIkMYwj1fLqgbMetCvr6CuYTICKCT7SqLiqCCJqbDLLbsOewLIujozXW0jFWKqyqqRXGBcUNE0b8Otse5KTFHKIZDqkHxvtclbsdE+nVPfdax+HkL6VEK2EFeIdrTcfxe1JCXHfe8NdB63a9XOdPyYOe5u9Sd5wOT+U7CBroTJ1/1jwqD04QwgCNBv4QeOcwJcMDl5LdeYQTx3Ju6cR97FxWEc558LJTXLaCCT6dsIN/+BycVq2vgJxs8Jw2lUWyZ9eg20VMACNmbz95dZmnlaK7Rq/8yRF/owe0FtskSH3O+X7qwqYbhjc8aziJn8rEhAaFnCUY5SrOQmLEzECqionLI+UJng4wKVGshHIueFIBl8NQ0WrJUmPXUomuHRAC1eE63jte+RT1tcyJ8ApCNdSZeM1rU7mbqqmvFtrAgauugeRZBj4kvDY8UlOs0nh6mx52ntH+2HGY/l4eKnGHwsiR7lWJXwan5WNSApfelD3gkGy9B5HVFGHgl2tVKYx0c1w/Jsuty7aLopV9jCciVB7DcEYwpybJ/jII5R8/pTUA46R4iicOu/QTVWuZIEEHWaPa/73Pr68y+24ZRApBgESBganU4WSno7GgqxJnOC0oRC6DyT0d4P/wzBqU6Wff3eJ6QNdJ2masBjViGWKIDTRVEh6ejgoPleyhXUuNP5oGaSWpUIOPUUQ/nsaen8dlJ47B3yRtGEIHQwYAeYOxrdB4EZ096WWDOS65V+LAD+IwhhEj9FWiBlyf3fIwnhgm7iaTLTkcxd6cyvN+UnSsg18aFs7hCvOPfsWt16aNxD858c X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ee530a6-e1c3-41ff-7f2c-08dc2220b94e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:51:52.5006 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5fOqndz6yS7Wa5MNlCw7/7z+MX+Qb38bG/Icv6ghvFESOPE5JnWmRON0HXQMktRuxZw9cltOCG6Uluaix0wCMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8917 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789584104341081720 X-GMAIL-MSGID: 1789584104341081720 This driver is initinally used to support imx93 Soc and now it's time to add support for imx95 Soc. However, some macro definitions and events are different on these two Socs. For preparing imx95 supports, this will refactor driver for imx93. Signed-off-by: Xu Yang Reviewed-by: Frank Li --- Changes in v4: - new patch --- drivers/perf/fsl_imx9_ddr_perf.c | 121 ++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 34 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 9685645bfe04..b1a58e9e1617 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -11,14 +11,14 @@ #include /* Performance monitor configuration */ -#define PMCFG1 0x00 -#define PMCFG1_RD_TRANS_FILT_EN BIT(31) -#define PMCFG1_WR_TRANS_FILT_EN BIT(30) -#define PMCFG1_RD_BT_FILT_EN BIT(29) -#define PMCFG1_ID_MASK GENMASK(17, 0) +#define PMCFG1 0x00 +#define MX93_PMCFG1_RD_TRANS_FILT_EN BIT(31) +#define MX93_PMCFG1_WR_TRANS_FILT_EN BIT(30) +#define MX93_PMCFG1_RD_BT_FILT_EN BIT(29) +#define MX93_PMCFG1_ID_MASK GENMASK(17, 0) -#define PMCFG2 0x04 -#define PMCFG2_ID GENMASK(17, 0) +#define PMCFG2 0x04 +#define MX93_PMCFG2_ID GENMASK(17, 0) /* Global control register affects all counters and takes priority over local control registers */ #define PMGC0 0x40 @@ -51,6 +51,7 @@ static DEFINE_IDA(ddr_ida); struct imx_ddr_devtype_data { const char *identifier; /* system PMU identifier for userspace */ + struct attribute **attrs; /* AXI filter attributes */ }; struct ddr_pmu { @@ -67,16 +68,6 @@ struct ddr_pmu { int id; }; -static const struct imx_ddr_devtype_data imx93_devtype_data = { - .identifier = "imx93", -}; - -static const struct of_device_id imx_ddr_pmu_dt_ids[] = { - {.compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data}, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, imx_ddr_pmu_dt_ids); - static ssize_t ddr_perf_identifier_show(struct device *dev, struct device_attribute *attr, char *page) @@ -178,7 +169,6 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, 70), IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, 71), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, 73), /* counter3 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, 64), @@ -190,7 +180,6 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, 70), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, 71), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, 73), /* counter4 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, 64), @@ -202,7 +191,6 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, 70), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, 71), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, 73), /* counter5 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, 64), @@ -242,6 +230,16 @@ static const struct attribute_group ddr_perf_events_attr_group = { .attrs = ddr_perf_events_attrs, }; +static struct attribute *imx93_ddr_perf_events_attrs[] = { + /* counter2 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, 73), + /* counter3 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, 73), + /* counter4 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, 73), + NULL, +}; + PMU_FORMAT_ATTR(event, "config:0-7"); PMU_FORMAT_ATTR(counter, "config:8-15"); PMU_FORMAT_ATTR(axi_id, "config1:0-17"); @@ -268,6 +266,22 @@ static const struct attribute_group *attr_groups[] = { NULL, }; +static const struct imx_ddr_devtype_data imx93_devtype_data = { + .identifier = "imx93", + .attrs = imx93_ddr_perf_events_attrs, +}; + +static const struct of_device_id imx_ddr_pmu_dt_ids[] = { + { .compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, imx_ddr_pmu_dt_ids); + +static inline bool is_imx93(struct ddr_pmu *pmu) +{ + return pmu->devtype_data == &imx93_devtype_data; +} + static void ddr_perf_clear_counter(struct ddr_pmu *pmu, int counter) { if (counter == CYCLES_COUNTER) { @@ -361,7 +375,7 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, } } -static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int cfg2) +static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int cfg2) { u32 pmcfg1, pmcfg2; int event, counter; @@ -372,27 +386,27 @@ static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int pmcfg1 = readl_relaxed(pmu->base + PMCFG1); if (counter == 2 && event == 73) - pmcfg1 |= PMCFG1_RD_TRANS_FILT_EN; + pmcfg1 |= MX93_PMCFG1_RD_TRANS_FILT_EN; else if (counter == 2 && event != 73) - pmcfg1 &= ~PMCFG1_RD_TRANS_FILT_EN; + pmcfg1 &= ~MX93_PMCFG1_RD_TRANS_FILT_EN; if (counter == 3 && event == 73) - pmcfg1 |= PMCFG1_WR_TRANS_FILT_EN; + pmcfg1 |= MX93_PMCFG1_WR_TRANS_FILT_EN; else if (counter == 3 && event != 73) - pmcfg1 &= ~PMCFG1_WR_TRANS_FILT_EN; + pmcfg1 &= ~MX93_PMCFG1_WR_TRANS_FILT_EN; if (counter == 4 && event == 73) - pmcfg1 |= PMCFG1_RD_BT_FILT_EN; + pmcfg1 |= MX93_PMCFG1_RD_BT_FILT_EN; else if (counter == 4 && event != 73) - pmcfg1 &= ~PMCFG1_RD_BT_FILT_EN; + pmcfg1 &= ~MX93_PMCFG1_RD_BT_FILT_EN; - pmcfg1 &= ~FIELD_PREP(PMCFG1_ID_MASK, 0x3FFFF); - pmcfg1 |= FIELD_PREP(PMCFG1_ID_MASK, cfg2); + pmcfg1 &= ~FIELD_PREP(MX93_PMCFG1_ID_MASK, 0x3FFFF); + pmcfg1 |= FIELD_PREP(MX93_PMCFG1_ID_MASK, cfg2); writel(pmcfg1, pmu->base + PMCFG1); pmcfg2 = readl_relaxed(pmu->base + PMCFG2); - pmcfg2 &= ~FIELD_PREP(PMCFG2_ID, 0x3FFFF); - pmcfg2 |= FIELD_PREP(PMCFG2_ID, cfg1); + pmcfg2 &= ~FIELD_PREP(MX93_PMCFG2_ID, 0x3FFFF); + pmcfg2 |= FIELD_PREP(MX93_PMCFG2_ID, cfg1); writel(pmcfg2, pmu->base + PMCFG2); } @@ -476,12 +490,12 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) hwc->idx = counter; hwc->state |= PERF_HES_STOPPED; + /* read trans, write trans, read beat */ + imx93_ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2); + if (flags & PERF_EF_START) ddr_perf_event_start(event, flags); - /* read trans, write trans, read beat */ - ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2); - return 0; } @@ -596,6 +610,39 @@ static int ddr_perf_offline_cpu(unsigned int cpu, struct hlist_node *node) return 0; } +static int ddr_perf_add_events(struct ddr_pmu *pmu) +{ + int i, ret; + struct attribute **attrs = pmu->devtype_data->attrs; + struct device *pmu_dev = pmu->pmu.dev; + + if (!attrs) + return 0; + + for (i = 0; attrs[i]; i++) { + ret = sysfs_add_file_to_group(&pmu_dev->kobj, attrs[i], "events"); + if (ret) { + dev_warn(pmu->dev, "i.MX9 DDR Perf add events failed (%d)\n", ret); + return ret; + } + } + + return 0; +} + +static void ddr_perf_remove_events(struct ddr_pmu *pmu) +{ + int i; + struct attribute **attrs = pmu->devtype_data->attrs; + struct device *pmu_dev = pmu->pmu.dev; + + if (!attrs) + return; + + for (i = 0; attrs[i]; i++) + sysfs_remove_file_from_group(&pmu_dev->kobj, attrs[i], "events"); +} + static int ddr_perf_probe(struct platform_device *pdev) { struct ddr_pmu *pmu; @@ -666,6 +713,10 @@ static int ddr_perf_probe(struct platform_device *pdev) if (ret) goto ddr_perf_err; + ret = ddr_perf_add_events(pmu); + if (ret) + dev_warn(&pdev->dev, "i.MX9 DDR Perf filter events are missing\n"); + return 0; ddr_perf_err: @@ -683,6 +734,8 @@ static int ddr_perf_remove(struct platform_device *pdev) { struct ddr_pmu *pmu = platform_get_drvdata(pdev); + ddr_perf_remove_events(pmu); + cpuhp_state_remove_instance_nocalls(pmu->cpuhp_state, &pmu->node); cpuhp_remove_multi_state(pmu->cpuhp_state); From patchwork Wed Jan 31 05:58:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 194491 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1692256dyb; Tue, 30 Jan 2024 21:52:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWBiCrV3gUZMlQ2enHZjo0TdyDIJ/n4BXVuJWV/eBQm7TTeOijYbmwatb5LEIGa1fuNRSo X-Received: by 2002:a17:907:20d9:b0:a35:fbc4:4c2f with SMTP id qq25-20020a17090720d900b00a35fbc44c2fmr285670ejb.25.1706680370118; Tue, 30 Jan 2024 21:52:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVDttUmM0IHs5k2AoQvETB2iizASY4RDB9icuTO9JN82RG1bW6qyua90NYZPtw9SLZmPJfch+ScdBkIz7a8pn4dZMR8KQ== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f1-20020a170906494100b00a352623fc7fsi4485624ejt.391.2024.01.30.21.52.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 21:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45786-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Sx732rWH; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45786-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45786-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 954611F27930 for ; Wed, 31 Jan 2024 05:52:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2DB0B3EA98; Wed, 31 Jan 2024 05:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Sx732rWH" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2053.outbound.protection.outlook.com [40.107.20.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A508B3EA76; Wed, 31 Jan 2024 05:52:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680324; cv=fail; b=jA8B+khHpve+XHJ0ewTvHpUiTrjjv0F1CGfS3WOVfqOMOnl4lJyaVTiTD9gg86CyYWy177/EwPPdmi7TKMpmXv4fpbzipWwRMhyv6c/sQwvmrSWRHavM8ow8VrWtjHoTh5L4tlnQmoAcEBghwz2HNHxq0VFttVgbJtD2KtpzX0U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680324; c=relaxed/simple; bh=KNhmptDkCM7YBwd4mq/S09xULaZM58QqaTYnPL2kbcc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=qMskxKxWAt7SMoBywjzgqMEJjtGHYK6zoMXyi2wD5+PjsKnKKroLCWgTw/VGT3hUKShm/ZAxUNoVdmZd2C6QjNnRcR8hNn8J/36BWcmgfpEeiB/0rQdAKX2CVNa70ETOMZFkQbyz6gHav3Cmh+5gKCgsZoIx9kM/1w8OYR4hvDo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=Sx732rWH; arc=fail smtp.client-ip=40.107.20.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y5QoRbgEOeAV8QdDWdfm/rcB9wq88HZLoaDyg4SvIZn1vhnfnR2xe4dMCtsJj0HzCaW0xUO/A5ucJK+SrMXP/ZYoK8udMWUp/jtPG5ev10RG2jBC0J0dbAqN0mIFhDYQmBgHhRxmAcodI/q1qIIYDK7c3rt7EF5C7ho1e6adWi58fLps90AfTUEvg/pHROUILK4HuhDK1DsCIcSIrjovBcUcAGfxWUytip5DvZmFm5MTcc+q/iEVjBoVM5uxNkW5n7a3vg48Id2zApaV3tDIZ3F4Q5UZvAYxm+xr6bkZhN4Q5yZqOnFSkefl7I/E2Js2LOsGOR2QDyze7IcbaL51ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e6Ss69IAFApk/iIN3SDUVO4qAB+QehpT+RfXON/d2qw=; b=A3QwLjyG9U0UTYX5/GvFvwqP4//rifhg//yMEI8xChF8h3Hb1uwNd+5Fbl2hIAAAmFPAjSdZOQtTSdOu3UCd2bjfODy+wWGUOhIcScBTG0HPtgYT4Wx3d4lW2Q0Un9xhLSzrnmRJeBh2ToTIFgAJWaljOZHwQKewIIKihXVjjpeTsOhULh0+i8GJYLEnC6AQp8/79JIdrshlsJDbSKH7cUUnQX9FHIyxtrgF+5lBBIift1nEd76nM5FCMO0Y2Q51njw/PmzkmKfSWkd6h/BBDpU1bbuz7dV+3ZeHU0lhfzbwuFE2LOwXg4wZe9pTUHMw/xjTy9M8+76PhG91fSPwRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e6Ss69IAFApk/iIN3SDUVO4qAB+QehpT+RfXON/d2qw=; b=Sx732rWH77kWBbpP1/0o4ybWYk6ymuwhtJkC+P+YHth25nFyeZckuBaWuCTR2urzRoovzGf2KLtc+X5PSCFEcxeNIHsOt2CisjSFNmWsPEdZOPckYYyeJ/3GpZaE3/cAaSFPGihfoE5BwpMwM9Wl2mmw4tb8VPNVaqxOaoxX6ro= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by DU2PR04MB8917.eurprd04.prod.outlook.com (2603:10a6:10:2e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 05:52:00 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7228.029; Wed, 31 Jan 2024 05:52:00 +0000 From: Xu Yang To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: linux-imx@nxp.com, mike.leach@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, xu.yang_2@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v4 3/6] perf: imx_perf: add support for i.MX95 platform Date: Wed, 31 Jan 2024 13:58:08 +0800 Message-Id: <20240131055811.3035741-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131055811.3035741-1-xu.yang_2@nxp.com> References: <20240131055811.3035741-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:4:196::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DU2PR04MB8917:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f998e44-7f3b-4e37-3973-08dc2220bde4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FRewQDjndR8J4iaaKzDOYcfHRkl9FQkigfBUcWBfI+KNo2MT1zVek40qNLT3zJR5cfQeQ9c51uI6dlSKTb63L6s2+my1K6X2heRHjpqL8KnFtoqzqskGEgkXJHngs9GHF3cszrj6sRwcRAkFWD4BOeA+KpmbUAwaPQJdjxBIjTNLFSP6zeaK5ALcPisL9e9M8S9y+9+mVT6YGRMj1THEbg2HxItda2yChInMSddbZrpkc7/VV6LM5iclalacau+DgcBJe1mRrIJjpj0+T8KRzv1P6ck7x19QmqMRobuSsGmNER8Apgp7q1Ss5yqUiLP4NCWSZUM5SxZBJhPAfMF6A2xBwMIJ3B1X+sYutEXpCLmUpIy75uNhZvF6Cp+O2AsNf15OBRi0EARGEJ5X8FOLUtH4ISYUgMVBaYldSe522IpKtTcyO6jxA7jI9l3bwL+1cWRCn0GL+1ZyryFHpDl0ikfBOrmoapGB05A/Lk+OgwX4thZ5mM/py/4bh3AudIGtxqDuIC/XT3rQtaWdxcNloR1U4zQxBt4uCd2UVlbD3AgjJHk4q7wc5PLE8/uf3h/Zc9p4CDo5jdlG0SRmS8wcMRJwpw5N07Bz5G9+3IJvshIOaBAuNTOpzfKuZcDLNEGX9ucWMLCsXZPy4kVHoFu13A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(2906002)(36756003)(41300700001)(921011)(66946007)(66556008)(66476007)(316002)(86362001)(2616005)(1076003)(6512007)(52116002)(6506007)(26005)(478600001)(83380400001)(6486002)(5660300002)(38100700002)(8936002)(8676002)(7416002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lTUgT47pPXFCPTjmZoh4OFJ6AjsFiWLbpnqVDOopiSJcQIxOivLvNRxeY3xoOuZ/sr1NsdiPsK0tccxKf4T7dpyLuHmhVNSAiHGGxWSfTbuGqd2OXFm1EF8ZbyMPlxFWJTJKnpmb1G/nDtMGXCFGOakCF+TgRmMpoNERWZ4LIl7qcxbuGB1K4QvGR8WB1HUCoC2iwG0FgcPhEnYakva2+L8DOxrOY5y+zvpw6nkzZk6hu5E5zjhCfHIG7kNWyuiNX+H2+a+EzwynlbnrqgoM02uYQ+Y53HSTHXqZCVBMeJNvLG6J9pwZhGQwrGqyqN5txvw0lIvA5VBH22bXRcYUP5/W60f2SkycmJBJRlNjLqsehu4hwecm1fKe5zyOzSQW/LI5Lpm3vGtYghY41SwqIzRM449uuSuQKexYV132F2bihtKVA6JFKXcFZFChhDXMip3Jtw69Va1buLXc37htpxUTY5rDpOQAbEZd8fAn0MW+zUOFtDVyolBpqaZPVhLQH/Pd34mCTUgpqYfqdHnvnep5Nn+zwmaxCXKfWasf9R/n1iKkcTScRc9OVnYH6s8wyAUXqIxvNSoRAObQffLZ4C43UaguaOAYVSFKC1uvYFLeEtI0xFrgXLanunmuFLjfnQd1s0hEk1hntC+VEk4KhF/S9WUZKAWx4Rmm1Eqj1fRZCDHte+3U4IC7xzKgB3TZMMGLzysZ+tKJoVuRi6RdP3M1cJR6D5BOPFizipUxxtJqW3BecOVBKz5xTO35QpInXtAg8fJRwA6k6faLHuRcoJOo9RdckMgOtp6G4NJboTqNIdVws3du32NrsK4eD+J1gjSDTsQvuBNIxTdxQjE2UBjb4eHBcohEB+m+QE5jwr5ehjzAhHsE+LVx56CX9mWlyHytxbS831Dd8sbVQS2wL7ynR1cuYwrmkbmt9LobjnY8r9TIVuzU1yAmcG7OWo8F4dAuhDp5mvpHm1m2jJ+D9+mNNJNX0eA1VrQJdW+V7ijs1U2+UiBuajtQ+ddJx42XWYcYS//cdmqFfBMD6U8w3zw6ZSqHAgS5H0rbVx3fEIOhSWzaDw2iyxHiX5S9q2RpAB6C16ccFkn7zKoQI4VgjnWcGy4zOk/NGV++X4TG2tOlfVjJeN3O1hjyziCFqHNjtsBRUrfgOL43/JnDqukV8SU2SYIvzetj4j7AeMQ1Mnk/4yY5whlmLYOn2S+yy1giIvEYu+EgIn3Hc3f6pOgskDE3j9yZzKBKKxdy8Tb/WILA143W+w12vhYj0V4PW0Q0H0woA+oNnmpkWRmN9XuoPxMeCFsYx11PCj/rCbsjsj2OY27qQvW0DodwNF4SNOkN1TP7MTs1eXL4y1LoUQqv5+N5Al5NWGj1qdeD3yTejBFoQKPxHR8BzhqtpY/ojNt3imqHeqAiwABNz0+72MFX2JzEznmlCrG5DLSEkPf7uHnopkKa5WHNOgARIBBoIRU9wZehionFxjvofukwETvYz5jBuh6p7tYYiUPcJQTTI/a1B+SkgaBqcA/qtCTtC3Ti4jmCJRiEtWCANw5I6BsYcNm64t4i+lwHScBsrcH5b+j/T03hEkv82zaJTwote7L5 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f998e44-7f3b-4e37-3973-08dc2220bde4 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:52:00.1605 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2PnqUM+qgqYHitNOUSipQwoibOnDqrRyk2SxJSyonZRiIqNjUir0/jMH1O0Weenbf+PUtT33/Hygr4+Xrb7X9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8917 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789584075819508209 X-GMAIL-MSGID: 1789584075819508209 i.MX95 has a DDR PMU which is almostly same as i.MX93, it now supports read beat and write beat filter capabilities. This will add support for i.MX95 and enhance the driver to support specific filter handling for it. Usage: For read beat: ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt2,counter=3,axi_mask=ID_MASK,axi_id=ID/ ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt1,counter=4,axi_mask=ID_MASK,axi_id=ID/ ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt0,counter=5,axi_mask=ID_MASK,axi_id=ID/ eg: For edma2: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt0,counter=5,axi_mask=0x00f,axi_id=0x00c/ For write beat: ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_beat_filt,counter=2,axi_mask=ID_MASK,axi_id=ID/ eg: For edma2: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_beat_filt,counter=2,axi_mask=0x00f,axi_id=0x00c/ Signed-off-by: Xu Yang Reviewed-by: Frank Li --- Changes in v2: - put soc spefific axi filter events to drvdata according to franks suggestions. - adjust pmcfg axi_id and axi_mask config Changes in v3: - no changes Changes in v4: - only contain imx95 parts --- drivers/perf/fsl_imx9_ddr_perf.c | 86 +++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index b1a58e9e1617..85aaaef7212f 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -17,9 +17,19 @@ #define MX93_PMCFG1_RD_BT_FILT_EN BIT(29) #define MX93_PMCFG1_ID_MASK GENMASK(17, 0) +#define MX95_PMCFG1_WR_BEAT_FILT_EN BIT(31) +#define MX95_PMCFG1_RD_BEAT_FILT_EN BIT(30) + #define PMCFG2 0x04 #define MX93_PMCFG2_ID GENMASK(17, 0) +#define PMCFG3 0x08 +#define PMCFG4 0x0C +#define PMCFG5 0x10 +#define PMCFG6 0x14 +#define MX95_PMCFG_ID_MASK GENMASK(9, 0) +#define MX95_PMCFG_ID GENMASK(25, 16) + /* Global control register affects all counters and takes priority over local control registers */ #define PMGC0 0x40 /* Global control register bits */ @@ -240,6 +250,18 @@ static struct attribute *imx93_ddr_perf_events_attrs[] = { NULL, }; +static struct attribute *imx95_ddr_perf_events_attrs[] = { + /* counter2 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_beat_filt, 73), + /* counter3 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt2, 73), + /* counter4 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt1, 73), + /* counter5 specific events */ + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt0, 73), + NULL, +}; + PMU_FORMAT_ATTR(event, "config:0-7"); PMU_FORMAT_ATTR(counter, "config:8-15"); PMU_FORMAT_ATTR(axi_id, "config1:0-17"); @@ -271,8 +293,14 @@ static const struct imx_ddr_devtype_data imx93_devtype_data = { .attrs = imx93_ddr_perf_events_attrs, }; +static const struct imx_ddr_devtype_data imx95_devtype_data = { + .identifier = "imx95", + .attrs = imx95_ddr_perf_events_attrs, +}; + static const struct of_device_id imx_ddr_pmu_dt_ids[] = { { .compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data }, + { .compatible = "fsl,imx95-ddr-pmu", .data = &imx95_devtype_data }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, imx_ddr_pmu_dt_ids); @@ -410,6 +438,56 @@ static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1 writel(pmcfg2, pmu->base + PMCFG2); } +static void imx95_ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int cfg2) +{ + u32 pmcfg1, pmcfg, offset = 0; + int event, counter; + + event = cfg & 0x000000FF; + counter = (cfg & 0x0000FF00) >> 8; + + pmcfg1 = readl_relaxed(pmu->base + PMCFG1); + + if (counter == 2 && event == 73) { + pmcfg1 |= MX95_PMCFG1_WR_BEAT_FILT_EN; + offset = PMCFG3; + } else if (counter == 2 && event != 73) { + pmcfg1 &= ~MX95_PMCFG1_WR_BEAT_FILT_EN; + } + + if (counter == 3 && event == 73) { + pmcfg1 |= MX95_PMCFG1_RD_BEAT_FILT_EN; + offset = PMCFG4; + } else if (counter == 3 && event != 73) { + pmcfg1 &= ~MX95_PMCFG1_RD_BEAT_FILT_EN; + } + + if (counter == 4 && event == 73) { + pmcfg1 |= MX95_PMCFG1_RD_BEAT_FILT_EN; + offset = PMCFG5; + } else if (counter == 4 && event != 73) { + pmcfg1 &= ~MX95_PMCFG1_RD_BEAT_FILT_EN; + } + + if (counter == 5 && event == 73) { + pmcfg1 |= MX95_PMCFG1_RD_BEAT_FILT_EN; + offset = PMCFG6; + } else if (counter == 5 && event != 73) { + pmcfg1 &= ~MX95_PMCFG1_RD_BEAT_FILT_EN; + } + + writel(pmcfg1, pmu->base + PMCFG1); + + if (offset) { + pmcfg = readl_relaxed(pmu->base + offset); + pmcfg &= ~(FIELD_PREP(MX95_PMCFG_ID_MASK, 0x3FF) | + FIELD_PREP(MX95_PMCFG_ID, 0x3FF)); + pmcfg |= (FIELD_PREP(MX95_PMCFG_ID_MASK, cfg2) | + FIELD_PREP(MX95_PMCFG_ID, cfg1)); + writel(pmcfg, pmu->base + offset); + } +} + static void ddr_perf_event_update(struct perf_event *event) { struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); @@ -490,8 +568,12 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) hwc->idx = counter; hwc->state |= PERF_HES_STOPPED; - /* read trans, write trans, read beat */ - imx93_ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2); + if (is_imx93(pmu)) + /* read trans, write trans, read beat */ + imx93_ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2); + else + /* write beat, read beat2, read beat1, read beat */ + imx95_ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2); if (flags & PERF_EF_START) ddr_perf_event_start(event, flags); From patchwork Wed Jan 31 05:58:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 194493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1692449dyb; Tue, 30 Jan 2024 21:53:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjXe20F6VhrVH06htCIVUzHo8wv3o495XD+d9PVgi1IXucXOG31yFFrHBUIHQsfFH+K4S8 X-Received: by 2002:a05:6358:180e:b0:178:60fa:d700 with SMTP id u14-20020a056358180e00b0017860fad700mr376679rwm.12.1706680420461; Tue, 30 Jan 2024 21:53:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVIoeNVjIdR1344c7Z9wCrLrzcd70NerkOQb4sijS/sdyX+vVOTDlvpjsg9qpxRjJ6XmdX8d6G/ySZWJwjQ76PRWwMFTA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x16-20020a056a00271000b006dd881750d2si8844313pfv.46.2024.01.30.21.53.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 21:53:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45787-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XsLxGdHL; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45787-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45787-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 615DD28B59F for ; Wed, 31 Jan 2024 05:53:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 624833F8D9; Wed, 31 Jan 2024 05:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="XsLxGdHL" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2060.outbound.protection.outlook.com [40.107.20.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6D433EA93; Wed, 31 Jan 2024 05:52:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680332; cv=fail; b=F3eDHRQp8IGut1C2jQBUl03SYjlqWwJuakSfQS8cVttiiwJpgrnV7r7FbnsAjgTDqHwuMqO5Ha3BOmrX7FenEq0Q1EtOucMsPsS0iRLgvvQ7O7pUVFzeBmn2BJec9GkSO9m2bkL70zFWPXh5pjZXUqvD9hRenfoVDaC5/Ou2bm4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680332; c=relaxed/simple; bh=fIo0CMs8IQI7AsbSt7Y0byBIJ1+dRBv3854WDWnocpY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fybjySkyxMTiVv321js8r7hguOTpVt3LxuFo83wX3tH/93oAuQHX+waNEi1cu1MpvfWyaJ1CDLiCVS/zJ6FTbBvUEpG7TCsjwdYznjDEimkZsxFUuHomdjc1HxXjmU2poStZ6a+uoDGOkXQq5TK7cVOF2vWhQaXstow96QVbFdw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=XsLxGdHL; arc=fail smtp.client-ip=40.107.20.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X4BMgG71iQSu3MhcaXwXlDoRaXYCRz55Qk4PgGG0yFfSqHnIR9qDViUypEQXysD2/3Dy7rxntfAwR+m56aN9CSm1NxpaUj3kPppAgPMxHno2kV8kth46x2xyRofWOpfz3eNaCaHw2g7RjqmoeX2NHO0FaFNt0kQnCLcvjxnP3RzvdFKGhldO+XOSgMsGtg8Gu3wJUbz/BYtFEBwi48A2ZuVV7hWisc364IyGgfeMtEkSk+uRS+DpQaSQQu3kvEw2xh2qIz1Ydx7oxy6iHfJuoipaUi1mS4LUhuOGxDC65++U7DFFFLU7SpXizU5fc/ew1Cvy3BARBvmlfr2rJr/aHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vBI4ftkU98M4nX6JrbpHLdsrSZs1U0vy0GlcdQ7ytjA=; b=MFbaBIzFEGMtrOKzqsNAGZ4cVwTkcRcj5BVn71LItd6ZPfctW9K+lzr079misApfNupqAWz25hS6PyMxupeafP7FijLo/WKfemWwiVMi2TlC5c+aqvAuwE7qqSXw04TaYFa5DQWH46RzXfjFNAJNMaLX0c3xqxgQk0tIGbaLEw8Y2SoFF6x9jdzIH2AxV34vuI44dN7agS2TxZB8ifZKIddEglFFdYnlFInT11kzEC+MceGLAg79rEkBTWMzuRFo0ybaUh+nvGP6k4NL9LisdtjX6CueN0IkfZO8TB0VeO0BZdpghUsWoBvS4tlqTEG4KfGqCqz2HS05mLWZ/SjZ4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vBI4ftkU98M4nX6JrbpHLdsrSZs1U0vy0GlcdQ7ytjA=; b=XsLxGdHLHopqrkaVajMFEdmHeE3cazOp2IuB1487+JuANOoOeRp4hxibAKpJT5jz5eWeces2x0sekRzxYHi2H9i91bTUK0mBa4Z40Gn5Cyp7TmTRJoTxQzWYSBtw5AuMObThUHNNAAhGkJ9LhdsmO6d+wamAXo9S7mPltTtvqoM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by DU2PR04MB8917.eurprd04.prod.outlook.com (2603:10a6:10:2e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 05:52:08 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7228.029; Wed, 31 Jan 2024 05:52:08 +0000 From: Xu Yang To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: linux-imx@nxp.com, mike.leach@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, xu.yang_2@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v4 4/6] perf: imx_perf: add macro definitions for parsing config attr Date: Wed, 31 Jan 2024 13:58:09 +0800 Message-Id: <20240131055811.3035741-4-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131055811.3035741-1-xu.yang_2@nxp.com> References: <20240131055811.3035741-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:4:196::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DU2PR04MB8917:EE_ X-MS-Office365-Filtering-Correlation-Id: 3dad1156-7f86-427d-23c7-08dc2220c290 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0NoOkPgllhWs5D337/GVXeLMsxQozXPuFYBLejEvxJ150rxEjCO/UMKLDUjjR+QTOG58IdpnGjefvF4R0k3wjcpJndus6u2zRbVUciM2Fkbiov0/+owc+EdmHQ8W9de2neGUAXn7sHPfWkU5EExwIPuNRO2JArBbzmQjZbUwB6ZbvHJOXvPmPVD7HLrrSPaoLQ/+aw6yQgk2QeT14KPkltOgk2VHTZDfumzQno6LVLRqwp/vinCboYj8RswOSLCSL/MVNwrWH17IsgR/5MW1p3aawQJsrkst2Z/Eo8Xk4A0EH9YESJfmtPidyLw6pghVSTMjK0kqvO5/jQetpI6O/+LRW10M+exvug3/YunnOOxwNuUsLk17OzUWbWhINI5f8JW9NKuzdyoqIe26Tof8gA+wGX5slsJgoADdbJVOJJnMsbwAgOVprRHL6gb3Vs7NQhqcPt3yIJuYui3RdbXByBLviLj41iZ6eg+oLkIRNtn6lrYKPS82APfQb+nOUs2L45aIGEgwhWhyIRa+o556S0lj+Rco6iQfHzywabQDL3mDOaqd7gz4TD42l3Jm85tZE9q+9LmFuLazhTjuXuJO1asQY76an0jrTxOUTCvOiHhNvzVzkc87QY+wy1IcZPJ10gULnLPeuXzQRJGxCjL3cg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(2906002)(36756003)(41300700001)(921011)(66946007)(66556008)(66476007)(316002)(86362001)(2616005)(1076003)(6512007)(52116002)(6506007)(26005)(478600001)(83380400001)(6486002)(5660300002)(38100700002)(8936002)(8676002)(7416002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gm4ECq5KKgCSNHlXc9e21zuKAnBiamcuTTzHU46pDSWRtEdsRJMKltuKrxVzhdzchwvsSHIbilj4nvOUq/HTz2lsEWzvdnbJdLO/iZ6M7nJAhR49ZDdgYotINjUlqXjHnqKZ/WyVvkd7XMXoU3A6p3XdoXQzwOPr7ZoMBKINTJoazXQjqifBp2G51cdzX88jXe5tyHZzbpGCCyGYDCe2SIMQ5aZhlAnN/HfpRG4FqaXSAme9zVKEQ3LTYNAiHb+zfeIBiSiB5wwKu2unXmyT0nm1MT1p1Ilz1BRP1VRkg8xSGc9Kq/PKFuEbbUj5ZnithhXshYWSzcaXxf2VMI5zPsbMgzAALlQhz47of0jDMTm0Xuzq+vNtci8ZF8bk/V7t7ZwCwSdp5waQPdtU2NG+T4eMNOkTexc9gYNhq84vUummCe0m/FpF5KjRqYFYyKPsbIYlfYvBroqq/lsTuapeP1OTZ7P5P+a0D6m1IAKIBnuv/YixVUEQE3/P+WhOQI4MpNTSKZ1Q8ZJBqLobPEYmmNkUfPPQERNPp5D2O0rM30nytYMWRXu8lEVwbby3ufWXnd9dw9P+rjjG+3/ci3qmQXcKem2tGjwXqUEg0XfUJfVx92HoDstJm/CWQRzWEaom3tCZgrkv/SWbgR6mnnjFXCPCGpA0yALLR49zhJs8ovizdwcaYpaXGqJUG3RjO5l6//MYGtXnOW4WpnPQaZuotOpunY7ZQoip4PEB8HiAQjNy+dtrb8mR+xploDctj8b/AVUCJORTCy41OJtU2awmDb3W+2dsDyX4788w6GwUkaxCue7a61AqmtaH58Os8lnw7/OllBKqPiFgY9tdhSHH9ZMaU58YeoLijOop1d+TJ1OtjdYQWi0+tNru7T90Qtf5jAI8FHQWSFn35EQZhbqPUzlwuDrMV1Dhcdx6t+Y9XoxZ42fhGORLgVh/UGqvG75dnkjKqLYl81OZfMEGFdD76dxbW8tGTpqGb8dmQ5PgWSYeC6Ef5JF6fL+h37lW7bhuxVOE6DSx7mLTL99W8Jak8Ddk/HaOGvg/wnumLNzB+pxzPuJuTjseN8t/ESW6djjbnVPHW6fnHEU7iATufRgF5vu8mGLMGuZDdKcBtlzfAZOjiP2yOVrrCucVjfC3VAdiuKn3IG7UrzWvcBJRz5N6nz3K/Dw/Qtp2VPEtrws0lO+67FVWSYqD5WC702gTE/XMBirUFEeIF3az8ZQKBq2hHpSbaHwLMW7x559sxC15JYiCPJUy71uhi9bkForMhE5DNrFrykL1NPK5zusAJzNJSYCtbzga2wDubGLVjLrosb+yLGBt2SI/uwNevrNI4lyT0832F2gDYjO+c6y9JpSLahUY7NTBSxSZ1k5Fy/I7Y/lr9cfTdN/P7iS2XPtpX5EdM0mrnUClM4UMcNSTfIf7qSZ2W1RVdbvIBVm5kNS98fWPyZe0axtTPLhWvt/I+FJPM8pIqguYWtCPCG/ypmawjXNpTlOajt+zDSiDXxmNKBx3AT2Gj2d1Ao7peFVGpMf+BBf3vlfFohwbSMmeY1I8auAH/urxX3BgHqOYJh7Sh4t7V/0ex9EiLm058cZ45/Ff X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dad1156-7f86-427d-23c7-08dc2220c290 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:52:08.1204 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nCcWPYYfaEKNV2+U6AVmIzfcNGHGXqybIuy2DquXhwHrTpOMeg55OZin/MzvV7vxyiuXPIhjQCqjG4VesDRa9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8917 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789584128784088559 X-GMAIL-MSGID: 1789584128784088559 The user can set event and counter in cmdline and the driver need to parse it using 'config' attr value. This will add macro definitions to avoid hard-code in driver. Signed-off-by: Xu Yang --- Changes in v4: - new patch --- drivers/perf/fsl_imx9_ddr_perf.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 85aaaef7212f..94041f06c152 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -52,6 +52,11 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CONFIG_EVENT_MASK 0x00FF +#define CONFIG_EVENT_OFFSET 0 +#define CONFIG_COUNTER_MASK 0xFF00 +#define CONFIG_COUNTER_OFFSET 8 + #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) #define DDR_PERF_DEV_NAME "imx9_ddr" @@ -381,8 +386,10 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, int counter, bool enable) { u32 ctrl_a; + int event; ctrl_a = readl_relaxed(pmu->base + PMLCA(counter)); + event = (config & CONFIG_EVENT_MASK) >> CONFIG_EVENT_OFFSET; if (enable) { ctrl_a |= PMLCA_FC; @@ -394,7 +401,7 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, ctrl_a &= ~PMLCA_FC; ctrl_a |= PMLCA_CE; ctrl_a &= ~FIELD_PREP(PMLCA_EVENT, 0x7F); - ctrl_a |= FIELD_PREP(PMLCA_EVENT, (config & 0x000000FF)); + ctrl_a |= FIELD_PREP(PMLCA_EVENT, event); writel(ctrl_a, pmu->base + PMLCA(counter)); } else { /* Freeze counter. */ @@ -408,8 +415,8 @@ static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1 u32 pmcfg1, pmcfg2; int event, counter; - event = cfg & 0x000000FF; - counter = (cfg & 0x0000FF00) >> 8; + event = (cfg & CONFIG_EVENT_MASK) >> CONFIG_EVENT_OFFSET; + counter = (cfg & CONFIG_COUNTER_MASK) >> CONFIG_COUNTER_OFFSET; pmcfg1 = readl_relaxed(pmu->base + PMCFG1); @@ -443,8 +450,8 @@ static void imx95_ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1 u32 pmcfg1, pmcfg, offset = 0; int event, counter; - event = cfg & 0x000000FF; - counter = (cfg & 0x0000FF00) >> 8; + event = (cfg & CONFIG_EVENT_MASK) >> CONFIG_EVENT_OFFSET; + counter = (cfg & CONFIG_COUNTER_MASK) >> CONFIG_COUNTER_OFFSET; pmcfg1 = readl_relaxed(pmu->base + PMCFG1); @@ -561,7 +568,7 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) int cfg2 = event->attr.config2; int counter; - counter = (cfg & 0x0000FF00) >> 8; + counter = (cfg & CONFIG_COUNTER_MASK) >> CONFIG_COUNTER_OFFSET; pmu->events[counter] = event; pmu->active_events++; From patchwork Wed Jan 31 05:58:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 194494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1692503dyb; Tue, 30 Jan 2024 21:53:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGB3gEs26vgxQAxMKEwpwAd9i4WSYeQcMRpvhjfX0QgywPOt+1+PDEPfIaCiPh+27HuwFN9 X-Received: by 2002:a05:6808:ec8:b0:3bd:9152:2e35 with SMTP id q8-20020a0568080ec800b003bd91522e35mr958411oiv.32.1706680431319; Tue, 30 Jan 2024 21:53:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrrzEkhyo3m57xQJGX1hp1uSkA/0OqEma31qgvODC5//rpEXBI1lxmgPKkuQRaaTN9rlt7WIEQZVFAZbdmiwqKMSBtnA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c12-20020a62e80c000000b006ddca8981ffsi8911153pfi.10.2024.01.30.21.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 21:53:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45788-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=g1a8a6ov; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45788-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45788-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A298F288A0B for ; Wed, 31 Jan 2024 05:53:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5FEF3FB07; Wed, 31 Jan 2024 05:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="g1a8a6ov" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2064.outbound.protection.outlook.com [40.107.20.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 869243F8D8; Wed, 31 Jan 2024 05:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680340; cv=fail; b=U3yt+qhXbrWJrw3nZ7sAL83QO0WXoLrRSX/zEyzbGxxp65fTC503sDaiVI5DoR1Exq5HsuaRgkxnHCacMmYntHiBnpoN/dWXxY2RVfJL4ldLbbjm956++BsoVyd/k+zxeDqeN0X20wBNyPSnkGuXmA31pQfPdhACBm5IJmve2Ww= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680340; c=relaxed/simple; bh=T5fxuPF5b3VlmbxwO7pcQHKiMfW9oQTchAan1ngMoCM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=R5jPZMJrhNH2xaBlfFMXvab8YW+Vkc+uIC6x476dd7nop4ps4nk/oakWaocCq61NQ0woANASHDZl2uQ1XzEk0MZtfxzJbrWQhiWvYsYOixOCw5J5l3+NxiqTmE5dx1hL5fGLVOY0pkv+DWn4CZvTadrk+7D010YdBRHfhJ7NCfo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=g1a8a6ov; arc=fail smtp.client-ip=40.107.20.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OED9MNAHo553+XSYURE0q4Kz+A0hHnePjcb0Gv93LQMQ1PT66/tR5dYh3fUuU2OlcOJ0d+rx1XEzdTnsXox7i0WQjcpiPOb5W0wkOeC6RvYVD5TMZarWKUsQ9bTbQj1K9BYwF/tzXEAqtJzmhGNBqsTbdiM/eYA2cuHkkvbrybVDh89j30EhiHpK7rLCmL7G6lcktwBjHEe51kTdS2ysfRfjEjyGnjbmFQRutUJ2BPI4SPMKhDIJiQxCbtmJxty33Mh+Z03qzRkHBocN9ZTgFIIjovmfynKCrMMfvb4c9NppLu+s3xCRyRjiCpOoY9YFrnwc/2155gju1aiGDCETXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JxE+kbGqvwFdqguUylkKC9s3foHLtB9G/N8s8DJ5+Z8=; b=PlucF3x0eDoVhPMCfJk+dv+4XT/ZODRtegc8jOLb7qQ55mf6SJmXWZ/BDZgB7H5onC6UlK7uaQ5dhawba0OiFy6wesHqAVYcaYFCMBAjKeIKZUabXy6SSR7SUOQF4ENzz8QkFFMWGq0BnFuJMs1qRmud5lCAO9HEsdtnduBsy5XHos0o0VnwTOPSc15WpqXqP6ur3hnd69hnYa+Y2EpeFbiASeJ2dYhHLNAc0cnREY7I2h30b4QOh5YTjJa9jXkl22arv8hi/23SosQQJ9E+oUWsmczoadXxkbKNb/5hw5k4vWMMaxvl+9J0t3Ac3jY+b9lvDjRzLjDSxQFArjFCmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JxE+kbGqvwFdqguUylkKC9s3foHLtB9G/N8s8DJ5+Z8=; b=g1a8a6ov6/a9up0vgc7CYF7SHGL7PAI7rO6EU0RR7f00Y0P2P84zCDItOTXqyqOvTkui0t5mJAzIxhUYDbO7HzeQW3/NislU/n+toK4JOM7uzC/QJvPua/hoSDy9lxqiEDS7NEb8Lni8SJmWDEUUW5xUiWP1/SxH/zSf5bhWKEE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by DU2PR04MB8917.eurprd04.prod.outlook.com (2603:10a6:10:2e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 05:52:15 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7228.029; Wed, 31 Jan 2024 05:52:15 +0000 From: Xu Yang To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: linux-imx@nxp.com, mike.leach@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, xu.yang_2@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v4 5/6] perf: imx_perf: limit counter ID from user space and optimize counter usage Date: Wed, 31 Jan 2024 13:58:10 +0800 Message-Id: <20240131055811.3035741-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131055811.3035741-1-xu.yang_2@nxp.com> References: <20240131055811.3035741-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:4:196::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DU2PR04MB8917:EE_ X-MS-Office365-Filtering-Correlation-Id: b34f514c-3b21-4c2e-7fba-08dc2220c732 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W2zP3yQPR++QiuuQ6qe6Q/D/0Bx8xFOp6I0eZ1QDImrXdRTnXMtfGiCTc8ROPlbNd1b32uDV5Sir7lIFFGuPgPY2iI2x0XUJfnLWtaSf8Js49yyYOBf8T7CwbgzmHULaeuRjPke600d2HTF5Io2qHlHwSwUcEr9n63xU4tLylCH16litDLYMe89oCQRusYNq+845JpHLcSDzt+RKpTK31WM6qiVQNdDFt/bRHwiaThO/aGtH60V6cGV0Y5KJVANhyn1fK8oMsBWHitxPzKHY1JsT5kk75c4cZhKbSRwkLCr7X2wf4u3hyWZQ1jLBTD67x6uZozLJ7UZJv4npPmOzfA8kdxmMrndmR3PNFUePeYkpGDlp/2x6g04HPyimA7TUN5xisIRZL/M8U8PRi45sjElnm0qWe2xHaus5Oi/OwI/oxA8k84hat31t4gVPMI50Tgxi4KCNLvhANXAqkCezn1vZXcoJphuJTBzbYLpR/CSwYX1XCmof3rmAfsKMm6xsy7SW0EXX9sW+p8LfiHgDJ26mOd8UDy8XF/Hc/E2Bb0sDcNWS784na2P2p6WubbQxYMtFGOLq70W1y2If3EuQWjBNA4IY8GwZyNFs7ilJlhAVZcBDNWpla0QTWXsfsV6Swk5GlKCgfV6Juo3AF+Keew== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(2906002)(36756003)(41300700001)(921011)(66946007)(66556008)(66476007)(316002)(86362001)(6666004)(2616005)(1076003)(6512007)(52116002)(6506007)(26005)(478600001)(83380400001)(6486002)(5660300002)(38100700002)(8936002)(8676002)(7416002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ufg9od1pygUSCJAeNbBaQDJmM//ZUKpr06D3FQw52XHVShsbwFArt11ZVNivGV8EIDrMUzcGFvaKJaKlzd57S5anuvJ+XKaFqMYZ/h8ZlhS9gFd4eP48jK6e1TogpCg4oQAO1rFNRK0mwqUaEg86d9dEpVDjUGDwZhw9VW8VMyKJoztwcF59PeIt2Y5QqZrUNL6pO3f70Ti4FglrWzdXZrxKEviAacUNtjkrWruOudGt9XmdQ9M8HllbUk45MwTrfSd4kVHssYZnj6IvqIt9j3fvaAU7BctEhUFuY/MLTmDnZGMjMmpSeayOJ7wSBuTE5B5OC647A7hXCpl11FC6YJasD7muYW32elrqH7wfxLGjqCFivzwbLyCNrNpUKZGaF2tWvkgmZoUhCL01jzSzhMhvDDS9vWmhxDTBFGxCPpM6jOcCmE1lOh+dR6WXZoBz+GpnVFIy6S79/5HgnR3EJUa7aQdEv1ffgNE+qfhO93DZpDB89ymUBzhDFgRGCF0ouphS/LAYczCsvgsYKmWPNMdCB5JPbfdD+tRYFwRIFXxDSXCzG3SFwZqoCgVZqmccOkrvWTbdRm9g4Ny6aSi9e//hWnUpyKOZGoeYor6pEpx2WvXdPJvfH0c6qpuK0m8fia5HhBA0E0KA44qFhAZRzLvNq2YbNBwS4tnp/o0xTkoCxwDONd/oVG8bLXe2ifW6PP0zPmzlJ0Rqys4AYk87UYW5AC2h2tf8wgVX9eCEJwAj6Fqq5cz1Cnbdq7U32cYJH1f2sHovuuyoan0C14oS573u40yBO6LULfaFz+ZZXLgzJXDdbVE6p4BTNMnu5y/BP3JctNfhcNeXqIGVUeToZzByw7m7BnMuskSnsFuyhXUeWk3BKaIMjAp6cEMitThoB8CABxbUPtaHI527QfOnxKoU8lVsAqPujW9HfVBOQSV76oVHVGmwyiiywzwcXRHtA62Yw3nam3PBjw/bXhrIzBDqBLzpc4M6ZJ6m9T8+7cQRvESO2vaRCWYnihUQBTqOnIQvFw5bgprtop9bzNklfDgVpM7XteSj/vugrsgzMZKg93GYZv53oN51df347l9yvqPkUhMb8yglyU1F4R+NAYRhFkdOV9+MH96pw2VvZruPtraktUmDnj/1XeVjkSw/zu3P3ZspoKiLn1t6p2TX7iio9FhKRvgf4K5YQ6gNLvhVgQ42GtoolWRTCqN13zTWNjppeBjbIYKhZfQpp/Gad/BEO8nRcklRreXNKVX/byY0YJl14tDfzLwveZ8NsPCHAaFmR+yQlo6G7QN11io2Nk7TSpfnYmtgf1TSEudB+mNtnkrxnjKu3e/7fLVi8/xpUhWK8KtLpnkW7+2pHQmOVVJPFD31UgyGowDw5a5VmzqGvZJbux5rVS6gu49KsfoEyvaoZJcjcM73HY/HoDcmTg4D5HxWTwtPyuzhM1fH4PCgKdLOyPGpojdDGvE/4HULk+EWnDB6vEvpTz8XixQNDPGjZe5lzM9yliFBhQ8FNxWTomhPRsFv7BPWGaQs1XOt3g8ZSs3TLjAwskNsQg8jZa4lHv0IxDcgI7xd2keBjy5wXsYWy7OHVeN9gvWt4xYt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b34f514c-3b21-4c2e-7fba-08dc2220c732 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:52:15.7731 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tg2VMKrPwC7vjfs25GieTCub/iNKYUpz8kd8ncHyf6fHG+reCeoJE/J5SXxj2BLDA/HFB/9zh4xxjUvY0Z64eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8917 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789584139824050848 X-GMAIL-MSGID: 1789584139824050848 The user can pass any counter ID to perf app. However, current pmu driver doesn't judge the validity of the counter ID. This will add necessary check for counter ID from user space. Besides, this pmu has 10 counters except cycle counter which can be used to count reference events and counter specific evnets. This will also add supports to auto allocate counter if the user doesn't pass it the perf. Then, the usage of counter will be optimized. Signed-off-by: Xu Yang --- Changes in v2: - limit counter ID from user to 0-10 - combine dynamic and static allocation of counter Changes in v3: - no changes Changes in v4: - rename ddr_perf_is_specific_event() - use macro definitions to parse config attr --- drivers/perf/fsl_imx9_ddr_perf.c | 72 +++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 94041f06c152..e71496809c52 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -51,6 +51,7 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CYCLES_EVENT_ID 0 #define CONFIG_EVENT_MASK 0x00FF #define CONFIG_EVENT_OFFSET 0 @@ -240,6 +241,19 @@ static struct attribute *ddr_perf_events_attrs[] = { NULL, }; +/* + * An event is either reference evnet or counter specific event. + * For counter specific event, the event count will only be incremented + * on the corresponding counter. + */ +static bool ddr_perf_is_counter_specific_event(int event) +{ + if (event >= 64 && event <= 73) + return true; + else + return false; +} + static const struct attribute_group ddr_perf_events_attr_group = { .name = "events", .attrs = ddr_perf_events_attrs, @@ -514,6 +528,7 @@ static int ddr_perf_event_init(struct perf_event *event) struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); struct hw_perf_event *hwc = &event->hw; struct perf_event *sibling; + int event_id, counter; if (event->attr.type != event->pmu->type) return -ENOENT; @@ -526,6 +541,18 @@ static int ddr_perf_event_init(struct perf_event *event) return -EOPNOTSUPP; } + counter = (event->attr.config & CONFIG_COUNTER_MASK) >> CONFIG_COUNTER_OFFSET; + if (counter > NUM_COUNTERS) { + dev_warn(pmu->dev, "Only counter 0-10 is supported!\n"); + return -EINVAL; + } + + event_id = (event->attr.config & CONFIG_EVENT_MASK) >> CONFIG_EVENT_OFFSET; + if (ddr_perf_is_counter_specific_event(event_id) && counter == 0) { + dev_err(pmu->dev, "Need specify counter for counter specific events!\n"); + return -EINVAL; + } + /* * We must NOT create groups containing mixed PMUs, although software * events are acceptable (for example to create a CCN group @@ -559,6 +586,39 @@ static void ddr_perf_event_start(struct perf_event *event, int flags) hwc->state = 0; } +static int ddr_perf_alloc_counter(struct ddr_pmu *pmu, int event, int counter) +{ + int i; + + if (event == CYCLES_EVENT_ID) { + /* + * Always map cycle event to counter 0. + * Cycles counter is dedicated for cycle event + * can't used for the other counters. + */ + if (pmu->events[CYCLES_COUNTER] == NULL) + return CYCLES_COUNTER; + } else if (counter != 0) { + /* + * 1. ddr_perf_event_init() will make sure counter + * is not 0 for counter specific events. + * 2. Allow specify counter for referene event too. + */ + if (pmu->events[counter] == NULL) + return counter; + } else { + /* + * Counter may be 0 if user doesn't specify it. + * Auto allocate counter for referene event. + */ + for (i = 1; i < NUM_COUNTERS; i++) + if (pmu->events[i] == NULL) + return i; + } + + return -ENOENT; +} + static int ddr_perf_event_add(struct perf_event *event, int flags) { struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); @@ -566,10 +626,18 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) int cfg = event->attr.config; int cfg1 = event->attr.config1; int cfg2 = event->attr.config2; - int counter; + int event_id, counter; + event_id = (cfg & CONFIG_EVENT_MASK) >> CONFIG_EVENT_OFFSET; counter = (cfg & CONFIG_COUNTER_MASK) >> CONFIG_COUNTER_OFFSET; + /* check if counter is available or needs to allocate one */ + counter = ddr_perf_alloc_counter(pmu, event_id, counter); + if (counter < 0) { + dev_dbg(pmu->dev, "There are not enough counters\n"); + return -EOPNOTSUPP; + } + pmu->events[counter] = event; pmu->active_events++; hwc->idx = counter; @@ -604,9 +672,11 @@ static void ddr_perf_event_del(struct perf_event *event, int flags) { struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); struct hw_perf_event *hwc = &event->hw; + int counter = hwc->idx; ddr_perf_event_stop(event, PERF_EF_UPDATE); + pmu->events[counter] = NULL; pmu->active_events--; hwc->idx = -1; } From patchwork Wed Jan 31 05:58:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 194497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1693013dyb; Tue, 30 Jan 2024 21:55:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhotmKGji4ct2DMoviBOuSIcBBd2JUaIcpHSkiK8T3c+O7Mt9VPbvP+6HtV3adEar40Nny X-Received: by 2002:a17:906:52d0:b0:a35:851b:38f with SMTP id w16-20020a17090652d000b00a35851b038fmr335214ejn.11.1706680545244; Tue, 30 Jan 2024 21:55:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrv2SAe5P54UT6DjRgoUmzGMmRHiRzCRaw3aEDeSAhY9AOucLhGXjEqEEMVDTiTGFNAOLSHvk1JlhZnJ5nX51bSdHJ5A== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id m24-20020a1709060d9800b00a35a597e7fesi2989154eji.627.2024.01.30.21.55.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 21:55:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ggtziJzB; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-45792-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45792-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 861AC1F282BD for ; Wed, 31 Jan 2024 05:55:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7188B4654B; Wed, 31 Jan 2024 05:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ggtziJzB" Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2084.outbound.protection.outlook.com [40.107.20.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 495643FB1E; Wed, 31 Jan 2024 05:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680350; cv=fail; b=l1515bx0rSjHxaFb7Zmdm7TQT2KikvJ3WKzdpd1yuZADo/rMW6UAFZ78pJFQ8pLmCnP4yWIgDTzUO6tq9a3vE+fMPh02d7bqUhk0PNDcyW8ochbXns96r/QT7pCVIXIdTkPqnLmdJvpKCgGiLrO36qXxLIPBR/0DBbQY9jdVK7o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706680350; c=relaxed/simple; bh=DfA9jboq5OtzVjI4FFTRm8NHeDr0ag/yhpEkOeVMRcY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=W2L9jbu7phJM1eWfQLHiplquTNq1SDwO6jyIWalygmxeVB6Jv/BGW0pC5AvJJbxwEDpxBMlY7550/yXo7s1SXGxx43HDeA5XW0lEQbHcxQAj0f8mKTDCQaO4/NgK2Ld9OhvP7RrMcSoPfzJrhxIGqqfCsAjKgxTGv4cnEiMGwr8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=ggtziJzB; arc=fail smtp.client-ip=40.107.20.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7w9SdIq0e7EEWy15DDxG9ZkXGf9Y5O4er6C/dyXWR4REvZYcLip5kyffqX3GqcvmgxoHQHcAXgdsY8D6Tuj6Fau2+VZPgKMc6J1ux89BKodpcwdoClL31tkIVbyFrJP2bF4jB5nug0oDvaTG/XAc5Ex+/wwZLnJS1pO9Gsi9UWRdxB1pNO3x9nVJieviGL84QqaDOfDql+MGOwO+MHalv4bUDGFuy7+vJptKynipLMnYqw8WxZ3aKMWbCC6Gkn05qrJztoeksNVEv2iUJ0QuqOEfhyEOOXMHybmDY6pS1kN3RUB3uafX58Il5UgXpkhEJIpUqU1V3ZiHWAoabUsWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ijqBS53jpwxQuBaklaWWA+q8qcJ7hUt2ppkqyFKfgOM=; b=RgzrwKtmGd2Z7/xOBaF1aOEQYbSBXFp11sIJph0+w7oXs6mQjXxMFy8MtmP7krOitkwe9VIW0k2l+r8C8kq+Y6NUtJxHaizbC/7NaIzenNvG8YTmf5jdS2Ux9QSB0LC0A3yFSVUbLUMc7SThLzVwxZ9HvcKO/TAM8JYBpZ4xhYY0FZhSR5pQbpuAJylgOQEejr1SQC1p51dp3SoxhU8X25LqkmfesU1lZyWLyW77Uow0DSzjhizDPN14DtfucNQqZIaOnWZhVvUjpi2+dvTkz0ms2KYcVwkzDKf5zoniClBHp9tLUcsAvblmYgI0Tno0Q/mRwErzahePqoPOmayNsg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ijqBS53jpwxQuBaklaWWA+q8qcJ7hUt2ppkqyFKfgOM=; b=ggtziJzBs8+VIwPuYC8IblfG6wKkv5637zoFk4ZyuscKZJ79vF6tBUyZpSRWoYA1Xe1epvQxnBEtmGVloPM3Qd/sionrvSsHYtDtVX5an+UpxWOca5Qnvdsh1QYbit+MGAJLHZv2Ux0pkPVTwl7FidvfSqCIBoU40/6hRK1Wj78= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by DU2PR04MB8917.eurprd04.prod.outlook.com (2603:10a6:10:2e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Wed, 31 Jan 2024 05:52:23 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::d45f:4483:c11:68b0%7]) with mapi id 15.20.7228.029; Wed, 31 Jan 2024 05:52:23 +0000 From: Xu Yang To: Frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: linux-imx@nxp.com, mike.leach@linaro.org, leo.yan@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, xu.yang_2@nxp.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v4 6/6] perf vendor events arm64:: Add i.MX95 DDR Performane Monitor metrics Date: Wed, 31 Jan 2024 13:58:11 +0800 Message-Id: <20240131055811.3035741-6-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240131055811.3035741-1-xu.yang_2@nxp.com> References: <20240131055811.3035741-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0041.apcprd02.prod.outlook.com (2603:1096:4:196::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DU2PR04MB8917:EE_ X-MS-Office365-Filtering-Correlation-Id: e65eb295-f083-4715-f032-08dc2220cbc2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9Svdu25oPHoB9eifaXIhzq/iMlx9M3xiQkPBksd+QAS/9xW6l8rFZTqRuEbnzj4uytFqlQeo4O0ndpO3Vx41TFO9dE5dZ97iUBINkLuwiikLNRTMO99MdZDK74ZbA003MELlHUBMGHSmtHxrxQrT1cxaIfFbyoRh1O/Ui3SFRplHfWT7m7TNNa9s3DbdxdsvfODuxFC/2CCbW2ArjYHpid/iQgPio3L1Zk44OBYAPEBDD/08N2zqYOondvQgyq+iZvpg197cWntF1e+Cetw+1nSB8BTTK1D9MxTHIBb82J7B8dxTCOM44AeYgeLbU38UnOaHUQQNWMKXS1T3X5BTYZbNnjGyIjqrg68iwuzi+H8BlIGl0ZsyAimu1ttiphP1WgCwnat5/9c4E4WJyNhDZkEHuiUEFIQPUibJfKMtED9k6dCzFqXo4UwaT037wwZdG/MyecbotFd2HVxUHWz8OAVWXpigs7NuyUVCG8MuGzBixwMxwPJlBOTv+hnJcKOuoPiU+hUXkZ/J+SRkH5Ll3dscOB6kh673+Diee5ZVtSaQVxEgd5hZqIbcJmwl7ILFcqqMmNEWGS1sD7qmXfqRaQHaXW4XQE0+1EZuvouDOZ089wuPOATv/U+1iQsjbui/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(38350700005)(30864003)(2906002)(36756003)(41300700001)(921011)(66946007)(66556008)(66476007)(316002)(86362001)(6666004)(2616005)(1076003)(6512007)(52116002)(6506007)(26005)(478600001)(6486002)(5660300002)(38100700002)(8936002)(8676002)(7416002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xt/ggXHRuVOsaluPyXefUZ+t909EkSXEIamGSdg66eEMXkmu4xsIoo5gxTnNECJaisJ971xTQgjeMhlWsikF25OXNNaFzV6GPZrlf/2aMBcuNGaM9FUeHITK6gIPxKn6N/MiFw3Ck/wzAMht80C1mQVxoKKq3v8ZL0XdwUrSuh+wL+o5alqi6RaW4PJ6u4vvKj2rx0IpK8uOmgj6yaRM6+hSZWFGGoKkF7kYK4FT6ENhaYVdI2xPuNS322dyFL0N53EWxGIWH2w9BcFQI6K+yeTZ01EC98+e02mZ1SgGE0as+GfVhXLp395iFlCLoy+ka94dwLAcF574MCMThV/7RyE36XhSeFNDdFxEaAbY8LqY5V2xF70qGEalUNJYr8sjQczPbl64kLfyP7/x4KndG5eQOVe6a5u4eNv2aR5LL8YW8GauX3q8VQazESJ50napAjkWMSRXmxNJVGPLaI7cocx8WkRyPezrasl4eijoLcQ/1ayb27y6+if0/s8dzOzLmmal+RuF9h7FO0zVDiKOocMG2fga2/cN+2ALQzKMm58kP3YywesSxdIAG6K1vr+zkUwodW7WMuvUofgQfCB7dGsCBciES06h2tDbIUrtCqHNX/wIXwkmnUF7GBcQ7A9EghrJXKNfyQ88rs43ahbzGi6M2MVFLoJpc+SQ1GrTtKfblQsOlkT1fxesxCk4Sf/LdjOFsdWLC2ePmA5nThFjv7XyfGKXWjgAEbNjPTqyS1+h8UgauqxaWO68ytMdqUCy9mFGg1JFUgzEDId2KIHl+HYAHOXMkwXSI7JNntWinn6rEXKeyqfEQFhzi6YB4pbe83Ef0xrah3f98WPmEmVgH3Ji4XgUr1wpacV5WvaYzbw74jGHwmdSPjJe6CMwuod48PUYuaaSMMOyKLed6/HdUAkRjPyVJYYcQkmEz0CYS2uIAnXVsK8NBTy5yfrHC/EIB+CFksT3l0CftojPmjZocoR8JYivTYUDqeewe6JJuDgrn+vAzK7495zCWBIaFo6XYe98hS9L9+ihAcZQKZMBer0KZPi77nhuQjB4FEiiJarqiFGqehfivhXViYbU6MoDHWckD0Y92hUHWqqKTaLjhRgNU/dHgLy4kXs36v7z8nhhPZcpgIDkw1W5kQotsRbdqX9jS0OogC/GTw74YhWDzj24RNuXTWnE480U8ug+Hw1FiRdb3kI79S8WqOyFzxZjXDqRk2EwnPZ4v0k20zgh70aQYZ8fGIvhegVOiMvoI2r8HnKu6AfB7oobEk/P89ivpGVNkhhfk4lzm50eaOQ4isElAxalCiOWENzONE41+OQHMSoVe+0jXluIErlExxzA/jOxHn2RGLr6IYEhVrQREmAyptR675hwVYTJid71UMQmwFhJO6ck2UbaxKTrTk1RRs2AwGtEXyzzKVjynpWSjoftKPtVEz+uewwWGCBKimz3c2jxktP86DKkYP/ZhOv5GCDQbCdwMxmB/KO4ZK2KxkYhi1RYplgzVrFWF7dqHOlTD6cLNw1ap5ghvur/EUp7y/B9R5ZMpFBiQqD39TYWd6Qzt1EZ2k3g/fdJepsZH4TQnfl3ThxTXHMZ9XTaxbyO X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e65eb295-f083-4715-f032-08dc2220cbc2 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2024 05:52:23.6188 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LIyDZyWXP92yl5jlrynHlLT6x8VD7jJdrGhaWhWWqxmxf1v99nZ23+awSwWkSOqdxB0tDoGlYVTf8i6fsNdMvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8917 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789584259289406319 X-GMAIL-MSGID: 1789584259289406319 Add JSON metrics for i.MX95 DDR Performane Monitor. Reviewed-by: Ian Rogers Reviewed-by: Frank Li Signed-off-by: Xu Yang Reviewed-by: John Garry --- Changes in v2: - fix wrong AXI_MASK setting - remove unnecessary metrics - add bandwidth_usage, camera_all, disp_all metrics Changes in v3: - no changes Changes in v4: - add Reviewed-by tag --- .../arch/arm64/freescale/imx95/sys/ddrc.json | 9 + .../arm64/freescale/imx95/sys/metrics.json | 778 ++++++++++++++++++ tools/perf/pmu-events/jevents.py | 1 + 3 files changed, 788 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json new file mode 100644 index 000000000000..4dc9d2968bdc --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json @@ -0,0 +1,9 @@ +[ + { + "BriefDescription": "ddr cycles event", + "EventCode": "0x00", + "EventName": "imx95_ddr.cycles", + "Unit": "imx9_ddr", + "Compat": "imx95" + } +] diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json new file mode 100644 index 000000000000..2bfcd4d574a8 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json @@ -0,0 +1,778 @@ +[ + { + "BriefDescription": "bandwidth usage for lpddr5 evk board", + "MetricName": "imx95_bandwidth_usage.lpddr5", + "MetricExpr": "(( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x000\\,axi_id\\=0x000@ + imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32 / duration_time) / (6400 * 1000000 * 4)", + "ScaleUnit": "1e2%", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all masters read from ddr", + "MetricName": "imx95_ddr_read.all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all masters write to ddr", + "MetricName": "imx95_ddr_write.all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all a55 read from ddr", + "MetricName": "imx95_ddr_read.a55_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3fc\\,axi_id\\=0x000@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3fe\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all a55 write to ddr (part1)", + "MetricName": "imx95_ddr_write.a55_all_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3fc\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all a55 write to ddr (part2)", + "MetricName": "imx95_ddr_write.a55_all_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3fe\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 0 read from ddr", + "MetricName": "imx95_ddr_read.a55_0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3ff\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 0 write to ddr", + "MetricName": "imx95_ddr_write.a55_0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3ff\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 1 read from ddr", + "MetricName": "imx95_ddr_read.a55_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x00f\\,axi_id\\=0x001@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 1 write to ddr", + "MetricName": "imx95_ddr_write.a55_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x001@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 2 read from ddr", + "MetricName": "imx95_ddr_read.a55_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x00f\\,axi_id\\=0x002@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 2 write to ddr", + "MetricName": "imx95_ddr_write.a55_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x002@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 3 read from ddr", + "MetricName": "imx95_ddr_read.a55_3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x00f\\,axi_id\\=0x003@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 3 write to ddr", + "MetricName": "imx95_ddr_write.a55_3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x003@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 4 read from ddr", + "MetricName": "imx95_ddr_read.a55_4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x00f\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 4 write to ddr", + "MetricName": "imx95_ddr_write.a55_4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 5 read from ddr", + "MetricName": "imx95_ddr_read.a55_5", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x00f\\,axi_id\\=0x005@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 5 write to ddr", + "MetricName": "imx95_ddr_write.a55_5", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x005@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of Cortex-A DSU L3 evicted/ACP transactions read from ddr", + "MetricName": "imx95_ddr_read.cortexa_dsu_l3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x00f\\,axi_id\\=0x007@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of Cortex-A DSU L3 evicted/ACP transactions write to ddr", + "MetricName": "imx95_ddr_write.cortexa_dsu_l3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x007@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m33 read from ddr", + "MetricName": "imx95_ddr_read.m33", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x00f\\,axi_id\\=0x008@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m33 write to ddr", + "MetricName": "imx95_ddr_write.m33", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x008@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m7 read from ddr", + "MetricName": "imx95_ddr_read.m7", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x00f\\,axi_id\\=0x009@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m7 write to ddr", + "MetricName": "imx95_ddr_write.m7", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x009@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of sentinel read from ddr", + "MetricName": "imx95_ddr_read.sentinel", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x00f\\,axi_id\\=0x00a@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of sentinel write to ddr", + "MetricName": "imx95_ddr_write.sentinel", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x00a@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma1 read from ddr", + "MetricName": "imx95_ddr_read.edma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x00f\\,axi_id\\=0x00b@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma1 write to ddr", + "MetricName": "imx95_ddr_write.edma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x00b@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma2 read from ddr", + "MetricName": "imx95_ddr_read.edma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x00f\\,axi_id\\=0x00c@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma2 write to ddr", + "MetricName": "imx95_ddr_write.edma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x00c@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of netc read from ddr", + "MetricName": "imx95_ddr_read.netc", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x00f\\,axi_id\\=0x00d@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of netc write to ddr", + "MetricName": "imx95_ddr_write.netc", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x00d@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of npu read from ddr", + "MetricName": "imx95_ddr_read.npu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x010@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of npu write to ddr", + "MetricName": "imx95_ddr_write.npu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x010@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of gpu read from ddr", + "MetricName": "imx95_ddr_read.gpu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x020@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of gpu write to ddr", + "MetricName": "imx95_ddr_write.gpu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x020@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc1 read from ddr", + "MetricName": "imx95_ddr_read.usdhc1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x0b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc1 write to ddr", + "MetricName": "imx95_ddr_write.usdhc1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x0b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc2 read from ddr", + "MetricName": "imx95_ddr_read.usdhc2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x0c0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc2 write to ddr", + "MetricName": "imx95_ddr_write.usdhc2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x0c0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc3 read from ddr", + "MetricName": "imx95_ddr_read.usdhc3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x0d0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc3 write to ddr", + "MetricName": "imx95_ddr_write.usdhc3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x0d0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of xspi read from ddr", + "MetricName": "imx95_ddr_read.xspi", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x0f0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of xspi write to ddr", + "MetricName": "imx95_ddr_write.xspi", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x0f0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie1 read from ddr", + "MetricName": "imx95_ddr_read.pcie1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x100@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie1 write to ddr", + "MetricName": "imx95_ddr_write.pcie1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x100@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie2 read from ddr", + "MetricName": "imx95_ddr_read.pcie2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x00f\\,axi_id\\=0x006@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie2 write to ddr", + "MetricName": "imx95_ddr_write.pcie2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x00f\\,axi_id\\=0x006@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie3 read from ddr", + "MetricName": "imx95_ddr_read.pcie3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x120@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie3 write to ddr", + "MetricName": "imx95_ddr_write.pcie3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x120@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie4 read from ddr", + "MetricName": "imx95_ddr_read.pcie4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x130@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie4 write to ddr", + "MetricName": "imx95_ddr_write.pcie4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x130@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb1 read from ddr", + "MetricName": "imx95_ddr_read.usb1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x140@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb1 write to ddr", + "MetricName": "imx95_ddr_write.usb1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x140@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb2 read from ddr", + "MetricName": "imx95_ddr_read.usb2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x150@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb2 write to ddr", + "MetricName": "imx95_ddr_write.usb2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x150@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec primary bus read from ddr", + "MetricName": "imx95_ddr_read.vpu_primy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec primary bus write to ddr", + "MetricName": "imx95_ddr_write.vpu_primy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec secondary bus read from ddr", + "MetricName": "imx95_ddr_read.vpu_secndy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x190@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec secondary bus write to ddr", + "MetricName": "imx95_ddr_write.vpu_secndy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x190@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg decoder read from ddr", + "MetricName": "imx95_ddr_read.jpeg_dec", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x1a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg decoder write to ddr", + "MetricName": "imx95_ddr_write.jpeg_dec", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x1a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg encoder read from ddr", + "MetricName": "imx95_ddr_read.jpeg_dec", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x1b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg encoder write to ddr", + "MetricName": "imx95_ddr_write.jpeg_enc", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x1b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all vpu submodules read from ddr", + "MetricName": "imx95_ddr_read.vpu_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x380\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all vpu submodules write to ddr", + "MetricName": "imx95_ddr_write.vpu_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x380\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of cortex m0+ read from ddr", + "MetricName": "imx95_ddr_read.m0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x200@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of cortex m0+ write to ddr", + "MetricName": "imx95_ddr_write.m0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x200@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of camera edma read from ddr", + "MetricName": "imx95_ddr_read.camera_edma", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x210@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of camera edma write to ddr", + "MetricName": "imx95_ddr_write.camera_edma", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x210@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi rd read from ddr", + "MetricName": "imx95_ddr_read.isi_rd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x220@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi rd write to ddr", + "MetricName": "imx95_ddr_write.isi_rd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x220@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr y read from ddr", + "MetricName": "imx95_ddr_read.isi_wr_y", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x230@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr y write to ddr", + "MetricName": "imx95_ddr_write.isi_wr_y", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x230@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr u read from ddr", + "MetricName": "imx95_ddr_read.isi_wr_u", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x240@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr u write to ddr", + "MetricName": "imx95_ddr_write.isi_wr_u", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x240@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr v read from ddr", + "MetricName": "imx95_ddr_read.isi_wr_v", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x250@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr v write to ddr", + "MetricName": "imx95_ddr_write.isi_wr_v", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x250@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma1 read from ddr", + "MetricName": "imx95_ddr_read.isp_in_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x260@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma1 write to ddr", + "MetricName": "imx95_ddr_write.isp_in_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x260@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma2 read from ddr", + "MetricName": "imx95_ddr_read.isp_in_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x270@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma2 write to ddr", + "MetricName": "imx95_ddr_write.isp_in_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x270@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma1 read from ddr", + "MetricName": "imx95_ddr_read.isp_out_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma1 write to ddr", + "MetricName": "imx95_ddr_write.isp_out_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma2 read from ddr", + "MetricName": "imx95_ddr_read.isp_out_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma2 write to ddr", + "MetricName": "imx95_ddr_write.isp_out_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules read from ddr", + "MetricName": "imx95_ddr_read.camera_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x380\\,axi_id\\=0x200@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ + imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,counter\\=3\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules write to ddr (part1)", + "MetricName": "imx95_ddr_write.camera_all_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x380\\,axi_id\\=0x200@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules write to ddr (part2)", + "MetricName": "imx95_ddr_write.camera_all_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules write to ddr (part3)", + "MetricName": "imx95_ddr_write.camera_all_3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display blitter store read from ddr", + "MetricName": "imx95_ddr_read.disp_blit", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x3f0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display blitter write to ddr", + "MetricName": "imx95_ddr_write.disp_blit", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display command sequencer read from ddr", + "MetricName": "imx95_ddr_read.disp_cmd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3f0\\,axi_id\\=0x2b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display command sequencer write to ddr", + "MetricName": "imx95_ddr_write.disp_cmd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3f0\\,axi_id\\=0x2b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all display submodules read from ddr", + "MetricName": "imx95_ddr_read.disp_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,counter\\=5\\,axi_mask\\=0x300\\,axi_id\\=0x300@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,counter\\=4\\,axi_mask\\=0x3a0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all display submodules write to ddr (part1)", + "MetricName": "imx95_ddr_write.disp_all_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x300\\,axi_id\\=0x300@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all display submodules write to ddr (part2)", + "MetricName": "imx95_ddr_write.disp_all_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,counter\\=2\\,axi_mask\\=0x3a0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + } +] diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index 53ab050c8fa4..be4b541a0820 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -284,6 +284,7 @@ class JsonEvent: 'hisi_sccl,hha': 'hisi_sccl,hha', 'hisi_sccl,l3c': 'hisi_sccl,l3c', 'imx8_ddr': 'imx8_ddr', + 'imx9_ddr': 'imx9_ddr', 'L3PMC': 'amd_l3', 'DFPMC': 'amd_df', 'UMCPMC': 'amd_umc',