From patchwork Wed May 29 08:03:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678166 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2062.outbound.protection.outlook.com [40.107.6.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 872EB16D333 for ; Wed, 29 May 2024 08:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969874; cv=fail; b=HVStnyOG5s5o0oEz6fyMRput6xw6G0cgUS/IEz8fNv5nib91d72KoeQDaDfKMLXGdls/I9ImVl+JtUiqjbAo3A+wHl7vylllH1vrClyd1nnhJ3WG9KFKi9Fju/9UCV7tQGy67G09N8ezGMl9NYBLjmaitKwBtWxqfqvNDPrk1to= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969874; c=relaxed/simple; bh=Ym9CMxxDEkd2eO213x9Ep+O36SPBU+umctj0AUHJWXw=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=eSwEvitCy75lDlF8SnOmhSV5Rw1MUUPgJ6wE7M2iZ/KiJvYIVXsJEkHc08La7d0KE5Ui3MrLmL+tOdFhYBRTNqCPc0K1rT/tYnjb01Nz/0dsPeSSN6Tj2tM5PIVX7bFmUyPmvWnLdgsNBr0mUyayM5cS2r9uWNSFmseBgZNHP6M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=brpmVPro; arc=fail smtp.client-ip=40.107.6.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="brpmVPro" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GCPSQ77OEqd8GqtcdTn6jM/mgjBv7rrZhTj5H5v6MHD9Xy6wrsbQ8x4dOwnvzEI6j60zMGHNwu/f+IdLd6iO6JNsr5xrqge97Drydwe4cQ7q+v83rU0xrJRy+EA8Z5wAz0vzQoP+zSgZKJDp4mL+XHxqN0QmOHyAkJpqdFBSPSLPKIN+50hQD8EH+UVp2z8WOAgIRDQN0zVPJW4g8pp/wqvP2k9fXJl7HCr8etG+e4zyLAk71xfI573LcuzUO9zwok2Duz35JHGOVhFWbreL0zZQomqPamZSg8pugoLdJUBL85iVXhPop51jmqEY1Dby4kbzcxe1LNnZjZoCwcUy6w== 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=5v7tmwSDBOSA1rl4087dqZxA7CFqSfCP4wY5xNi5cfg=; b=lxbbGLE/jxWiPXR01Gy21t9/hVKlw10NyAUrCD8/lsqIUt7xLUZuU4SMqvy8Ie4Z+Nt98lCjvMj0ZK2S5ogSA38yD/CdQy68VRZ4EwRDFyaMAZpU4ifBJIt8mPHIORb7oe9ouKqxjtWwxwKiNYU0Vj/v6nomaOS5jZYxNig29tiKLwvx3iYd8YWUoiPLILpKB3hu2ZuzlY7yzG7saMgPd3yiuQYQwNQdLH5fmg0uWC4vABbnuiATfpVnyMl9KqmpHhPy3nJEjoM7U0y5COci3wO+46gUDwxMGZjbA1tHLdjDsBeDWtLFr+quVvVrLWVhBvcf337ee4cWDZx5MppFVg== 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=5v7tmwSDBOSA1rl4087dqZxA7CFqSfCP4wY5xNi5cfg=; b=brpmVProhcC9EdzsUjnF3WlRAxI3Fi9RVtqygd7QIbbkZPq8+/z8749HdR4JN9jCIKO3H7YR5IYSURXJmxqKolAgaEh8UPCGeEYvUhPEiTWvJgBIj5EjKL5tyN8STJR/y12YQvrldXowZ9uIMXCHmh8Qlqs4xh3QZrrQwRbYPaI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:04:28 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:04:28 +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 v12 1/8] dt-bindings: perf: fsl-imx-ddr: Add i.MX95 compatible Date: Wed, 29 May 2024 16:03:51 +0800 Message-Id: <20240529080358.703784-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: b4f90810-551b-47d4-7d88-08dc7fb5f674 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: vwv+fXuv5G/HuG27LfqzOcRA+Izr9QwDtbOTbnQ9rTYfn/Ztaa8JTIGOhdLOlBc5h9Mh1YkFgt5kfOm2GFGxHUllE7symtYtc3JqcrzsjmwKxMjSRYyD1TVhti1tePCePHXVdVyqkvP7Pq7MldSgJTrE7snLPYWytn5HyCQ0hn2MWyeGluIkwovyE/12ZQ0U1Mbrnsj4+t2vUsM13zxWude8u7cQ70B/I326awF7swP7+WqbxNhmb9w+J59CPCFxw+2reiFxhd0nw3CLz0lwJkJEg5PA5g7W3LJ3ZwwKbilolCfyeIKmnYA3Ksb6pAr2Gw/PAxx9LR3Hw3p92hTkKYlFJRa7viqveoTNX0qpeUjrg/elM1LDBRxoQvc4dM0FGyETR3kmVHQkBd5kDguPh7tMgt12j7C+tILt45LxEj2UqbkpizT7z9qKCHhOjRxWidlkhVb2767sDYFke44McC5gf8haiZvGlY25KL6FPTyQuwlS3WVyRLK1fVwOzJYo/EcoXDEcOX1kh/Np74uFxnRqAPOpktGRcDekVsDa8iKlvA49cbCkqpdLrPC9C/iS1ACrbmaiTOEruqAkWj+3Fd6UFnSU1BCO/YOfM3762TNOjFzRYhrdwhzmxvj+ED/bpT/+iQll2YgyMZ61FbVM0Tg3weX9WJnNow8oLtE9HRdIscAjMZiTxT0iu3tfERFsO/CiLCw/NerOs9GyLM+jYE62o2/ocoilgUnMauv+uoX1bWmOaSo9JQSdno10XTx9ogMJpquNTp/RA6KJzM6iIJbkUlZXkLnilmG3zkqF0IMIu5ouheoQYIUrLwKbWyg9JkQ/WsO1tLrT7miWEhCN7wbldeI9BNuT2/ujFR2du+baz/9XojcAGyFRPfEbj2+wnpHcq/Bg8IqvHBZ6WOrQ0xbQHd3Z/Q7XvqatQkTboKaiGo8IdN4jos0L2D1vFLG/7c2CdXQ/4YPguf1OVIeOdiJPFATT4rZ2gXD9astWpX9fUG+XMdAnIjl97r0eyO492+JULPGVLLwJuFLpxauPpo484UZ7Q+9qdDZjtFqKu7N/OqwgwAoj/9dLXEvlqVk3fo/gkOmMIIoZSCiG/yEPBpthRHuqKpD7wduvsE2m9t1D2hxoN5SfHHSQrzM59a5fAa3BWAv2c914RL4dyz3S4n3VVWTNE714ncVPXrIr3OylkyUkBkbLguBaU79E6JjS1qEYrDO+Z4T6R689vFi6VLeqQ1A2HMiKTKre40CmDhOlxWnGTB2U3yF+93VtZLe1GA/K9XQDKA0LkXQSl8nsHTA53O1BtNOcO2imtB0k9b7rTee54gT1p0fJhW3sodmn4HLz4jIM5fBBWhZUpbRL0FXCQnIiEvkl2kXvjG4jbqc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XwBWoIC6ggicdw2WTXiDoOqs33h22BDh76XF5K8wWKsCtvUwP3Qc2jte07A5aEv5g7+qPuhYyFcOt83G2n/TCB1xsNT4isUbwilkPUCIXFAzn32BwRfBJOeTH52Zqnfw3PTwhGa7pkdQmLSXwkczkTPItoL5hKQWDgRJBEr/62gtAGMGigIew7YYbdvG81JPVdZjBrKVyrCJJWyK0+hDe+uCV8ae4NO0/AqiQIx06ed6Mx1JwCiZHLrNDU7OZgtgsX3bc2Z9AsZ8U4WjCKpIZZxz+zB9l2SYDyqVPDeZinuPbxONs2Zq9JQ6QSpYOOe12jPUx84ViL3NDF2VpvzdjacJmzEFzK9iNPqCEgxxq52kJZR/VI+ymeIH9PEiuObsuup1uhwBIwzyrbYyhUJn1AzgDvX6jATZDvEVg3j/adi1hv+uWp23w/xWgjKwfTjtpuyCUyPXD2fknWP2e7sxcNkshvk6qMoMMeQtk8RDYr48cBN/qMhK5vvyuwuikNc0F84Zknqs08OPgl0vUaClZa4SvJIupYQPHybYuJzeRlPX9ddAPTA8EN38ywga0x7Z6zFyLTqoxunBINm9B3MD+W9OW69+U4fDKOtdnmndbltNrsF7SsDwzwxVba/K+0DzigSVfBlvwniiX9BApZ+ov8deVAAgrxi6SVMll4KAvYSn1roFURg3719AevUtt5JuhvrNJ7qpdGoBHEPauXuKoInxAnLL2eDCeE1THC7LLykV4VJdrwzOVWz+cag4FAx+wYCmHNQ6PPeGoIJskXAwmbExK+Kq9PXsobM3q5AAE31IaZZ+El9+wMGlCoxitvcLYmZOEmH5LhBnZkF81sr5U3oZe86Hsnivh5TNazI9bRw9pmxdbXcEIM56loBXqFRzWD8K4Db/n8pgu/noMlN1tgzjnCivc4tVx5xcblphr0w+jnYRpQpniXBwdRPqTMnlyDW3hY7zRwSsa70AA06bOaW+36SXtHRFMMcMWj6YMC0vwYJs3XNUZfS5ckOGvfU5XrXwYU5BeZeL7BDrXZnl/gG++II6jkB7za26/lLUkGKGtZ5hHOP5+wH9lUojMmWpqX6jX0ngHfAQFpUpP3PY8amKZqbnXmjN+ip78AAXKA5CRuvBotAGB8V5Jj0ll+s1V3xf40va89kRgRvhnTIArZ1WlkPUJ4x6jy9Wyt3+BDB8ztIVEiccD4c81aKqyLDusn/xKdbPjka8FkXFqPW82FjizkH+203KuH0wR9BJ2XuWrI9bAHyEMuRvXwhpn5CaSKa7GEkDoA6ZOogrkFdiVK7/HjZBqWlM2TLFmNlQ0EiFZDvKc10vUBCdS4JZXxhS7DDyqgmnt6spouOlaT5EdA3KxNFBy3boRUix61a3Q+UgSfLOQqjzwjUJEXXm/TK59xI1RKVZHhGyYG1IDC7fpJak14LbldMd2usUdUlnWcvuXRDsue7l/hrEMv9FPo9PAy/BnBHQjUgs422Y04otlmOmCY0XMRrOL02c/tVjwOIMSbf3A4wJM35ZnUPPIMh/CRPWqVonxX6cxTwSBEPqLymb8WzbJyVbsNRgDXQT+YGJOgNXoQsTgAd0ioX+bmTj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4f90810-551b-47d4-7d88-08dc7fb5f674 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:04:28.4382 (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: d6I057QLTMDru+ATnNCmK6zKwE6An5mQ6xe4BR5xmNL2tWhPz87Hcvf4PC1vhFtrzqjbRjrAOw7nqffQrJNtuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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 Changes in v9: - no changes Changes in v10: - no changes Changes in v11: - no changes Changes in v12: - 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 Wed May 29 08:03:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678167 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2086.outbound.protection.outlook.com [40.107.6.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DD8C16E866 for ; Wed, 29 May 2024 08:04:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969882; cv=fail; b=clzW1L23Ev6G950u37X3+eqcmMHq3Y/SOrjMLz2Fpst0nhvAYgN1gIZCrYVbyFMVsW5kwruPuTnyRP+p4dM2YdMr44IZglkbCiIf7dM0Ua5cSKkuyVCYLAD/ZJIRrg3R/UqYdwFYdDaI7++IjvIVkxRXp5jzzc4ze8Yg9FWohag= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969882; c=relaxed/simple; bh=xrV8CoQE6s+hjKS3mhJJcuLHCI/TVS4gxz0thLNJDZ8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=V9hQX5GY8POhruH8ErLpq/LdbO0M69cz31iocfejo4jvtMmCfWRgyOC4YWKK0wJ716GxGFyJICydotPuw0HcAgWTa7FG2kFE+lQIRvVpeBSESuGuHK4P0HlXBl/+Cd4E/rNuD5OVEzJaGqqmEdJ1HARdEDw4eXIwSlQO94CaQcc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=VQYvyvka; arc=fail smtp.client-ip=40.107.6.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="VQYvyvka" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cK6FOwBoHhRT4U1tCmnBdisPst89+qj/uELnIkGtteoiYPW7Yrom0wPYZa37ymUE2tyXwj/m02//2rQ6om6xZndH2LmCIETKwDDmFXl42AGcV1df8T9SCDfnaBNY9PJbj9oYA8zpMNuAHuVNw/LHWvoj4NIHEqQU6BrSWiGTvv3fXjDGrKQvqTAOJEArtIc+jtNEDXXRdpYVO70RsGXkam3x8SLKwDQJo/Na9chLL80eXu3psjpHnoMtJTLo9UkxOLO9lP+rXwVQ9frzj7oktcnICCJMT8tFi03zINLMH007R4ixm9lQcC0J7nAoVqv7op34WtRu3rhe/2sggDg6JQ== 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=NgjbABisDP3gRdYq/T7zQX5HLpKMoQ8ELqZNhLllngU=; b=FR0XaRmYrLh5QZ050jV/fAI/k6a8htQm+2RmWuSyw4VtuUTl0ooz1crSJ7q+KEudH+Fc7dm/KWyQSVFSFymNJMZDviKipiG7DUAisuLC0lvh1+B3nkbA5r89A8Kiq2NMy4a42KpE//RaTvjiTsO98tRrWRvOY/QpQubv2LS/kW1Jg45mTRN8bDoFvMWmUqPpfKidIsVCflH/Jf2rssBXFJOvpzQJoFExZYwy7VVwBarAxDBK9P0/rwC2MW0EbwURR7+jodwhRLH16Yexf+4Awy9ZnejZD43rFOva0okWZciRn9dFHMZNdRmEdU/nKL0QVJqAlkhUGc+1zcfEiI7w6A== 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=NgjbABisDP3gRdYq/T7zQX5HLpKMoQ8ELqZNhLllngU=; b=VQYvyvkaue/ZeyrXPAJuB3Z2dDVsT7uURU3GfKJI2HZQi7MT9m6HbJBYhC3V36BZ9uxrr5yEqnsNly7qXZY5QiyedIVXjvoY6TVdru2rdSvh7ewFWiHroyVS7nPs1ODU6uKFSDDVg4x5pqPfPwN0eH89ZmhhqwNuJju7F2tMmdM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:04:37 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:04:37 +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 v12 2/8] perf: imx_perf: add macro definitions for parsing config attr Date: Wed, 29 May 2024 16:03:52 +0800 Message-Id: <20240529080358.703784-2-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: f7f1a1f5-b54d-4f40-c0b1-08dc7fb5fb40 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: CGxZb05vDTa+3YZw9Zwf6fIc7BXl22TIhH5/3Ji557jZBecngITsYTB4UiLfNf4kpPG/E41Zbz+xZy3ypcdFuXp7rOY8gMQZ6eyjaLEpnUg0irnX0nowgAfRoLyzP0v1hh2qc5akphKKn4/guU/UNBk1DAxVDqbafigBjMuQ+nurA1NO6sETiGVhi2Gt6OlMxajzZwhKNbZLx7zY7h105GXqG7Cf7fWuNig9fvu6Z3PHDfkoNPXzjkXZvxLF8CtYDOsDjsM1yWxf/g2b2ex5zx3MQVfTPXEysIVzZMJ2NFU8YLf+ksA1a1FTAu4d7FshjqwqXzHOJrsdUdEg4XESoNsa7+P9OhyLBHIC8dvcNKJXpTA+bIe9JfupbBzB9cabgtsKMu+Ivm27bi8+9nqY4Kr56wtucaHRFzQ26NKpPrNHZfmJc8lRgsz3YbqjvIG/nI8u6GtcyIcqplRIOlboxkHr06l8rMaUc+jZISbXRH++IP+GlBRP7TbsRm1BC5V4R861O2q+zQVozmt2BCDmHbwBYwsweTCw7bK0SoUN+zryOLwgirsARNVG/f0T31n2eIvmtL4TvcAk1pOghnu42ageCeSduKvOXjmHz6MAILUpOcBmAHFt0Lo4+O5TDY/j28QlWkpVofI9rlBlNHoUPAtxia7m/LJuBL4LLdLGhf7mM4k7HjEpHFajYmGabcD1/Yo3NtHV+vQAQVrVkfPmrQjw46HFFy9vRSLWLaMAcNEDtQt+egP9z4v2xo5x6Mmtdf3B9enWpB2NrZiE1te3AFOgtz6KiBiKuEOlYJnOwI0nElR2xNiBDS2pPC0w6kOA8gAs6ifLXDcwrlmzY/K2xp28MuTSSIbZLSwp7yKwTzgkNKYXFs+Ckjku7RdS8HaTJHiKMIhLruyLm7+vs3gIhTUhpegkfq/iziYyyzgezph/Hb3XO9/jCyvqh+hQ1ENsC993zwJ6+OSp6BwhWdJw6MvCDR4kEslTzFh9PgaklSUvT7yUyWneFfa2WObjjGCeLZCUjNegLRbbKF5uL9xAoj9UsHSP9BzoOlvGl98NaiofopNiIJNEBPzWbCmTKr6gjyHjKeIAY9jHVxREYsS0Yv6B1prPB/xggsVkRX++f2dwyTiTtFsIb96svpXv1dP8kueOPyGaJTPaENVaQ3erlN5hxCFPRnchTpcLXVQ3kZoBn6qTfLydyen6zjElWF7RBdiBXceWNJoNtNwwifh+ouREPzeNsncSpgaHdzB+HoqE68W8gPgbJZF2vs9LmSyRj63TDnsdZmKuvmJ28FpA+7hjyayUFrJizlgj67NzPT76g/iq0mT/P96tuHiLApUadATlQJqYQB6RiTKFy7/I5pK6U2y8jPzSfaBNK0XcLuY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9P7BIuxPZ1cKhj/LoLPDxFuPvFIwXU7gnJgFZrLAsfNNtVgZAgKK3Zyq4xz2AvjfGrrZAfoovgGl3MCzpXtMm6Y7HtPqp8lxtTZYysdHxyZNAaVlf/MIWDXUF6DVKKT5xVLTibqVL8JQa/RFasog2buZzYimtOKUA39V0dhlABwOUvFz4L5YYbPJsy/u9j+cpc/vfDXofAP3KVLcqZtxm3jZQYMw+cvgrU6kFoy8EVWHXgsKlJHx3YQzHZcGxvPMLaDddNtpy4xT8clMrwGvbbq6/sGqYMjygFCw+RpO01hy4Cq+hHgcuN2YEGN5MdlbyI+Rw4bhkj/hisN6OUFBdGU82BTpBUaBpBRHqk76kQBM1LnWeHDb+dpwcYxegCX31c+zBu/NgZGR4OVqeWBDTRsuxM8xmDiIp3Ce/09oMD+N+bfqMr1tgMWwY4LKaph+YDY44E/2sOYgte4+vfFgwBNShraWSj/uogoqzxhzH9lN3zp90hGN8/+7iM9NbRWNlz6qW0d/pLw3+zFYQD7g1SUDj4ng1Q+R8Gx3e8x03HCqKHfwZL/8dxl2WaZqcI13tpG8xcV4dWFZ/m0rUokIVWjBDKtohtcW4gqkfiMbNNPsNUEXSHm/MZlyXg+T/2sRnIG1yRJ1tvwAIixY7KjzrjcDQ15uxjhc+IXpw1NU4tlup/Vvym2VWiH2NU0m2esHY50geksWwlL6M+WmjmNO2w4X1N2WlmTzJq/+NKUkv02WXUovC8OrQSjoeG5NtWAy6ee3Y+dQiEzrkJ0rTwuHF6rnpvJPEB3Dq8WGtXDrnTzI3t5VTm688D5oCcYMuU6BRFp0GTu7Au2TzPRJqc331hI3Nq8hcbqKiL1KDExmwpxFpGy1CbHlveijzimaTBpw39toq0KjN+iWf0Dwvo7phKQJQwycFKKoe5HPMVoDWpWFYAUloTq9bn/1mM6Yq2zpRqpQpdKJAa8P+eyr95Y2Pj7n5kSs/nRvJutsnGiG3leLOxNwdmjigsgGkruYL27kqbotV2Ea8/QSt4OmFfOVDgk37hnVIiN00ke8/HpanTomuntCs0eji+2VQ4Kw0XLekiFkjQT7eVayzPVDtSTgSPfw8ASc9hOmzOGN9PHoMuhzyPvsmNwCrrmAh+AZIkhF9NyT/ARWbsZvqNZmweROWsf3KEWe72pnqRQfjqKRq8juCXHEsycHQpd62GtqUvbtGplTG6xWXF5r4lNEpqxkVSVO+OpOB/O0IIw+A/EIsoJxJ62RwSR1+VEbTTwROnJ8LMDm1V5/otc4E0VNWlghH46VGe1woKgUET5LL62LyW6bQmwZtMqYVjEhrRfEnpTx2nu4aAVk+biO79WzkRuhxAKZcI2B+zsMHHtomse51ZTMuV8w1Ay24/dEO4jcVA4Dm8dMY896fOeIoS4HSyi/UWm+o9GETaAdX1i7lC2JbtbG6d/0e6YiS1apY2ZIH9Lq0v2Zv5VuiFOlZsdtx5O30jLChTqgPL1wNv0r2RvkD+OerhRFTv27CxyzlNbVmuX610cDjbtJ3Kp+2Q5Cr/rELXfDVFqPfqMnJfMNDBH3oc1ZbICerVikys6WOw/g6dDp X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7f1a1f5-b54d-4f40-c0b1-08dc7fb5fb40 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:04:37.2862 (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: oyTLCKZ7PhtsUEkA7TjIcjs1pBMleTuR3LodWfxLlH3skuTiC2Rsg1Czuly0619dA26cZmP3insWKTLzLWr1qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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 Changes in v9: - add Rb tag Changes in v10: - no changes Changes in v11: - no changes Changes in v12: - rename CONFIG_EVENT/COUNTER to avoid conflict from Kbuild CONFIG_COUNTER --- 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..c4caeab7a9be 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_MASK GENMASK(7, 0) +#define CONFIG_COUNTER_MASK 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_MASK, 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_MASK, cfg); + counter = FIELD_GET(CONFIG_COUNTER_MASK, 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_MASK, cfg); pmu->events[counter] = event; pmu->active_events++; From patchwork Wed May 29 08:03:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678168 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2074.outbound.protection.outlook.com [40.107.6.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3BA816EC02 for ; Wed, 29 May 2024 08:04:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969892; cv=fail; b=lvqpnZcPohLbsRXlxjhcu1wE0dCCDYZuT4seq6QPuvFxL+j3coT9cWaQKc43mA1YVJldKSm974DEH8Zju9EJ9X6/Ryo+VGh6G+KIv09nR7VeunIn4dkpx9XNVUtk6oDfQQ3RuobLGcSyFX8TRjsVa4lzH9qD5bisoIZy/pwc0o8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969892; c=relaxed/simple; bh=tDbgPWBkgeCbwH+9L0zxQ+Th/wPWKtJh44Qs9kLpKXI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=GfliXW1oRTiHhfhBOfgyxiEqXV4N/ceu01GjbunHY6CanEVAmLuXm8sZDgFWeiZT4D2sNO/FZlLErmyo73vIQENy16niq1nncoPXAYV5RG6wfGIATeGhr65ZUzgqDdsMksZktevfjCxxJ8WHRL81B8S4GujFKMi9+eOSVj4x2hg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=fZ27x5lU; arc=fail smtp.client-ip=40.107.6.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="fZ27x5lU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DfskrCLnxhBMlWBGLyFffAT0b+1KrClAxLHBWRpml6/q9/8azu43mB6CqqCoa1/nWX8FqfjA26viwH4agnpjviN3qWrLnZz5GsnS3NpLBMZrNzXfI/nIWp7T2nZ3bwOyEDxVsdwcAwEjF3X+Ln/7+ZcjtELvm8sDbuCHlsiNDT54jsQJInN0Gv8cfs8IXA2igMBqg0oDJO8i1QXh4kKx9eey1YPxofb5c+vR5zIUlVSCt07clutDFQLC7tgMKfAJyu15gHCqklMK2hjNNhUlQ0tCECoLR1aLoIxemNCc1NbDfrVEVynJmnkIue7UAhzyODTpGvGxpRPFBxgogtxsOw== 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=45WDZLIm4+/eUX1+9VQNKr7o+7MUFS86P9rwqwhOP5M=; b=g6ggkwKrxbAjXktE9gfQpqLZ0YoUPqf0NXA+ODETW8aPY0vrje/y6bPwA7Yd15IqZzN6kgnKF4JKrQmkIrJ7XXTQn3jau9I00sozI6Py/2D6PRkqG+pH6sJ7KmMgylf6M04rsSXi5FDyqN9RV0tGG1TWMxz8oX838Ua2GpJRWLQCT27Q9Ils/psVh2ccgFRjB4cjLw5GAGni5NTk3B8/ZIpKrtNdPC4F5+L6AGUq2KFq/L3crySXtV689g5gBHLF26gENkuU2uAzcMIzwmlnU4C0iTF3NU8xt0H7uwyu7XylFYwLl/Rav3A3has6+pZN87X+ynFEkwsqQ4uSxtIs5A== 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=45WDZLIm4+/eUX1+9VQNKr7o+7MUFS86P9rwqwhOP5M=; b=fZ27x5lU2wr1SEUBYggZoqX0QFJNXb/NgtGVNbNXIX3QO/j58j/lyQ/oHvsBvC4KRJlrXSDTqedNel06reNzLwWCdV8JeDE1AzWXKvj7Drfy+tR+jIx/8VIfdEWnfWuyMXEbwvyWhkhEx5jIRfbkglQ8pdlxt4qEl42yHxIoESA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:04:46 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:04:46 +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 v12 3/8] perf: imx_perf: let the driver manage the counter usage rather the user Date: Wed, 29 May 2024 16:03:53 +0800 Message-Id: <20240529080358.703784-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 26949178-5873-4d22-a556-08dc7fb60107 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: U7J9P9GvRgPW895mB4Uk1FFYms0S1MrxjsdzMjkKO0GOFM3Hs2RzVqSOWoQxwSybB3ZeSwnw3bDN4fSPWkdM+AI2lTA7BM5Ib1mw8dQ+Cff2uKEs0A08Q8aE45DdbHSbi5/DwAfr8e+OxTOVG4XF0e2ZrLqOTPf4P7pyrBGhlTkll4w/+ZRyx/uBUGuirUmmThWta6XY3exgKObo//ZQoFjtREeXdTks5ovvojxUpLukYSSqCWttEEdmTCIQuuSQvKoK9meW/cs4+m9/tuMVSjJffca7QF3B0LO9hb8/L3XmynLx97tSzCPIQRBgrMLOiKv5rctubZVOjPTtB7swp+G1ogv7BQ4MEu4+86EbdNhoFOajaMvKHx0Fdn6wYA0IgN1a4zxgpuM+xgkQzk7OOj1RMC33G9waP8Q3VMn8CpQ8XoHzJFYM3xkstGCuqQav2O7WSjvlz1eaoUDqf0ScIp+mXCuolDFtgKTbvidOOndbmJ0FX171e4X5BnNz+K+50PZ6FoiCnNDd7r39nUvSGM8WglD3hZa63akIjUsFLKIZZEHJu6V6UcsXCJDxGGCCPQVVsNlNfuO5Cjt2WZ6P+zuNQMPQVGeJ4ZQZ3vFuL/bToZxxKipzrhz6tgjfDscyyLe1euiP9HnLiuZrzLnZaQLUBZE4IfAXCnlcxSbd/3n4rFxUm7yFtp/IVpGL9hqFkJEgPZ/LQn6cOZp9M80DFOGK48W+hBAzYq6sbrhwAeZqicl56OD+2JPWnBuhLIr9Gr9f1D7laAEeWFwk5VTb56uFG/WG8Pwwt2yXDH5RDl4sk7S/4gbEs30WehyCRRMhw0YFeXeMPk9cM6rzOqbyDrQ7xIw1+ENSiLizCA8jzpBLKNMUeXR7dU4/ZPMQq8yv0v/LJBcdpzkarwPJ14MMYtM+77656xWSPAgVqBnqMRMVy9mIn4r/vMQvf17qUigNiLCzbb/0udXp9LlgyKwQzS13emFqmheQX781oAN4+517k69zh5eedqrrNhFuo/5LrShv2OL1rdpH/aldJ2hKWvmBAu7adJcc8iVhKWrV0MvjEYkIlWTGWySIJ5aQYEGO7vL+i+YIROXJ0eSWCWnTrQQle2LYtl+7+fCnQ6cDosQclv58Ve7JSw1lV6G9z2Bif//QWU/zP4O5vxM5DlbxMz/I3Myr7wRJE8b8imv4pr9U2I3s8BuDDTjaL0ul5njRBxCD4cltqhxC0UPmW4clZ43P3yXAXX5UVtIDLhRduBeqxI6Cp36XjUTcpjiCijmorV3B3hvHfNo3DrQ/dn1y2yPTKhZX002Mhxi49xUkCtedrrBkny9kH0jPS2eBmvm+hsPhtVqiJpKIi2azULZy4RjoGicKuK9OKA/wP3tR/O0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: E60mebaSNyXwzu6HQS8UxaarNe1Rlz/duW6mJeHsM4SVe1UN9d2QiXRlB1Ic8W4LA8bl7ei2q2Vb/alHkM32UZklQV4QPfLMJ9MTew1Si5gZB4GzLms5V64iEqWmRSaHFy5L2eEnCq3EJengh+c9zEXLv6X6ZL+DvB1Rqz6hbEZURuN59w7CIxrcT0F+KSl3pb0RaMNEiudXUynxOav2jIpE/J/V91e14y2OKehkrhCuuZ9bVPiXaaNmBTYPpKpGP4aXj+LTsaEElpamJuj8ZRBxZ4RfY/gJsGpB6NS6WOUTFPK9OEesYeVkUItZ/75rwc9iXUbSWhpiJtxx9YppOyfvTzvB046/inbO4LPrKxIKI3QCevmoRc0tC8lk8gGS34XU1aFbYye+I5Q24bOl3h5mZSyC+p/1q9PwxO9oJTyiMFYUk4OOp6TBBdx3+eA0BVkXcpl419ZCxX0HdoRawzy6X0oG6rgkXUtdvJnnbpTPEylFLTO6hGefxcwd/8l3Wq3QOqvEZ05FpVmpWjYf+Qr2nakRFT8LsPP5cXH1wfsm1dRU6ufAAlLn3TAy9zgtCoInhhFIF67zdeOoKfeO9Jdu+cyXR8hjuz/ZRlWTsf+HQWU0XVdJHeOM5Nl6Tziapy7cxtIgTGcmWdPVoSaHL+jbz9Mqu73xjyXSHgXki+uB2d4C/3jOMycmHhelKh06xyDXmgpQWRUynDzLNWyFMxGQC8GzYpG7Z7kmoM7CfvF+Mr3rCGUMnpGQG+seq7QmsxY23g37R+o0sLoujhtSlA4FL7dPtfxDppudLbOarkNnHkAuMwPy61asLJai6yHISRAOgE8nwhS6kVJW51Muswrd/7VdZP5JA+6hMc0T0ijbC8jil65WmYDrxstHwyS2D1LPwKfMQt+CadTbFK6hXlsB4kZWFOaeyz3vC9/kdsVXn6z12nd3+mg/p9HC1GUfTB+Pytzco772z0Zb/hWndj6doqWNMqbJnQLuFokOXHkVlFvZoR1HS7QZlK8xC+IUNHL51OlXWAgP8hlNJCmNEDGRUxhqS28bE1KDnCJhVHMcXo35ToBZ/y9J4RUWJt5p8i17tFaCQxcDKQ+UcLp3FRvxlIapnAk9D7IW3HAX4y1GNfIcIdwiNnK0K+R/uG5mfLT4UUi+t6CJzkHVOm/9PNIyfsWmEWRqcplzwhYfMtOTLFqvZwipZIM6Hu/eJnOR3l4ZXcXuSA0kG1XeuEntX8B8Xop5zKYWJgaWsnEiix82pVmpP+0HBcYJtz0PEUKLyq0BwE11Jm+at1j8etfRLQZe7dMkRiQOEh1289mWsjnC3r5p4ijz5OWzbDssJhRUVLigA8TvsL7tH9eKrmVMZNNwQmsVVqZiDlFhiRHKT8igzWG5EM+ITXHc/YOYl6Gr900o3+bLpFY6w8wUNjw05HmUb/A6J1OZ9vJE9AaGkrorT7rRPSLJwWAJ4DvUygtD5wdm0Gy0fJhOICFVrgtRPOVAxtm+a6rDv7fQYXklmEPTYVlhdmLolOo3asf3YYfNrD5jxfAFlab2r3rT4aomc6blV6OK0py4+9lNRA20KnR5vlphyeKGc0eYqUFgjt3a X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26949178-5873-4d22-a556-08dc7fb60107 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:04:46.7156 (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: VM4eYLKiOuWmqgzVIHXpMOqyDeAOs6lnFzOnjBsJe6vuag4YZ4C0hH0TJA0B+iPA36rh6JY//sHIl51mISx8Eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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 attr will be kept for back-compatible but all the value passed down by counter= will be ignored. 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 Changes in v9: - keep 'counter' attr for back-compatible Changes in v10: - add some explanation about 'counter' attr in commit message Changes in v11: - keep counter format "config:8-15" - use event format "config:0-7,16-23" as suggested by Frank Changes in v12: - no changes --- drivers/perf/fsl_imx9_ddr_perf.c | 168 ++++++++++++++++++------------- 1 file changed, 100 insertions(+), 68 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index c4caeab7a9be..08cb1bfb09de 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -41,9 +41,10 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CYCLES_EVENT_ID 0 #define CONFIG_EVENT_MASK GENMASK(7, 0) -#define CONFIG_COUNTER_MASK GENMASK(15, 8) +#define CONFIG_COUNTER_MASK GENMASK(23, 16) #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) @@ -130,6 +131,9 @@ static ssize_t ddr_pmu_event_show(struct device *dev, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } +#define COUNTER_OFFSET_IN_EVENT 8 +#define ID(counter, id) ((counter << COUNTER_OFFSET_IN_EVENT) | 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,7 +249,7 @@ 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(event, "config:0-7,16-23"); PMU_FORMAT_ATTR(counter, "config:8-15"); PMU_FORMAT_ATTR(axi_id, "config1:0-17"); PMU_FORMAT_ATTR(axi_mask, "config2:0-17"); @@ -366,13 +370,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_MASK, cfg); - counter = FIELD_GET(CONFIG_COUNTER_MASK, cfg); pmcfg1 = readl_relaxed(pmu->base + PMCFG1); @@ -392,12 +393,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 +466,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 +495,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_MASK, cfg); counter = FIELD_GET(CONFIG_COUNTER_MASK, 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 +515,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 +536,11 @@ static void ddr_perf_event_del(struct perf_event *event, int flags) { struct ddr_pmu *pmu = to_ddr_pmu(event->pmu); struct hw_perf_event *hwc = &event->hw; + int counter = hwc->idx; ddr_perf_event_stop(event, PERF_EF_UPDATE); + pmu->events[counter] = NULL; pmu->active_events--; hwc->idx = -1; } From patchwork Wed May 29 08:03:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678169 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2041.outbound.protection.outlook.com [40.107.6.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0873816EC00 for ; Wed, 29 May 2024 08:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969901; cv=fail; b=ctkvl0naSGfBbecUgnMt/QOgtSsmvN1D5M7a7+SoDe9pZ88iG/RDLVLY31t4FarRUW7w7xdx1WF33pZhEz2Vd4B8qqKmHarLJ+BK5PP1sXuD9OsYgeX6CMC6SRQQHTQHpKrHav8cyL0zlPnRls+c3lj97sjbqKRsmsJVeVPpR7E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969901; c=relaxed/simple; bh=hVkq5jnH5lyoKbHTgAmm+HYAKxoJBVv/N7tg0mCJe44=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=uDSobDpK/IZUCHQsanp9NqguvRCvaArJjVYEyAa50MN6HH/vaqO06kbTSm4VTb20TwlKpmpPTq77huxLJkIxAgv1YlRONnwhsYIUgpb9LoJ3/b5y4CLxsgamJ5Gr4GD+jjUV9ddGzd4VIMUFQh1ah265ed7HJ4m/MYGy/OnhJtM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=oG5+nbrv; arc=fail smtp.client-ip=40.107.6.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oG5+nbrv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kuQzdlCY0BUQ736QHDiAclMNN+mXg4gcmg9zgvIEjobo1Jn+x/qSBF4LVOE0xcIzpUWML1E6gs9k3N03T0zhSmcSWmjFwQwMDisP0rKUB0URNpgVn8ril97ZsBuVH3JDEE1Vbj2pEkgZvx9mvdzYAYJb5qM/pvb0ooCBlMm8u4eplmoz8pWrXib5Bjp5zidrA5GHtqXl+4bvaLVwWcRuYWmz3VetPvYkUFWs0wlX3uvrjmQWQ7v4F6cUEiS3FvqPOt4TrcmPDgfJzNEqYc5hae3ZY/ms+6EVncSsPZVGPrSl/sbYAf+s2s4/woDYDlxjuDuckDfsWhpIXeDPxaaoJw== 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=5HlNRVi51ytSJRRbUx2kPMORXnn0TepzkzMmj4A9uO0=; b=XP4IAhIQCuhhrlPfmYyjKmIOtPWtTyDIDvzBFJqrZxj9jvkcikSTvtBuY/mK+nMCNZWOUelf27udfM2BR6WDY0uT35Buea3G+vURY7NucMfsRGYndcWzwa1BLa+ognU7GbRkNMhgjNx25G+YBXp6PmkFwZ+GlHdWgnFhC9GuHLnKVdl9uH4XRjsIHN8Ehw5F2fTgbJwiB3l+caCABHtWjTD8IQySjWnXrugSMihOIp+MBiL8ITku930/JWur0daDuvkJZJR5GtLDyrWVx46CH/140FjmEvy/0S2ZfCjNWaqMPlQkKxbmOoVmqH1osd2yB1y0uva8pLTVEhysBJ4bEA== 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=5HlNRVi51ytSJRRbUx2kPMORXnn0TepzkzMmj4A9uO0=; b=oG5+nbrv7rr5L+SUgwRWRodU5vRCfXGRKNRRrchInOnSTOmDOgzJBKPJlc5vPVRnpqyJuSF3H0SEkn2aztJud88WjP+9ZUJMIMLoHffUnHwnc+bfRBVyFHocfKgA8EYTydUiwf3uQ0BLPUOAVEnPJcSzMxt/JcCZEq96rRoNJPk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:04:55 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:04:55 +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 v12 4/8] perf: imx_perf: refactor driver for imx93 Date: Wed, 29 May 2024 16:03:54 +0800 Message-Id: <20240529080358.703784-4-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: a98cea31-4945-4aff-915b-08dc7fb606d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: usBuMYScOqhLLInenyT0B1i2fBVNyjXgZd8Cy8iRKw76gw78ywOzr3RPwpV7FXsY8k1k6O3prI25gbSCBthejQ9OU/vjslPakFHONiLFHcFw7BD1bAOk0XusYGyN03EA+8rVNb+WMq65XkrLDGVTCtXV5QotUh8dUutf85148Mm2Ugqy4wrSWrxuLo0saqDQ2GS4tpd+vKtpzJOvEFJzjcz2a6P15NmpaOkRhyF90WFBxjy4F+xE+TT3y4Pwk8RQTKwDjLr0/5IZ4uUEQoDMqddCGg8Yb8ZaM+tCjGfi3XDojNK/bN0uUmC1gWiWWof9ZFuYMRtitqrLKV8UxdqCXk8Y/R3D/1EM0B1UnU/JVh6R5XtYn4mZ46E9zx0p2Hul9XhbO8NV8WSu80SQlQ0a4migPwWa/cl5CDH2KIzvKpSdTvdOTVZB5c1PolONg5tSVgsIRDw1TLKD7rr/oYXXrWpNIfSsg61SflE8JC4WmmaTVFuUOoqS05bJCBeu1AHKa2P97wO6J92ldsgH+cfZO50MpTwEVmNT3WMvVSWAeX1xYhwxQhD1RZDTKChiZb/uX3/S0go0nS0z/MK6v2U8GUAKXLmkECK3nTR3AhhbiR9OFHWox7NqztwZp1G3xyNujXe8ntfzusSFYOigttOXHoPEaa2180btfCKXE1BUbOzB2Kb+dGO8jvsVrxY0sD23vAD6U4EZ/XYb1dLZR37tawb9T9/H2Kxfeo2hE2cXPz/9DXKoL+OYJbsEdwty+NpovzyaV9Kb4YExd99/h04LXiLCPQuLVwFheOHgWreEKg6n3AQC+D00hepoN+y6dWgZYAAK9yTgi0jFPyYzVISmL0JksTdOmmI8NABxwzllxF2MZym4lev7NkscUyTm6Fla6vTof6+4aj8vfO5RCvmBh3xu36B1MY8X6jo3ROrKKcoH44RDpv3GI5z4+0fNEHy9wgHj58mOe+QVnSH/NYxKtWCbEGdayrZ8KMtWlB1N7PTs9IT4Bs1mn5Dir2UOAkEz/M29vLGzxrr7Bf5QndzAdOhE1lK2CXh5KtsynX+nJW2WxYLtiLU6TgZ+5hZM+l+94EW7Ka+az3fFe7iEs/aMU3/rVypjJu6GqGDzwdN0d4by/7jZ4Eh0MGXHYnmeB0uka+PojIgv51ZUq7Y9A7UrMfLdnbfbimABqA1Ocm9U2JQip4ykEfS77sYYvqWOu/Bh1a3bkH5iaP8EHcKHcVmzRZgTFmmJPLpAHbbkmddczuaPxoK/9Y8VU1a1n3AET1SgXUvm5XyC7j5aTN+x/c4xN2PZocTw9DLaLElO00NypolQYBIrooV6+4tfWcZi6cg1Z9lK9hh2I4gysOEYKgncFHswTjPyJU/OjP3Crw32PLg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CYHZlIST78SpFxAsDamPxd9oCJEM5T+IWe8JTsZ3Dzj01EMFmNf4d4b8NteUqnjkYs5cBpGa7xTfSWgrwY5epzCzHYzcym79tXstK9etccSPsQAukzqo5ORQRBPoTZEsllGAfShfJpu0JAbbCxbfSN2OuPGcA0nJSpVGsrI0YqG8M/eVaJORgtKYx4vflcG6D5p7V7tfsE/3tYNt8J73BGQN75twBKbTGD+C/PwzjyiXoH94Obnc5keUCnJSarM/HNpnv4wRj8C8zzOR8GlR/vdbW1QJVvfpmXLQnM83Q8AGviN1TqqxHCBMI1CfswdaakpdcWxXOhQ0WtMn3W5YGBHgh+y+ohdWSKlTMSOyTpystPwKKIsAbRMpxHUQFYV9uDrm2yoELWJ88CCJtKpZ5hm0M2FkJwMbR4NEOKuKn1Z1H86iDEj15Q8pEvvjefeKmJJHb7cXWfsqw+H371yx9bL4SzMA+qfcpizSTEnJG29fLm3BUXzJLdQnkPsaPFmpAR3I3h8UzNlfbA69LCBuVSrQRKlldnWLhrYfNDzk9dzMilCpfZgszUh0d0gpy4uxLRKqKtS9VZfJCfOzYoS2vzvTH/LCYz5xZn/jedCSqyJrytHS+EpfWpJeT2DaUYM3/f8udfKTF4YvuD19CVtez2evk8sh1v2jHOhq03TmpfaD+VR3SulIIyq0szmQoUaxPOWYm2YNVbKCwGLq6KaH2e15mYPkoHx300cF84No7TF4ti3IDa2Paqh0Geg0zD7v6UUg8JerJ0alZFDUm1zxMu+usdvGgyLJdPXXRIBieKfhmTN6sJCWiLa7Cbn2mZi5aQHV/X+Cc0jB0oDzyt+OpmZt9rNwPkOILjfrbTWsTe+bGNWpKcmO8c1UgOSC20dcbsStr23hjvOOT4ObAGWdIppNTmmzEzcKGw0QO9Xns6dlgCNmm2lb7lXBtnFrrkOqhqadRzjCVca/2uObNwZpGEXe8sp6zWy1OI+5dhWVlSWHn0AhZJL3afaFJQtAdGctzgVBA+iuI+1OY0lP6Jeh6Q668GxRziP68B79dWHx45VVTYYoM8kEln98lk61yMs2gvRiYEWbsLn9L3mDUFz5hgtU1GwgZxXcD8ovF2wfsFfkdOSNo7Nt650+YdzNE3EU5pSA635pMiTKaV9m2l3ZRDRHORKN0KEZsYRCtGr/ChM2FlsLMaW5KD7niWVYCGF5keE/ovPZe+1VSFVcagoTnSGfdUnguWKPvtIeuvzztu3SjZYifOgwIIUu6pCXpFx3Ygq8gSJnC875Ez2WNs19oVdid2/wvKVS8qM47ES7mAQnrZAQqBlNLdgViHOuolJhPMQW5FnbYhDETpdKGpq4SXMGju1MLm76Ae3jeE8m7OQKLP5nPe/5eSTRdwXoDzhZQox7BlCbVGHsZhbFdsHbQEZxXxN24HbgltMVSKFChLbz2y2hHG9bUWBsa1G8BP/pEQFoKilDMqYB+SvlHyiqHNUb3oz7emjH36cf/CrHQiqn6unLZ/yx6+d1OihWX32PaZWh5O2HpcpA6IVqI8lDgTWwfaaVDnu3W3zTVRGmFxSK9mManZkF0RgHTD+wOgVV X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a98cea31-4945-4aff-915b-08dc7fb606d2 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:04:55.6773 (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: X95dD1Wz8h+KD8Js+p5RiaXRRD24NheiffC18Y0br+L0zOAy8ovReJ1Mtqywy5L03X68oKkz3paYNmpTDUDWdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- 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 Changes in v9: - add Rb tag Changes in v10: - no changes Changes in v11: - no changes Changes in v12: - no changes --- 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 08cb1bfb09de..5433c52a9872 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 @@ -75,6 +75,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 */ } @@ -122,24 +127,37 @@ 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 COUNTER_OFFSET_IN_EVENT 8 #define ID(counter, id) ((counter << COUNTER_OFFSET_IN_EVENT) | 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-7,16-23"); @@ -370,36 +408,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) @@ -515,7 +545,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 Wed May 29 08:03:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678170 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2058.outbound.protection.outlook.com [40.107.6.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A55E16F82B for ; Wed, 29 May 2024 08:05:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969912; cv=fail; b=jbuXRrA/8skWMg/ud5eOOEyS9ev11gpQUOs7RDZDsHDYTDxvDERRdHHeEztl/YZVtGSacKYcBvmCwP9lZj3WINWsau51oILvaFy3l0W+cIyvF0dnKTv/MByUORJqnl+H0cpxDGPXZkROjqG2sRNqudNw7iBW32cgVn3T+Uy6XtE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969912; c=relaxed/simple; bh=gZ0NCVQJwcgzPfg0K2dgAsID0DSlDTtFDocYQJCKjcg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=U9FmfHOqqPtLHQvAmcYN4oIjYC12DeVgVI2H+XKJdCUBj78viaTT2UdWd9W1ILFs8m+utP/oyR3IdbUiHQXuFob/hJYy+SOM5Y85FXNvrkzQvpf99XHjstyyNIqNYpnMyLzEnCi0TCyk705/aQ2BJzRPZQVmCr32qhsAIYL5TEM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=kwUAgYpi; arc=fail smtp.client-ip=40.107.6.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="kwUAgYpi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ak4Ot0gi67jgYjvwhRiSd4LzfMdmOhuxjTZGdWnXGBR3hx/LoWA2iK7yI0UWxs5Tm1lI1Zu3j3jK4N2jVUmLByL/p95Lw522BSMsyAkmBDukk2jxT562eFrkQY0BwDe5vsQHSfx3w2RcbzPW4gipakF12prlbmJEEV3sqxmmEq38cOxMqR18N9NFBubEAxbhgUzCs3eMB8uVZznvbEDHTUgHXdtFSXHfp83F3MMa3P2Db+cjBfBWKGOxTMru2qi64ZMDvWGrWZtT+KlX8O4N52G68wUu1Lhd2FbWR6keBVAEZH+u1BF9EJIWWXxRvtikG2TxGSi9IBe/R2aEuT6PZA== 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=z8xW4gHqzM6JxKa4WjuUK5nNtGxgGV6ViWbKIY4RoX8=; b=mJHUT8ensTByAyqG9lYhKwyN05Sxpr4Jghw+HGtobFtvW53JJrTGcc6AwsSPj6h8mQc/H5xRCXDZgVqx57ONHrjLhk5Z8vlNHaXGMS2Uy4P4PxgiYCBIn7ZqE7/4nMn2p52UmVZbroOvFRZSvOelYgkhvr9BbJhj1lq8Q39OU+tgJPtChlJ5jl1FW8wCSQSBYabfJjc7Xdv0Ij/x1y3uSNMQwcwzom652MhUQG/uBHJoogiRBOY+A+q5mseMpbOxgZjGj9lcSMD+YytwWjR2nMuDKb7keh+fMGTv/FrrVXQXe5Sqw7A6v2qrK5NZ/m6WJiFe9DsHlRH63dXBJ6C7SA== 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=z8xW4gHqzM6JxKa4WjuUK5nNtGxgGV6ViWbKIY4RoX8=; b=kwUAgYpiNq1oo5ggUyfaPaJoPC1zJey0S4qM7U3hb7DKSMiIjCX1rBLB3ezxU3dneAPbjJ7TFd9QVaB3gHoMTiRazLoXwGSLjvQevfdKkr3TXxmCvvII64qphPhY4KfS8130cG7WOGkvqKQrlQjsJxwbg8Ib0YGcpGtrxS3wRqE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:05:03 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:05:03 +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 v12 5/8] perf: imx_perf: fix counter start and config sequence Date: Wed, 29 May 2024 16:03:55 +0800 Message-Id: <20240529080358.703784-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 56a61e94-9ada-420f-fc99-08dc7fb60b74 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: y+01n+xo27SREiOPiWIY65Y5VUCj6QP+sHdomi8QB8MSiE5Tam44A0j7idD9EBXZFHLEnKjf07Pa7V2HI6NygzklG8vNrrc2mEynPmH6vWimp84i+Ab1d1/TfFlUSR/yLpdKXTIb1XKqPxoOY/qdZepLbydZvPM1Vcdrr4AlZ/jjVyZBy1D7mbIHQKCIynYva7f+XS8+rpproosG1HPSqr3EG3BHLHWr9v/be8bf21gt/ZqQz4+dyz3EWzoo1MJv0XrbUgNswVqBTKc32+NOrrNaesSKoQ0OFGRf52OaLFndwWkb36my1TA/7/Rtb61uamrI4OlR9+zsgN5/P99p9s0ii27qjrai03ziB2dt/zcDp7/bU+aq/L6srTVrfm3sHXhfn54WUqv6z5A+cUMO6HQs3S4/Q5gd10nNZIigYieCI97oWNfT6XQgdDxDyLlZHZxCyJ8XbzYsQcCRaHCn+/nvBhGDu4fkSO4+rQ26p8saHdOPnd5V/NmqZ+/EvD0dv5QMof2hIaEii+462aNAG5xMROBmlzERtV78qnyIPOTr5Wo+Ed2K9oapmxF9yWVnd0iW2/iNaddAWAVtvrmRx0dkWzCEuBwYvgiLwLigeZ7SceP00di1BJB28CDNrbcAqUlCDYyIjvrfW8ZaSIY9ELtUTYvL83Y+nI6xCHsFbVYpETm6UCysTiwqKaMRVWqX7JNjSvKLuT5zDV95YD0FS6EFOqq2ipKaQmpCtWEJbC3JgLzmMBbrTmk6OeVemN49XFAROouQ3cjBqLhnExTbyZ5ZaTxdF+bDzRAiQOFhyb8K8QCQgeNO6TqyLRlZZwqqqPgKCxeEmrSod1qo2sO7OFdlfdsImdjPH8adRH03KNZNrKT+8IB3CJkharuHRjZOnFXc9GxUW3l1sKicNR1TVOlTUp8tKJOTqEcuNMZVX0CYqGZyjaihfgjAl0LSc0lT0PplVgkcKFxRipxY5Tq/eEE/3GA+e+bQDuDZ7B9KIt8cyFve6rRcaWInBcHSeef+DBa/NebGKaBcZKAYH2hO82Sl/XcwIktJG0lej2+Z/4COhFPCspJxST2Lw+v5I62YReDTPM4y/9Z26boxPMHyE//gW9YpxPzhIXNxKdAVTLTjqh4/6gIvuNSihpmV/JiGdyfz/Dz3vxz2Z9zKS8Hl2JyJIgC6AAAp2oRhxZ9ThZkPdY4xPoy8l+BzzyOIaNeJ7J5C+0boQ61fUMHqxXArex0av1ZM1h74sZUaqgA9oaxMi6zhnv2bOFH73Jc2dpxtm4Bn0di2rz61vquvM8+Q+6ArlbpKFkk4NyOkH3535B587mPQbCLhKqSwvPPHrLKqJQ0j+j+k9kq7w/66KDE7cw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RfsEQLoBqNSKhUNCRGEEQb7JZdtEds95M/R7xIMhzlOtcF7lwE9bKKrTk6YHflnf81xLw05VmFWF3zlpQLJFpyuPlvYbd5nZLIp7pc2DqBcPQdqhSvo8EhMysx/yrip3QiyP+OKdWpwG8art3DX4+vJVx+ozEjLWP3PMQCSG8PnhapTMHbtMJnAEkzylVjPsN2eSnWF8njmSDFQhOURaQYubXQ7/GLv8a09kLgw1dsPQcygUmYz62wkeEFITdeBXkPRf75xYWXx/UOIHttRAid+box8LT+Gp8gcqXiH5VI51jeMpttWMulTgaGHsDeOp1vRTRs49iFKSL3MVGB2kWfWG+taz15WlLlGlLddCDNsi/EAwEdNUO9vesRGjUVAmCuFlrH7kh3k5zpnvs9le5OtRczpzAnRHcVP4yk0xMhxEiZ5KKEmLz7ZJH0duMR++BMnuF6/vMxd/blh0EJZVO2k2JS1M32gVlkdUs+olDz66RxUQuVHItr5U83WWFyrnw9V4LElN4Hnsj7351KydiXAwmXTGYJuonnkfohgAVfl5hd8XE5T5I6vCtOo4vdo2G2I11Xcc4BixwgSPaYQTTEDzOCO6wd5yu13bCe5M8IpzTDDlKOwKcbR7bZeg7WWoGHyNgCOsXIgaor5rmkvbclwq1atlLbPcpgZl87kd4mUh6fLNgc3c+SfyCPQFUv7f9XoAiGJh50LpRuM2MJNbY6RigaYhyD1X79Gq3kaqKvb3td02oP1hLqRDp1HMgDG42kLG42GEmIV7p90PrWGCYUqgHz5OseWljC6aebwl5HPdxNqS4nMeg5DmDfVyb/2IFSHVRJq8e3pte/tQRJL/yp9Yo9JSM+D4dcDVfTTKS/haLnWWHkbD5uZ9CtNxtFROS1oDA+bS31gVKhb/tEkXHcqd7X3Wte0I9MdS8LM4y3PRKBHOuW5sb6iZiZTsObMzuzPd6tlfoe8jIWzXI34MDyB7Ic2f5xVHH74fEhQmstQAaKT+9lZrWqVgxxIDY/t+e98gw3u0k6qR6G3g7AOe8PSp+WdeKKVIfFqR7NIsOtILWAXCSpFkvNryzH3ECmwrkRWpEn/adwFXkZQwn0drjhY9nYAtv5m0JNs16sEHJ1lZtDUFTKDV0SwIMOFpZPjKQst+vOg3dPbqviNlka4WeUDqpJkXyF5XZk4bEZEQkTATxKGmOu5gJYfHZ3+5UJQYb3kov/0SfTtvGgIIfpxcLSBqkuSqKexEqb/WCQON8OGhhGL7AXLoApyxxehZELldUCJ+eBExiVPtucJ+p+eazTdMQn0nYyi6qwjUkIMVNdpcLcdGflnKcYduzUk0ZUdwr61L2ANQSHIl8VtY7RGl4wb60vb0YagQrJlaQT6FYTjZmSnsjPu6efEKXqajkODhiH8YRnmTtBM5KWT1dYgXQRev5qhCkuqvbYA4V3rogxHBlJkETg6iSOcnAnz1QviaHiDRUKkp5Lb98lwjFfKRx0Vx6dVSzexhJmMWiWEr6x87a6LiTlsZC/bKwntbyodnee7Jvycbbkim4rX3HjvIwAWVy34/SxWa8m49IWbs5h/TsVU3Yf1kxcS4uIlDQzH7 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56a61e94-9ada-420f-fc99-08dc7fb60b74 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:05:03.4249 (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: JV0NXT4DtcmZTtjEsqLJqbxpPGdQYv6pU1pwG+S7X4EhClU4ThF06oThhG7Zw+7vD9C3rnSd4FjD9s34goO9Ng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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. Reviewed-by: Frank Li Fixes: 55691f99d417 ("drivers/perf: imx_ddr: Add support for NXP i.MX9 SoC DDRC PMU driver") cc: Signed-off-by: Xu Yang --- Changes in v5: - new patch Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - add fix tag Changes in v9: - add Rb tag Changes in v10: - no changes Changes in v11: - no changes Changes in v12: - no changes --- 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 5433c52a9872..7b43b54920da 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -541,12 +541,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 Wed May 29 08:03:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678171 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2074.outbound.protection.outlook.com [40.107.22.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90688174EF9 for ; Wed, 29 May 2024 08:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969916; cv=fail; b=VzoNoPv19VwgD+z8FlrwC2JKfMM7F8Rd+uhXmMmZxcFapX7hhn3gmbhnRNl4pFA+o3r0FXKRG3odHDEv9DB+A54+61R0kXLg43j465JTz+jSo6Kw2xif+K8+57QtdvBdQW1QvOwvtmMIisPd5RBpGwisvzygtqDZgJp/5mitEAA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969916; c=relaxed/simple; bh=Sh3Oau0aY54g9LQIAAC5aIPhKbNRrmKQ98wTVc7Gvg8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=k2m/D57wL9v0J/MFLvmyvojHbML3ndoLsdGGS0c/eETbUTMrpp+fmsyQBaG6YjqbdDNgNQdV6xJSqjquxzE0zxtPWIiDn9E9L5t7Pkp1jEERU5eXx3Zvud3rkLylqL4HsFmqXIuAnQKOuxbLj7a8YaaqS6sPIx8f+LP9HY7f9OE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=bDV48EZz; arc=fail smtp.client-ip=40.107.22.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="bDV48EZz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AjISoPEzzOCRF3h6gHG04e46IWjFsR93L2MeeL7YKkDJ8VC30uZ8jXthqwp5XttOhQOJ4Lyw3nXiuVbMD950zmcNXUxcUFdk0INkpxQVx024PTwSiI99TDW8hDiviimduMEQHpG/juy1Ek4Q50xLx0tAyfWCU4+gMsEyqnqkr/3xswbYyXFzp9t4RwsWn9T1u+sDMKPkCSUDdllITPHeEHCOY+SMRVwr5kKL2UMS+kRTzOp1bhvQsJVBVtrB4W4VYNZa7MJDlBJ0TEGh+Fjng2uxol0VFRXrRnytoOUAIuU9NgHQsKx/NxrmXfLfYmDKLrYT6Q1OSbIHbyaYJL8V6g== 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=UIVC9q49Y15Eo1eTfe07H/cIjOoYuuo1u61ZEqfwFT8=; b=dKidtkHTIGBzHdiRUf/4m8KkssRhTMle0/ALh8blB6Nvaq0Tw5pisjTJfbwlSOgfN73HiyHacSnX5hDiF0mhIhp0WTP7E5K9P6By6JAqolW86BbZLgfz2ixvQGoMEWyb+JrVFQTJS7d7VzuG0QvGIioG+Tjyx6AM/gWAEG++9JTnElRD4s86CemQYJ4tEzln2ZGfTd3E0o8TTLLB9y6zX/t5bIMsBaL6xBZp+3jl2GchQ7hIgTHA9aNGbhpy2EJYmyOxfGTHQPO21qBmf7B6vYLo3bbDBmbj8q64zQ6O6wCFxU14+hSQWEBqtm2h1b7ffjvLr5vdiWLcFrcYN+Pa4g== 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=UIVC9q49Y15Eo1eTfe07H/cIjOoYuuo1u61ZEqfwFT8=; b=bDV48EZzVQNyBexxVb/BBO1O1hg/VV9C+HJHOg2QJCE0Nwc+MN6hgxhe+NcwsthIACoAkD//q59fLOw0KX/6cDrQ59aXjtZ6jifPe0DBb1NwZHBH35Awl6ArhLm6K4Xa/xjiwK3w/tTNHi2FnSSto+MW1o2AigrYzQqNTaJnU0w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:05:11 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:05:11 +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 v12 6/8] perf: imx_perf: add support for i.MX95 platform Date: Wed, 29 May 2024 16:03:56 +0800 Message-Id: <20240529080358.703784-6-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 74614e21-2cb5-4cb9-0d07-08dc7fb61018 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: rdGtisgGDsH61WQ0nEnKEIbkGzatdMzAqMN7QT1cYEFTpJaC3/G9+XWLNYXZNTx4a8cjfU+hMbYKMshfqIUbSy1yCgi9p5md3IneQ+EDxUcstB8DZDh1MRIwsc3z3zXV+s6yUGPIzfmEAV/9dxwuN/lKpGmGeONWPHBPZ+k0LcBakVtLdIGVgfwn8GsyM7ugij7hvwbQOnjMx5aD0h7Hvj2tV06TWJjA+RyR9jRiKOnkPPhKsSm7R2gwHeNrDu3EXi+lLD6+ELKU6psKmU8zV+B0p6uvIrZSW3vcCDZzjPm3EFMHjMu+3mNhPxb5EM8ZE6eXLye+IcJXN0ntxtAjljeMP8NG8qs6L8SuAqcP5aZKZkcl7I/R5ykWiImDT8ivoDpdBEuE3QA5TtLW6Hw0ccY9IUaMOovwCoKOp8GoPMnROij01tj+IlmtFc+ypOxKH/NCsanJ8pLV3/++WaoqnfXstM+l/lNcHCNWtF0uMSNEOmKG/edBo2mx4gdW3JGq1wYvzxeCaV5/GprNYf3iOv6R9+MpzTFJ0NK0XeJTN8oYCl4R63+eduSO7DZ0JeusXo/jfzweaB/5DZtcXu6M/FVtGf9jJbYbLpqbQfOC2FYVRRz9yo1yAzvw1AZJybo/pVNdg3wgiO+Mtf3p4YpO6MLFHJ0zvGYNnktf1a6tIPZi9v0KBwQoDt96vp9fqMJZca5/O+HPTacO0YTkwpoIBa//DF1gVhMhFDfxPGNzwfnSghNKt9HOoyX3cworFcqQ/+dfw0ma9NYFcdTuqnIfNfoMHgPVlhT88t+NYAKfn0evrtxEkk4Re257V1i7V/GvzmKMkFSTiDUyr15xxASVmeGkxDKOYdyFG/B7dwRgIV6k9jYMk8yzoE8ZrvAf8NTNG38gzB1I/feyIAg88kTEHwXgbemovvpPcNLn2+RIRmpx5Z4MvDgeQAKRjQbLGHgb9iA0hmdpNL5bkCsoOVKE+aD/JdkK4wl+4M5dk4EmPR+HSlJTWJgUW7dbnoOmkN0X8NLoMIeFFotBjZKZTNJfXBmLlUyhlEb/bwgA1ZN42iddQJvM73Hl2OnkbVkxFxfJX8y1iBqAA6TZMlz6b69vFb/sp6kT05HBcP7QBONrEmKt8H70C8N/U1E1JVSqf5DU2CMBmS2tPxoOnao5DBAMJXb18S2wQ7Z7S8EogQ9r86MCi2KbuByOmclbi1JqrQwsJBSdtb2YblduUAjgBuuaAgAZApqUvulICEfxzdMrjMt3iC0/sZp/tBCumwMgPvISUIkoLW/djg4V2j83a6mslhCng0npruQbfCtc1QdH4QP3+x7/cgBcqi7KbKRlM0JgfwQABDdj/gduTa1nbdv2qg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: buCoGAu+G1tUuG2j5mCeV/+9uJOUvKyAmF0GL7VbHuUv0bywSXKSLiZqlq8cHW46UBwGBfOa4T2+WokfYAUUhpPmdck22TqDQol+UKM80Wfs+i2sjCQ+bdeiLKjsAepg1LSNml8WMoWfVRXjVw65f4A4Aged2wSgzzzdCxZ3QDUB+9pUNBl1MVVn1Mk/RWhCpY137I8nLyeIs1ogOaDkGJRFORmrDXtDM+MSc5p6NyGqce7XR2kXKPhaxmgD1y/6PP1LX8MLq3e81hd/M9PynN54sEipbQQ8bB5fvq1sG+EjlhkjnJI52BCoGeg1HkF93GgA/eRBDXL2pqQu+SRSf6qgxd7Jm2hmBAs/k1jmDpTu7U0dDzlAbI1UbvaIdupAMhx7ETuFy2h0COpRN4a7HrL8cETB39Vna2lyHhJJ1cSK7Bsv6p/7VwHA1QcHIYSEp/k4XfB9KT490LGU1Kzz6VdF+dEn/BrJCXGRqjG5skES/e7E2cpnENNHmEUtNKzM87+ma8Yv2PCDrVEVEnaZow+QsUh8FLpNBnECacyU860IUJ+w0a3JXyjcWbmNiqZ8ezZ2kfj4A7nnCMzf2Z6/IbnOjwhGrZRsRoJeuySgtYfB23t+dodc7TP15veQ3MGajvEM72Fso5iS+q1aBHQ/d+IbI6Gd526u1GTkeF/5c0sKuk+qNn5R1tkrhSjV8YWk/2Syr4TloCb25yQReXrJuS3V1r5d1y1dPy08wPi69Z3roi1Itq4Eb1jK3jV3XJO1IhVF6AupZVHYScj7V3qtRxGzDDiYEYEb9g/nByaKpXiA+wmREN3tz+fDTQyTuS1vdCbx0T8cDeKAqOE/hyghy7OWDRB1RPZQkitaHnzipehv6tW5zBhtj32gDyNcKB/v8RhBYxYlY3srrfA/j3wlyjarddwXv5hIlM5F6ViGpcEtM2rpqQNabqHzDq6QqlTvYCi4K9DWVkYXRiLa3bo4cXInChZM5gtXHfQYvVl2uiQRm7WME5jopr2fCTR6JppnmTnO0n4slUrRPhnLbNkq10vlnoJO31ikI2ljK8Emsnj+FEjJ2LQxg/B479KX6GTPOwx5ARP2IgGTrl81iqUwgEtG45LZ2JiVWRmgSsDHcnDXGZf2QXcHo6Z6V/2Ntqojp/YgOprlL4VVw8vv5VQTq2yLuYqFv51NCgi6odWu+mCjQ3vGIYp2mb9/mdKlmhm30OF1eUQdvwl/tK0ipMZw0VE02j0N12N2oaWdaT6YEbiANAMCBviroKS0wACK6lLzxKwvw3OemAOuUS7FocXtj93TEq1yeXU4mTWmWObN5l9f3bR7Qjl5fx5ZUL+IGFeYwiSrrcppHgVRhL1+ug0uZh7LJMWtEX0LiZSQhWnDtCYQwpMtfDthGD6GcNgB2fjYwaACF3oHe2j96kzDXpZkM9sj9b3dkxNxedQyX1jJMUZDCQl1PZ7S/EodgYwNY16JDxLqwWoL+v2mrm5iP2/OLws4TB9Ug2lTZaoCtAkOUFpXY6gDCJgcxYM2iMrb5F7n3ncAj8weEgIzuV4hQQuoVhG9KjE5DMXd3Q3bD247fhBKa9a/JhTlnJhPb7yuW2cS X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74614e21-2cb5-4cb9-0d07-08dc7fb61018 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:05:11.2409 (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: XyfBI3c0fo3NH5e+w865YGg0AXG787diEsIvaYOzx/BoK+gJHLz6LzopmOx4AQTIAtSXmVFJAUKRTyOMuGv7bg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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/ Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v2: - put soc spefific axi filter events to drvdata according to Frank's 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 Changes in v9: - add Rb tag Changes in v10: - no changes Changes in v11: - no changes Changes in v12: - no changes --- 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 7b43b54920da..69f920b1caf2 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 */ @@ -75,13 +85,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)), @@ -432,6 +459,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); @@ -541,8 +619,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 Wed May 29 08:03:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678172 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2057.outbound.protection.outlook.com [40.107.22.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DDB1175551 for ; Wed, 29 May 2024 08:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969924; cv=fail; b=V13B6ULTAQi4Lvx/WG3eU1tiB0tI27H0q6NlmbYQEZaYetWAjYAhTvhABjpt/eztIS0xSRmVdoWYR4F2sJwJTlhx0+G37nyHtBDcZ4qj1VKzqnyK7OT6NPKzycnmKpM68DWP63Zh3XlMyXAPCb0wPn30gpnXuYJtditLdEzQw0M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969924; c=relaxed/simple; bh=Ef8OMxrhUi0B79xki6A3x3hyM9x9bXAFgRkl6UjLEXY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=iEO0E9wYqvgA/ifmSeTyrZPqJpNoOooDXnk8tvh8cXr7Zq2aY/k6JzeAzicUaX9l6uEtMXUhMQuVDZvfXXnnjyjeuSu0aZC3rz5t1KUB2oYMd7PPBL0DbO39dYVzX81uPky020dCDjSgUrWuAfYd+XX8g9m8T8O3nBsdIzQfvw0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=m0O536cF; arc=fail smtp.client-ip=40.107.22.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="m0O536cF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O8lU/Pz/gg4gzBLW4Zj7JN5yOVSpPhTED2tB7ybQSyDlapaGceUNv8ZvdwTpoauXqdngclTRoKWg7JfOObZza7y6zuWqqR1+bQlImFtSpz6uwK94hxWhnZSxwS9Sv/Osvo/GHcHsmy80o2yYQWG8IB2iAJBBS1uiDL7MBnka4oRtnDcVhvAgBuSSAxmOmPZVuyrXzBlKI46kI8oNAzporEN+qZrpu1Sbdr1emluAg3lZIJab04xnGIYE7uN5ZH2lljkc+0MPfTS9SrgaulkloEZ29pZq47rdan2+n+b60b5bVdA/Xs8vUkpsi+QLTihMKGf0y5lIiPwr3qzapt2nDw== 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=S9xfbevwG/DMGXMdeNaT4ScDZPFm1zZHE1RLIBjvxQQ=; b=WYKcfiw2GWkQwNFzkEv+/XU0GrTAionnhFPB5G61ATwGr168v4GBwDbW97BYh61zhm6IIbrY//WCI80Of/4ukynnadPxXeeykK/nb4U53tSHmVi1LaLbleje2QYmi1xAF9g6WZRkdG8eUvtb0ePYedv/rLjYfuNOaGfybIeE0AToL9/LdzfaGa1SD/MO1N83p7d1LInNjJnfrOh8hI+B9uUruHMQ1oVKPETbBwZRDlmpSasosQe6iF8Zz9jAPsJ1BNruDlRkUhL3El8j8me9EVfMNqPKIxWwqBsEXXSRtFXNlx3EsqqFMcwc4AQXt+4NHpClUOdMhLIK3x4ng/3b0A== 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=S9xfbevwG/DMGXMdeNaT4ScDZPFm1zZHE1RLIBjvxQQ=; b=m0O536cFN4M+cxotVWya0C4XgA+2Ws8/B6DCF3fTXa9V7lkhdAKyf0hg57TBXfxCJI59y4Hh+0yc7a5ndIHru1q0TFS3OgR366YM77m8aD8e7J+6t829bJ2e9a4z/59T+iLqdSUV8PU2C+wA7ODFDfLFuRozxNMxFsV/51uO+tc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:05:19 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:05:19 +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 v12 7/8] perf vendor events arm64:: Add i.MX93 DDR Performance Monitor metrics Date: Wed, 29 May 2024 16:03:57 +0800 Message-Id: <20240529080358.703784-7-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 837b28e8-33ec-4241-69ac-08dc7fb614fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: BplZRWZm0BEPYfvxqPxgr97zAcqkAsm2ju54kJl3+Nr0be0qnsWVwtyq3ByocmlLjs0z1b5Rus9hGPaFJ/gUw61/Uhsrjd59O3G8R6o2EBCSdly3s+vCiiB17/syKorEaxXcYfYb4t229g4O8smXWTdA1WzSJJXrzzQxK/j1m0LxL/vIb+Sqee2oVsK7/8TuVjvH6cD8uTZWZFBcsAVMzV6b5X8VChY/OmAY7VT+60EVJmr4WilBlwXgVnm0iYR8ECeBaCMV2p01Zh7zc5pzU6+b0OA0Rzuyc0uzPFvrSeOvSi4L88Y+vDj8ZCUZDWmMMsgqpACT+5k7iL5T3GFadITMGX6Qlpqg7olcpWhxYf4Mb3fcxiqYijWG6uOA8juhMWl2oBGDdkNhTXMveYIZhXUsfXMgKdl4yqADy0+p3Ayg7NcZCnyRhPQy784XSUbw95H5Puy0NakJjPHOylV8NnghR/QYfrHfXeuyvDWAMo37hs/kvsc3Wp3HcjiRO2ZQ1ebOryUGk0LLGjzO4VjQ+ekmPpMCgU1oOz9vBk3bY3Koepmmw/fgowTppoBpRbPjyJkJgMMwEH38D5SCqko/rrSYkeDUs3MKWYpQm4VARRGq0KCQ2Qnrc9sLwuc1C0WlntW9AYGYTvSZlXV/caw/00yufpMeKy0xFw4nGVPrl2L7D5Wias/5gXykMtwhVnljYKz5xhTZMbzUfOuFgza/A25DZcugxBraxvIO4Rt0k1ffFG+61r9u+Hx50DspAFRhfHoYTGxE9qJ4zVS/sUDglvRmBkzIVrZdSbnmf72bzoWtfK5bZ/etTo3biiyoyDPGaYLIKhXbfzgPlsBFyeIy/6Mw1Dd7K3DKbUZPssiF2b8r0C6+4ZRoTN5vxnhPrXVzFLGTuC7cNuVH4us7Z7FLVEhsIMHGrOGZqZUsFvnKNJKhU8yTTPSeqlm456nhjvJcm6TUjaypLNdqRCD0GACjGK3T0AnowV7RD+HgxREn468lJB3kSIYXSCvWuUIqmrIuz/vY2gfR8DCFRiXlRFR2B26LA0UNuDmdg2fjBWi9ZUE18sIHA7Cc1trENKR3K56ciOF5mu4komN1R125yKaTPVbcjFfU9DyMF1bmN80CJ4V+JFMZQompFLmcZVUnpdzelWB5jXR+zvBs58/X+5/45VReexvYQgvzYZyNI6aWW5htXdby0tDEh00Nb1d4DQgeJ1UaikVOWDj6X0N/kaUy8hM6eSQaqlNVqBpKG/nB594CgMr2276WDqi9HMBjPF1ZvbX/2X9xuinvg5u5K/KbVVLUTAF52JJa4GBiwRRwG4rDQDXy55FRoE9Rd1OsXX9ltt2nd5albh1ntA4CPEaFPg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fAuq6XrrqvfQtRyAtduGFsFMg5FslHG2tj6xfmhAliQRfIEE30gY8uu/fzIZC48A2HKf9J+OB198SLz5sKPN+3Ssn8QgLofdg4oT/vfR41rGkh1yESP5NtmSQfuPZZkcPQQHiHSBmoRCZu4GHDudpJMJ7EkHgqOiwcXM6ejSJSeuqPpPXiTbb2FFn7HFslcgSkxQNM1rXggLNSM49cjO4rq44CVPuzwRsi82zHh4Bc/DYJ1Xsgk9l1/r45EFduqVcQrGdinn+yXQEqqrUnYI2DPr3YoP/+zumIyx72OQUluH9vw1nlUwVQgGqHZEGDElvtDwlfS+9uePitTT4ZlgN/cmVyFrNdPRgBN3mXcV4nVVqDd8iUGRHXSVO5H79GVh64zFJLdSlhVIdlizXdsP7Hk6JsNbdzbHjGlfdNMvLMUmqNEmoctZsrPvySFUiPgcgYqQiU80YGGfP7yxGQnyPwxLDgYkIqcfYw1uoVtX/473Q3+UgQ7z8z98r139a030giAjCdhHf2xOUtyLsiYMOLbH7p7tjXeVTIDSh7DgpRG5dQJvtit0Q6eWbxyT1Osrx6qMLOZugLwc3n3sXtAKOWrWnOe9aiMbvnh7+bkZCEgTNknkri4DWW7w+EpEItUBX5tlyLtswaLZOUVKmVs+eOG7QkgsIlgU0DK3OQm+9CjP7Qcs9JOSjd0EFoC/vC9T16KdUHxkEDtWBqrxoBk1VPYPbBpHHcD08d8FvjpqwUVJUDzVT7GeNgV5PzhtRBF88ZtbCfL4jPfp6xtLiJGOpzxXMvraPTrMZEMQDlRiewgMVZFlkJPHj8k0ozqWp5e42ZQJoQj4HhynOwGtCv6pdedLn5etPjFSAD9vIvNqJ1/SwDuH5u84S6j8cTCWoEXLycspq/wpP4TOff6vfO9rp/33BPBKeob+/nT0kzVB1+TR9Zb/drGxzpdK6KdYwPr6s/s3tDu3dul2atEn2ungvzQQ3aftvacauEZ77kVAYsKGciwRLAr+DeAPtlwtzJQ3TW++JBamEhTx/jGIz7J/R+D07bWd8Ym9d9nKczNL4Ng9ygdWzJAjNwm9Q9cgzHj458Pf+uMKs3TF80TlhTaw3DxgDS3Uu5xOR+83pI8S761YSFwdEPZrSbsJ/apvl3MrY24ySJrKGCDUB0X0Foyb2djqW8g8Q5ZrN1USKuhnY7jatPX/vxZA+2d0yUHKkUaA2lwQJmGTIixEQFFfJ4UZMT6ku0uidmzNcOuQECqit4upJnTnlM545tET51d3Oso+MtGfMV+C8LhbURljMl1ubUv2fN4fw2kI+F1d8JzbxFCWA4yKw34zI/vC7BHwsEM+eCvKHH981Lxp84epp0eG1orlVg4qLmP1WrJK/QUpm2+6uxKi2cz+D4SrKWcLw7ji/gkmXIKoH9deqvb0SNhYxMoTxP5oa/JO7qflNEC+rq58w6Y87Td77lYnj26vNEQLN0AWjQYizi10k99lmHvRaDHDabdkj5VlDd7BHtTNKteRtg3JWIAjBSmOopw38Y5IcNfBxFQH+PU5Jk62bwGEI/JtPPv/jD3GvouSufS2V5PB4tsep4Zdk8T5Gj0nzJ6Z X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 837b28e8-33ec-4241-69ac-08dc7fb614fa X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:05:19.4569 (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: RqVgUP9bvs/3acqd3C1/nyPTrxtfdWEs6VRXgoCORKsJllGLi/jwMetC7SadgW1Qh7x8IjIKyBkK1XGNu3vDQw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 Add JSON metrics for i.MX93 DDR Performance Monitor. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v7: - new patch Changes in v8: - no changes Changes in v9: - add Rb tag Changes in v10: - no changes Changes in v11: - no changes Changes in v12: - 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" + } +] From patchwork Wed May 29 08:03:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13678173 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2058.outbound.protection.outlook.com [40.107.6.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B29B9176FBE for ; Wed, 29 May 2024 08:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.58 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969934; cv=fail; b=R+ZD8TzrzcxVHeuqbSmEDJsnHRdmaQAv922+mTvfB193cwMg8Fui1U6T+NgjutzE+K4R5im6RwuYqZpXjMBgFncAyUq9faQQeZMhpRvnfwWMjys19myzwjmWxH4QYe6XU2s8rPpubebwsdVG4B9t3Q9rVI2Q7tQqFEwsTpXgHiE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716969934; c=relaxed/simple; bh=u8Y+/YLIfv6uJK6qBYz8Kcxj8lqEpbuS6B4WTxU/yGc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=lTvzkMvEgD2L1igiAeuDAyMe9qJRHWjbInMopB+SZlXBCfz3+HqdG0IS3otSqxSHuEf+ud42CFa40OrvvZubFs5gZk+SJE9iLjrolp6dDnjhp94sGWoZdpqa9KlNt/0odlcTwMAftxS+Pie0Y3OR/ObF+hXUE9m+4g6rR0mQnJ8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=TiNkbhXh; arc=fail smtp.client-ip=40.107.6.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="TiNkbhXh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D7931tmlBrP5edTC79xMl/wAIXJLyaNvlkil0Y1wsNLFCUxwVbZQ3+tGT7D5pWEpsv3uVs9uGPZpMY2nvOD0n/eYj/KFAvYyleqgi2Sb1EGHE+mktq8fxEefz9a2qx/TDzw4Mg03wFUgy3bWvjy0UCdbtu/VVpBsC0e3wbyL9K94ouih5e3f/zDYtL3TSjYkPmEhxWE4EsPAAScitIUI8alJWj8F7KnghdYeIrxWF7Sya0gD0hB7lmD2zfMZGJqCEPJYNY6T990hzAfypPseo20/UL8juuLuzKzavyRotWJd0pah+3zOUBpu++CDrVXH3q0EMnUche2DAh3Pcg+m3A== 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=AD4ooXJcjvcg8dFIwl3YryLii5tuRTiK2zDVtol4jq4=; b=HAwqRdZt3jEOIXRHRw6yAybcqD8aqMI5IHtEdAzFw5OSwajJC9IhXTujRD15v97N/XHWK4Vf2SpLZjI7n3JxrNqWq2vkufFwyFEv7hde2+9clT4VbnQEXL5WzMAohekPQwNy9HpWoOhg5Lvxg2as7IcuAVuz6LM65jI71TBC8uKeoP4elBOAz0MHaPdYqkEq69ECRldu31TfO3jxyqdknwx535VapYfFPfV5eehoyslzrqlsnDl3vf1iA9BDboOSIniptBecX5Y7gwfCLQQQ2CiBp3L+jMqCkFuACeyagPZUS6wmiXKlvJ+qCEJ5bZcZWC6nH0V+xfdHmMHOAQH7UQ== 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=AD4ooXJcjvcg8dFIwl3YryLii5tuRTiK2zDVtol4jq4=; b=TiNkbhXhx4XxdQUbqLU7MFgqOuTVX/RegYHUu85EMuOkkAPJ6qh9TrnyUvv4b50/J5keKshzrY3ATI5boyjf+62mqSPQqwtRsqFhPrm0nLQ3C0BEiQA5uEM+BvIZ/KCZ1hSGIIrGSt/CMVUGTip+bw6wZ1t8D5VokLhKs4cyy/s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.19; Wed, 29 May 2024 08:05:27 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::4e24:c2c7:bd58:c5c7%4]) with mapi id 15.20.7611.025; Wed, 29 May 2024 08:05:27 +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 v12 8/8] perf vendor events arm64:: Add i.MX95 DDR Performance Monitor metrics Date: Wed, 29 May 2024 16:03:58 +0800 Message-Id: <20240529080358.703784-8-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240529080358.703784-1-xu.yang_2@nxp.com> References: <20240529080358.703784-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR01CA0016.apcprd01.prod.exchangelabs.com (2603:1096:4:191::20) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 081614ef-d820-4f29-d6d8-08dc7fb619a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|52116005|376005|7416005|38350700005|921011; X-Microsoft-Antispam-Message-Info: mmIsan1RVXfrE3sJNIQXxoaeE1PbARuC4i6jVn4RrLkcJ1adhAmky9ar51z5GeaDdboa5eZOQ1NhL3X9x5b2Zps2AkJoT101KG83Tjs9LS28ihpvd5gZQ1+1r9+6PlYrS7jVJAbSJ3IJeir/AmR4cUUcJoNr3JWA3tLHQvWGisTJ5RZ09qPUUajLFOkl1a/icIBVC750NU/W4MmRoMNIHloGbCMW4RxtKDFWRcuyumwDzR1AJ6Nsle0PWTuRFx1U1vTCrwozsEiYQcsBMj6Xpdb9O5ZEOxfwZzjHYeEXzIMHn/C3d8cWiu+v5p4wn46XTkr8aiF5dWFknCoM3Jvu37+P9rlVT6t4Dv4dfiT7vQk+g4g8oTuRPyck4kGVh7/rocWyCJq2WJ2eed/ITVzskjkTlQ5srx6vib296WxGtlpKJvubxQlTAYCalxGaQ11xScxLHy/bWm+0lmY7oOO43FW1ySzQxUFBPuYtzIiTORKiChd/id9+P0it9dc1e/oXfoKKU86R+5PvnPKJff+F90trV4xt7o8lgqSHqxAHq6j/nlqjxBQLQIXydix/siWcyCn6rmETmnsl8aUu7ihf+CrZKDu+FfUtA2nmkbnMU5B57allOmB6CbYiZ5zIvT5Pco9H5y67pMBjNFxMcsUMD22w4h1y9ZdljvjnyKFpNHDF6B/uBPwboT+GMy//C2sAkobWWGvkGGezARR8cfkKmujkk1y6MCEW9UqDdB+OIwWFdy5Krrf0Gdyqpk3s2JrdcjZ79vXOsbvHfPKGck70X4YXnVzpMtaxHe79c2W3656Mh/hOZveQ3Raw/7nobhm7axeKEaeENJ+2Z1Eglii+75sDNt858cqop+53F2/hfk8Kq/+x8ZtOvY9PAISL1RyGRf61HZh4rAch6Qn8bIHEZRgUWwKItfTAj/Llui4B/OPRDoi3ZTrgx2+DEMLk9py/cbnhEe806SLokZsj0N4L27tfwJNgy0rwgAkdaAf+ZpG/1QKtRNU1th2acrkXf3JwuJMpPG4IRwlso597pe6LzD2a6WM0NS1wZAYK02nboUOF6ywOLcTdJcTx/HcgAbfS0dWi2gyltrUNuuGAsU35Iy48XglMYqP3HnkW2wWl4Wmop4BbzbK/e6hXT0E01hJRgx23InzCBEHR/Utcx74VKempNWuDendjuFliCzshkvLmM6dRQyyPe/Ks9deqtTtwMrIoy5fzJqCdWt4kZmSjMksRvQDL764xT2JaUCMb+WU9QzMG62fSx1qpCGNQugk6cxg63y//qM/maG7v4kSEI29EQ5VWII6y9z1tUu26y86aHfSp2+iup+wcXU1b624Hz4Ka56P20yhm28xXlj0ZsQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8822.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(52116005)(376005)(7416005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +nBpJOW4FjYlEwuFJowZPp1FICW1SUH+3GSKgmIUFmG2NET2jrh2f4IshmziAbq8smb70VxTi/ETj4VlaE/yHsHC68wyyLJ3TVt8iunV/QNy9mGiMj9UMLdtQQaslF/jk4fSLchwkLqyyKRncSGmwDh0EQKyMYb7tGY9gxm4muYlFUp9yBUXNsbXnPRnvJVO2X+9XgQMKCMp0iHFSJCo7TsXPAznN+0FE44wor0IaK9lZdtDXIm0UB1zdPl0/WwmLkdnf1qOE5fWOY6YfzgU1efeCpt3F4w7yP05M3li6OW2yDG5HSSIFcgk697lXbw3RfbhlQNCAIIo4ZorMDlcxv5NZsmh5Ko7ScWPZFkdl/OgNI33VcYol4FiOmPWCqxKmC/8WQUzw52CagkPNA2qZ4MUCApaGM+wCnktU1UFbAUX35sXnr79sVRZ8xDUagbqwzAs4YFHdNYXZ3nP0xpknMhWHj/3zI8bW2URncH7oe1ZFbgPIQab+8+N7IFJVc0ybzhsNh91Zr6T0U80rHC3RLaJkMpr4jJU1S/IvP3kr4i7x1uWqUDW5zpMP/Ov3uTnCNThwZCC1JSiMsxphF2+mZpOFWroObeEmOydtovKms7FNbkL+ZyDhJHye/1isI0AgHgN8ji4cfd3at7SpurI62EaqYfMq2cpnOrQXSnLeYKno+Up9C2MUsMr0bp6HFFkARR3LYxohT01W/vk0wEij4yFkl7h3RBtTI2b3BHIrjz1c1iUnPLOm0tghEeUAcSYlmss7t4O07HNjrJSOjjf/2GP69/WIvUUXuNi6elf6M//MgqynkRlBChVF0EkbMg6PaJOBXQCm+rSkxhMqa85KNaE8ui8s9IDheEnbVNj2r28LW1oQJ7hiEqHOlQ1oMLyar7DRVSOyNOTkrBVBEE66dGpcCk8e9cOLIgBgDX8gEm5RG4QcT+EbZlfI8X3Xory36aooY1qXd6jh78NBC1QALzlwTthdoahM3IOJQ2ukupNRSkNxt/1m1yX3Cef71tHXFW0oDhJ/yXNEIdfEV4i7dpnno8H6w9dvxHXl2z7K+DRGRstp74pjH6g3J/dgD0P5Y6OqH+MAaMI2mtYL0Z1dlRBk2nED4mF2V8wpkBdDuT0oaECOMhDBmTNwuC0NioX6A2SV2WTKXtjI9hUGm6sb7IZaJNOV7OwQGLmjG0gITEi8wiab7isB5km4aTgJFBzlubF/Z+1v8mAA4PBkP6h7ve1sYQAWq0zKhVV3vtdBubWfBVNNXQZCB0Tt2PKj/WbxcVRA0HWDCYUnpm2o5wH13W/Tm0chrDSs7fjZWBpqEsKaA9qdmggBkscqduc32+/J3DnA+yb1+qSqhg0FBF2ALT7gNbCrE+FodVoknP27zy2HN67lgEliexAkCH4F7rpWz2CJjorbM7dyst5QGztnRnlFsxAeLJo5NXmNx4pwN2VAP8y0yijQw3Wmmh5GEptwkqq71I7cydexY4OgMdkKROSeR4w4vwkyU07XVBSeGbTG7yvz/Vn4G0Ebgz9uTW5/dM2aX2rt2YmZtsqvEwBfHmLckSZDP0zsvDEO8ooewWx6XSbLNojeoevAmodFjmg X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 081614ef-d820-4f29-d6d8-08dc7fb619a5 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2024 08:05:27.4149 (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: EKMCnpZucCBcu+3xAeILyshDS+PD4hSIuC38UDWLX+NCvqTScC2B4Ad2TOM0xPxo2umJxT0vO3lxhzHeNikUSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 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 Changes in v9: - no changes Changes in v10: - no changes Changes in v11: - correct display metrics Changes in v12: - no changes --- .../arch/arm64/freescale/imx95/sys/ddrc.json | 9 + .../arm64/freescale/imx95/sys/metrics.json | 874 ++++++++++++++++++ tools/perf/pmu-events/jevents.py | 1 + 3 files changed, 884 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..126ce980f6f2 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json @@ -0,0 +1,874 @@ +[ + { + "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 layer0 read from ddr", + "MetricName": "imx95_ddr_read.disp_layer0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x2f0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer0 write to ddr", + "MetricName": "imx95_ddr_write.disp_layer0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x2f0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer1 read from ddr", + "MetricName": "imx95_ddr_read.disp_layer1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x300@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer1 write to ddr", + "MetricName": "imx95_ddr_write.disp_layer1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x300@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer2 read from ddr", + "MetricName": "imx95_ddr_read.disp_layer2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x310@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer2 write to ddr", + "MetricName": "imx95_ddr_write.disp_layer2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x310@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer3 read from ddr", + "MetricName": "imx95_ddr_read.disp_layer3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x320@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer3 write to ddr", + "MetricName": "imx95_ddr_write.disp_layer3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x320@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer4 read from ddr", + "MetricName": "imx95_ddr_read.disp_layer4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x330@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer4 write to ddr", + "MetricName": "imx95_ddr_write.disp_layer4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x330@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer5 read from ddr", + "MetricName": "imx95_ddr_read.disp_layer5", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x340@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display layer5 write to ddr", + "MetricName": "imx95_ddr_write.disp_layer5", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x340@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display blitter read from ddr", + "MetricName": "imx95_ddr_read.disp_blit", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x350@ ) * 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\\=0x350@ ) * 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\\=0x360@ ) * 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\\=0x360@ ) * 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',