From patchwork Fri Mar 22 06:39:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DAE64C47DD9 for ; Fri, 22 Mar 2024 06:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fv28c2rXHzWwcw5x4VeuyINuhb3fm0gYV8s+ZPRCDcU=; b=dQuHsYngwhdfMZ 5zrVk8O/LUwwwDB0SVIGV1oqaL0hZEsS/qwH2VDHVA70jW46QozzZjaWHy0d9OLoZZPRstvIMzv7Y lLcuwQPyGlxtklx3VkdGJviYiBdJXFmMYQooOgKHlLAT/I9UBWR15xCi6BPGvn/uEqymVv2frHecb McmTJokGkZLVKQTMYHhiV4XopA84dF4s9ovY53/IGrSzAt1Eo2bzByfzuJUM5Hs2pYfO41KeGzVkQ 0nXYMc0zIRkuSzBm5Cr/RSGv4TGraPptalyz2gQ4czEsgMwqSDXI6cZ0DMZ7ylzgevYrZJO/LBkxh hiO4xcHeuKQ2DYcJugbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYYm-000000061w7-0zHd; Fri, 22 Mar 2024 06:39:24 +0000 Received: from mail-db8eur05on20604.outbound.protection.outlook.com ([2a01:111:f400:7e1a::604] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYYh-000000061tQ-3MA8 for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:39:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fra3dtBvbA9Jrn3GiF8p/0tbxMotFp/5ao+J84VURagmsZ/X4N/Q40+d3O2QdjIWlJj1CSkjwztIW5sDgxblVin4izW7T8t0gNkQ2Rw2eiWtcZxW+zM09XBcs2ZEy1/dD8xXvAa47iCW05/d5z8pzhEsAQ1+IrpGTsVRsfdXvTudrGdmZvHzjzcQCAub1E5YopMlzyczEH+ALFRXKZs+nz8c4KaY8vvclZ6MeijFWqjWIsLFfPgLq/K3VGJZWp6/14xQL85iHgPnO0TaUV7WguvS1KG0yhgxVYyHtt3LErlWLno1YCzntr64CxO7k9wW7lDdOvXwPtL5TJ0NvX9aQw== 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=kU6ltcEd9/H24mNJfR/tl4910fcrDrrYvk5Br1cYSrI=; b=dZFGgJxYwRoULHBKhqPbTaY6TnE+BYyaJflH39djozZmmDM4NNSEbMXSdd5XZVyuWauZ75Ld1TFwlBsYMb1JvNdT9a5Bhu8kCd1DPVEI6zBKJZ87ZuNp2XvrrjypAapoGgrXOiW4IR8F4KWrLdTaVGdY2c2/tlZmkf8cb778dK6rvXIsfRDr31rLEEwjJ6V5TrhxMxP9C/ktgwf6rcePP5sW8mji0RXX1CPMKDfu426BBfyGnM/5UvExDZixhozuJoxrC+SUpDQtQngVd2mcaSxSh+9ezlsNSjGnUIYQkXSRa9HNnQ5YxvS9dMAc1DRUNWF2ZcstLhpTOWB1nbodKg== 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=kU6ltcEd9/H24mNJfR/tl4910fcrDrrYvk5Br1cYSrI=; b=mtYwpPjHWfvF3fZG5I28DSZYO3rnHUyO3zwdDdyLJGC8O9zKh20/Rp0RV1Qxwfm4aipTu0y/XHfZ0Vut8YrpkQrPGpfe27RW91lcL4JK/vvnOh06cKR/ZgIdrh4wpFK6XLLdcF1e6TpR1gl0aTolNdVIrIcc/+TRPc1QI4dvZLw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by DB9PR04MB8091.eurprd04.prod.outlook.com (2603:10a6:10:245::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Fri, 22 Mar 2024 06:39:13 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:13 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 1/8] dt-bindings: perf: fsl-imx-ddr: Add i.MX95 compatible Date: Fri, 22 Mar 2024 14:39:23 +0800 Message-Id: <20240322063930.749126-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|DB9PR04MB8091:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f6906d9-be2e-49f5-5092-08dc4a3ac9ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9lotxkWniJuz5lDIF630K2wuDTsG6gxdCuyUY6GWAmrH0cVnMQgg4xxIbFfWRgt/hxXoniczDdNVpG63508ITCKLveDp+LQGiElhC+DwYbCY54YxXBKxz9QV7grtn8Yrv2FU6IIkz0ZVZYMl4jR2+F1jwWHRW664UxkNMmGO3d/3mBi0UyiPKMAm/MIHvqQ7Pwfz3V9yQKC12mwvRJLv9PhVLkz814bFWf6ixrasDUTMj42pWvmukWN08z4R9GCrmWgCD8RfZkvXZuDWBs0KPr8WulHGb5DgXnKyY65Q5N10b3G+G/kkRolL/RAnJ3IbEEbLpoo6a10WfJl/bf/MjxAsSXW/QjKQm2XqGA/OcaVCZIMhphu4uAOdh7L6oKb9LbC0TxFFL8nnQFfuZUeyseHzH/M+5UAXBIzbTMEqM7jd+sHxxBCJexkY718ShTucR3qcIqBTj3nkRgzN3vz/dtOw467hNHWb+n7fxkwxOpGTha2osG7mVUtEPOdqFtd/eUU2AFaI0J23Tile+ewbiDJKoW8ySrfJHFtX39CnIOxAjBRTXfvBcNNBjrI2z/3Hw0pice3YYBCK7Ebq6V+Loo0ZLHSXKueXWKpK93g+GZtw5fzouTNcFNIrFWdgNwbB7IOP+zRrwq7IwQ1pWMhxkMBjxG0JOCTgTN8VFebhaDFk8fLAZ8nLu+556ovL9LrWn7HbNaPVGoCXAz30WLT6D/Tyn+FD5WPkGZ1CI235ZYk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(7416005)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gd1EZzLYnE8x7tM3lrBWr6r5gzujIisLXUnb74bXkeL8ZiyRw07udtCJ6f9z5W3HdHxU9LgLyWWa45HiL3XpJGNwyAghaMiskGDMZll4Z27PdeLvVfIXu2QNgDlId16O3eZlT48h7IwffMxrO+oadIgzvjpHVRAWMtJ+aa03+p1U0m3tTUihGVlKKCn1KZiGjlAAV0FFN3Q9kBD5DgER21H4OfW4P9S/1UdIdZQP6W9MBAVFLDTSPfp2koTILrwNH1xRjs0NmzwE1zFqNHT2xEeQKQaDAere0eX0UxttEzN1g0Uofcpx+iN02U4j8F2k9y7Ew1IUa4i4KrUkSC31HsoIVtzGqNXoUvW4LJ3GR1jF6SnDtSjebhUhWogeBACXLjDcPLe6/P/jfSatXVZDCaabi/iu+VKiQsSMpctwsJk4ebfEhPZUAZW2xGrVTDrXIYB5ppowcKiP3IF3zQv4I2TvxbdtD3i2lvP5sFQwVWFXL12f9H7iP8O7AytONFoREJZVKqevrSksGEv4YR1yPzggBdsi4TA2MqCQo0FeMvmiIkzjtvAVmiFF4FpkebSIVlndsblr1uM88xl597+Gx24iNQYC0UYRl3oWfiKEDYJCHH9H9F/OOoELzTBr7EDlRL7x/yyhZM2SxxQVXT/RZCvJUw+GJV5aq97CBf9xvoqMOKWVvEUmwmky2GESy9QZ54IMY0baVe2VR03tkSbBw3YalgYnFb/AIUBzj2jVPbMPFz3izHmyvdc84uEv1Y5PEcpf9UrO0B6nzbj5SyM8ABUa0nprRqyj+Hd93wOp09MyUCxFRTE4OnTWs4A/W/sH0kCiP0d18rLWesbJinJYvpaqYb2Un7DZiY3rKKhfL9yTuYX/jDPfjBP61BB7dAgD/bB5ZoH81e0dKoDuMXRk5WRYv0EClucXdLSe/apVMHrnWlwenDNk86Z6I3Wxr7kSFc/cWHMp4tWn06GDfnrSKKBx3hRwxsHysb55QeLV196+l7p0nF8tI2VJbj7tXywPV49z0sNwLZjoowFb4+JbLaF7Moi9dwCfwaWnre8NXfizqBxP6DZRqQPVkek+VL13cjtu0q7e6SnwigufXl0WJPCoWRgnZWYHCm67Ebb+aaL6dcf8Jv1BIcxUvuor3WSnuk0FHrqbH4FLKtkjKaCuqgo5RlRiOj38Xulvh/ViJr77RmNkxtHLenFAQQjTuT4Rp+GrJ+L2fSEo3t4iR3Z8yKoV2BM8K2qsGeXVRBLvTV9wASZEjRe/KsilxFni/HVUHirWK287Xc5wXGR62baT8RpoGBRrvXpU6DuSw0VRterrbpWQ9vbfXcSgVefNWYGJwOooGiPm5SspCWViT9R5OXcM+U5CiXLyCZj8C/gpEJkf0cbyQptvKFkaxN1HNObr4LVlJde76VDUJQOR39XsGhT02BEkDlzRiwX06dam9hVjHNRvgw3BjHas3Z+zU4/Ds1zIGMRhO71gmDoU2YHlcOGNcukvRg6+RkHO5eVkb1QnkKe1ANWLCkWh4zUagliDN/ja3alFeQ49Bd7kP2lEAPHL+C5gXcfZQv8OQZ/xxe+s3iZ4G9KvdW5BNbl0Kb8l X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f6906d9-be2e-49f5-5092-08dc4a3ac9ac X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:13.5222 (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: G2Swl++DtA7afGwgAsePumVglwH3hd7SEbXg2Z/NNsDNPIS6vBJ9t/kKA29/62tnYUfWi/eZAGdgtW/KUMsqUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233919_941436_D431B057 X-CRM114-Status: GOOD ( 10.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Changes in v5: - no changes Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - no changes --- 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 Fri Mar 22 06:39:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4E92C54E71 for ; Fri, 22 Mar 2024 06:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ISzzuZ9GhL6ukdN8P5wHM9+dY4SDa1jjIPjgtmedpTE=; b=FVWiT4S0vAdkhL nfEO5EApZMGRSMa4ME7tMKXCoaG5QtttdrleFnzPeL/mSUP5/9twFA+oICed578yM9qMakNASopZc vF1a8HgWjFU8UKfZOrce9WK0jiotTuk5qUY/tiJJ8l15iWTW+g/vkdqxK1czKAND32I+9RlIQYex8 rFeFQL8TbCoG7D4ztWEB1Li4tDzLSVEZt+U33EmCX8KhkIUlB8+uj/RwJ3hb0rstXZfwixlX22xdB FrOfsCsGlKIxJ/7WyVR7B9FKwCXqFGGzoQ8F3KpfJdGUohM3rcux8uDsE6WxCxF1V2fCANG2LYQb0 Evt+XENGrT9k/fLGHCeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYYt-000000061xx-1gLy; Fri, 22 Mar 2024 06:39:31 +0000 Received: from mail-db8eur05on20604.outbound.protection.outlook.com ([2a01:111:f400:7e1a::604] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYYk-000000061tQ-0Tmc for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:39:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f9NbG0XVRgVi8aoQHqjj9l/0VtcIWH7jiMHaarvHzgdQXC8hJGTVaRa3QFwsER9bE75DRHvmcYBI6K6LIeD0fNw6piybj2Ba/OldIYskut0i4Gxo1Dd9A4AfIq/7JDhcxcJyAXMcuu3VaYRJWeVTegm3PHT9iEd+OnZuLfp9S+0xuwSilwjMFpUwcWyjqrhsBMRnpb6PdQYIxRjcIarMWXMc/zIQBpPgJUOa7VBPsMdeSYNoZAm0A8aSOVqr+FltTKRPR9GtY/dvITkQEZzZrdeUwxK0mb9+bUXw53423w3dVEfFgoj9GC45BfLa4gQJcSG/NBhRSLIyqIyDDfhbHA== 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=Eh/24dzJXeksENJfGrTAVYplEbCO/6KdVTixG12Zko8=; b=i5bTzS7Uv8B6OdcrOriKG250LUGV4bXUae8pagjX8sVS4jxaXJjOSLqU86SLctESJKbrF8LzeOWTs+q97lxYdBmmw1YL/j7dgPMdEDjElkslPf577uNduw4T6bJOqLZpQKQdqIpONc8TsmkNv+FVUpViXPmzLY7/7F5YPx9jgYc9xVllukZHxFWHeFQPANYWfQT7zPU/BR84ObnP0uP5zFFaVVencFRz0GKXBD3M1QWRQt0YqziTiBLR2KSQqar5m+e/MDM7Dck6v9chBvPA30X2otQjJdKcbHprE2Ok1Lv+QmnIZBK7tn1saRkUTEO5JyDJcVZMPlNvPgKK9I8RHQ== 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=Eh/24dzJXeksENJfGrTAVYplEbCO/6KdVTixG12Zko8=; b=NnZhO5eN95ogikvzrG3mSb8tAkydQZZLyN2xe4umDw4Q9udb82czKFiSs7IQy1x6EtjybkFhtehp0S9+gHm9pWvrUBixgWEPnXxms2o1yOctIK7mbwtEetQNaLWY/OxW2mqtGqVa1YhRlDq9gRE3gpzdpPbt8f+6JL/OysDDOl8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by DB9PR04MB8091.eurprd04.prod.outlook.com (2603:10a6:10:245::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Fri, 22 Mar 2024 06:39:20 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:20 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 2/8] perf: imx_perf: add macro definitions for parsing config attr Date: Fri, 22 Mar 2024 14:39:24 +0800 Message-Id: <20240322063930.749126-2-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|DB9PR04MB8091:EE_ X-MS-Office365-Filtering-Correlation-Id: d1b1523b-065e-4dc2-02d8-08dc4a3acdb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2e657mhBG6kClTCzA2yCIr1A+ef53k96pIb0b9ds/5kDQm5yl1cXfcsaKiR0n5P5iISh0WSRoPVrlqqYIuASRjYyTxQtVMwJsPXoMNd6RcX3nwhvbIKHB7fdfwRJsnq6OR1VUwlI63UHWjNIEWFW4fB1QNuIwURKThuFq6vQPZeVz2LR0Es47v/YDdG4JsNrqSn7NEarQHwiWCaUjur5/oc1kci46sXQ/fV9PuGsspHC8HjTbylafNDOLNsDGOE4St3IXv/aHwPyTwZZw4NTDU06FeuKgiPKfPy/DJaM3XMU2ZEoJQENm79xmjWWouC2QmG2xd92UtGn2S/U2e6kCC/gFcCOGVtNpjegsPfr+RyDiSN3tEsg8trtW3moHA2FGR1S3r0LV78wxexy2akuw3Prv48AEOEj5l0Rap38NwvNIi3grf6WyVNgbtR1EJDLiYD9QvMu+fu0tYwrIiMk9g1F/onG2QQ6F1aScDQa4Arwsg4r4nJQyXyq3ghRkzs4QF40IJuh3X4As2j96h7sHrs6tYMf/ACM27AZRBWhbMEf8oxIUQPYgZxEsRb9p7Apz8E+qsPZIQUjY0l3C6Cj/SIB7Bt3s1gKwglGorJowJTScOOLG7/P1qTyJY4wNSa7Y6sMmrWjGGnu7OqTlBIgc6fl8ckbULzGl3TzdMch5EQicZ4u7evM+dDUdyIIa6p6CqNkafxBzjPC9YplK4S7r7aydwnBTxqmRkM8eDE0slQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(7416005)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TYOHe1uXIqkosnjq0qduxw+dF1Gi+RiO78W6S0P4ntQvK7Cfkk8hDrh2kyU3dPJpjhko5O0jT0EpZ0S8CuuJW1QQlMBXUkQqpXW/mhESdi5c34YUpmcJ75Y47i7p/eneWVLfw1TK2yIlvUGrb2w0jwUhKY9rd+fWjsbTb1lZwewStzkpTxSkoIq09pcs21mt/tLq1rFFZOgeUTctZ30KbgYh8iCtLD1w7al+3ndEIE4rxF3yXsgoRRYmVt20x6smVTRQVZZjmtzzqaq4i2rKFoQwFUWjY11bm4dl19iZLU/uUTQas1SFeAQcKZBsacX+nUPdZjmiUH+zzjjgZt+yQgcTuij7Vw+BsbY1IgvzvZTZfgDdZffZ6bLxXqkQlmt/R+q0ZYS6IJ8flFAoRula3mIDKFN2831Qlv2pnXS5THJShYjHKyWeG8htOvL3tEzRcOgYrForXDYpiwqc2VEgO34G2hi6tY0CKyLnP9FSBoaeYDzfPc7eSH1mkAz0VK/UsdAxobftDyhgkGewo8u5yEoicnwgYaRTNSj2DP1gJoNet94gIDTCZOIcWSqxZ+sHfhgD/lSWbk8LNKtADlMUJO74mNSf221mYcxmOkpU61gp0aYHu3DQEwomlp4pQ66g45ZdSuan5uo5CebPN8GMyAUea4zizb3PJlaohsAa3doSGE5XOfqzewvlvFhKMd1yIbHpYhy8aUl18Dc/kAP1ryz+rfVSrV9u8yMJlHOzJ0ZmDEvjjwDu90Pe11FWI7XzJT/I2DKBMudGSpWogh1DuNTAu6XoHhdLGQLixZFqmKsu2ZtgGUB6Mipwf2ilThTLvvlNnPVgA+3IjY3fjefy/FmTp9pQAmsuRR7lXFnFQhMLwvNjy9NGOOGarScG9SeNHedsQaN69s8iUX79ixIWpfQtzNwmFSFjv9NAOqGD16YdDZ3VnUMYa7CLeJSi50ZFuSmi8N89StCweH1kGta9iVEHmUOUzol+GwfY7Da7i4z6DeiswFJN2y0t/AQQNPfSEhPhYo/OuwGsUH+XWhq38U0Fm4LcHNcSZZE517G09O9ma8UpHycdI4SS7VlgoPQvlQo7y/FnEUUMQFfXbwmg/6EXS59aUE09UQmpw2llJpUhxdQL0m+78pX1LZRTrcrszmzzVYcGXDojMaL8MWw4/Y6mudvaDpw0UY6YSRvWdDXaCmxFld6snu7jynZpYMfYR3R61vB6c/azko5jKRXNcgPCxbrkR1qnKYI0iQ4E1zVLmC9mGc4gHrmD8nbktEvd8ySRW7KpXhJ/kRJpvaMsZlJFoGhcVECrpuCBZRxTAE5fkrXa8htW9GTGqljFp+VC/IXaUsKPF+xNvreoJDZXMqqMMRxkufnrOMb2qICG87Mx1kQTKXfp568937NR+BMVw9/f9x77URKxTbCWeRW9GdqaowYCrk4uzn7Qc8zB4JtFL7ltFA3hDXVJVt5OJBT3TK+cTJ71Y1Xv2NGKG0GU1Zv3tfWEzNmWu8+4ER7XZCgYYpxn1XrE1EHYQBGESZQ7vb+Dso9JAagLk15XUDrV5ka3ssrhj4Ydv9GmJEiWPKe4DO6anAlt+HEXc+t9caD+ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1b1523b-065e-4dc2-02d8-08dc4a3acdb9 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:20.1660 (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: 010S2OVnLjJR032Zgc61Ojld3m1EFj6yYgOMLHNGS2Bqt/A9XXfIJ0Xm1+E7JWWQo9V6yF/9CN8BZRTgnwkODA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233922_184084_AAFE8EF0 X-CRM114-Status: GOOD ( 15.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v4: - new patch Changes in v5: - move this patch earlier Changes in v6: - no changes Changes in v7: - use FIELD_* Changes in v8: - add Rb tag --- drivers/perf/fsl_imx9_ddr_perf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 72c2d3074cde..0017f2c9ef91 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -42,6 +42,9 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CONFIG_EVENT GENMASK(7, 0) +#define CONFIG_COUNTER GENMASK(15, 8) + #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) #define DDR_PERF_DEV_NAME "imx9_ddr" @@ -339,8 +342,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 = FIELD_GET(CONFIG_EVENT, config); if (enable) { ctrl_a |= PMLCA_FC; @@ -352,7 +357,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. */ @@ -366,8 +371,8 @@ static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int u32 pmcfg1, pmcfg2; int event, counter; - event = cfg & 0x000000FF; - counter = (cfg & 0x0000FF00) >> 8; + event = FIELD_GET(CONFIG_EVENT, cfg); + counter = FIELD_GET(CONFIG_COUNTER, cfg); pmcfg1 = readl_relaxed(pmu->base + PMCFG1); @@ -469,7 +474,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 = FIELD_GET(CONFIG_COUNTER, cfg); pmu->events[counter] = event; pmu->active_events++; From patchwork Fri Mar 22 06:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67A64CD11DB for ; Fri, 22 Mar 2024 06:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LZnSpUKj92wtx+Sg7lJwF4njeLWSm+d8WHTYfUCtD+c=; b=B2TdYRJfFnwxeX VnNMtxgYhIitjuKNZrhdsjA9ukEoRJhBevWkakd7/qjZ09GoqcDBfw85pci//SKXqVTSTT3o+7oJJ rM/i9cqbqSUjmBksoN1wvxFdCR1qqwgzeSAMoLyKC+95gXD/Qf00QXDZczDjCN3Efcwl+UkvTNO4y k5C0KKYhHoYGmehNphpdDxsDIJ2GYgcF2X+eMdPJePZ5tYP0J2I3zy1Dej3rzsVNXYpYEeuaCA+oY 1ii+cYu/2zM7cMvTTLl1KY8qU8W8rxp7B2sAvqF6FKXkREdswwvzoE/PHtU64kgOF+eGemF+6dT5d fHTLnSN450w7GcPvWgsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZ5-0000000625r-2ozq; Fri, 22 Mar 2024 06:39:43 +0000 Received: from mail-db8eur05on20616.outbound.protection.outlook.com ([2a01:111:f400:7e1a::616] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYYv-000000061xa-0xBi for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:39:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HxFmCuTXN7FSDYc8VJT7BBZD+2KUqk79R1PkbbCuxbj3tf2hPYmEZRCYcaSsIp++c4ivnnyawWC+DfB3otPaABVD8/5zrsTiImXDZURhELG90EycHFPR9uimrR9bUm3M6ReQT8BYfefFuhKNHFrOQS9BdNEFR5lKaXpWiXwtg+doJpSdXl0liwx7ujH3iTZSPmZCrDN4tbg/JgwZe9tuzwOJ6mAkNi8y+ZyOM/L/O7/I8ATeWWzvUiKzHkITXmv1qQJ2w3qupIoYBWX+WIgS1gWfopgMsp7BoPOLPvQFbvBfFCcDdJSGUuj0RDlWsJ/ium2UK17M6GGg/JyFvj0X5w== 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=ZwmTZIdNCReqPwuOYBcXgXOhGAsE6Ons0vS3d+lwqO4=; b=DLua1pZxDaAnyueZg7rA9USR15wyRMpDL1BUuOpuXd8GN/UDax+7CSCrazQMUJXbyf/5By54jFw0F4w+9/Bwp0vZ/eQeTxAOMmnguX6fSIw2HjpYi/EVEPX2q6cEBHuSWunk5PTWLn4LrpiGKVlLNRTllTk9yiT7Dty4lNoktqk/PM5vfctQpFUrqyQCVu9oeTCCNY102XF+2aYcfBjzfkQImeRht7Yprl6Rr7MqrD+TWZHcuHh+kHv7udO0jyvAlYpBvdeJ30W6p7fre1jYruj82b9v6rsst+DLNSrGpVDJtymsHAqMQ8AyXX0c0sBR12IRYfdyetQ4/EU+JxeZkA== 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=ZwmTZIdNCReqPwuOYBcXgXOhGAsE6Ons0vS3d+lwqO4=; b=I9X+V/M1kZn/OZO60xb+ymmRT7/knQKUrrjknnSfBEfoxLuBdzMiSxT0p9pgVo9gFYxZnR4R6jslsUs4XiOlrUiO7IwATwUPxIhB1PgycFa+6mBucZgziWlJC17U5PWxDc88EuxW2Ty5j49+IHpvmD4f3MT51Kgza3raVILoymo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by DB9PR04MB8091.eurprd04.prod.outlook.com (2603:10a6:10:245::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Fri, 22 Mar 2024 06:39:26 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:26 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 3/8] perf: imx_perf: let the driver manage the counter usage rather the user Date: Fri, 22 Mar 2024 14:39:25 +0800 Message-Id: <20240322063930.749126-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|DB9PR04MB8091:EE_ X-MS-Office365-Filtering-Correlation-Id: d4f79836-a4b8-49fb-7d18-08dc4a3ad1a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: phONhfUPwJONU1jJj+5Np6pu+GeZNA7EH/Uj9ANs9hhoh+X1G5Y1Zj2Nwsje9Ur0fk90BjumOV92zMYV2pVIWLHGrOli38BgfA+1ZLFzsofhCMfhdDg6RpCZcDLanp8DE/xiobcoGx9ZIVx7ZN1oCNglwV1mq33o2RZAvXG31QtbveH/Y8GU5965SMpvqSggRfIQLsxayJAHSCyFGalNJeAns4PqFI/AnsFROSwS73cDL7dakRtD0BlrE3CePd92I0kbZ8nFvFJ9G9PgaOjhkmQLEyjRR/34i3gztNNooggjvFEIKUTXb8wuaAEGt7glq/UHnmUtj835s8p3p+qJpNH2fctFNveWsvTDvMKHGPwTIo6tRMwx0vgd8vYHYIY6i8L3jXO85pdx2QvEHMPsJFFZ4N5gLRmkz0yZD+Y8/7Q3p2OCfQxVmNKVQd6qLs1JZHgqLbi/Y8IefyJskiK3K6J9bfAbKGqxHutSqPHqYqmbEV4Eu2O8FOPKVbqibTedog1CTYq588ycBoc5J5YIpfnVIygxPlSNa8aBbhRfq2MSxMd9nvHy/WuriK7/6HYLXLirfSwhecF2T+L0Ld60g+MGWSPwJ7lTJ0tWkxeRRzzwn1SlzrzH+gkhGEgTaGR5Zjjp3aq+bOLQqKFsgF3U4nwt4dlwShcdCmGdBB1qbFHC+sHo07CKM/jwoxMRHCfS8jUkI0pUgkEVagELobG0M/JHOBvgYr6SiZnNjcVMe/s= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(7416005)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mx1bxSCrJ+A916AEfy4iV6U2isZ+rqg0N3/mwAmj+SgRE/gSgz07XeKeO2pi01PUnUA1uUrIfNSbpMHLOVMhpizLzY0IJbl+UWnhJ1Unw7ANLxWHjNE5lVlJ65SoZ47BkzXVExIoDlvef3loFFp232sBzJVEE8QgQCV/MjRXQJztFMBk09qrfXkdjBM09clQPYFAXX+wv+rPVTTkwPavyF4vL3mrp/YoMPmIh9eET+W/utF8BPHb8DX3XAJikDxV+WMP8SHgKsoIv8DT3S607L1J74XZyj5sSPzXn258aXHbar4LgXat22r62961VR5KrQ2GmcsW6lwZz8F0WQFm/jzL+XkOsLWMfeL6kobu3vMloMwFzgosashf/yaveZjVPvv5+AAkdNX/FMYveQpc66fiw7wnCErET5TI6f7XGG6avnbAHV7O5jvMqodMdKR5+j0xSCj8pnfBNXq4L1aNJGumjNN9eBttvR0SUA+1VYJfZFYK2p4tmIe9jEK540491DAY7OuKgu30z6BLxGXMozbaN9cCucAlV00/mZ4LROem4fCpSxnKET8firS6jbmQedxH9mFaox5tuDQeGIWwaCwfEKNg6h74n4zv4eKI9AGodq2nzheo0fmpwiIIWzYdBMGZGps8h48yKf556Xp61Ll345qFgQCN8xn77bvrMGJdiaURm/igT5E+qsHlrmwxayxB/zzYHImFX8H2SCSHkKzjgMoDf9EBLkwdZzXcCxKtgXxVkRva3fWP4JhjwXeQthuA1LCzKPkp2gBy3QBOIimaoE4iRtHtVv6U7aK/6Rh13Qz/+c/8X/oQb+ecbppeHjVugn0vjPv54LNxFgN9UegUK2uSBawhN0V/vmZT4H3wJbvvzhlXi9f0UzKqiESJl9V7tdVfGrbZ3ZzQwX4Ht6zpMZHckraLPtLZRt0G+8oFdmxqOdi5Wr5bdVtBN5lC6dsUZNYXS+lD4IvW5HrXEwV5od4m2Op1EnUj3f7bAxT3ZypIE+4U/sdf7bAiMluRb7xkWH8OE2uwyEGeYGs0tBf+Y/ABwVfON/C9+A/08+d0ztxWUBT+J8rBM9oCyMN7y3LrmlmOViIqWm2Ox2pDVpGKGuozORMKPl2kTvgZdS7mLfdo+QrpkzjGrNH7dzYu0lCBZyxOL8f4GtkX2ZwjnOHikhDzSvi/FuVkPaRDcWXtgZ4p2ssnci1LzyFpmYMIaJMfn/Z6ZTS+QBSnoHMy+n3J2N6+E6otdiIR0b6c5TPyja7fM+z/fv3BzOFsrsEGywRBB8T04TbbQIALmchMxv+YkNz9NOBxwU4I7O9so28D/vHx524uimYz42ZJqu4AUK86Jm/hGSToCuRR1LqbzQnutp9vArnxyUyXPbXptKvCBjabMJW+2p3RWNN7wFoBvhRnRi+lYeW3Uwf2/WcDWKOw4cfQtoOqNm5pJ2uZhx321B4duT+3dRPjIXBSz9tV36hA5UNZDcnSpuo0lfQtZ+CCE3kUJYcL3POoegLO2A8/d75OYIFslBALv83RLKKqPKovVQkIVsPQhEjkS8v+utUCm07MCFvqO9Bvpt4LI+2es3i9qefxn8KbAB+EhbgT X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4f79836-a4b8-49fb-7d18-08dc4a3ad1a8 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:26.7721 (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: eI1lNqz02p1GK1sB37FqJndD5RWhaK4RWDeZbSGo7UHsqqLd1nZFgwKBLxchmncyEqZwWwEe+9CiAQMaRJRIZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233933_514975_DD4A7FD6 X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In current design, the user of perf app needs to input counter ID to count events. However, this is not user-friendly since the user needs to lookup the map table to find the counter. Instead of letting the user to input the counter, let this driver to manage the counters in this patch. This will be implemented by: 1. allocate counter 0 for cycle event. 2. find unused counter from 1-10 for reference events. 3. allocate specific counter for counter-specific events. In this patch, counter attribute is removed too. To mark counter-specific events, counter ID will be encoded into perf_pmu_events_attr.id. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v6: - new patch Changes in v7: - no changes Changes in v8: - add Rb tag --- drivers/perf/fsl_imx9_ddr_perf.c | 168 ++++++++++++++++++------------- 1 file changed, 99 insertions(+), 69 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 0017f2c9ef91..b728719b494c 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -41,9 +41,11 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CYCLES_EVENT_ID 0 #define CONFIG_EVENT GENMASK(7, 0) #define CONFIG_COUNTER GENMASK(15, 8) +#define CONFIG_COUNTER_OFFSET 8 #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) @@ -130,6 +132,8 @@ static ssize_t ddr_pmu_event_show(struct device *dev, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } +#define ID(counter, id) ((counter << CONFIG_COUNTER_OFFSET) | id) + #define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ (&((struct perf_pmu_events_attr[]) { \ { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ @@ -162,81 +166,81 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_pm_29, 63), /* counter1 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_7, 71), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_0, ID(1, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_1, ID(1, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_2, ID(1, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_3, ID(1, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_4, ID(1, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_5, ID(1, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_6, ID(1, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_7, ID(1, 71)), /* counter2 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_5, 69), - 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), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_0, ID(2, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_1, ID(2, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_2, ID(2, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_3, ID(2, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_4, ID(2, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_5, ID(2, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, ID(2, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* counter3 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_5, 69), - 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), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_1, ID(3, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_2, ID(3, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_3, ID(3, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_4, ID(3, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_5, ID(3, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, ID(3, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* counter4 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_5, 69), - 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), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_1, ID(4, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_2, ID(4, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_3, ID(4, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_4, ID(4, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_5, ID(4, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, ID(4, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* counter5 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, 72), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_1, ID(5, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_2, ID(5, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_3, ID(5, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_4, ID(5, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_5, ID(5, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, ID(5, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, ID(5, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, ID(5, 72)), /* counter6 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2, 72), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, ID(6, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2, ID(6, 72)), /* counter7 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_2_full, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq0, 65), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_2_full, ID(7, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq0, ID(7, 65)), /* counter8 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_bias_switched, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_4_full, 65), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_bias_switched, ID(8, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_4_full, ID(8, 65)), /* counter9 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq1, 65), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_3_4_full, 66), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq1, ID(9, 65)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_3_4_full, ID(9, 66)), /* counter10 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_misc_mrk, 65), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq0, 66), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_misc_mrk, ID(10, 65)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq0, ID(10, 66)), NULL, }; @@ -245,14 +249,12 @@ static const struct attribute_group ddr_perf_events_attr_group = { .attrs = ddr_perf_events_attrs, }; -PMU_FORMAT_ATTR(event, "config:0-7"); -PMU_FORMAT_ATTR(counter, "config:8-15"); +PMU_FORMAT_ATTR(event, "config:0-15"); PMU_FORMAT_ATTR(axi_id, "config1:0-17"); PMU_FORMAT_ATTR(axi_mask, "config2:0-17"); static struct attribute *ddr_perf_format_attrs[] = { &format_attr_event.attr, - &format_attr_counter.attr, &format_attr_axi_id.attr, &format_attr_axi_mask.attr, NULL, @@ -366,13 +368,10 @@ 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 ddr_perf_monitor_config(struct ddr_pmu *pmu, int event, + int counter, int axi_id, int axi_mask) { u32 pmcfg1, pmcfg2; - int event, counter; - - event = FIELD_GET(CONFIG_EVENT, cfg); - counter = FIELD_GET(CONFIG_COUNTER, cfg); pmcfg1 = readl_relaxed(pmu->base + PMCFG1); @@ -392,12 +391,12 @@ static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int pmcfg1 &= ~PMCFG1_RD_BT_FILT_EN; pmcfg1 &= ~FIELD_PREP(PMCFG1_ID_MASK, 0x3FFFF); - pmcfg1 |= FIELD_PREP(PMCFG1_ID_MASK, cfg2); + pmcfg1 |= FIELD_PREP(PMCFG1_ID_MASK, axi_mask); 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(PMCFG2_ID, axi_id); writel(pmcfg2, pmu->base + PMCFG2); } @@ -465,6 +464,28 @@ 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) { + // Cycles counter is dedicated for cycle event. + if (pmu->events[CYCLES_COUNTER] == NULL) + return CYCLES_COUNTER; + } else if (counter != 0) { + // Counter specific event use specific counter. + if (pmu->events[counter] == NULL) + return counter; + } else { + // 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); @@ -472,10 +493,17 @@ 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 = FIELD_GET(CONFIG_EVENT, cfg); counter = FIELD_GET(CONFIG_COUNTER, cfg); + 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; @@ -485,7 +513,7 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) ddr_perf_event_start(event, flags); /* read trans, write trans, read beat */ - ddr_perf_monitor_config(pmu, cfg, cfg1, cfg2); + ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); return 0; } @@ -506,9 +534,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 Fri Mar 22 06:39:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F722C54E71 for ; Fri, 22 Mar 2024 06:39:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l4QkfgzJSLe1l1oUjoAW7ueF5wzf+anEs1dkthUvn/w=; b=lw1RXcHxlS9EYw 36DXIs/NGmxGs+HDuZy2OrUC3bs2+TMINsIbx70sqDIVNBTlUqvv4LARWLrHPT82mvT9LDtgSBocX ayV56fpiIlu0wCJ7Su4ojTVSO1LqH6N4BzKDPOgclnHYjkf1PJBtrlOYcuw2Q7ZFc6qwEVIrMt80X N4+A9kFfZzG8T7bSBc/qHQ15/3DRWOK0m7+T2yBeEHe6eNXgO4NBG2exLHluQ0vCCZNylolt2lNKX owXXTEpJTHSxh1i83zSviQ+YvNV4F3zN1pU+laf6hhTQXRaaENCEd9d8jLxV+Kw0ecsRLjdtqZ8D/ 2FiF7eRK2ZtpFaXjCIoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZ6-0000000626g-3oA2; Fri, 22 Mar 2024 06:39:44 +0000 Received: from mail-db8eur05on20616.outbound.protection.outlook.com ([2a01:111:f400:7e1a::616] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZ1-000000061xa-0eGI for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:39:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BIbrVMDV9HWJl3iVo8wz8qZx187QioRwAycSmoQ9Qldah7CX+tPazvTOCHPk6RsjLQGFOokyKKQ3b8P2fLdsiOaqaCDzLLf0sCLM64IjPtUIr0JpYl/jbWHDeYhGV1JE7IvFLphxcbwml1xI7rTRLUT052qaPAl46z8/emhMOJj0hm+ukIgLHOStlUsDqIXzpJ/MwZQ7EFLQKlidn+Ixv9jxvXS+vm5mkfwo5MVbGTKCeoEm97DnyrPY8CIzjYkO643Pt0ku8y0e/kBJGPMPkpiktX9E/ShpEDK6Dsh0gW4mV2TZh6OYQJcjyygh9TVydzNNIgvAU3+de02O3Qw0Dw== 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=SOB3WSf1SaW835T279z4dsncCLvkZYCvdyIrwZomBg0=; b=IC0ahRKyYLtkxK6QmomBUHctXpY+dERlWW517xYuGquLszyPoa+5XvPUG9+I2H9bJKkR/KqMkLNNl3ipLWtRNQetrBDiFPLSj/O4fJH6m+rbggpuBg6Q9mtxRipu3z6sg57lXb2pav8LiTTNvofKqFUsft0UpJAWPqoBSRP+OZPr9gWz19ZSH0C3aiOGCNuc7PNJo/bE2OTXzWAY8y6obdVwNLsOF7IA/dP5Ct26oKpEKzYUxvAqhSfeUn/KYrt3tSiMn2X6AhvwaImMMtdtnGnSOR4LUlN4pq+vSeToy1DN1CiTUkVBD4pbUuJI9LUOXTsy56FDpIwJgFNoAMVDfg== 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=SOB3WSf1SaW835T279z4dsncCLvkZYCvdyIrwZomBg0=; b=HwW4gxpZQSf7LoyhTLMQizkCtHbPj4aNtaQ1ONMADwDo21V3ipICmIjLQdRV9Ieu5TnSV+XDYCsiOM0nQxeylaYuBKeVb5XvFXmaaIBvddtqzg88Na0q2vpu/P/AGxZvRGGQiZmp/ujlO4i8kcwv/T7rhNKwXbYmiAVSCu6kXto= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by DB9PR04MB8091.eurprd04.prod.outlook.com (2603:10a6:10:245::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.15; Fri, 22 Mar 2024 06:39:33 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:33 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 4/8] perf: imx_perf: refactor driver for imx93 Date: Fri, 22 Mar 2024 14:39:26 +0800 Message-Id: <20240322063930.749126-4-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|DB9PR04MB8091:EE_ X-MS-Office365-Filtering-Correlation-Id: c2930008-e8ac-4c75-2316-08dc4a3ad5a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EBsZj71dF3rB5kXN8j2XT2XAyH1+b0nFK93SBI1faVvo2uFfk5SH4TXL9zC6ocozYGbC0h4Q77w7Yq30GCPI+BiYq643eaKCdLSxfaNsFPE553LPpUVcTkHQ0avHaHsd9fy9auLAXnO4w1bz8gnNkPbbmp9k0lHmgLPrb+qQP4sO7KAoEE5wep0tep8dtt+dwmNjElxitowEgiN5Pc2oyYK6nZU73g7a4/6bZ0pVIyQbA4T1mpRWIn1QvsBAM97MaztIPZFwVEqykrnmgjuRvYT0tvU18nYE+QjFC2OGXvXXo/VU7XzYxmvYwCp6Hav0s+eqgz/PtygoAcVSbdJKtscIej3VTeDllCkTzhXtMnIuLtftJaZmQU9w0mcZbEcn798G7Rh/09st94KP3sImc1W8nnHvV2XNRPP9vofNCjxBNkSe/d38/YMCWVjrnUcjJgjLOUwxPq6Y6cegixUDArde3+0u46ntMFzniA+hScB6qH7cX4KvSEJBc8276sYGcYUw0tCRLgTZPHeZ2BMvDch1HxmmwLG3gUopO49l0noOjF64rJTSaPdSexd0rW3FJSMMmNUl5e97QM1w6wxAhB5eMANnF9AbMHDwwyNar1LaeXA7jjO90x1Te1a4YO54vVNaoQixEhmdT7pc5nS8XvY4MSJCkwHFbX6RZu93Q115y832fZdc6K0FaPl5hFXmVD9UYgZcJWjKoLvQfAzOnwTHbEqhWNEHI4ALruGJ77Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(7416005)(52116005)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: khccwRnSFC6mEsG0/yHzUf82JLKN+gBHXWS8IyBId1N9+RjpCLmdXDUIbkW7Porht0AVJWHYmRQzIlb4cr4LZdenpXV1PwdtdeJU0c6RUVwd35SzUQ6KLY3p92Vns5lBtbyy5uW/yEko9Q/iuRYDkMc1rzhCYIiujMwnJbzolLHNjomwED5qdvHsmeOWV+Azl5fP4cQ+1o3Nch4BdPsLkcfkTFqzqgnb+sisQMvDe7GF49n48H1Zbj3pLQKwKrUKDzk7zP8ArW+kwtiR+yr8/QxhshXnom/7O5C5rYiNuHk2aFqAqTSz3GrUnqis/kwN9dOiGjNuvTY2HwscfuN22xXqGCd7GAgHbaa7v41gGG6NPC4axrexvKSj3t+P+aRLRXn79Iu/EeeiK94LX+sPIEkNamI/5tRJ9pbdPIYSfcqNpxCqhFjJP+70NACoRhavkTL06yJThyxeb55WaMLq76oTJURXmhEEU1xM53YOUr0lrnfi5FEF4gxw6weXVtyAujpLW5eRmVvbvK26Q5Xw8r4plQVL9zLi5RrNKO+qXy2hNxUyU1Q6t7dyrI1GQTcTv1QRYUbi0xoWT/PBxqg7sBSIzFftMryHkpXvJxMrScrlLKnPaVYRE+kZlcarF+hViMKlcCXBcgDTO33GeDqmvQl4sSTTZ/Mkr8Zvcc4virwb1xzbTPD3LGrgOsclCkNAUx85zfzjGj+PRmINZdBZ7m0Mq058wAuw9RTnrU+4fSHm78QmzuldERlWea1JjS01Ij6rKieXDgrt6omuWtQ/7oIYVkQGn8lkSBbVUabBOVGrTVrfvfNEc/xRd4bwF34UrAkjmdZtjr77vpQ9FO7qBASL0SCj053QzBFC02+K+wYZLub7EzmsexeqcaSS3HlTtGo5faZCBHfCcorD/N083v1MAkD6gD/gDspRuIweRNdaMN/hhadQtMqqQ4guOghc8p3udUDieYwerS60tds+w/T8E2YcIot15yvfOSdKjEcgZq81LQ7P9ANXjxlR8HPepewtmsR7FfFt0gT1S9tBDXOXyLh+KD59EDwa22zsDId8xYyomEpzs0yhAquu3hLMUrxQMMkzLThhxFYuJ8yY5oPwMQmgy3P2LTCYASNISVPV3TaWMc4eFH5EmQxd1wlIvx/mioN+bk2GhPVvR35sDEqEbG8Dn5/OaXq2puOzlJKtFA5dw17K74osUqJ8rbLaipwzxG0Q7BzUDiglx0tZ0rD882cnlCtyeqzatQHD2P2flBIrEkuQkIbBL0M5VVcBp+N/GqSm/tfbpawTaOuGvxMotORBUFByEbE4Qft+n+LCwcL470Ri4vQYUaqQxZ3jUXc1fnglKRgd9U0ivYEx0e2MTauQut0JSwJ6J9gClnW1S/kNAZ0GFJUj62klS44459qC1sgVJ9jggrSUwwaNY/jTWuoJCrblqOcknpnIE1HINuceGtdlnvmB7hJ+77KfMLz7YqGt0yExq2xLLbqnHyrUGIv0Sqiprr4L+MExGK7slPun0DF/KCJ/UW9G0gXxyt1HKqkgfS/BEGt0pvd0mewYTSPJKXQofOBncN6iVZvkhVJsCpdc8FgX7Nzdqwks X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2930008-e8ac-4c75-2316-08dc4a3ad5a4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:33.4863 (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: jokPAFejIoso0TdPWaVwYzsnBLkI8+koQX+HIaHIVE0LX1A50FthlI7AyWedJdoZSbu5SeTTkCZERuz+pv6HIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8091 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233939_216724_CEED5C71 X-CRM114-Status: GOOD ( 20.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Changes in v5: - use is_visible to hide unwanted attributes as suggested by Will Changes in v6: - improve imx93_ddr_perf_monitor_config() Changes in v7: - improve imx93_ddr_perf_monitor_config() as suggested by Frank Changes in v8: - adjust is_visable() as suggested by Frank --- drivers/perf/fsl_imx9_ddr_perf.c | 106 ++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index b728719b494c..011377c01dea 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 @@ -76,6 +76,11 @@ static const struct imx_ddr_devtype_data imx93_devtype_data = { .identifier = "imx93", }; +static inline bool is_imx93(struct ddr_pmu *pmu) +{ + return pmu->devtype_data == &imx93_devtype_data; +} + static const struct of_device_id imx_ddr_pmu_dt_ids[] = { {.compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data}, { /* sentinel */ } @@ -123,23 +128,36 @@ static const struct attribute_group ddr_perf_cpumask_attr_group = { .attrs = ddr_perf_cpumask_attrs, }; +struct imx9_pmu_events_attr { + struct device_attribute attr; + u64 id; + const void *devtype_data; +}; + static ssize_t ddr_pmu_event_show(struct device *dev, struct device_attribute *attr, char *page) { - struct perf_pmu_events_attr *pmu_attr; + struct imx9_pmu_events_attr *pmu_attr; - pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); + pmu_attr = container_of(attr, struct imx9_pmu_events_attr, attr); return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } #define ID(counter, id) ((counter << CONFIG_COUNTER_OFFSET) | id) -#define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ +#define DDR_PMU_EVENT_ATTR_COMM(_name, _id, _data) \ + (&((struct imx9_pmu_events_attr[]) { \ { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ - .id = _id, } \ + .id = _id, \ + .devtype_data = _data, } \ })[0].attr.attr) +#define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, NULL) + +#define IMX93_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx93_devtype_data) + static struct attribute *ddr_perf_events_attrs[] = { /* counter0 cycles event */ IMX9_DDR_PMU_EVENT_ATTR(cycles, 0), @@ -185,7 +203,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, ID(2, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* imx93 specific*/ /* counter3 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), @@ -197,7 +215,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, ID(3, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* imx93 specific*/ /* counter4 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), @@ -209,7 +227,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, ID(4, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* imx93 specific*/ /* counter5 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), @@ -244,9 +262,29 @@ static struct attribute *ddr_perf_events_attrs[] = { NULL, }; +static umode_t +ddr_perf_events_attrs_is_visible(struct kobject *kobj, + struct attribute *attr, int unused) +{ + struct pmu *pmu = dev_get_drvdata(kobj_to_dev(kobj)); + struct ddr_pmu *ddr_pmu = to_ddr_pmu(pmu); + struct imx9_pmu_events_attr *eattr; + + eattr = container_of(attr, typeof(*eattr), attr.attr); + + if (!eattr->devtype_data) + return attr->mode; + + if (eattr->devtype_data != ddr_pmu->devtype_data) + return 0; + + return attr->mode; +} + static const struct attribute_group ddr_perf_events_attr_group = { .name = "events", .attrs = ddr_perf_events_attrs, + .is_visible = ddr_perf_events_attrs_is_visible, }; PMU_FORMAT_ATTR(event, "config:0-15"); @@ -368,36 +406,28 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, } } -static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int event, - int counter, int axi_id, int axi_mask) +static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int event, + int counter, int axi_id, int axi_mask) { u32 pmcfg1, pmcfg2; + u32 mask[] = { MX93_PMCFG1_RD_TRANS_FILT_EN, + MX93_PMCFG1_WR_TRANS_FILT_EN, + MX93_PMCFG1_RD_BT_FILT_EN }; pmcfg1 = readl_relaxed(pmu->base + PMCFG1); - if (counter == 2 && event == 73) - pmcfg1 |= PMCFG1_RD_TRANS_FILT_EN; - else if (counter == 2 && event != 73) - pmcfg1 &= ~PMCFG1_RD_TRANS_FILT_EN; - - if (counter == 3 && event == 73) - pmcfg1 |= PMCFG1_WR_TRANS_FILT_EN; - else if (counter == 3 && event != 73) - pmcfg1 &= ~PMCFG1_WR_TRANS_FILT_EN; - - if (counter == 4 && event == 73) - pmcfg1 |= PMCFG1_RD_BT_FILT_EN; - else if (counter == 4 && event != 73) - pmcfg1 &= ~PMCFG1_RD_BT_FILT_EN; + if (counter >= 2 && counter <= 4) + pmcfg1 = event == 73 ? pmcfg1 | mask[counter - 2] : + pmcfg1 & ~mask[counter - 2]; - pmcfg1 &= ~FIELD_PREP(PMCFG1_ID_MASK, 0x3FFFF); - pmcfg1 |= FIELD_PREP(PMCFG1_ID_MASK, axi_mask); - writel(pmcfg1, pmu->base + PMCFG1); + pmcfg1 &= ~FIELD_PREP(MX93_PMCFG1_ID_MASK, 0x3FFFF); + pmcfg1 |= FIELD_PREP(MX93_PMCFG1_ID_MASK, axi_mask); + writel_relaxed(pmcfg1, pmu->base + PMCFG1); pmcfg2 = readl_relaxed(pmu->base + PMCFG2); - pmcfg2 &= ~FIELD_PREP(PMCFG2_ID, 0x3FFFF); - pmcfg2 |= FIELD_PREP(PMCFG2_ID, axi_id); - writel(pmcfg2, pmu->base + PMCFG2); + pmcfg2 &= ~FIELD_PREP(MX93_PMCFG2_ID, 0x3FFFF); + pmcfg2 |= FIELD_PREP(MX93_PMCFG2_ID, axi_id); + writel_relaxed(pmcfg2, pmu->base + PMCFG2); } static void ddr_perf_event_update(struct perf_event *event) @@ -513,7 +543,7 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) ddr_perf_event_start(event, flags); /* read trans, write trans, read beat */ - ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); + imx93_ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); return 0; } From patchwork Fri Mar 22 06:39:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599702 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3673C47DD9 for ; Fri, 22 Mar 2024 07:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mBTjZX1DA8i/wYCuGysOnUdxQJTzB4vaUkLsVwe9HoU=; b=iWJJIWnlAKC62T yxHtVFf5V0j5126NL+9xEipQOtyDzU3GBtrWK8AekM2f0e8udM6fzZQ98DKVyFntqca9JuTbyavAd HgtAy2oJv6HB7Ppyl/DKtqqK9siNmCqsL0hVbaJ797GYFfbIo9m9w8lxJQrjYMaHQhnb6/gyGOpyh VdQTV9Tv/NBH2XhdFQA88J9c7Lh2/ScrCqfyKhs5z0V5NTHNwRMYoZG6hpy28AskosfwzKvZI0msl XoyGPgzcp2lL3hE08eznkwfoG6/A+xhNmnyHSvIwZx3GDY/zB5V0uthS9jx1IdGFU5LwgaQlJDsAW BX1QPoAN+Ys5NDUR65kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnZcg-00000006F9a-2HVe; Fri, 22 Mar 2024 07:47:30 +0000 Received: from mail-he1eur04on20600.outbound.protection.outlook.com ([2a01:111:f403:260f::600] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZ6-0000000625G-1TRC for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:39:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z98F9MCZkabYB2upJwgOMDakqOxV7MyrLDBxKSmN+uxr1l3RN1xpQA9wqP+McIQxOsJcMhsNfKqBcHO6DTBxd9ApPe/ZDzdCXc3vhJLubue5saURNpGFp+O1m8q3fmN1y9LgiRYbBLVZjna3EG7M+VdXiFVpGZxMoOWzbFfbAJECsYceTen2RbWaIA0zDYBwyvgSeuK8XaHZ21z8ciDcNHdVOh/qATfa+5qi0b2FZOJWfwH5s8jrbcdK6/17JQIthDdRPJeq4RDWsl3BGS4fHl2fl96Lsm87lQxMjv8lCJpO/9i105WLZuAqD8gsbV5thIS/jG2km6vLcG4yMFVPzA== 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=H+CMt+Rcp1Y8LexpV0MGSjuehDYnZVCAQLAdLLv3SxI=; b=G6tj8HEeBiv1LN1OOcZRHhGFHII4GhIThHdtvKxPI4WRzyrZX7wliz/J5wZjjRn8KfoZ1UtJIzLeGDcLXp5TTiDeERKWzd7FLPD9LzgP8jF3JUt3D7IwdcSwYrAscMZUgF2rUFel3zmJnQkoy9h/zNfpy5yZKK1ENt/TxVU47GVDXinrLs+7Q/clKDAKdrBhZhfkPsh+spM27eTogR864oclj1VZsIRIL9KvMcy8vn7fEcCp2SsIqa3ygqRuyjvYkZmucL7huouxbVTv7HglU2fu8RMNVDMGITyXH2huPg4lzx2UE0Nians8MbfDz6DP0h3JPdFV3r+YD75f74k6Dg== 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=H+CMt+Rcp1Y8LexpV0MGSjuehDYnZVCAQLAdLLv3SxI=; b=DYAx4f1oYHSVJWZyDdMiZRPUS5MR6Ny1EoyGVvbY/yq/RU1phKK2kx0cghXT9IqCY4H1cxgkxWd7oDMmGMcs+La0EeCuWxJS46DysPRLUUJKGzzJCNFZdink33fY3Qir0pY5rkv6Tq/CWgAjW1aXhe0l2h7gvDnDNWlK7L6HHwI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by PAXPR04MB8928.eurprd04.prod.outlook.com (2603:10a6:102:20f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Fri, 22 Mar 2024 06:39:40 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:40 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 5/8] perf: imx_perf: fix counter start and config sequence Date: Fri, 22 Mar 2024 14:39:27 +0800 Message-Id: <20240322063930.749126-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|PAXPR04MB8928:EE_ X-MS-Office365-Filtering-Correlation-Id: 995ba2e7-54f1-4c06-e484-08dc4a3ad99f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UUgkgyYKq+fGCEjfd4nw3WC12bsnfIQQYdr7w2pH+L0N9Ts/d0rrn5hW76PJUlaDlw90EsjkmQPnhF5tHUSwIW/kJbYIieAxzrZOFIyrLU4veotaeeMp6fsG52AGhFZ/Yt3CN6f6Zf/5EJDm/Pw8HLiM2AUzonU0YxeQC9qR6WtFecAGDAyVNtIgh6Ou18jDGmD80vnSGsBR57tqXtipFh5RIEVh3LFKgAi4O4ihogWnwp6V0NW8djN7XX/n7JPKiJ0J0sO7sEAJK0fIVudO3RcCJjjayN+1H6/66d9n53WE1NAHIBJQ51rtPFhph3Ki5b7CP0vnZtVffBDyoh4ftXQv3vLXkA34aQ9EdPMsI3aaNfWD86bkaourX0ju8vaxNSF1SfRK8FyTS/kJeLIcgSIbR0FYDcUXoXRPBe3Zh0SEVHTDdteWBF8pDsSN1jVH/6XYrStCSbCGLf36HA98E19yYIkxdo3GEV0yR9si2v/z+LIt6a7zVPhihopwnM0GcIpL+ShzATJKx0z1bj2Fg2ARyt35dI5LHL2ZRihVFegcLFGoIf+geWRT08foxlYS471uDgnVmJtgHh760E3DYdTGBsJgM0gjxEq3DhHYUMUiO7PFuo343GaqEYLy4r5vGsZXWkBA197eH5C/nY+W/1/Ew2rm6ZxgS/GunrvidVf38IcKbQioZNEisIo/8MpT9nL3oFw71KSN/TFnNGuwmO4kriCgZtfCpxgtRr/NC6U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(52116005)(1800799015)(366007)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uj8duaSwgp0yqbdiorrpiXaBQRzShGho9/AKwEcNcIAy7fEsuJRDJOA3OlkVRcO0Q94nUHUn1TNIH92Oa8MuTeeijebWSxv3J7a/QEzra2TKfTah12aB/0mx8Qdcxa0LlvWDfTMm2sqL5oW/wpGIApB+zB0KWr3PgwEDmActHyFzDGz3GDQtxRKHZPgHndharlfX6oXxn6NnQpXAoWHxNNURRwbibFZuvSCvI8FXJcaaut8AWxascSyidtqSux8JLPUgVGZgbXp6DNe4khThsv5PlLvlJl4v9WGC9hb1SUO3gyh1s8bDdNKpL8C2LQbJspxFGWHnJtJE2XrrB+aKEONkBRiGLPPRdr7r2sze8NK7A361gwHAw2xrtsCST3D7Hvni1UFxAuiQb9f4H+dn69ASf7eYdhNPCU/Ui0uu9K+U5PQKTw2KerbDt0BUyip0WlzQDo6W9a+Hy7/xhVm8j42y8Wm+DPrLMAu+4KJen1FoCNyBZHD83QWFdTdHD+itDr/G+OkRHzj75+QM3Gr6M2fqZJrPzWwGNqTnmV0nLxTdPdDZvDgDQiH6LtzI7EGPt4sNDEzi5YWXsOyEZnFu8s2OMR8keRL3vofJw4FN88A/5wwEViCPVl/vgi66mJHG3xX/JmnRCFpdJeFxk6Nu1ZpisW8ukhK95F7MfizE35Mhp1XEnvehicaKHE3tJ/BoHZ1RaMBGwU9TyOQRXNV8jo5inoKDzHNm1s2D+9rwkd2n3s8e588jqV9Fgi5VQMpz/K5yEs9M+lFwvLlKSO0xBoxPV5JtMXzyQT47VUQKVoRxNYQJo598heMlvBXD8e6s7L/rziv5Qv5aKlVqRFrl9B4qyHpysJhpvUMAuOCAiTF14ltcR7ozCSFFTyFIK57oEhNqMB+JW3KMNZK7fo63JLR2vEvuha7zuWtCYdv6eaKf4kAM7du3z6skCiU9GLT3Pwld5Vww9agsnRo5Iz4Zyah/W3MNltmCv7fODSSJnfUUYMLYys+rPoUiGm3qJYAljky17oZt8nE86PTJweFtXjt+4umIbllap6HkgQCCi4vOwTz4tPPX7OuZ/JZAEXjPYWkLVqKSBfdmNEqw4EFLs86d30J5ngaSxxerBCK0rqF9uKviI8sV2KWHX4rS/dY5dxJ/HXNc6AIOcT8B4GcelYjlzX8Iptn1od4uCcgLhBj947CVcLDfwhZnReQBbnG1rThXXWIXUsigIw8+CUfvYj1lLKYWQ/UB7m6NIHTzgV2Z6q5zp1Q9jETdWdiMjTu4fzU+24t8Qgb8iXMfYqE+0f9YuHOLiGF4cu58n8uK31EwW/OddzijJdkJgl/ed24lkm8XQpwm5Lae1fnl9O7/ouApQfvRsrggBb7tNAbpb3XrI18LRzjnYtDAYRJbqys99ZVNM9Dubk//js4xJgsZkruF7Tfhqv+wqb6aRr9Tn6Zja4JTDu+yQF3bxHB4om2JenFz0KgC5CBQ4+zUAHgzSvmgfsMnngvVrRMMxCt1vdf9jL6PAIZ9cmDq0goqKHOn/DuHlgT7FCsGoWa4jA6ViwUYcEw3ZyNTLiPXb2sFHJsPN5MvZYvWix77gSwl5fQl X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 995ba2e7-54f1-4c06-e484-08dc4a3ad99f X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:40.6237 (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: nuBRZcJFOpnaIIBFiSfU5+lyKXEyR1ZiZilN24l/cpl5HtexZax9wpTnolJB42QcGHIcWzzMiTIfQMgXFA4QqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8928 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233944_657546_B16F416C X-CRM114-Status: GOOD ( 13.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In current driver, the counter will start firstly and then be configured. This sequence is not correct for AXI filter events since the correct AXI_MASK and AXI_ID are not set yet. Then the results may be inaccurate. Fixes: 55691f99d417 ("drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver") cc: Signed-off-by: Xu Yang Reviewed-by: Frank Li --- Changes in v5: - new patch Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - add fix tag --- drivers/perf/fsl_imx9_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 011377c01dea..fab6596d3e28 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -539,12 +539,12 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) hwc->idx = counter; hwc->state |= PERF_HES_STOPPED; - if (flags & PERF_EF_START) - ddr_perf_event_start(event, flags); - /* read trans, write trans, read beat */ imx93_ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); + if (flags & PERF_EF_START) + ddr_perf_event_start(event, flags); + return 0; } From patchwork Fri Mar 22 06:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25073CD11BF for ; Fri, 22 Mar 2024 07:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9CWQlVfq9wk+kwC0Rx99e4Xco2rXq3OCAO7+5ng8WgM=; b=kc585itonZZO6v iUcQ27pWnOXBMaR3tr8+rzgzy46S90qZShQvhs/QGlAoTf25Al8ZrS5VTstXgA+6sHIdlMKjmGF7V n3H/UVbTekAtGN8rn4dERLlrWfLC/8N1OucZxC/SvXmsfXnWBnYF3lspevbiOZQH1RFyypGyX44qO G/SDYT8BWXxe+ckBbHTub4B7RbJvLuKY4YiRkkOdCo4+Q6rOQ/EaM4RUfnW8RaprbUjB8zYdoC/0e V2kOUBROzTCg1yTgk2K0vMPDZYrfLYMJRjZ0j8foi2UAHerDDNjh21XBxgMCeyecoUBcivORyG6Iu xihlTldQrRZvfWgJzmmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnZch-00000006F9g-0xkh; Fri, 22 Mar 2024 07:47:31 +0000 Received: from mail-he1eur01on0611.outbound.protection.outlook.com ([2a01:111:f400:fe1e::611] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZE-000000062A2-1ZLx for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:39:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jJ7+56VeP6LPx04yT2fKhUyroCj9pp7buarnmzJEWdHdmZPHaFRHymlL3PtcrTbNW4yca/3U1xNA7hdSCNIUQO1nQyOqyUOURCthaAWeuFPZb7KWoixJNWFbyNkn3QxeZd+7pwFPhEhGibrle3SgAXPqLsgVfJ3cn5m6rOIXfuZ/i5MOct/lQCv/YRFTD4IDxkbrnFT9yr+weptcEbbg17Qofj3W1ZamJ3I/Q57Va8DKHXBvjJ/Eru9q+IYwYPuzFdGHUAifUBiSTzGUTPP4UrV07+HeFcp8ieaRkcQ8FJalRZ/L5iq8FR80uAyfrjBSWvUhbmd3iujDl1b/NjNfTA== 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=Uz5lGhO/mHkDKzAXhAzF2sJwJsMO2dtrOSaEh3WFBn0=; b=Znd+qlPO4LhFTnjk3C9YbyjZAjCOgeyGWoPjr+ZcyG2ieCCkBwb0hWazovL9s9KRk4HDf22LjBitdoyx8ZxFRIuo+1MOIV8PDtzj7GNirST/fG+9GXsTAc6sT6+hyKVX5htEF444A0EhUIkSoJUL/FP2a8DDvMd5Ok9d2OMocDzRmY600/2RGEbe75SG2f1NWWSUZrohRTNdE4yWkQw22RPaQJfhE2ZBlJjbnDjDNNDtoz6cBirwU5Q6gP4+5FmU6p6NWDSIGWv9W34rC6BoG4CPhEdfttvdsaWCPmAsfZYSG3Hcdhgle+8gWmdcJaPlq7eYaniq12yeJk3+dwXYqg== 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=Uz5lGhO/mHkDKzAXhAzF2sJwJsMO2dtrOSaEh3WFBn0=; b=drh+9JBe6EQdAHvQTmwQUNnadwKHSuIvM4JOSPitf3jXb56AufUWK44NpppG7mBBtjXmqXSjM9bJMuGCiOi0DBGvGxqy91xSo6XRRzhkrfYpppsRxNV3ecVS1NHWHcLtpSK5/207lQCmSqKqFQMZZ/oId1gODfR2tO9PWJyRoYQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by PAXPR04MB8928.eurprd04.prod.outlook.com (2603:10a6:102:20f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Fri, 22 Mar 2024 06:39:47 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:47 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 6/8] perf: imx_perf: add support for i.MX95 platform Date: Fri, 22 Mar 2024 14:39:28 +0800 Message-Id: <20240322063930.749126-6-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|PAXPR04MB8928:EE_ X-MS-Office365-Filtering-Correlation-Id: 9114a1a5-2252-41ad-0a1f-08dc4a3ade21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KNNFGyyC6/cyNBgogkdjRU3oe/WVa6nxKwiOTENsGhzvkO1DN4TEtJdi/hwurIw8OIFUrQAF4QSdyO5/gkWv05lPmN/PkRFtI33wKpFR3ZalkNnehyYRsqZ53ELiYgSFjHjfE2yw6zc8ZRDA6LlE4p6HazIhoi+L2wqDvuJfxyBgwzm1qj0cVkUTCituk8jVJu2uiTUOwjFdtJvfiZMr9NI2p4hfiKLx+0M/pA+bjlgBxASDLklFF7zfdA8ZYQZxhd+HwoVpT3plDySlFSjoe9F54LT7jnnCjy8+SKmvYQRwJIleSwCV3qQtU25QWbHWuwK1PL/gnT1RIdBfM1G6jw0ETTNp71b4c6PAMY+mCJQSM4ZoVf9LSIC3BdtZflSrk/pdKq8OE4JI2ol8gSscLEn28os69B61MgutTD1qOj2byeLtdIG3yP4gU/xtSAHMc428y6gvttUIRpRh+cvcyo33o255wbdBJZ9d7NnlPpvJWQHYDLJgvThC7AykXgtwNWyohtiFklIafLt1v1KKfqrQXaAtVCN6zwWkpcCt3C0TbdHUaCsjT+N+0997JoK2meqpxXqbvmm67Z4x/NIvJY05chCUhO/70vuuJasSd/llLPqGLTun2OaPEPMuh5AADJy2+Y+AQquzKzczWAVEFEbVN2tz+ZtMHlC5wzJ3X6l2sGLWT4CRLEpldEK85Az6US1SNjUzDnG14APfuYXwBjSPKgwG0yqM6m4/7iRLvrs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(52116005)(1800799015)(366007)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HctdzsEJdXdYZq7nrHLS6XX0km+u5nQz82lGYlBv4+LnAdowWeIbju+Bmy6Gnv81YUtSwcUSzqxQwTgg5qNfAzPvf8CXGKiFIcFcOAcaNnKkbHk+bT7EgqCC/b8yUvQtAhg/6+DAkgC4rF9B3asdTqKxzbqRgKw5nkgnsI1UDXAWDXRF3g43jX9wPOeSRbsrgzsWLn4RJjmSKK3F7vsAFcbhu0cPDn/y6FGCG/4WuJ3kqXV+qYvePlVmZYOUOrS9/41ma0C0bqDS7Bt12zBTVjXuV8zpHMSBK1b3TTu/j/8Ee6nDx3hSxsEJ12ZxVzeY9tzA8VxGZNDpKBDVGHAWVbkoojDVVjVASyVYoyW0EVPjC+SbcH5bIlIZ7ixpifO90oxcthZQUmuqk1H+IScPIc0m8svy6gf77TqVm/fXUReT3GCShEyodfJ3MDqLr8Amn7t3wzAgCsYYhyQICFd7p3hh8zaVWatgTUhDllOYM6zECpbJ16HOVduBjWgvZCwMuCX69lr4wbWtu6Kh0y1RzDEzAwZX05ClFnq8VBrpilIeghuxpXMh2H4GLoLAxrbk61bcBjkdqoEhcQpIGlceBipWr+q817lL/LzcS5lWJJVNHOKLXfTwDha8LbvL0sb0taoG168ZtUlzWDuw80qnQDhFW+ErK+nWJh7thx631a1PnPGeCHS3YGCDhAihQ8O8CFg8u0RyeZA3oaJGSR3t0IbKSilX9otTBkwI2jVpu7ZWEZY5HRYx8hBtyF05QLMXIziqf9ubSiP8iXujRGVPUVG/cROL3/HEjk7I0G8c3f+kbajpCNyJZZIfphGPr9pheIgZD3/j6388wurFIbJikHq+uJP6wf0x0qKYGRBiqbdo7y1QYSE96OiavoSCPHGvNcyaaJ3lJktnsFvxtM1eVq3I6svwJM7gifidZ7aDVxwJlJK5rXPdJruwskKaoKn17qaCiCHsUzHBWosZ8KOR39izZ9JYi8df+4FrmX2NDx0KL9IREPUz/Kmzty/pIygjAFvUuwZQMct9LxMRDzhRjfXuRVeFkmu/JfzUwNN4Lr9pqBAMVCOtNEIluOE+p+Ph65QsllWYwOZQAFcvF0OszfkALzPcTHCHzK1Qj95LQGW75WGvIKnFUY528N9fAF+HbJzElT3r2qNVM03LSpHSqLXwippSlOaWLSGomHmnkN0m4wgViq4cxApUEYjuRKJUF1a9h5lHxx7+VOZJdQM3nvCZuoNJAAEdXhiHXn2a1IYFn9ih3TA8k1y08rYZei5oCCLwU1FPyfe9+33c7508DS8dpYlZb4rVPuXr4TKVg73QMP+1LOpaMWuuofbEF8CuQhwBFfCCxkcSm8Y/FkrJ47qcHz3bqZ+yAKLNCMMKek8tHH4NCD9FhEb2gMMXBpJyTKJGOjEYCJmH8TWVwHoYcdlExprtteEwHKGivxYiomChqWmMPsmrp0LOkOqWmLnUpBHWMpE7d5SQhlrk+efeYJWBYeHc1jakMe9fGU4sXx8uChHXB1pigkaE73mMk8Lww6eIaVGlC1Y7ZzdDyPYINrY0ofSjZ/Ab/r9H2Mc2BDKjSOoO7m2UZ5sWZbteBzhe X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9114a1a5-2252-41ad-0a1f-08dc4a3ade21 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:47.7034 (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: SjfJe8e7+Vz+xTe6FhK+cAzJdJuAxgAfy0koqH56+0dCyVorshG6w29xqHle7fmqpICZDvuLHZACst8Lh2ruZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8928 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233952_729711_A5766AB1 X-CRM114-Status: GOOD ( 20.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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,axi_mask=ID_MASK,axi_id=ID/ ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt1,axi_mask=ID_MASK,axi_id=ID/ ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt0,axi_mask=ID_MASK,axi_id=ID/ eg: For edma2: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt0,axi_mask=0x00f,axi_id=0x00c/ For write beat: ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_beat_filt,axi_mask=ID_MASK,axi_id=ID/ eg: For edma2: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_beat_filt,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 Changes in v5: - improve imx95_ddr_perf_monitor_config() - use write_relaxed to pair read_relaxed Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - add definition IMX95_DDR_PMU_EVENT_ATTR --- drivers/perf/fsl_imx9_ddr_perf.c | 89 ++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index fab6596d3e28..9dcab4192d6e 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 */ @@ -76,13 +86,23 @@ static const struct imx_ddr_devtype_data imx93_devtype_data = { .identifier = "imx93", }; +static const struct imx_ddr_devtype_data imx95_devtype_data = { + .identifier = "imx95", +}; + static inline bool is_imx93(struct ddr_pmu *pmu) { return pmu->devtype_data == &imx93_devtype_data; } +static inline bool is_imx95(struct ddr_pmu *pmu) +{ + return pmu->devtype_data == &imx95_devtype_data; +} + static const struct of_device_id imx_ddr_pmu_dt_ids[] = { - {.compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data}, + { .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); @@ -158,6 +178,9 @@ static ssize_t ddr_pmu_event_show(struct device *dev, #define IMX93_DDR_PMU_EVENT_ATTR(_name, _id) \ DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx93_devtype_data) +#define IMX95_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx95_devtype_data) + static struct attribute *ddr_perf_events_attrs[] = { /* counter0 cycles event */ IMX9_DDR_PMU_EVENT_ATTR(cycles, 0), @@ -204,6 +227,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* imx93 specific*/ + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_beat_filt, ID(2, 73)), /* imx95 specific*/ /* counter3 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), @@ -216,6 +240,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* imx93 specific*/ + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt2, ID(3, 73)), /* imx95 specific*/ /* counter4 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), @@ -228,6 +253,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* imx93 specific*/ + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt1, ID(4, 73)), /* imx95 specific*/ /* counter5 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), @@ -239,6 +265,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, ID(5, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, ID(5, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, ID(5, 72)), + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt0, ID(5, 73)), /* imx95 specific*/ /* counter6 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, ID(6, 64)), @@ -430,6 +457,57 @@ static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int event, writel_relaxed(pmcfg2, pmu->base + PMCFG2); } +static void imx95_ddr_perf_monitor_config(struct ddr_pmu *pmu, int event, + int counter, int axi_id, int axi_mask) +{ + u32 pmcfg1, pmcfg, offset = 0; + + pmcfg1 = readl_relaxed(pmu->base + PMCFG1); + + if (event == 73) { + switch (counter) { + case 2: + pmcfg1 |= MX95_PMCFG1_WR_BEAT_FILT_EN; + offset = PMCFG3; + break; + case 3: + pmcfg1 |= MX95_PMCFG1_RD_BEAT_FILT_EN; + offset = PMCFG4; + break; + case 4: + pmcfg1 |= MX95_PMCFG1_RD_BEAT_FILT_EN; + offset = PMCFG5; + break; + case 5: + pmcfg1 |= MX95_PMCFG1_RD_BEAT_FILT_EN; + offset = PMCFG6; + break; + } + } else { + switch (counter) { + case 2: + pmcfg1 &= ~MX95_PMCFG1_WR_BEAT_FILT_EN; + break; + case 3: + case 4: + case 5: + pmcfg1 &= ~MX95_PMCFG1_RD_BEAT_FILT_EN; + break; + } + } + + writel_relaxed(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, axi_mask) | + FIELD_PREP(MX95_PMCFG_ID, axi_id)); + writel_relaxed(pmcfg, pmu->base + offset); + } +} + static void ddr_perf_event_update(struct perf_event *event) { struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); @@ -539,8 +617,13 @@ 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, event_id, counter, cfg1, cfg2); + if (is_imx93(pmu)) + /* read trans, write trans, read beat */ + imx93_ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); + + if (is_imx95(pmu)) + /* write beat, read beat2, read beat1, read beat */ + imx95_ddr_perf_monitor_config(pmu, event_id, counter, cfg1, cfg2); if (flags & PERF_EF_START) ddr_perf_event_start(event, flags); From patchwork Fri Mar 22 06:39:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599704 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 770F1C47DD9 for ; Fri, 22 Mar 2024 07:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WpEu28c7jQTRAoI0V8bkqpI+fsTO07xZxPxqKE3zHIE=; b=xLBNVx6LqEnQAP PygmVXopw6RWJ5YF2S/g+B1Ti+6e/bPs++alMxEUlquTCK858kV+2q5A+0ZRhgJoGGpmBKQv7nxwc YFl2GrtgvJyXBwBa6d02+Wcfh3g4EUr7x6NmXiTJrVwp3lvdmU2zlccxmW0Am3ImAUzgWWEb8j9TU lChU5zl6c5udT3LD/loZVD61XUCGuCZHCrNJWE/UZmymrB0mthRer7P2M+V/USuVO/vuPLPtv9wN/ 64CCtmNu2wYC0EtLrK3KPjGxiiexDybqTrzsgxPlLg7A5RPcFZgTwr/GPSQ5vy1ejtirUvotFGkYu TayvyNGCViRSLBig7i0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnZci-00000006FAD-06zN; Fri, 22 Mar 2024 07:47:32 +0000 Received: from mail-he1eur01on0611.outbound.protection.outlook.com ([2a01:111:f400:fe1e::611] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZJ-000000062A2-0iGb for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:40:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fjkRegp7innnq5hhJSywoGh9UNWatcL2ikJjHX3PCU5KQOpGQnoYXVZBRaBgRXt4+LSHwvtbfHZ6Ppx2u59CtDujuqmWF9SLE0uLOMnXeGJonjBPKwyHPSehA4lb/P/KA+yudKGdnS1bcZzQsdN8zc9Mr4cFsd0nv2SH1Riuh3AL4GxGv90gPDYO8er1U2Nu5U/6GdT+hL/agsAz9Sa1UQ9fMrtU/E3Kg4Nz7R5S+eHP3SC1Th8dAFjguBSC12iN0waMp6kK2JjM1ZC3sQICmFbtTWRYigMSpOjA2l8NOzbFKKuX3sjjLcTTXMKyVGdBjpJD42EX5zF7Ck/Cq+StCw== 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=FtIt0Pycf9x6p7bmMiMYAP0vEogY3dj6FW+xcu3ltrw=; b=RapO7Vv+lFoUlOUgafBDiZztTddyOinpnR6sIMbmvx4whveRFNy4hwrXgNljRXBM4CuAXQM9LaL6EGLoXQ4Vx7scbYirKIp4Asl7jUqbcziP3Dz6Lirau2SP5+MIz48iIPG4uL1awGkDehSioiQVkfvbdckiDnCPw4Ht3iXlHFgHYudmZWLVZBWTy94b831tzvAyMMiHO3PvzPv6AMuWeUfje2S0hbSzcE10+IOn59TyoN6p3IQksLM9whLgv1LFk1y8ky25d2Broam+zobNI+OraeD35blDoJx2/qA6qOMS6bxYqoz2aihf/1qy800DdrBBVasMkkcxx+lbah8r+A== 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=FtIt0Pycf9x6p7bmMiMYAP0vEogY3dj6FW+xcu3ltrw=; b=Xs41l1EzMlr9TdAEf6qX49H2Og1G0JTkSW7gY96A+DJi6H1S+Y0FA1A/i7uIgmjeFMuUX1M2CPAvLH23TlC/RGYRkJR4kvXN88uZgePAjJswVon8mGF+GngXQ/AhZClgB+qmA0nUnhfwi1bESe+1c0eUYDygOrATKmRYBTeopPc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by PAXPR04MB8928.eurprd04.prod.outlook.com (2603:10a6:102:20f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Fri, 22 Mar 2024 06:39:54 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:39:54 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 7/8] perf vendor events arm64:: Add i.MX95 DDR Performance Monitor metrics Date: Fri, 22 Mar 2024 14:39:29 +0800 Message-Id: <20240322063930.749126-7-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|PAXPR04MB8928:EE_ X-MS-Office365-Filtering-Correlation-Id: c2f45a86-789d-491a-c7d1-08dc4a3ae22c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mjoMChgclMdAoKi2sKRKeOVttajM3Hn5h3FsuBsjHoc+gJmXIeBry2DzW7oCJnXYV9jnOF00/WlrSjgT2t0FUtFyHgLqKHcwIEpooHa1gFJiqey7NvYYL9GuajvB6bfeVU9UdgNaCJ2zIlRnPTVAB4/ojeerAPTIkaMWSMq3V1tx9r5fUYGstKjIY0I6FlQ3GOoq0Z4nsoKiOOA4hhpbtbsVvbDru1JAd3pVcYbbRhZ2vk721gwGdE7ql/ND2ZE6Yh0h3Ot5MzWKoydx2fugSt/KaHCFLM6O3TK/pO/VJkU7wb5mxPCDknJBK3WuSa2mPhKFKMLevcapqAFswXbaBKVpK3hheS74wYkeRVFP/QY1QCh9Grs6l+4Akt6kezx+NmwsRkvd2U8ElqbvHdS9Xgt8UhXj+ZX6scuG4+U4LaMfQJfI5GXLOFMcLgewP0ILaaTkjS0yPX2725c1+QDfejY+5pxzQAhjjxd40oBGMADVHmkTaV92HMvhljjTtPgwHXR5UTDKPkIKWh/omsrWRuVREJDHJtIuBgDL+JjUOOeDkEjrV7i8e1AqDwdY/RrMxR5NOg3V511ZHtsUpFzBidNKrlF9rBrw1kg1p/E13w8kESaFypXvYREC1XPSrCv371Lw+fmm9YtUEJIqgT38mWWoK1/qJhEKFSoPzvk04eT97EydrN+oMPmqBnOztV6CRU+aUqnj3ysvJbDHF7gTo8K2Kq+9+1qqsJ9iZPT+Ji0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(52116005)(1800799015)(366007)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P0CN8V3irj7U4s9shTbmDeFWw6sfJpNBczquGf8PHq4dAbdocc/1u7mOWs6rQ2znTAve7OHbXHSdtqkF6MyLKHDQSxnDp9h5JUvEY8cnCnmLL7B6tebTKZWIkTYgS0qz3q2zMZD8vC5bdRT7XhUCLyDQmZuyCkPDZcpmoTluKxsYK8kX7YQTYp5uFgRd32F0WHVwuib7kf/D2p7hmj7o0G0iYEJlJR1OlQS08yoRWJefExj0ONsJdYPYZjS07MTQdv/IUSzW7hxxY03XqRxdcEQsKAfmZo6ke0M5BZhGYJs+vdtu/2PXKUaIA1MDcJwhiKSgBQj9Vy4SZ+au0mbd7NVLEIqXxhGI+vXibjzeLPoa9k5E+jFc1ZRRHUotvhTna4C+r89nAmpUxyolxArkZxj9gNR4Sbmxcnw8L22kf8tkhBxs3plrNNmLsgNj94jH1Eeu5LKU6naGv23Esm9EEPMxuKM0Ojmybr+05OGhp/hzBQrnkSCAwapZYygAmvhdRXIpIn2dUdN9lkCU26iTdU0zH9WIRCVjaxaK+wP0XwSSeAUojCmj8m35gFvdMkEp1lbcISxmkQgIyJ239+Z/J00H2QmqccskIe3F5WVAXNgAhX+8FQhvh1yZszH+uJKLin5d1VlrvN3F6qCv+KJE9MfcJM5IUGEfNRBwt1619FGKAAFMFQ92FiDRC5NsazE7+Bnk0h25VpboYGwKm5KEHjMIfJBMd/husho1lJQhra9Y4FbE5LAPRVH+WtPpenCzx/jFQtxWSvwmc6+joBmyzYg10zrGIvCvliCqXze1zoyuE4ch2D4zEsHFV4x+nSfALLQ55qSzgq/FWYeubEqQMZ432nrKvAhXbmhO8NyJG+DcYhSrDAdho7OZ8hlTNvQyojREGC5AXrc8A7ymS9UrWnTtT+/EGtas7e/YWnlzQ9IiRZgEf4BiUrb/mSF65sqGGu3awuRD31rDhFAzZc8HxOmPAQ1EMbn3bz8pYkbG3Dw67TKZqPnjQx4yYDi+wdtuVlHBJVMVTAwkuIH3CrZjPo+03GIY9lC1L2vWKDkRCLE6LsabPUUMfplxGw6WKwO9oLQkYltZfrRfNReHF3zdWNsOmeRJKFm5Y8xSezd570KkpuMIlJ37Sp6J/Nkn24m1MO20ZcaGvkiE7Zpd9HCZXLpHDN3D0WBBvlrodXdVAOQofjPai5qCqHrK0HuBaAUhiesr05JTJ1YBrmZ8Nyv3tH662024RCGngtZ02YbJFwavIIdI5C6YiIuUS7wkDKK79RPxEmki1hLchtuJKb2gKvNmtCq2pj9IodujcTg48j8aXt70xgH4t4shJb4ehpYotyQ537H/J7NwPpCxxbaynoktWfvkY62rBkgSF5+9iMhHIxcjtEUbhWc35LwyXAoCnQ/JgAMJZb6UY0fGNq30zR+jqkIQfrdRbW7YOpRGH/D0mklsNIAiw/nXUD7zN6jpGGT1nh5pauUxGCqmlRkJcFR1d1wWw7BLqH1bN30lR+VsmAgyntTfh19S2woX2EY80zNHGS6e0PArPBJP86vnkgAXJ/HO8FVoFEbW7pXDimBvbuBfezEHZtjQTAoqIxW6 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2f45a86-789d-491a-c7d1-08dc4a3ae22c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:39:54.7482 (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: gqU5q2vp9cbYb9hNbopEwvVM+bH4GWusla9XNPtJrdY08eh3f6gJjqMZF1XLa80FS6mQnIGFoDFpBwpb/gODAg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8928 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_233957_617461_11D25013 X-CRM114-Status: GOOD ( 14.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add JSON metrics for i.MX95 DDR Performance Monitor. Reviewed-by: John Garry Reviewed-by: Ian Rogers Reviewed-by: Frank Li Signed-off-by: Xu Yang --- 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 Changes in v5: - fix typo Changes in v6: - remove "counter=X" from each metric Changes in v7: - add RB tag Changes in v8: - no changes --- .../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..a3ae787d448c --- /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\\,axi_mask\\=0x000\\,axi_id\\=0x000@ + imx9_ddr0@eddrtq_pm_wr_beat_filt\\,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\\,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\\,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\\,axi_mask\\=0x3fc\\,axi_id\\=0x000@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,axi_mask\\=0x380\\,axi_id\\=0x200@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ + imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,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\\,axi_mask\\=0x300\\,axi_id\\=0x300@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,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\\,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\\,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 e42efc16723e..ac9b7ca41856 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', From patchwork Fri Mar 22 06:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13599668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4718BCD11DB for ; Fri, 22 Mar 2024 06:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4IecO7TgsrSXV7XEW12q9waVSxzMOT6dNWcigJyVKRI=; b=aRBYykz+CMXx9v PkZdd74O3RbJCOhdVJQrv1r2vVLnIIZGODn0Hp0CGRdMTxR1mXyyzzEh/0uBeQnl9qilB2aVXsGS+ rVYKFL4FBvBxFzqZuSyxT+Jf2E9vx9Q8RjnLL+LJtmRluh+X7oTM8QbJLK5Pw+1BtrL1UzAqhsPeO 13UoVkzcP0/1DJO8ietuLtiOerijW6JXu78TM1il395wR5+E2zb7GGrST/KJe/Y1YAV9EM0ir7DVN 9BhVzvlr5lY6qXItbnneQHEom/bmT3EL9H3iO4D4eYTjnBdEGU2rJmIttIcnHPGfCDPHvxuPtJCDI ADGt/CKuAH0Xg9LGPFng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZk-000000062Tc-2tMw; Fri, 22 Mar 2024 06:40:24 +0000 Received: from mail-he1eur01on0611.outbound.protection.outlook.com ([2a01:111:f400:fe1e::611] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rnYZR-000000062A2-3dqC for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2024 06:40:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QwCmrBsRpNZwdotXEGzrqe0vw93K8TBXGGYuF/q3Qz3UW+xG7XbOhy6/tTkj9EjTAllw91TPDFlK1fNRwxUct8GsuJpX6UQ26P0p7lSs62SnnepM7VmF6gceVsN28VjyWSZrE3XZJL+hkCpovCiywRQGJ4D+2IlMVcGRZD5lj+8aU9KNqzXBA4BExfj0DoPfnzUFhU6O2QWNQh3QD9i3xnverJd2Sg+8jdKTyfPFMscF/eFcQ58QtbEH+Ingl92V1/uod32Vz9hR0WCQtBTtUNEqaXYrMGrzuCbUdplGur0tACquDr8Q05oDhIHQ00wi0J77K+eq2xvlXuWja7wxwQ== 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=IViR90ZsEm7l1zdbOidolnyGedq1oAOZ99AzYJwXUkw=; b=USq8fBxPzCmMF3/4NZBe6yUa+H1OnXppA9I6uRjkTMR3XyVDi6xfao4q4lVprX3as57taxN/4+b0Zt7WKLl4eXwoqk+4W2ZfMBUb9U/WJgsnMsEraQjeyR5nSiyh1G+KlekCTE5XkyhJjM3NUgCtfMUgp82KXcHTJplwykBNNuUT0HVs4wzM7Qv3RW3NFBCHLLnOahyqDoQPJjhxGngSgPmmO1JXK/xmjzznAZKCENZcJVP/F8YdOf6GXbcMxsujTtnee1l9NvhaSZoa63GZHpxcHSQ0RiV+l99cR7gjV+hpbHOUxX5IQwC/0Z1KONz5vAAFblIk3JnHX7Ck3+sBNA== 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=IViR90ZsEm7l1zdbOidolnyGedq1oAOZ99AzYJwXUkw=; b=OTudlDjpCNkuIRoD2/9ngJXf/mF9oVD3K0Mh3i1/xuQySbbPFT5JWmKmlF+KzrImr+HyxXb7wqOBr0TPhQKcoqyuFV/1WkFtUHojjsOfYsNajD2U48D1TP/uvNdYs3RKvupRyG9nem1dWY0JqIWwWgTaJDuYwyE1zYgyHhkcgyY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) by PAXPR04MB8928.eurprd04.prod.outlook.com (2603:10a6:102:20f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Fri, 22 Mar 2024 06:40:01 +0000 Received: from PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3]) by PAXPR04MB8829.eurprd04.prod.outlook.com ([fe80::1b13:505:8d50:f4e3%4]) with mapi id 15.20.7386.023; Fri, 22 Mar 2024 06:40:01 +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: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.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 v8 8/8] perf vendor events arm64:: Add i.MX93 DDR Performance Monitor metrics Date: Fri, 22 Mar 2024 14:39:30 +0800 Message-Id: <20240322063930.749126-8-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240322063930.749126-1-xu.yang_2@nxp.com> References: <20240322063930.749126-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0121.apcprd02.prod.outlook.com (2603:1096:4:188::21) To PAXPR04MB8829.eurprd04.prod.outlook.com (2603:10a6:102:20c::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8829:EE_|PAXPR04MB8928:EE_ X-MS-Office365-Filtering-Correlation-Id: b747d162-ee17-4187-d8f9-08dc4a3ae647 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BCNBeNq7/6598cCtLskV9mbLHxnqebLqtIqQRW/i69WWwNvW62phphawjKy7wQ5FgSJn7BAIn1sWbNydSsixW5pERUP/k/jmYXUosduHPlY0fM47ZS0IgXasLnbNNsQl8/XkMRnvutBk4vrY5l7rt3jm4z+59c5FLgcrJbFW6vqS9mxSPHcM+0pjxTs1YlPypR+R3YXM/u4iM1XCaX3/iNYFg83YKdHAi3TAhU5EwEMUvN2EEl2qMucqyjtwMXAxlbKV24+P4hfVTvc7iA0HuM0GsxeQnFcFV0t51DNL5Ib43+pUKZ7fEFeUeStgdzxsPxhhIkWWjhPc/yCpJKwiNpxJS0XURD8fkx77qM+A68gi1QNvhLQVcstkzk2um1ZnMe4CMk0sLl6QhfL8wHVDAqc+EM/XjKVaa4Owi4ojcoVr1sSy0ksK9kBwqOZ7Duy26mcKyO4gADjPOX+lmJmNyRpPVR6RQgQyhCiu6DNsu7CjZ0c+yU60mvsf2a/1581OfYVwqJ2js5ScXG0GpfrbqFsXAQf2hpiP+5wACGIfInleHgFy0IXmLKNCia5QA/qRNTlB660UMhhwdSQEach1fSWxlNeH+nUJ4no4wrmGMTtqYY7UVMv48AtTVV0Ef28MB3cD1WCOndSEvrtcvsQ/oLz9hCxVIcZ8EljgjVbt7RrBXrfcb0KZ4HCcJT/zUtYY9t6ESH2WUJoCSiA62O6A/f40oix+U7qqtzlCd83imUI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB8829.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7416005)(52116005)(1800799015)(366007)(376005)(921011)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YORkAWrR4qpELRfRoQXorGgwnBaGg4aSGaaS7nUQKnexkmHw+EoZUuJX10CeBVWbLPfJlCSm88e+5p1oTSKwDyXzsGbv7E42yMSfsgtfoWo1aMPRqhNgM3/5h+OFtKmHinVV4dhDKR2yCC8V9mW95etaibHdJphZdwf9nV7QAgujtMsAUCcnFvv4hSqi6V6pYknhKyy1zgOoGvxD7ATKN55iMHY+x+KAT18jKU2ZbTiumsSFXBaMfWgvO6GUUTGw0a+d7znYY709dj3vfwf7Cmqz+5dCZferIzoZN/F33eQ1/BvUJKkyF0dHnQMTByv51niJxd5erXDo19McoQqkLv/aharKqk5F2vvRFr1BCyhZiIss+acLJC3rvo1TTNwEaP6Ue4IAWZ+zelZlzUl9BIi2z33RkcNWKLR1Da6b6U9xJydH5gIl9cC/OoqmcSX0vVFchfIct5ET2xaDuQwJlEz2eP1l7rbf+kjJGl1LlsczeNt2fgob3gYUguwNAU6oi2JMxXgJGVeq48gdS0nAOPWApxinoUV0+Sp8zZsTE7DhgLrwU4nhFGtIn1+0LdZlIScWlWy0GrxQfehwI0AAQgPwu6g6ELcee1cmAr9tK4o1wOODAeP5F4b0Wc+L07Hfpjpy7rfiJFghNUSHb7x7AGs9u40IaK4vBHdjwZpSAd7WQvm3exZepwtF29/KqRfd2jPUT2NHJRO4xzGsOey5M7RhLHkUaffy/2uq1RRZTC8o8Th2jo1+s/mbc+lJyLzKTw9ZEteWvLbWHlYCjuDUFZ9y4xtf3kuDRJ/LGFRtGNL4aayjdnEdnQsmfav8KN2+UkT6f1W4wthF/2U3R8F7hxFk43UtAj7k8X/5wQdBtF2bdYJqwkk0/nOjeiO2t0XnOsObpWqlN/hj1qfqhl5mIJg2mhWXWFeZsNRTf6Mdwew2QK3jBbf6D/tG4bTghmaPYPD09Q0aeDGKRgApr8i4znSMu6AWMrJ72qgXCnzXrn5cIK9OQHpm232fIc4bveNudCrqSO+DVxBPYIYCxeN4QNZTalUSMKKTETDw+fXmuDSDSbhBZqK4yieZO587B/lg5BQfDubKqQNzERP8eqHUIruc2ipSC3ThJ3VuI9Fq8hHIuU2qKTl36bpNfzBdlX3tOdItSv9o2sGerGqiIRyfN3Ud1tc5wPAjfUjc+JqQ0lZmKEqYM/REs0EmH2RhvTVf8FNY4ygTpC50s6Q8jH/TcuszY0YD9uhNdIQxzlnpnSEpn5eWK/CLbDfVEh13m39qDVeWwzvI6ycycDTVczOF7jjNq+vWRK1pIYFg9UbKZ3HW10sD/3s/fkQdJeuolCdO/XO5IL4mhI9LChd4SIHPra4nEthmlV5pDn5vFdmGR1QBSSqre7EFAVxQ/wBuKyywWzF5YtRPAnTk4bWzEuMPW16uoOzlZzSMTMG7X2vp39/7cQrOLQn1Sk+A4ZJK8HnpQAPd+6mld+aYuhLflcNx4QD0WwMmvmzP2ktY2kcqCYdqceB47kmJvyBK8eGrX03c2SAtRRtugGEtdu9haNplALql2oSyjDaAhQT99sKe4KTg5PIpjW+BjPqH080ku+kP X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b747d162-ee17-4187-d8f9-08dc4a3ae647 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB8829.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 06:40:01.3379 (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: 5Z2JxBFtWvzvjmu+196flzwQ/2IeVk0TPJ5TuGAefv4GPYPHmnG8liGQ6zWCuCnYrFDSGo5fMasxtX2RQ3tpSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8928 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240321_234006_031428_6C9CEA4A X-CRM114-Status: GOOD ( 12.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add JSON metrics for i.MX93 DDR Performance Monitor. Signed-off-by: Xu Yang Reviewed-by: Frank Li --- Changes in v7: - new patch Changes in v8: - no changes --- .../arch/arm64/freescale/imx93/sys/ddrc.json | 9 +++++++ .../arm64/freescale/imx93/sys/metrics.json | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json new file mode 100644 index 000000000000..eeeae4d49fce --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json @@ -0,0 +1,9 @@ +[ + { + "BriefDescription": "ddr cycles event", + "EventCode": "0x00", + "EventName": "imx93_ddr.cycles", + "Unit": "imx9_ddr", + "Compat": "imx93" + } +] diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json new file mode 100644 index 000000000000..4d2454ca1259 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json @@ -0,0 +1,26 @@ +[ + { + "BriefDescription": "bandwidth usage for lpddr4x evk board", + "MetricName": "imx93_bandwidth_usage.lpddr4x", + "MetricExpr": "(((( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8 ) + (( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32 )) / duration_time) / (3733 * 1000000 * 2)", + "ScaleUnit": "1e2%", + "Unit": "imx9_ddr", + "Compat": "imx93" + }, + { + "BriefDescription": "bytes all masters read from ddr", + "MetricName": "imx93_ddr_read.all", + "MetricExpr": "( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx93" + }, + { + "BriefDescription": "bytes all masters write to ddr", + "MetricName": "imx93_ddr_write.all", + "MetricExpr": "( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx93" + } +]