From patchwork Mon Apr 15 02:03:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E15D2C001CC for ; Mon, 15 Apr 2024 02:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=h+EQA13CdKiwyTjGmEL8fwywUVmCYCfKUW86p+W1y+s=; b=ZcxktfqhKATXgu Z0Iom3oTqOFCU+uU+i+puRWeT5jP220mlD4DeuYD03lRoEWXT+qhkgSGqLQggMq1/hLM4hjGbvxoJ HVAXUKkSLyWJCmmQToi9V8bm7r8uc3lAh4IAnW8AP7syy3a62TtSR513x2/OtgI6AlUsfr48jgzc5 xrqZKLJuyraATTo8am+pJ6V3c2muiWoQ7zaehxhe0oaHCaJE6ZO/BUF12hsPmxTMcr3zP7C6WHBvh chklMVHLBLEFuO8W7O+V9PfKqAonHV5mXcrRNio/laZFBdV4l5KjL0ty86WPNYzdqO/fcGmDYG5om GxfN35E3XIygwWpHVfdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBh1-00000006jOF-0uQw; Mon, 15 Apr 2024 02:03:35 +0000 Received: from mail-am7eur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260e::601] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBgx-00000006jJx-1oXm for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:03:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fappIUpI8X4jQEgg8s5yBHy6zAOjOuk7j+k64zrdgZ3NarWMOy7Tro0AG3tjrqsZMY9R6iwO4/jk2q/x2aOauquI175kCpCD3ShuLuvRIVWD692JhQnUnlOi1T78rU+wW93wnrg1WhYBBuk2GdzzKkRn5R2uTBqIzUmR3bDxWOP/9sluMT0pQQIYlaOhP1cdiVSoyUZv742DcasL9519Gu1F+uKMebtec8LsNehwx0gl2X6x6HJ0iyE5j1jJ6AUtPYWJfAQuNrxjaxERrwRNm4yQGtJuk36ytM5UwmPW1N3HnB2s7Jpu9nhElM2O4AJ2JlJJz6/yykuJhvY0oQRugg== 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=+AC9rRb45bI9McUjccAWwlf3JW1sBVKpMmgHqdwdE8o=; b=h16H6KPJ2Te/ot6LX0YzriEt2dBLbnExWSSpRNEc4VoVwSERHkBgTCPS3Yi505rmvU3v7Xdfq4xtQZUMy3MWR1P6I0FvZIqmo4Rd2OoKUUZQTVNRUtWJz4ctgko78McfBeTsddQSbDLKNIiVrz3Ptrxx353dQyTAdU2PWj4I07w+hCPiNi2rDdFbty/rHSzL9lJXvaW+FsKIaSr4fh3BHiuRCS8VH0IKttV1o0P+wJB2vmdG+mwy4oIX2pA1aC5pEWcT0QJJXinj7hVudgTCgIMvsJYmg8n3fiivk4DtPof8mZZb5zXr7p4fylqbvsVPn4RSoWnyZEux/nyH08R91g== 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=+AC9rRb45bI9McUjccAWwlf3JW1sBVKpMmgHqdwdE8o=; b=f8UFUxLqln4W4KZSSW8VHCzkYShUgfgSPiZ4lQWHudHUi0y1f/67nIOSLH9iJmIax6toPA0ZVsepS/t+u9p8zImh3vKCL7zSe0g++T4mpg3EB3hEkOPmKRDnWPuqPA68E7+QetTZaG7e50iA//I04hSV5IuTSTJ3Fku53g5U9bU= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:20 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:03:20 +0000 From: Xu Yang To: frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH v9 1/8] dt-bindings: perf: fsl-imx-ddr: Add i.MX95 compatible Date: Mon, 15 Apr 2024 10:03:46 +0800 Message-Id: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e6ecf4b-72af-479a-d165-08dc5cf03904 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tOjPbg2hIeyYEGi2JtDgEvk6qP8JVWvPn1d1U/cLc3moIoQeU/L+3waH+b+bdxsfx1vl97oUwC/C0FO3+U8GyRLHspmKae4msUZv2aZNsu6Y/IF6zkYWAhDZ0UHeqIbR8hurk7DVk8LeDmKLf+YnvF468FlI9Z+c4Wa9wzBhBC1G9zhw0AMc3QA2qT4xZmn8zAxHXqEn+XnsMHfU0ORg85z4FpqGKzsA9XBE1RFr7+EU2CRJ1RxsBWYPm/c4BM1Px66CsFaccjsW7gT4Tof+Uopp58A/c3rO9dJTYnGughBZA7f1sGT5EMlW0LmVTl8RgXNxQoujhxIymqXDFUQCagb3S9StycxNR21rcG5ea7LEnQzsxZEKAiMLcOTTRtda0CFfueblTEuxaRIyta9mvnwl1VKi++rEULnv/BXJ5hXvKu25YcYwyqPvXabK5pROhGZinNo6r5Tt9xM9Kxv1YGXXl98y+z5jrm0VNbIhYqsVH30Ew1LYuCPoa3GF20wxt96xZisxsWUNFANJSrzB6T4QfjQNOyM8OYuxOC9tXECX8XdJCX2PoVwfX0oAsB06BL3tCnCko/BYygzDqjOgMBRVJNAyfQhEU7DYQepINfg6E8pmnd4f2Xst29p7EAHJF81/M2kCbrT1DUmm/aTGgqd4f1o4yF/5T1bIuTgktwSOMGrg0fFZ8JCfK8P9sB1o30CyMJtFrUel/oCxk3QkN+2CldE6wEya3qUWkghX1kw= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Pjqa5cVTafIUwrRq8/yjHbuI5lj15elS8bCoBzP/hpPt7RSGjy+y6ZpRQHQWIpV0GOJkwoF31qQ0Zd7vACeOR82uq3jfLVOZ04GDwdGVLEM39dVQTJCtsYFSfaGMD/68AKo2KcmnnnINFmla5GVz6dCMlV/F56jCKanWKW2HH4Pvf9R4HB4aU/9mvPl42ZKgqspZbOd1pVsOCpMLefCN0YNZKsWV7MBI4kI0s3n0ElKEEfs62QXt8bL6Uxcxs93xMbkNQt1FDTJdvG6t4fwTzB8FhEY4NWqlxXHWd58kJcULQfmXfUW5YGg0ohxM6O2k2SqpvX+TGMXj0lWlINHWLowXDPwR5XhoiGmFbvb0MwJcdkG8WRIcbF0lOKOPBMJLyLNVUYQt8QhB/HkuLbQ7I6HtWFwVNW0FWLGQrOSA8abZizohK3LIfhEHvj0B1tAyGoFoxnc2xxxqPER41slmblg4L1DAtmkE+8J9xbBf0uf9hicqBrkgnPGHgq2KndvmjhHYRn/T5SXJ/fWzPRI6cZPkGHjwQeg+9XJvhfL7ldeFCiDdQ/geiJYlUdfJVioR3tEfaEsK8IFRkfzC0KHdGdsEhRFhsRuE6diX1cxvDwORLyhUI/5UvFGZoCaS/wTX7gPUfdvIq0U6275jpkitq3jbO/yHciJZoAiUZ4Jop6XazGoJebDom9jjHKw6rRFicqubBnkQmnb8Gts2QJwa+UBqfgSTuSjVftPQeV6EENTUlsAN5V7PW+175mELotGEo01wQj4ExbFzTq9UE6pXZtgdrDlcgh2aUpTlherUrv8oEAzsreP77yZ8k0xlqeXRDwNf4y93SQr6+CB+B9km4s+LB5PfXiWpLTvtYhA5KjvAf5y80L6HJte9RLQGmoYbJGskdZDoAdvOL8v5D3fhlz1DRvrit/wyiB1YGH6VYtHSwUdRITJa17ePoQk4r+bAi4rdZkIQtYRtIOBytkWPEnQQDcQekvLV/owLkIYxb4VgkWuflCbwLnbaKkvHCV9hlkEfy/voT92K0kmgnS1+coNtQkQAFpGaeKb8jA2Cx6o2u/4dOwT+yZDLYAzaKeBHjS3kuepl1A4SaKLXyI6P3Ld2Kg6wEpZRjQaMgMnuGeHGz/0Xxo+aIdWLKQy8mKwiIU7cY/Ph5N6AcLvDHiZ0VASaVj7kNDG85IM7/tS5L4fQ7zxK9IOV+ua7TzYkZymJiy4dOh0Hif/Jdvi7y5yW97IZcQzftzTdknzba0Pk2i+HOngyLOjos/k924ZobcKbHwbXV/WfJdZ28XAACmlSo8O5r6dDMLinTa+6mpK7AABMKneFqSztLl+Ro8FhPdFdLrwIoSxb8nWizJkAYZENmi81kTFvlR5AK1f29BgZSdvySSHFbxTY43b9/pusEtkEDCJCq7CN9dF5Q5ILW/Q1cTpltaJhurzm5aPv2yLkTD5qyK5xB5TbqDJeHMXi4rjhHWQRojsNmj2LyGirQ+AM0ewN191M/rhrG5vnhqDjBqOOEnMqWWJ3izWqV4TwcMfYGfQ64JubR7Z/nbGyd8MRgJfYBsDjvwuXRfYuA5C8qi+W4J9uIjZzDHgqnHVxsxMn X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e6ecf4b-72af-479a-d165-08dc5cf03904 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:20.1590 (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: aUmsIUWyiyZiMObTn18r9OR+ApU9BafyvjC0zOKrXMUKTBeTyXFPyhIIZ+MNgT6x5ukazX/2NmF+h/e42/b9Cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190331_540640_66071F31 X-CRM114-Status: UNSURE ( 8.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org i.MX95 has a DDR pmu. This will add a compatible for it. Acked-by: Conor Dooley Signed-off-by: Xu Yang --- Changes in v2: - no changes Changes in v3: - let imx95 compatilbe with imx93 Changes in v4: - add Acked-by tag Changes in v5: - no changes Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - no changes Changes in v9: - 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 Mon Apr 15 02:03:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2166EC4345F for ; Mon, 15 Apr 2024 02:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YRQV5T/b1zXwJCacWIG0xnXVGXCarIsf+7FQ8r/LeT8=; b=kpaCHwDx7B8nlD 8/6wkuhku8FsOWckJRBVOZMjukKbb47ZqlUXeFj23xNhbo/VAoGXqa8kbblSXal5aNJbVh3EEmBiS H+1+/U8rnoDtBb0/k/j3MqRxVKlFv4cbYtXvSJ1VAXSGJ31oDjopCujY1Uf+n5CWiSBmcmF2ktWkJ cH1VLetQZ6XRXmb4/WHjUShsdXRENC0kWAkXl2JNsd0M2KXEADK5Oe8xMD1yRTtzGn05VkvZzMXTZ GatwndLH4HBrQI3wrHNox0wEfiX+zI34nRRKNF5xGg0VI6cRkUJ8kHl29gLDt2ep6In2rkckpsDvC g1VnriQAF0YjC+FAeydw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBh7-00000006jQm-1gtQ; Mon, 15 Apr 2024 02:03:41 +0000 Received: from mail-am7eur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260e::601] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBgz-00000006jJx-3gEK for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:03:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KwFMKcgUdBXJU3mNYnSmKZmZbOWSfYtSyQaDIejug0EhAgUmQLMGyu66j8B68iWB+ytf9nWi1OGnGHWgvoEIO3rpHpkezLcd+fUUyFbM0w22qOOLGdReNYLPCSu31A2qMntm+g9gRDt50qMpF2hWu4Imx2Hnz7hsq3WW3XOwJfnIp+D40abVHvradGgTkv9meCrFiXHR2bB9jD3su5KAyGviLdhIBWK+M1Wajm5TZzhNmDjmU9CtWM33/RMlk0CmnITmEZP8zq6crcifBwLzbfJhIJ6NsxdZbVitrvFBCoGoljKfLqrWTINt0vhMLb94xo4bmEpE4tEa7ORtCU+rAw== 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=zvDjqHs60Uql4uWa1FwthIEeXtJnSLRhqLXAGL7n/io=; b=gDPIwC+cRaTQYy76tylVfNqDuCmhvf/a3ywQlCUp9ronXFd7bEmhUhk/cW4rrlqTZx8p9T6LAeQRjgUB8ClxIvUWCNueR1zGHjjhZHQdh/zQWCzvCKtai2tGhAtCwOhsv4ummqQ9P0H7CFMyGZIleitTSlZBq1zuq6NXB3N+L+9d6p3/P981jr87AtFkXaAs3f9c+OX6U812pSQiZUz4qmFZeNPLlbrfvLz9ZoWn6Emk8OYthEXy/xsZUEeshyoOICiFixBZnFXH4t0lkNEmkbX/aEABnVbe/gtNjHhbopeBTKf9xvGIj89JF9SbiS14BP7Y052kyBWQ+y/h2h1d9Q== 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=zvDjqHs60Uql4uWa1FwthIEeXtJnSLRhqLXAGL7n/io=; b=i1TeOHaNhs132SYivWtQtOtU+K1wyoLDwyH9FsLisJshV4LusOzsak1jH5fPeJcX5N0aFcH+euyj6sF+d94Pwd0Erix7sHVA+TWFz91j6AGXiKTOeb2RAz8WVdR3jkxrpPa/TZJE7nKWJzhMS9muN4RbhgJXyj2VB5DdMyGUHfs= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:27 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:03: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 v9 2/8] perf: imx_perf: add macro definitions for parsing config attr Date: Mon, 15 Apr 2024 10:03:47 +0800 Message-Id: <20240415020353.3833367-2-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 570624e1-a3de-410d-1e22-08dc5cf03d51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CYnfNkgE4meR5U7piW27SdEuVIlQOvYWo05bJT5PWvoqMa67CAazAf4RgHknyUkdPKZR+r+YVLNRPOC++OBWX+NEc5waeqff2JeyCKX5xzuyqzXtIp0/SvfzM42PdZIp8oCHcoOlrxwRXrUYtLstA5rWpLKvOrvTevq0GPmp+C9ZP1hxejBHOH15IYQIiqSi3+6negjYSJjQNdMlOQAD36YxKBQaOkMWg5LCI/nEQtvFFjYMh39haB7VC7v2RjTp+hActbo4ovl5f1U/AqLaED3An+PIp2s57QtHxlwCkpsc1AGrFSY4bFn5McT5qtW84pMYwyOcJVAFnRcDezv3hFSNtOCOeApafauWqnjn2Au4RNm7bhzSHBNKqhGO9TYrZSNP++iFvNkuETuy/HDY1Dl3okbeTDlw9L07oETabxtXg6S4gnXRfwI+k3mQw4dEjZtL3LA4pHoY4pmn/nC5nA3i0FTebDT6dIK9RQUbJI1MxeCRgWf8R9Sxsv+v1ihdlO9wO0j3JYj2w+lFtKafM/cuJmLY//yo2fp454F+HgsKMEoUi/fVqUHMAdcPw3zzREhWV5MfJ4KFxKGeXfcqQB4adiTNQP5OmyGzFEG1jYjD8eefkhlD1jgrAMTdEI7Ab9O3Dol2zJsD0NYwmkiiGHsB3ph50oKxM88rIGip4tsBUpc+hTx4AODYGGk8EBwq9tNTiUHraD4E/JDXitze03ilbGJ49jsUgZBwPJbLtDQ= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jn3rVldFyrWBMeNOTDnLCnelrAm8gtsa5ig9b5JcjdgZyOk4cv5eRMkhre1apIPSgOcBSvD/8HXBZ2LhGqSL49uO5he2Lc3GkkLbmyN0EoJd4LQo2+rpDguVuW6PR2oFBEKA+7mowSCSVK3YRc0kCipmBgt0qTd27ChjpLQNthLqseQdVU7gJNC5Vtdyw3el6AItcucyVPsiKaAiG5AMM6i3PzomsuLmOzAK364JyMPQ/hX6+9CHXY04hprCkSzAiI8Ye0+Pk5VvZEWWrsY68mxJe0c8mhJSzSAc31hyymUgoF4vUqSdgCU0zj5SGeXSslG7SXxnt6IiT5wz0LNAS9YU8BTFp277gQRAd2gxGxLroegRj40h34WNGzPS6nnIf5Tas9V79O/jjgDTiMGheeZEp/EvluH1PgaXRn9DnzMqhZQxsM8WJJXmJ9ENzgkEluAjLA8TYYD1jE/w2QxY3tLPVjPAJXfPM5RTGFf1xntWy4drzCLBUa+2MatpV2JGt/S/alNOqo5kqwnpfBWTa7weD2f+7qyceszfC/NjT3M4pdb6M1gaICOOuCBT2Bdyz4j+vTVp4Ful3Ma0b14eqmO5Lmd5KlcjuxSkMVkqZXn1r9hB3MOV71i8V7V1E63h9YS3riL9MhyKPDj0gbN13HpYSpHF8d0xulnoQdKdRqa/EWlltHph4BXYLUe8HxneEga9vEDSRoKr+SwZcTGi6rnlcbEl5gFdNZ9U1P+rwcmly8mozui2T0aTn8EAEq90wPb1NccdgOt2yBWwZjr2+ujDNEBnLZluwzVfVx26SmvlMs3Cv6GfkEjZ+adinuDcv+hMIRd7JiXiqJpZ/RZ2bCVPvvINVY2FRCE3r4db+65kH0dSjFZqEv8it2+7JV/TOE+7g5RTfQG634bc7ZaVxHlZvd8QRXSHtmYeR7GJY+Iw4Vr9Ul5XR9Jn5HG4THlDLKWkDbFMbbAWuoHge9Qx2nW2nJT8Qk3EXLgThHUiOD7U4yZQcMq8WDW5OzyXVyk/ZYoncMx5p/Apig08icQFcU9YlQ1R4y9H+u6dlKRMLQfepiwMRQk5Hz9ipDFs8Ejvipl1rqbpBo6trGebCfQxKNJHpU5SS48rQbU363vWSV/GIm4eMypHu/qR/D2cpXya+0gH3OgZtBgVZOlIH0Qq6gKGJj/tuSzn4wQroqIAkxcGdnW4UCNuRgppNow9Hc8H1DskecToSP53rqXhmqG0iTGQKsWDrcIv17JNppPBAbmvmbBBpPgI2OMwxXTSEW/fm3P/kJcBkASFzNpUcXC2oeVRY8PWKClSmFzAzasYkLxrYrhhYmQVwHyXrUWhLMYIsqjk9FwnskJOuDdVyS9oyIxd2umv9sHGnCqZAChuiQv39ODXH3HM5+ckTGFIWPLRPVGS6KBoc3aWo0pQ9ZnNVvM5Lqy9pdDfEjxgeSobvskCNRbSB8s9mGWRbNPhzRB5fFF59GJO7G/+vo/qQWzIJpmpqHozbRv3iNxo4P0i2WmNKzmok+69Tiz2NghEPXCuTr6BUIoi6czOQfkdJY+a5MR/joW06fPa+ITZ3c5gi1rsYnhZTggaMY7xXNybZeRi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 570624e1-a3de-410d-1e22-08dc5cf03d51 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:27.2948 (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: 2jE1t4mjtrrKDS41v8LVIJ19JwrygUZUdu4qlzsX8tOUMKUIm9l6mTLiv9F5BQPqXmXi7oLDE+IIqRT8wYOtRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190333_954351_8CA44088 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The user can set event and counter in cmdline and the driver need to parse it using 'config' attr value. This will add macro definitions to avoid hard-code in driver. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v4: - new patch Changes in v5: - move this patch earlier Changes in v6: - no changes Changes in v7: - use FIELD_* Changes in v8: - add Rb tag Changes in v9: - add Rb tag --- drivers/perf/fsl_imx9_ddr_perf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 72c2d3074cde..0017f2c9ef91 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -42,6 +42,9 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CONFIG_EVENT GENMASK(7, 0) +#define CONFIG_COUNTER GENMASK(15, 8) + #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) #define DDR_PERF_DEV_NAME "imx9_ddr" @@ -339,8 +342,10 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, int counter, bool enable) { u32 ctrl_a; + int event; ctrl_a = readl_relaxed(pmu->base + PMLCA(counter)); + event = FIELD_GET(CONFIG_EVENT, config); if (enable) { ctrl_a |= PMLCA_FC; @@ -352,7 +357,7 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, ctrl_a &= ~PMLCA_FC; ctrl_a |= PMLCA_CE; ctrl_a &= ~FIELD_PREP(PMLCA_EVENT, 0x7F); - ctrl_a |= FIELD_PREP(PMLCA_EVENT, (config & 0x000000FF)); + ctrl_a |= FIELD_PREP(PMLCA_EVENT, event); writel(ctrl_a, pmu->base + PMLCA(counter)); } else { /* Freeze counter. */ @@ -366,8 +371,8 @@ static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int u32 pmcfg1, pmcfg2; int event, counter; - event = cfg & 0x000000FF; - counter = (cfg & 0x0000FF00) >> 8; + event = FIELD_GET(CONFIG_EVENT, cfg); + counter = FIELD_GET(CONFIG_COUNTER, cfg); pmcfg1 = readl_relaxed(pmu->base + PMCFG1); @@ -469,7 +474,7 @@ static int ddr_perf_event_add(struct perf_event *event, int flags) int cfg2 = event->attr.config2; int counter; - counter = (cfg & 0x0000FF00) >> 8; + counter = FIELD_GET(CONFIG_COUNTER, cfg); pmu->events[counter] = event; pmu->active_events++; From patchwork Mon Apr 15 02:03:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A9C3BC4345F for ; Mon, 15 Apr 2024 02:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HOSFT/k9bdIdWzRA8eCv0CPup/lkAlSZar/5SmvEwNw=; b=M5H+2YTABRIurG iHr6m68v8sIQSLn45Wo2gCHIrhMXq6GNcswZZfb6aJj/JsuCmd2PTiUBm2Ild4HuzmuNfW//hlqkr Hn1xWrwvD7B5uWHiIpWYayh+jIQw4zogiVQW2vMP3ouB5lOLAVpQL7I5uhWM2Okmy9/C7fDs2u04B 4LxAbpvHQBKzaRWM3qp2Gtgkz5Byu8kkcfa02fblPx+iJZVvzNUPKZe6L22qxqK4u7PEUhSj1RJLR tniBcqI6kB8H/kBqECboTb7zJ3b8gRRxq6q5x2I67/kT3gus9HSiZ2zRt5DKKdQHwlDS9D0tueG8t GYaxIIOV/bXewMk4b1Pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBh8-00000006jRN-1RDv; Mon, 15 Apr 2024 02:03:42 +0000 Received: from mail-am7eur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260e::601] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBh2-00000006jJx-19Ij for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:03:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k6csl8WbSSkxpa/WD5i2GFbo9HI0fALLdmlcJXkEhMXE3SdChtqn999axtPrtBZaf/aLb4QA0K2Hw/JjZR8iQ7oX7v+7AIZuWZkbHksanQbqqEagXQmQTM1S0QxJTcGkWF6krMBy6ksmy/JjjNGT/iSv+Zr73el90q+HCrrGmL+zsLmMzOxwwx2OLEBYAZ4IcNCcErKnCjqvKzN1ovhuWjmvtA6UQJBy3PpxyKe453JSsj54tngWXHk5JCS8jEI/ntaOV+Cvgcn/a9HIRhIzHf/Duy5UMIbmDmyVBlCeQ/1N+4539SY8IyNWmo3iGiuUXiAEVOdIeQPH0m/dCAecGw== 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=uWveXjTGiSAZQYTWZh8/htfvtYLQXYzpgbdrGQpMwPo=; b=AfcPLNk/KUsHpvKiwm7F+0EMdO4ukXElbQ1Dwx8cjiswSsEhMEYg9HzPo2hfLqXNyh+qCGLR+pizPXBQ1D4aDUmHB4LKkVSBnc2ZdQz0LCEesJDVRuScoT1ZchoVDLznOiYRrFP0wb6K3Z4uaD8Bdcabx3iTQX+9G6KPi+pbw4liZvg5Dpo2tS3Wu9nf9Q+ZPjk8vegRBRB/jdIwDvQrZmPZmtIpQvfZq3gEECu3Z7HFvVO6zW0GQrki8PLlChQcNJMxqOa/T1VBG4a+49IiNY8EkYH2rRBWsMDFNVapjAABxobTKRB3Dm4WrYPTv3HQKGWqH88evddydW+Xie/hiQ== 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=uWveXjTGiSAZQYTWZh8/htfvtYLQXYzpgbdrGQpMwPo=; b=dk4s9DmG7TSmGFRXWEX0+VUvkjrJ+WF8Cey1eNCP6w4Uo1Id6gFr1IT4tP3rijkk6Y+ehP01jv1oeiMsU+V3pzeuIe8SNMWLBM/rXv5vPxOhXZg6wfQU8eNxlDyH6H4wA17gr90nab7dholqwPshW7kAwcyF+xokq2yCwwEjeLM= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:34 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:03:34 +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 v9 3/8] perf: imx_perf: let the driver manage the counter usage rather the user Date: Mon, 15 Apr 2024 10:03:48 +0800 Message-Id: <20240415020353.3833367-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bf97d51-c22f-4419-4981-08dc5cf0418a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZQ44tF63LrEVP5lKAkbfQEVcEkGPzE1aBvfSYVoufAjhkCaywMMa6pF32MUSyhHdjQ5TBdh5uC5pmPqgaN0Uyo6IBFjwT+t8wvr6X3+vq993cCeqmxWaAsiyXrklOMHAGt6J4vC3teUhWqCtaLdw/gNtzB2EclTa1AYj00YxZOm2MRz1sHHzjGNjTDVQrV+9vtUXuux6bjm7PaTk7xqedC3bgK3u34nSPsL/O9KHubsCCm2jTJVsTsF4BMEwLeEur/ExZWAyfXqsMjJ7nkpyeq2LQEVSMk8cM36YgdlIaUDfyXIu5h8tatcbJm6JkUTtCGNBA81RfjJIqEkTo667gK5YJjwvQk/SH+inrjPaoMrwEnYJyt/utu9XcAMVbuz+i4R3mzGiw4FdsPIQWLlVFVChal338804e3uSN7J6PRzq9OnQOj5Wkx60PtvorGWxzUQaGiWccI0IcfI0kEwIvW2gujvp/q92Ylc0gdaxS6fC3XZZHzgX6rfyLheHrepkG4u37s1hXqHuRkgVlGMZ/aXTDRmLdWmFrTt1BKe2wqQQW7ctyiMNmcSrqOmG4Ck+0k5srbrGOzc6X7vQwV73Rmzt37rYyQU82SfbegPnb+7lu2mgsgSosisi0x0E55eZtYGAjtyQSi4pYF6/M4WmAuiyuocXWO9sNz1n79h9EHN0bUA0KGVr1J4+qPsU+T6dXU27dOBMu/xoN9+ThRCEClekwl9KfH8qXSkqcHJbZhM= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LqpK2s2NsEH8cvEawGXIgxq9bkL+atlNey02+dH/JFyLxqtA49dNsPeR293+aGCV9h7hBJjIZaoeubJGNL7yj0rolkEf/BBVFvyURWwsudJY0d7kpnzkuhBMDAPAAozCe9ETchntEcd02uzPJ7NccrcmOCcuY/vzt5TlKh0zrXrtvlJDseR8B3thXAjO/SY3gs4J56te4ZNvv9uOvs/nh90cGbntZn59LVBmgXaJ0KQwJltlaeU0DGXIODazg7GveIlRHcNQQU5iU9dPGb3pGOszbSO/COuOJWMKkcmASa5x6KBonA2Y3QUDmCLnlNimCxx7BeGj1XKLOQ4RHwoCVIEU4UfLkLazbmIc5v4B1hH77PR3UslWcpt+chHd1RW4cp/Ii5V6StbH3iDTZAp0/nagCidn5slrL3oeTBGNAaiOgYtpcHx2ftUJI0mF50S/8aE7kMRH4ffV8vYvYEHTzILIckHivOkwnIdxN9NlZYfocHbcW03wgTZ6HvCahkCIv8+K4AOB/0NWuWu9gWNd53hOnfTgKzkHT4hDg+HJVADDSLuAT0T8DXyD1RZIpxGpRc6Kw37nL95IfAXj1S+IpuZz8VTaQomA1VLdgzzB/sURf3Snxx7uTlyg2YH/U1Nd0p+7xqPFDd55euTQiec0IiME/h8hw3jQY5ChfH51+WRKWDaAexALrS/nrEpC8aOC4evrnX333z2g/tVAplAg4LT/bfyHuuqkq5EaDbghV6Q/Pb8lNpxCBzXZNticfwQrblGtRrPryWS4979pjVfTVCN1cKuTOu9LsqT2DO2h4O0cJ8y630iCCkTH6SU1O2J+kOyajIq8MUtbQM1VGYUTNVoXbOcnGVgS/i7cEdzWjzPTvROKud5Ef7oamotVIEErAB7RjVJQ4SE7p3Sc3oXCwQiT+yeMBOvzPaKcrGKbljIW+yWx2xiw7Z/3GkaAWKt0fAfvteTFcEsfEiwmAeEWGY5q47q7JlCZhw+t9mvOG64PpVMdgiX5xUlUJ8Cnub//Y5jTKZBNg2ZDcPxSkRjR5DI1y9QyHtaHtXKfhYopT5ICUz5oYBdyeKqTNvbLYxGV7VmOJmBlS6Do0JlTBPk0jxemFqwd5ZN6F57ZUl/gUue9j8U3ShURRtqQh1EgsqxEdd++qArcten61xH78vrBYXSOCniKg0KTbvx9WTdLBMzK5sCeXqNeQbUfEGyRbcUdBg8sUHjDaY9sxR9KeTf/34RBy2yeAXeT8Cqt4Pahvxx010TTIAZmjkggIJRyQW6sYGubiH9qTWqzH2y7PiNROqZetT65Z759PtE2HC1nBMjM044ODzZhLrubWvGrlxdmgdnrq360YCiyP6jFQ2vLgnIvNCOhWhT74+awpI09GKiCivp+nsfs/2Yv/5oGAw9RE20wr8K+H0zK3MSvUfYJMGYfvdcKA4LP13v5CyeURkFyFJ3Bdxiy3aRWvrZyT35al7wOWXvjZxu+sKvhlGSMD3KVAjqFbJyF413FaixuU+bxUE5q5LDn1msPrKww+7tnBMIuQOxt8Mt1hR/b9m1e6L6qQ5AfoSbyusE1OY0UnOSyKlC1mDSFnY0WujwzJ+yG X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bf97d51-c22f-4419-4981-08dc5cf0418a X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:34.3159 (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: 7zK/BEsQfP4BOJYLyn7S05vS/RMEd81NKsqXtqT1hbOLUvdiqBp01m1lfHnIeQp5PmPFT80AmplMNwF4CXUV6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190336_349384_87A981C2 X-CRM114-Status: GOOD ( 14.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In current design, the user of perf app needs to input counter ID to count events. However, this is not user-friendly since the user needs to lookup the map table to find the counter. Instead of letting the user to input the counter, let this driver to manage the counters in this patch. This will be implemented by: 1. allocate counter 0 for cycle event. 2. find unused counter from 1-10 for reference events. 3. allocate specific counter for counter-specific events. In this patch, counter attribute is removed too. To mark counter-specific events, counter ID will be encoded into perf_pmu_events_attr.id. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v6: - new patch Changes in v7: - no changes Changes in v8: - add Rb tag Changes in v9: - keep 'counter' attr --- drivers/perf/fsl_imx9_ddr_perf.c | 164 ++++++++++++++++++------------- 1 file changed, 98 insertions(+), 66 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 0017f2c9ef91..b00cbd920c0d 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -41,9 +41,11 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CYCLES_EVENT_ID 0 #define CONFIG_EVENT GENMASK(7, 0) #define CONFIG_COUNTER GENMASK(15, 8) +#define CONFIG_COUNTER_OFFSET 8 #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) @@ -130,6 +132,8 @@ static ssize_t ddr_pmu_event_show(struct device *dev, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } +#define ID(counter, id) ((counter << CONFIG_COUNTER_OFFSET) | id) + #define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ (&((struct perf_pmu_events_attr[]) { \ { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ @@ -162,81 +166,81 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_pm_29, 63), /* counter1 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_7, 71), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_0, ID(1, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_1, ID(1, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_2, ID(1, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_3, ID(1, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_4, ID(1, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_5, ID(1, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_6, ID(1, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_7, ID(1, 71)), /* counter2 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, 73), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_0, ID(2, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_1, ID(2, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_2, ID(2, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_3, ID(2, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_4, ID(2, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_5, ID(2, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, ID(2, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* counter3 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, 73), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_1, ID(3, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_2, ID(3, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_3, ID(3, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_4, ID(3, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_5, ID(3, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, ID(3, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* counter4 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, 73), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_1, ID(4, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_2, ID(4, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_3, ID(4, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_4, ID(4, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_5, ID(4, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, ID(4, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* counter5 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, 72), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_1, ID(5, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_2, ID(5, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_3, ID(5, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_4, ID(5, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_5, ID(5, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, ID(5, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, ID(5, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, ID(5, 72)), /* counter6 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2, 72), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, ID(6, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2, ID(6, 72)), /* counter7 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_2_full, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq0, 65), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_2_full, ID(7, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq0, ID(7, 65)), /* counter8 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_bias_switched, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_4_full, 65), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_bias_switched, ID(8, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_4_full, ID(8, 65)), /* counter9 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq1, 65), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_3_4_full, 66), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq1, ID(9, 65)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_3_4_full, ID(9, 66)), /* counter10 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_misc_mrk, 65), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq0, 66), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_misc_mrk, ID(10, 65)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq0, ID(10, 66)), NULL, }; @@ -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, cfg); - counter = FIELD_GET(CONFIG_COUNTER, 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, cfg); counter = FIELD_GET(CONFIG_COUNTER, cfg); + counter = ddr_perf_alloc_counter(pmu, event_id, counter); + if (counter < 0) { + dev_dbg(pmu->dev, "There are not enough counters\n"); + return -EOPNOTSUPP; + } + pmu->events[counter] = event; pmu->active_events++; hwc->idx = counter; @@ -485,7 +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 Mon Apr 15 02:03:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E9E2C4345F for ; Mon, 15 Apr 2024 02:04:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KDggJLpYIXYjPJDQxKPoU+N7zphYUFqr2xJNEOFKYl0=; b=Pm2Ehy6TBxsFQm izIu6hBcThUL+jkQrnqpG6q33jV3YQHQVwoRpDYG/7gZKdanfDHxiFyR+vxp3xJEXu7i2UVb0GBEa byCfoHZH1GCmnkPy38ZwPivvDptf0InbgKm0lls3ZPWjv/UmU//zC/Mpgv6ltU1N3KUKt+K9evs1x 8usLhLXBd2G/cgNCIVrYDtYOGCvVjcboVYfcKTYalBna2ITQ7LfgvHf3gePN7kzkKg8fOemZqVtyo OJXS3AQfuKz5Ojz2RPg9xUaKji5XCJXKLqUlU0MZQsltowzFdIIX3IoP2rA13XOXqKDiz7MEuytj5 EWMPW7berVmXEiwOk/Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhL-00000006jaO-2ayd; Mon, 15 Apr 2024 02:03:55 +0000 Received: from mail-am7eur03on20600.outbound.protection.outlook.com ([2a01:111:f403:260e::600] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhF-00000006jTq-13w2 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:03:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TF0NyOfxO99pb7DQOqzMzjz1GuKYH+am2R7Nw/rXoCHKPjLtkNzdIH/nUK1x6Lf5dpLkkSfhJq4Fr6Rpy8u607RM4Pgpo4EvkTtKS3xrtikGOdG1fgu4NNgWacZifdR6BCmDQ3C01BA4hplsFPQFTSzetbpa+eB8j97qMtpFlZA6zj8KItg8bdWMI+XMwOM8ymp6CMSyooOrxeNAKJX2ie2ON5mgOtTiBfZBTgYNui8KxbP95sVhgqDAQ4nVstS9ZA63iSVXt/9ZXzwaR6nm70VpZ/sT+UVWIc7sZD5f1XktHdKKAvnGXlgHVv352ZeP2L0My/A3mYOY9lyD7KBfOw== 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=a/NHYrDINE92LRHObyGmapaMgeDoYSdBb6S/87mxgi4=; b=gtAfH2xMUbGTe7jPnAYGt7C9Fceuv2udTYE6UTMJwkUAYHwX1iwgdWcMrIm9K3pdbHKfdk17MHDaKifXotmALbJXjQeL3+iQ6xpg1Veb1ozdQANvMam3woY2BcsE3H7dymToYpH1Xax4G+iI5O8h1KX4hjU4TeSc7ZZVrLzaEwamTbgnT8LIlrUXL5sjyQbRBv8ccHFn64XOCFBqT7OnAwBQf7t8d0GumfrViN19giJ5pmSAB3C8sGMHsughIUVgyjCUIV0HRArh5HuDleQEuHdLDxi0hTrQ+feqvhRfMDk28JSlVlyvyjx8krvUN91rPuObBPa5DUH6bY8kKZrcHw== 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=a/NHYrDINE92LRHObyGmapaMgeDoYSdBb6S/87mxgi4=; b=fHkI4PAbJhzDUQzxOvSr7dlkudZCxHhPoYjpK6ffLFgrnMhxdTAi0g/9xgkQL7kXKkQQ2+X8HSDAPLSCBq1c2weclgCLAgsU+33KQ62hXxRBJWA4KKItEkO9LX1haCgzoQ4ejqy9DR+zjTwDWVKuGfr/JhgZIclGTYp1SLy1mRM= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:41 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:03:41 +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 v9 4/8] perf: imx_perf: refactor driver for imx93 Date: Mon, 15 Apr 2024 10:03:49 +0800 Message-Id: <20240415020353.3833367-4-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: d5c07a66-4823-4f39-998d-08dc5cf045b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 50Pejdqk00p39TKLw9Bld95Qc0WDnSD7Fx9C2chJlV8XBT1nqIH1ke6eus7P4npA6iS71Ahi2FHHBO3DwJyvI0hhLZbB+0NtWJVDK5dPAXQzICYgxcjuxrXQAdFJ3TwZ+YfbruWZ/AURGg7WeBioXw6Oc8SeVRaZCpZtBF+mmOvm49j3vAo6yk5F5nOFKkL6Z1OO7fRAQyTHuN8hy++p1smELhjKXck4NBBNU0E5vzv0uJNtZc/e8jRRap27nGMqzBjs8pGlJlUTGBfYiELL9nlrcJf2UXKEQcUUrZARbpgTNgTM9iMQzXRDqGcgerY/jr2SlsfnkXfeLWUhKbPzNi4r0YGK9BtjSigWBhTIaK5Sm4M4mdsPpwBybcGP7xQofBIIYkAmc5c4h0+v8LPmJ4nZwgiAkmqiOyYDu7+s2TpPSD5zQttaBSNf/72LaKqca6lLDvWmEIxooStE1C/RRiiH2d2POefRttsxREv3uAld0tisKl0dBVGnQq3ndzCTkcDwVz6DUse7n8opef64feSjDd2k+tF1Whz+peHVmfz6PABDGGNbPHQeeybtjSJwDr/w4UQzA+CRUEau3g260JxaQ6bJDdzwVXmPOawip3UnSy7+z0iQf6sjGX7wLOCmcAertX+/DweidOmlwhJan3OKHRjyPBMsw6fMF82Re4bTKdZVF5jMSIeMjZLDvpd8KoCxoi7ebKLHWBzK4PpQHVxfm+rlrwE9Wu5hUQ/Z7Is= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8qBJROH0GLGaGtNn4LWbCrLcZ6djyfFJJPkfE4IdGdCl73z1VInT3RLrqLfhUaqft0uRTnEjIjkzi2slVJQXtFGn0m65YwQXpkTd/Brr7WC4DcahszRjSIh0KbVNXcepYjxAsAhyWTFZM9lcGjxktfnBAzdRAga06dcO0ptZktP6R3oog+Xr+Hb0nZJbsnUdW/5JL9gFwsSp92XsFWv+PhUrXXdCUAioAQEvl/7jTY9aWK1ZeONaBN8UfY3g6FhK7fGB4qjnM8IDbsqgNok1pxOn8UKbqMh8jLvPp4cUT91VH61rt3TvocMPvnE+JYnQ33ymzOpzG7Lo3S0O1xg5vxNAqy5n8VWt26u3K0HxUbxM+1ZAXnvlMIvuTF0mNIyhPlU/ZnSzglnfz0hsjRk/v1AxPdEHpAF8AC5S/ODI5ozZsU3VU387Q6H1WUbBVCWeHQadp+cLsomY2OLLNmltuoArZg5XweR/PzqzKnuK5AYfoAw/ZseGMPZ0s5H0zV1+EmYSNk2F3Hyiya5xjnvCWRqAstadLIVpKha5sQLOHwz1PTc81pMPcDrLA4jntDTvKxJKDvUJa2zcihxaqQWQH6bTvNlMkby1buUxqw9pwWDd6axOdViviC/eb48204k0FNqc1ZB8G/rr16sX7yBvEeyngq36ffoDg8a/9shzu9WS7zNVJdpXi9hgPRwfSR4un0EAmlhLrN76WM9gBdLe5nwtnZGyxU+xPbx8JNvVj5ekfGPdEaTqvv3Cx3EpBns/ksA2n2GRXiEoZ8EjyqxoN08wZvsFnW8hi9VOqnatgsdi+w6pWU4+ZRbnFzr1+3kVLmBFrxfj4mWSCgDDWjXSV73ygghleYdCwaVnv/p5zAwx98BInHGT8HH/8uEgr9CpS61quusnMIZy5HqjSC9xNaL1x4wQsMcPGza9J0YJSlHQwl/gxB6Roo8CIcnE6stpbdxorLv1o1e+QDLcO7hqH+xLcDcOtk7+/794Gca1Jm8CJrb3N/wtpZUyOpu/VLUo/5H7B+8LmV32ML9+qv1oX86sA331TD8MyVt1CcFNNT/L4FGutEsDm3Cwopv9iEHlOjvEkfKoy2TlTDKdMh5ArWujlm4DhbaxVh0yu7wDz4TPvSBHdKadlKxOAG58o+o+D5hOOMH1ADTRzD6nVZzgRazQaNkv1BR0yKpDcK3003Z8d5WriVKzrWwlliJ9NxjmG6W1Pqx27cw2AZRZxkGfwe79nHcLarmC6xrmBSw77Dxmk5gO9/dqnN/iirtU+Ku0iOapmRJFRpCFusts6R58M7IRTJLQW6vMsuThRpK4/pUXfpmYyoHMWA3O5/6ZBYR4BN1xP5yxWKg1nZbnAMQvbA/hD+9hTyUf/+YT3g4MirUqYxxui3A+5l9SSuSmamTPcjUtGLPvNPDpbUDAB1U7CNBYvxgn0Idl5D+dbkZazCjLUGpspOc8xrqKNSKZa47RtSP7Ab6EzYqy/2SLgXL2oFCH/nwVlKs7fpIq0XBSFFeMRC91u4EduUGvQ+dUTBi/WjogWIYGmoz7oG59v+8gQhoT08vKonlkijzhDIilBg4E7MXaYJ72epC49s6wySOU X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5c07a66-4823-4f39-998d-08dc5cf045b8 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:41.3343 (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: 4svo7IUJFd6wQy8W0VZ3NGXUT433fVJUoloLcLMuu4SxkZ8hn74sDG1c28MGmwRJ8S2A+871nLbHedU3rZon2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190349_591739_587647B5 X-CRM114-Status: GOOD ( 19.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This driver is initinally used to support imx93 Soc and now it's time to add support for imx95 Soc. However, some macro definitions and events are different on these two Socs. For preparing imx95 supports, this will refactor driver for imx93. 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 --- 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 b00cbd920c0d..1510502862fe 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -11,14 +11,14 @@ #include /* Performance monitor configuration */ -#define PMCFG1 0x00 -#define PMCFG1_RD_TRANS_FILT_EN BIT(31) -#define PMCFG1_WR_TRANS_FILT_EN BIT(30) -#define PMCFG1_RD_BT_FILT_EN BIT(29) -#define PMCFG1_ID_MASK GENMASK(17, 0) +#define PMCFG1 0x00 +#define MX93_PMCFG1_RD_TRANS_FILT_EN BIT(31) +#define MX93_PMCFG1_WR_TRANS_FILT_EN BIT(30) +#define MX93_PMCFG1_RD_BT_FILT_EN BIT(29) +#define MX93_PMCFG1_ID_MASK GENMASK(17, 0) -#define PMCFG2 0x04 -#define PMCFG2_ID GENMASK(17, 0) +#define PMCFG2 0x04 +#define MX93_PMCFG2_ID GENMASK(17, 0) /* Global control register affects all counters and takes priority over local control registers */ #define PMGC0 0x40 @@ -76,6 +76,11 @@ static const struct imx_ddr_devtype_data imx93_devtype_data = { .identifier = "imx93", }; +static inline bool is_imx93(struct ddr_pmu *pmu) +{ + return pmu->devtype_data == &imx93_devtype_data; +} + static const struct of_device_id imx_ddr_pmu_dt_ids[] = { {.compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data}, { /* sentinel */ } @@ -123,23 +128,36 @@ static const struct attribute_group ddr_perf_cpumask_attr_group = { .attrs = ddr_perf_cpumask_attrs, }; +struct imx9_pmu_events_attr { + struct device_attribute attr; + u64 id; + const void *devtype_data; +}; + static ssize_t ddr_pmu_event_show(struct device *dev, struct device_attribute *attr, char *page) { - struct perf_pmu_events_attr *pmu_attr; + struct imx9_pmu_events_attr *pmu_attr; - pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); + pmu_attr = container_of(attr, struct imx9_pmu_events_attr, attr); return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } #define ID(counter, id) ((counter << CONFIG_COUNTER_OFFSET) | id) -#define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ +#define DDR_PMU_EVENT_ATTR_COMM(_name, _id, _data) \ + (&((struct imx9_pmu_events_attr[]) { \ { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ - .id = _id, } \ + .id = _id, \ + .devtype_data = _data, } \ })[0].attr.attr) +#define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, NULL) + +#define IMX93_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx93_devtype_data) + static struct attribute *ddr_perf_events_attrs[] = { /* counter0 cycles event */ IMX9_DDR_PMU_EVENT_ATTR(cycles, 0), @@ -185,7 +203,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, ID(2, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* imx93 specific*/ /* counter3 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), @@ -197,7 +215,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, ID(3, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* imx93 specific*/ /* counter4 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), @@ -209,7 +227,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, ID(4, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* imx93 specific*/ /* counter5 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), @@ -244,9 +262,29 @@ static struct attribute *ddr_perf_events_attrs[] = { NULL, }; +static umode_t +ddr_perf_events_attrs_is_visible(struct kobject *kobj, + struct attribute *attr, int unused) +{ + struct pmu *pmu = dev_get_drvdata(kobj_to_dev(kobj)); + struct ddr_pmu *ddr_pmu = to_ddr_pmu(pmu); + struct imx9_pmu_events_attr *eattr; + + eattr = container_of(attr, typeof(*eattr), attr.attr); + + if (!eattr->devtype_data) + return attr->mode; + + if (eattr->devtype_data != ddr_pmu->devtype_data) + return 0; + + return attr->mode; +} + static const struct attribute_group ddr_perf_events_attr_group = { .name = "events", .attrs = ddr_perf_events_attrs, + .is_visible = ddr_perf_events_attrs_is_visible, }; PMU_FORMAT_ATTR(event, "config:0-7"); @@ -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 Mon Apr 15 02:03:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 24A3FC001CC for ; Mon, 15 Apr 2024 02:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SnpxLm0xLXAGo+NRkEsVjDPHWiuonhII9XCIIg2lXkg=; b=bnO5Z92MUlF/bu mr1R6gRe/oZdcACKmUJ+nEZY6OThdVrbblty9tklPzCp9ap1J1TfQyj3j3aLqoWcVs+ixoxWdNVBU edjdz0jPIxmmnQ/xjwZGug7Fu3aAhFTRz7DQMGSfF38sCnp+mToAuSiR58hXh2u+D2CJeTGWl8A+Z g62DnyX4g68xpc89bP5DDp/yTCwi95t/pKEXSVyikS0WqmmFvpvzTt5jBPKuq46w1nM05XOjwZbN5 7VPDAJ3EfyX0hy/CphSJReDD31YemQA9OhxTLbn3Qkx3xNbqA/8nNAECDAJ0LrREcOCxEo1liLrIr +30KJFkg/J1AydUQyUuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhT-00000006jfQ-0ppJ; Mon, 15 Apr 2024 02:04:03 +0000 Received: from mail-am7eur03on20600.outbound.protection.outlook.com ([2a01:111:f403:260e::600] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhH-00000006jTq-2677 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:03:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWY/WkBUDKpVDPohFWhlB8Ku4h8muccIUPLYWjn5ZJY2C8JvJDTJvr1y92YKR+XGGCscvYI6NT1PnDDXBQ0nw0y6cIB5EhTCSoCiLXoUu55NI/5/EU9hM7sSZE7/DDp9bO8OkZ+gpti/N7h8bGQ+4U4cnGTfFuKqv+IHrj+1yR6f1r0r1AxSsH2Ysm9yENKZ3pAhI2MXihy/XEpdjJYJ1yiBds4j29j158D+rShwk6cWOKTG5mhLh+a6AK4xtVoMxMtfjzMyPyP6DgCCkmFnVdHtIH2Yokqm+Q4V9GPk8c7qVgJKwpFI5LNn2kLtRKQVsSTPR4X7719wN2hExDwNqw== 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=7LQjDYvdW8tQc+jXTDbv8bKHhC/ea4zn9nLCLe+HWKw=; b=lcoloV1rLSAzC9CKdNCXDsN7Ibs047DN8d6izLos7PpgkSA8FYEPt6iAA+La2C0ThRhadVSD2E2tbhZbL+hv2olzafSsOXJiBaYRuanooNuQhoMQB1rlTefiwK5yEqCzVCf2RJzgwevLdVXW7sU7bs+4BxRTsQMWpN1Ytx9O7srY2ZWujxuRwhETpjnGtZMGyeYGYS2ElxSdqdkxM+MExh6jHxx/hcdIiyXRrl8jC8kO1iS0saKH7IMSEy2LdnrMMT9HIsJa5sZlzdtmRv2VqQyg0qbumnmyi6I0yLssahWDtsxdPibfxcPYgsG60wxFdh3h/xOKgfmPikv3LUsPeg== 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=7LQjDYvdW8tQc+jXTDbv8bKHhC/ea4zn9nLCLe+HWKw=; b=NsbM2cPiryFVAp+UliP1hJNke0S0YwSNauS5rzuyxEjETqouwNQ90AxYVqFmMCymK5QrKj9Xz0orfOYOOj207TEpDSKZFHP1vk2unWqDNh9mHiNQqG+1+S0a1yCZ9R1T7RFFIKFSnrdqgZcOiTs8aymfFAGoYNHGV9/Rc0HMqTM= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:48 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:03:48 +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 v9 5/8] perf: imx_perf: fix counter start and config sequence Date: Mon, 15 Apr 2024 10:03:50 +0800 Message-Id: <20240415020353.3833367-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 5524b646-2fb5-4ba0-362e-08dc5cf04a1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LxXvVv6zrJEJ7d1HzU+OGRK8SCj+gKOtFyDbuXx1NHkWdcyAPOkWLj5SknXIDPulBY8NaJWClQyLp5ZXVaIxbfXce68w6PuF6LsXLPD3/BF/7yBlqnj4Ct/QQ2uwHSFSY3vIuNuWeGK7ExpJbYuVZJGrHdXfUsgTQRjJCam56iCL7qbhzk1IiPtYvmkqXPpgfthqSB1sqJ95WekB4H/vvpsdLOEkQukZer336TE9mGh0S7nNyd4Of/Sod74YNYeVyWoCUIR3D6KGXfyPy0Or1PcCSd367e253hPM/Rc7gjxjsHWGZZ0HaLKJr9ODtvJWQy4E4QVfPE+NE8QCXSSuYoZ539remhvcp2x1KEAJ2RrpLG9RPI7zEwNZEJJ7iXwnXG3kGiy2703sgCYB7AtI2BUiT4/BC94IuIv+mHrnXQEc5VoQkvnF+wZRG2kmHsMdZnnOX/1VM9x4ejMS+ONKiQ3SuRatERm0G4jP+4Dis8n4JPN4oWTHslRg62Olzb9h9IggDOULq67ryDFw7LudnSAKwytsjR/8Q7eUShSLfBZsXO5WJOCFpUJDk9y2r+7JVP9K3eauwBJbpyeRo1Se7fOG+iveg8EEryJgZy0Pap3X36xlEBBgReBfknIb/4MS+OQpToNXU9EvNRrlZU0a9TZfsiMsiClVCgu5Y3bFZ6zM9lY+KJMRO5SV1l8NGXfZ4m0HdDbOM9MvyGvNL9h20Nj0SddL9y8qvzBJNoVU/m4= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DnXQ3rt0ZOQye9Sq2TyC2EnU0yhN4+GkDmdNgU7NVtQIjeg/jwf4rK/ITHCLbKka9IKQmBJCeJ8CQiPe6EjjyFtjn5/LNeNLnELEKKCBZeJjMH6jC8iA5jpDJHJVl2uzt15aY7U8+8BugSny3dObb7ptfwKYjqj8mQIKQMoje5aFnJh8zR/QWqZVGKPkG3+hpsUrYyd9mrgGUIguoQVr+c/Qu4FeVGgwstwUvgogRn1ER3KMrDgV2BPoNFH/nNW9Ag3KYi0e5o8ssLnDDGG5ugZgNazz9c8b/mLh5cywhBz2BlEZUCpllldwOoJuMH+K4qcskxdPFYsDoxgCz3efdYKmJ4imwgdklLw/FL/gxNYa0Fxz0wPQwkattMzq6IS4HkoAeVZdBKqXWpPwBdG1OiV/yxQzy5lm3AVIaayGkLodyi1H1P2+z8BEUS0+ZkSSeyFoX5XODNAaH4hay6tRzey4q2uUHVOD480ic13HlQS7NLMoInL0RIzFmzXRSPgT/yFJ//NuTbA6OhONqZob+vPkHYdq1eOKxMc5OjS1i5rm4Pf89fpK9kYVl+aNGsOOEKFlMuHb6W0Ak1sbKXe4ZLpr+U4m0HRHiz3Qy5uyCuV/QJtyXaWwsxKy0Hj3RM614JLLZ/vZgG/NnWJPHdGdKcME7lltizpBLfSQZYvncucxRoae04CvEPls5vJoUDfBUrh7jS0jem1mSwK9ayHTP5+XgS/vFsUwvHRgiqYQqfMHzsNGcb0mWuULflWSowaztDQjG1rZQuXacfHXdS0FKEWp075vn52UErStRxkmIb18t5H+RNLNVmbVjbzOZfzusSPh7C2XsxIfG9imhgcnKJdpMJTM9MiI+GgIPqfJhdzy0TzkPeSMKaMkofvgGzCZigwOcRRxd2tgHUfAY7s8UwMT7OeDCULRkfrKXiynCmZnrxEtz+NpsQvtUheN9KsACC9sIePQhPR64MNQk1cSLffTkYfSrIQtv0JEn41VR+bGQq/ym+d6YSM6z8ijySLFEg4i/5AYMwmr1SBtzgWsxEEluLqgEyZV404kd37t7bN3YuMDi7CuqMrSpsg8YgHM0CVOwetPQbpcF+Ie9z7Om2ROZ1BQdFdLji1EZAg6F2xqhwZebaNTGoVJsk9Bju60HjvmfSyRjyztYGGqsz35hHQAmmpo918pJXPf6AytiP/bOGERQeVa1tsNyYXDs7wlQLHHfEoo08N14ZgTVdYKRMGzhr+SyZtJyr6cmy8blqwavmbhmZKPAtItmNOz4BdHA9k+Bwwpu7IxFjIctjk1C0O1s/JncxyCSccvL95H5NaQ959aAplXUe6O1bRmPd23RSMqTiXBOYoWsbyhfBxckdTYbZhUpOqoXJfNtnUQyA3Xoeo8JVqRO6Uz1pIEaMCUaz6YF9xVLTSJzQBRJkT361yE6fNZM5wYGqdfS4hUZKIoslckkLTBM0SVVrPCx7qr1fPB4wSFM4SB/bULwEsPSbKyGvcI3U3zNEK/mieMOAjP5TKeXeZ+Dr8c2VDJaM7bgGBYl96ywH+QCb9Z7I6IOGtTxK4U9SUpWKaVvkqJaj+A+AHREmqcok71PM9DmRGj X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5524b646-2fb5-4ba0-362e-08dc5cf04a1f X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:48.8327 (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: qv2BbXaKwrZABlYPQdvduDxbrI8zD7Rbc2VniR1vyQUnxEng4M+H4zx6sOsdfvxWqzsr97+4T8H8POWgARj4jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190351_632995_85AA0800 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 1510502862fe..910fda7eb2c6 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 Mon Apr 15 02: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: 13629384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43FCFC4345F for ; Mon, 15 Apr 2024 02:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vtoEOobvMXAU7/jNiSF5gcakTidZ4P8d99856upWlqM=; b=We0RxY7U8JSoc7 PzKYrndNk3Z/7g52ZDneX1jDHn/n6y3r6wJsIKeXN+Icp6m4Bemg2ZPRbDFvBUCW/KxDHoZ7LB2Tj NGhcgDZUYT8IHqM3/RBv+00the+2//w/h/NuAe16kg+c4i8YPxYK4t9DlxDF98pWhjnI5t6ZPizgI k44PZU79vPzQEatz0Bbik3DVQNBOkWp9HMyu0d41tmILYiyK63ohoeHCPRPapLvITOO+OVDb/gGIz j8B5afJkQlm7ipcOMx6KXkosqXizBEIPCbI15iVXmGEBXviyyxQA+fx+fCWiii/lSQMQ22SozX4Qj 7OaFHsUeGrb5Zwk7wDyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhc-00000006jln-0sHH; Mon, 15 Apr 2024 02:04:12 +0000 Received: from mail-am7eur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260e::601] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhT-00000006jew-2C1C for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:04:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gByOVL2MetEwng15qYdkmfHL8BvQgL6Fwf9KAj/bXDBlhclbcvIVAqcT3w37dIv0Pu02RgIwBr5BmKHtXN4vt6Iz51Hdzvzs58SaqxVnq3HMUOrC5IHceA5qYcDIIYeqV1NjrlJwQNnt5dsFDTXZz8TKmPNWL0e1+ywLAhq9P1rT+vldvq2DBn/jFy4dxa/Gjge4vBiDtAuO/1G9WOaALeN40h7gYwFN+q4mksLpY2YgOYOfKVkb3SZp7myTDyRjjt2BANJ9H/ua3XKTP2ZY6wysP9GWSpniD3rZxiddA7/UHrOYuZkPsE5hEYh43f2+sJp8DUyziEPQiT31x/x/yw== 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=0eouDKYcVC603PhagIIyqYZwkoFF+vmymnFtqIKfp5w=; b=fsSx1gKWiXpEgMkXNGrMB31gXtTtvn7PrloGkrm2KukMxfLyx2JIMBzKIjkNsBos2ytKqqEBZYwgDIiCAAfJCgc33V0c7PkdiF2+98aXGusSwOLl7FBOHepq9Xg7bK3PVV0v1/JXW+PApanJ5KL59oMPI6fyDOUZlp7lEtJY2sQUENQjhH0VO7edClNzZ5ljyUVrtyurCMBObUPghYROMjkBUSguYEXC91mYv3YtzFYzu1AA9KJ22bvPNvUPBJgePTp6snsSIolTd2Tf4ciGOyE5+X17veFbOVfQFlHlL00t+srcL1w1KMsnCBVYEtQGKXYgsc0iKl61//K/nsVImw== 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=0eouDKYcVC603PhagIIyqYZwkoFF+vmymnFtqIKfp5w=; b=UW2dpk//MFyQOS50OaPFMgkpI0cz9BxeS7cSI+xv/Zy+XZWAKA+M4s/0RpNNm4kWWLF8Ycbqkpqcd2jcUR/6n0JdGDQ14ZGCvGgNpqfwfI2rmdoNDWpMtG2ryl4Z9glwmLxuPig49k94Mpwuh3kqVXDhYJlf2kCiYO3kcTjca8k= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:03:56 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:03:56 +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 v9 6/8] perf: imx_perf: add support for i.MX95 platform Date: Mon, 15 Apr 2024 10:03:51 +0800 Message-Id: <20240415020353.3833367-6-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: f8be5d70-db14-4be7-d65e-08dc5cf04e61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R0VI/4XeV1NC/3dnSMcHcSm90YVrBB7iC8b2Ox4pNZOf3RlVK+6nYdw2uk2TXqtfhjTFBr+/VlnY7uf0Zy5qqOH/VXlChAD6UhSPdJyvN0sJHUsNOVAcSt/dEFcpHyAMo85+rTR5szs1nISu/QB1zmC754w+R7kWBUyDEP90Zf8GMhU6A22lNWcrMwOE9hwWYyWcExdqOXR4UenYtTYeLmYEnyQ63+fYHcgFKdVUa7KxAEft4UFkZCS1pW3BaNM2p0beWckJAcM7AUy59nFtkN1Px7PI/YZpYPCFvVPK8gt//gdt2rvQeENRm4udDL8AQ4IPKaxN9yf87mMFhdh519oE83npTcrBd8TO8Jm1RAWiHJbCpTfMNTTbog4GHtAGn+vgw6kmGPWtDMkPvzvYr3S5mRXmHIDF1O3xMQR4mZODm3DL++wCU78f7YdgJljQHGYBSV+KKJ5OsFigy6pJrWWMbXhp9Ngaq7shCS6EA9JCjKQqG83mWdBNcc3XGq3tPkcXZcLJYwY+HU3A3q1qMP6VTdAza4OTO/tcOnpvuaYG/kuYGjmVMBIyIxU14bzyqoufuhI+VmiAJEQPz8ivFetV/Pnx1O3lq9/63oF8yLp3J0yEj+eDcnwftiAvzGdH5hRFZRMIv5K5729a0Oc8j1q0qUOeUtrmYM7G7RXn0A2j9ybT8GnHZ5vyBeHSf6H/JGzhgKS4lsAUux5IvDCzPrjpM6z0zi0i/kFPDUtwg/A= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c9Qcrrw+sKLFV/QiisoSCVaozuvbrIDxqm6fTAt6MJvHQ+x8tySxkRVu6992ZMPUhY7oMnT9uJzMEuLFNQ5y5YEKM1M1qUgCe2vZtD31VUbtTWY6rJbI7IbENJI6bSPuxQQPtCMHhwkbokb/Dn53xki1xsa/RpIoaR4L9tJXu6ija6RyuYOd+ixNIq6+XaYSUmFXJPs+7asZaphZy2MAQxzcI3+fcRkCkToKtYxIOCVXMEoijKVz6mx1cB7hVm5BYfs5uT6dsqn1s367q8/hWpvY0H577LDfANTJ/HCjrYJ8SydtVJQguM4g/G0a8IHNWVMP3VvwhjCCHq9m6/HBSHpaQmJ7rwILMa9a5Vlv4NCw2czcqFYr4IFQ5DlklpNkMUb1zufzPvoHhYyjfSnSl+9q59wI019+pcaar8IoFPmhO3BKI3yL2uTtRYiyTEwlbG58LVIjlFs91CfZqwqlpPWdg5EiNUzsEXStzwOptrJrwMhONByN5ksXqemx/VMovJLbUdw3qKlAHbmesoFoZvwg9rxQ3oRRovkTpb9Tm8wk4pKxCb4dngAd60p1PziqvQ0ivcQL/GEu4fSiajVAStMv0XkDGcjx7t+bws5Ya8vb0CHSKdqu67RYx7gmhtTjcG6fruIzj+vyZHleFOKSylR2qO34BGdd+ZcJMOjs9lV5dA73Ga2y34iyN+FE6BiBKp3H1EQRiDZoFz4wnkvwQRzOwkBdsTOE57DP/bWlsRV3QkXVxzQ2SggnObPykPrYrIVD9CR2BpAlTLv8xroqb0kGSaivzUo0uqbD4eLOL7G3aywLGKHAedZ+CLvtuSKRTLBoOjBVXEDcJAThCWxkzh2PFgbj+g4X9oddIhUcAJ0hG6Ekzk+yvgsVzSL7xM2FvokbrmEUQ/SLbhBfQY3jSENPctEKYwbfPhyFIU3ZR8fcfRFNVvv/LaWyNaudJ4TONo4DOm/wFzI+inOSgJ6Aji07b004clOPJgbgnaQ9yqqq5JxlAx91Hayqghj75NZCkxwR0jADk0Qv9NukcsvmZzTnat8M57U2YNSgFmphKlzCfB30dCrJD5dhP/9gvZdebqa4bOr5Dyk28jDVaNSyuomFwb7ccusNOAm8xzNGWp8wL4/JhAD56+17YBIaGsaH8l+CA2+CKwbwsVD+rarswEBmGQedDkLXYrPR1YXFmh7MQaGzrx570Q0UTo7orYxsyrW+mLH5+WjhOdYIW4c1Dcun3F6eq4GFLu6wHKPcxdT7XnR+pEKEIwXVqqToTwkzygyCpUd9mxvx/UqZ3wEJ1EqYgjesljCVjhZKK9ZwanukORH9N0+cBFfB5hg1x4NCL4Jf0PR/egcq5kjYie65MYIySMn/OfP7VcX6rnA7BWhc1zsb06pkyzubCcFk/y3IWndP/UPJTqQSUqBWsxmmisXDrE5fXuV/zPBbHLv/kQNhMQ0JTRa9MWN2DzxpB047HsCRVved+E+koNxlKV8UPbTmP3Y6AXNESEOvDlgAccK7tCxbX+sURiVwBUHB/1JHaZoZ5Nwta6XRHpNJGfDCAVpDUBG9d4iZXtzOH3W4I2eqmB4m5VTROoweBgsrrCIQ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8be5d70-db14-4be7-d65e-08dc5cf04e61 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:03:55.9456 (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: MhIvayDUHmFFudbtas2xnG41ULFz+wvONrirJfdqwE/SJGW7yfFusrjsHTjrRMbcrdVIMHkV12aD9ehFLbVx7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190403_946336_530B344F X-CRM114-Status: GOOD ( 19.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org i.MX95 has a DDR PMU which is almostly same as i.MX93, it now supports read beat and write beat filter capabilities. This will add support for i.MX95 and enhance the driver to support specific filter handling for it. Usage: For read beat: ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt2,axi_mask=ID_MASK,axi_id=ID/ ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt1,axi_mask=ID_MASK,axi_id=ID/ ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt0,axi_mask=ID_MASK,axi_id=ID/ eg: For edma2: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt0,axi_mask=0x00f,axi_id=0x00c/ For write beat: ~# perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_beat_filt,axi_mask=ID_MASK,axi_id=ID/ eg: For edma2: perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_beat_filt,axi_mask=0x00f,axi_id=0x00c/ Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v2: - put soc spefific axi filter events to drvdata according to franks suggestions. - adjust pmcfg axi_id and axi_mask config Changes in v3: - no changes Changes in v4: - only contain imx95 parts Changes in v5: - improve imx95_ddr_perf_monitor_config() - use write_relaxed to pair read_relaxed Changes in v6: - no changes Changes in v7: - no changes Changes in v8: - add definition IMX95_DDR_PMU_EVENT_ATTR Changes in v9: - add Rb tag --- 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 910fda7eb2c6..30c2a3aeed2d 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -17,9 +17,19 @@ #define MX93_PMCFG1_RD_BT_FILT_EN BIT(29) #define MX93_PMCFG1_ID_MASK GENMASK(17, 0) +#define MX95_PMCFG1_WR_BEAT_FILT_EN BIT(31) +#define MX95_PMCFG1_RD_BEAT_FILT_EN BIT(30) + #define PMCFG2 0x04 #define MX93_PMCFG2_ID GENMASK(17, 0) +#define PMCFG3 0x08 +#define PMCFG4 0x0C +#define PMCFG5 0x10 +#define PMCFG6 0x14 +#define MX95_PMCFG_ID_MASK GENMASK(9, 0) +#define MX95_PMCFG_ID GENMASK(25, 16) + /* Global control register affects all counters and takes priority over local control registers */ #define PMGC0 0x40 /* Global control register bits */ @@ -76,13 +86,23 @@ static const struct imx_ddr_devtype_data imx93_devtype_data = { .identifier = "imx93", }; +static const struct imx_ddr_devtype_data imx95_devtype_data = { + .identifier = "imx95", +}; + static inline bool is_imx93(struct ddr_pmu *pmu) { return pmu->devtype_data == &imx93_devtype_data; } +static inline bool is_imx95(struct ddr_pmu *pmu) +{ + return pmu->devtype_data == &imx95_devtype_data; +} + static const struct of_device_id imx_ddr_pmu_dt_ids[] = { - {.compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data}, + { .compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data }, + { .compatible = "fsl,imx95-ddr-pmu", .data = &imx95_devtype_data }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, imx_ddr_pmu_dt_ids); @@ -158,6 +178,9 @@ static ssize_t ddr_pmu_event_show(struct device *dev, #define IMX93_DDR_PMU_EVENT_ATTR(_name, _id) \ DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx93_devtype_data) +#define IMX95_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx95_devtype_data) + static struct attribute *ddr_perf_events_attrs[] = { /* counter0 cycles event */ IMX9_DDR_PMU_EVENT_ATTR(cycles, 0), @@ -204,6 +227,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* imx93 specific*/ + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_beat_filt, ID(2, 73)), /* imx95 specific*/ /* counter3 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), @@ -216,6 +240,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* imx93 specific*/ + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt2, ID(3, 73)), /* imx95 specific*/ /* counter4 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), @@ -228,6 +253,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* imx93 specific*/ + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt1, ID(4, 73)), /* imx95 specific*/ /* counter5 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), @@ -239,6 +265,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, ID(5, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, ID(5, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, ID(5, 72)), + IMX95_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt0, ID(5, 73)), /* imx95 specific*/ /* counter6 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, ID(6, 64)), @@ -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 Mon Apr 15 02: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: 13629385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AD5AC001CC for ; Mon, 15 Apr 2024 02:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w5VcUsLq9dztSJhSv3yYlgSsm+8nK4OfQEWN5ylUNEs=; b=0jnTL56+xz46kC kN2rVasKe3DLvdzkcSqjVUw64Tvy9CR0gIDgVhj9klh4iWR7ZNLJrH0xCqMNw3DdPwiu2hEtlB2aK K99+8rVRbK7ygUMrckB0UTznG6/LnmuIPvt81Js+QL4joX4qf2l8QN3zAU9ieeT9r+vTA5irGfUqv j0TfTJs/KCA6kRhlCWKA7mZ9acR8kUx1yS1pUSroCBuPxKlS6pMmDFtzsHI64tBMvbPb1fL1r6FMH Thfu6EPx5mQfZP4iD7kNlhqqzdiAkMfQmcQJoiac6OgZ+BxM8MBHJB8KRYeoolhJ30wFOOUDI3FXS jirE5cMxvXZGJXHHYbFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBho-00000006jt5-2gCV; Mon, 15 Apr 2024 02:04:24 +0000 Received: from mail-am7eur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260e::601] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhb-00000006jjJ-0JYt for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:04:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oM2D3HF4cI62umaLEJ68aVt3YDO3Tvz8VnP5xc761Ze87lCxpgaRsxCfine9GV0GK4PfSGKIFdewbCEyP7SwkCuMu8vZrL52NBkHvRRql18240PBaoXmjEBPrMShBgHsj0+1raIXlLWDG66CvtWMkL8yWqKiyALh8WvZJfaSy3l3qqnPRq0GivhRp9AXpLSgpxHC/bBKK3QVAOZ7+YB9i2vHY/vH9IzPZgCP0GHI/85ascRB//aHhpplAJbyCWIqD/wpYitS1kaJza7qAGJWQ1ggslVx5LdcMw85c4KRCvmlg8HiQTxXKuxkl7uX/amqiQF/BO0QI/rjG0LyKlqGRQ== 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=7l5MBoWHv6mjulWtQZCccsoh2jkgih+tW9a9SCxD+/A=; b=dsczN53It1ug48LjZ3YhmgRuZm+jY/T+Zi8uyeiLoIv/Pp865sRiOY+mr0LnDYRObluLaPRiwgHt4iwjZ3k1qtrc++11LTD2bPdhSceIfenMStCv3pCG+TzxugRs+ZPeZjeLBe1PRoimz7PADtXEPeOtcgxSFytzrITLeLRNbHH/GWcTV57qsq6aRNOoZ/FkSnrUlwvNPY7b2S6jaGAZYuB0+avyz/jgLa46oDfJ1qp+P0Ozbva6EGfBV4n0dY5lawwW61AXmc5KZRN24h55wnuVx239mQlCMvjjRqiRXhsjC5goixnyDeRNVBajqcn/xxt7BXygNtFZpSXA2lLx3A== 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=7l5MBoWHv6mjulWtQZCccsoh2jkgih+tW9a9SCxD+/A=; b=Y9v/F9q8A0nZoxb+8Csb1r8o8KTgR29XfPJnoCcwol/6e6GXYeCuSY7fe21/VzVyvg2DaA9szyPgsUXOYebOi4Seuml5umVpHbKh+qz8swW7Ylo911XU5ZKZxmU0RPlJMX54aqAzThIJyz9Jz1Y/PNqTv+OMh2prWRtCUmHdG1k= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:04:03 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:04: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 v9 7/8] perf vendor events arm64:: Add i.MX95 DDR Performance Monitor metrics Date: Mon, 15 Apr 2024 10:03:52 +0800 Message-Id: <20240415020353.3833367-7-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d1cc174-9b76-418e-296f-08dc5cf0529b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i/LeJ22ODh3sUtiONZRUIKOpXuCq2LMKSxj7YfN228s4Nroypyjsy7Jio6mntExciNNHXqeLJ5+hb9NRo4OWrA4CAO8L7OlA0SS15t7MxMfHtVpME6Y2c6Ce2nykf2hDcZ9TulcdzvNqOnsR0wSGs0sIoQu4ihCKJwf5cg84kpCzm/BKkceF3IqovLci0R8i1CPT1Pfwk7xQGekCDFLY/2Y88OLiT63qxnFORMWKu4kmJvMzI3sRu7apaGQ26t4eSpr89feeMligODjTRqxJ1b2EgxUQTzCMNca7Ab3SKQz118z48zmFA47QNv+wVg5FGeH4WmZTBsC5YEHX9aQkdlPlSC3CaTk1DYQYV4q5jxgR5fy//ax0+cS6w2jmhN1qCM30Ipf0RFzL3W3j91Ph7NEiZh2cM96V87X1ZkAElPGih9ZYeC3EkubJN20c9trfgtJ0upP6/oLkdmMCSPa1RWVemHZWOgA1Ze1t80GDcUdlG1S6Pd+aoOe5F4WReZf/X2GOsRdiRQDhkFRHlOA7eka14P1zpR4clBO2PgV/XmsSZZbHCKJPcoqCr6DSEq7ul/+FZPNgFF9tS3BQB0HYL/vJNJ3KqT4kZU6xFU9tedOrarqfsBJRmfxtuKBGkP+T9cFlJJ3y/3tvYBRPVXKC23YdOQBJHBdriHGaczldq3lZYIrwpfGYd6oC6d/eS6+1Oq6ziyB6XCKa9WBkPgBb30yQ6gi9b71/bsQhcKruIAM= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4miGsP8yr/b2kxP4K/yXBfa0n+pRjZhTALvNk+fbJC0iRqkYxBBn+GIXoLI/fRcxsuSvKDCJyOsNoOnDgbtWqVl88YxmpCt7eGyzug9pHqlcZ3CZQXpPcyyIOs0PRaNqPM+DD3bNZ1eJ7irKpUQp8ucIzzUiESyvCavFwqOs5k3zMEhsGbUCnLBfi/qh3WB1OsfC9L7ekXQtgKbBBF+PApGMPftPEgD0DLxP2knYbWknNFEVRom6ibckSyAtqufsCtONRntJOXafuicO+QDwP9H/M3dU4SP6DvjDIv+HsKQ5TsevfWL/CTZc+nCnID+ogFU5hjTYp6JqP6+SZnMNho/mZS+foST2yS/v6Z/SArBfibkxn2xXpv/nCldNU9Gr9OO6HX5jWmXIUdQUaEmqEdVxR7nHCOaIPMnYdkcXqaBK0gdenSdJx1P+7+vRbiLp6p6eDgyAyxTQTDmN+W4sJ9JSh7te5w9V0HZyC6KRleUMZi/kcE4YHy0rbkTZjH160Gsf+XV9/FviyEbqvQULx/t4SslbaIedebZrMvgbt2VYIS1o3O9PoR3SDeG1u8IVBIy3pE6RhrwyzYbDSdzkl5Oz0X3Z3KAsHvvcE8XKFLf/4k/SRsIAIDIyU/rBb2uR/GTfpZyGGsxIhP0R25ttPCeWU+TNG64YIJh9JXJ9XbZdV4aXUXzyscIpJyzgNaUJ+7iOr4lmwbzdvv5PZvaEpx+L10EX/4LOAcguZl6xNlLqCp3ppuk3d0ASfLTrNbYRednqRjJUzYt3540NVEdiKofpNhc98tJY400yBCg9eEhF2LjttYgaU2CCNT9n9OkkZ7bO289TatQU+kVCXRNWH6xdzChHbaTlSuW5N43aOgLBA9AP8/L9xHBjae3ML2iVAekb2DDfPY14kp92PjtFmP/GWmpW1aFREifsgjZ1rn6/X5eriF5TCQ65PcSCniOtx+EQE2VGMSMrN38rWSh68H47PhbwO5vtMO6GxkqFPolb5WTT5Vqx1ldd6ge7FqaigckSylt0daETCjRSgeDrSXiV9Gp557wV44CHp2ClxAd6jazX75nVRsllyhqCpPRM2mnxPcEpgHPc2XtAbc4fwUs6GqzLsnezq5xssrtghLlUMbdPO/cOERC5/To0RRoa+vJExbnGiiQxmWuDSoINhRH7la6dVlGMJXJeb3r0aSHcjBsZVhtMQLRav8deIfRlR26KHCvHDLKcB/QQZ94JJDDulnnh8Ju2BWMM8Aht3u6SQGkGGwYtCoNyrnnp4oiymJhHdhFhzs6WbXseR8XBPT7Ul/XQj87BIbYyhzVSzHpAt88r1Sp9eKR3/wyuO6Mpp2ODuT2bbYF5qxQ2u3AFfiKqpeeq5gXPJ00M7O4bJhFZbCUSy0d27bAriy0A/z41W9GYZ5seXfQrukxXRrcwEjlS48J448H0r49DbSte2TUzNUSFF/E4b8kL3KaUAdvFeGDuczhgXwaTU2f/3ymBI9Ne3r/oMs+2/PeebFo29lN33SPiaaTAV/Cow0/K611TuHNEZqId4llIl3Hgre598z11xwxcY60+Hg3HloFj28aufjzIDfw4k60bUq8tTiTC X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d1cc174-9b76-418e-296f-08dc5cf0529b X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:04:03.2082 (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: 18DOQvY3MiDA6hJy7yMjGSx78fPNRBBOFssmSlt5kUcHskEQm/ARI7ZtOFrqYo/nIIgR2hayHd+Oq3q32PGaUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190411_477637_132B3F52 X-CRM114-Status: GOOD ( 13.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add JSON metrics for i.MX95 DDR Performance Monitor. Reviewed-by: John Garry Reviewed-by: Ian Rogers Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v2: - fix wrong AXI_MASK setting - remove unnecessary metrics - add bandwidth_usage, camera_all, disp_all metrics Changes in v3: - no changes Changes in v4: - add Reviewed-by tag Changes in v5: - fix typo Changes in v6: - remove "counter=X" from each metric Changes in v7: - add RB tag Changes in v8: - no changes Changes in v9: - no changes --- .../arch/arm64/freescale/imx95/sys/ddrc.json | 9 + .../arm64/freescale/imx95/sys/metrics.json | 778 ++++++++++++++++++ tools/perf/pmu-events/jevents.py | 1 + 3 files changed, 788 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json new file mode 100644 index 000000000000..4dc9d2968bdc --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/ddrc.json @@ -0,0 +1,9 @@ +[ + { + "BriefDescription": "ddr cycles event", + "EventCode": "0x00", + "EventName": "imx95_ddr.cycles", + "Unit": "imx9_ddr", + "Compat": "imx95" + } +] diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json new file mode 100644 index 000000000000..a3ae787d448c --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx95/sys/metrics.json @@ -0,0 +1,778 @@ +[ + { + "BriefDescription": "bandwidth usage for lpddr5 evk board", + "MetricName": "imx95_bandwidth_usage.lpddr5", + "MetricExpr": "(( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x000\\,axi_id\\=0x000@ + imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32 / duration_time) / (6400 * 1000000 * 4)", + "ScaleUnit": "1e2%", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all masters read from ddr", + "MetricName": "imx95_ddr_read.all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all masters write to ddr", + "MetricName": "imx95_ddr_write.all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x000\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all a55 read from ddr", + "MetricName": "imx95_ddr_read.a55_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3fc\\,axi_id\\=0x000@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3fe\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all a55 write to ddr (part1)", + "MetricName": "imx95_ddr_write.a55_all_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3fc\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all a55 write to ddr (part2)", + "MetricName": "imx95_ddr_write.a55_all_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3fe\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 0 read from ddr", + "MetricName": "imx95_ddr_read.a55_0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3ff\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 0 write to ddr", + "MetricName": "imx95_ddr_write.a55_0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3ff\\,axi_id\\=0x000@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 1 read from ddr", + "MetricName": "imx95_ddr_read.a55_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x00f\\,axi_id\\=0x001@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 1 write to ddr", + "MetricName": "imx95_ddr_write.a55_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x001@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 2 read from ddr", + "MetricName": "imx95_ddr_read.a55_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x00f\\,axi_id\\=0x002@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 2 write to ddr", + "MetricName": "imx95_ddr_write.a55_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x002@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 3 read from ddr", + "MetricName": "imx95_ddr_read.a55_3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x00f\\,axi_id\\=0x003@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 3 write to ddr", + "MetricName": "imx95_ddr_write.a55_3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x003@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 4 read from ddr", + "MetricName": "imx95_ddr_read.a55_4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x00f\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 4 write to ddr", + "MetricName": "imx95_ddr_write.a55_4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x004@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 5 read from ddr", + "MetricName": "imx95_ddr_read.a55_5", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x00f\\,axi_id\\=0x005@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of a55 core 5 write to ddr", + "MetricName": "imx95_ddr_write.a55_5", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x005@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of Cortex-A DSU L3 evicted/ACP transactions read from ddr", + "MetricName": "imx95_ddr_read.cortexa_dsu_l3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x00f\\,axi_id\\=0x007@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of Cortex-A DSU L3 evicted/ACP transactions write to ddr", + "MetricName": "imx95_ddr_write.cortexa_dsu_l3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x007@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m33 read from ddr", + "MetricName": "imx95_ddr_read.m33", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x00f\\,axi_id\\=0x008@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m33 write to ddr", + "MetricName": "imx95_ddr_write.m33", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x008@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m7 read from ddr", + "MetricName": "imx95_ddr_read.m7", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x00f\\,axi_id\\=0x009@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of m7 write to ddr", + "MetricName": "imx95_ddr_write.m7", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x009@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of sentinel read from ddr", + "MetricName": "imx95_ddr_read.sentinel", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x00f\\,axi_id\\=0x00a@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of sentinel write to ddr", + "MetricName": "imx95_ddr_write.sentinel", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x00a@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma1 read from ddr", + "MetricName": "imx95_ddr_read.edma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x00f\\,axi_id\\=0x00b@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma1 write to ddr", + "MetricName": "imx95_ddr_write.edma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x00b@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma2 read from ddr", + "MetricName": "imx95_ddr_read.edma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x00f\\,axi_id\\=0x00c@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of edma2 write to ddr", + "MetricName": "imx95_ddr_write.edma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x00c@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of netc read from ddr", + "MetricName": "imx95_ddr_read.netc", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x00f\\,axi_id\\=0x00d@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of netc write to ddr", + "MetricName": "imx95_ddr_write.netc", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x00d@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of npu read from ddr", + "MetricName": "imx95_ddr_read.npu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x010@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of npu write to ddr", + "MetricName": "imx95_ddr_write.npu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x010@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of gpu read from ddr", + "MetricName": "imx95_ddr_read.gpu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x020@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of gpu write to ddr", + "MetricName": "imx95_ddr_write.gpu", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x020@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc1 read from ddr", + "MetricName": "imx95_ddr_read.usdhc1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x0b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc1 write to ddr", + "MetricName": "imx95_ddr_write.usdhc1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x0b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc2 read from ddr", + "MetricName": "imx95_ddr_read.usdhc2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x0c0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc2 write to ddr", + "MetricName": "imx95_ddr_write.usdhc2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x0c0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc3 read from ddr", + "MetricName": "imx95_ddr_read.usdhc3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x0d0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usdhc3 write to ddr", + "MetricName": "imx95_ddr_write.usdhc3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x0d0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of xspi read from ddr", + "MetricName": "imx95_ddr_read.xspi", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x0f0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of xspi write to ddr", + "MetricName": "imx95_ddr_write.xspi", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x0f0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie1 read from ddr", + "MetricName": "imx95_ddr_read.pcie1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x100@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie1 write to ddr", + "MetricName": "imx95_ddr_write.pcie1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x100@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie2 read from ddr", + "MetricName": "imx95_ddr_read.pcie2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x00f\\,axi_id\\=0x006@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie2 write to ddr", + "MetricName": "imx95_ddr_write.pcie2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x00f\\,axi_id\\=0x006@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie3 read from ddr", + "MetricName": "imx95_ddr_read.pcie3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x120@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie3 write to ddr", + "MetricName": "imx95_ddr_write.pcie3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x120@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie4 read from ddr", + "MetricName": "imx95_ddr_read.pcie4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x130@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of pcie4 write to ddr", + "MetricName": "imx95_ddr_write.pcie4", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x130@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb1 read from ddr", + "MetricName": "imx95_ddr_read.usb1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x140@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb1 write to ddr", + "MetricName": "imx95_ddr_write.usb1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x140@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb2 read from ddr", + "MetricName": "imx95_ddr_read.usb2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x150@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of usb2 write to ddr", + "MetricName": "imx95_ddr_write.usb2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x150@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec primary bus read from ddr", + "MetricName": "imx95_ddr_read.vpu_primy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec primary bus write to ddr", + "MetricName": "imx95_ddr_write.vpu_primy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec secondary bus read from ddr", + "MetricName": "imx95_ddr_read.vpu_secndy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x190@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of vpu codec secondary bus write to ddr", + "MetricName": "imx95_ddr_write.vpu_secndy", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x190@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg decoder read from ddr", + "MetricName": "imx95_ddr_read.jpeg_dec", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x1a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg decoder write to ddr", + "MetricName": "imx95_ddr_write.jpeg_dec", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x1a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg encoder read from ddr", + "MetricName": "imx95_ddr_read.jpeg_dec", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x1b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of jpeg encoder write to ddr", + "MetricName": "imx95_ddr_write.jpeg_enc", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x1b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all vpu submodules read from ddr", + "MetricName": "imx95_ddr_read.vpu_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x380\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all vpu submodules write to ddr", + "MetricName": "imx95_ddr_write.vpu_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x380\\,axi_id\\=0x180@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of cortex m0+ read from ddr", + "MetricName": "imx95_ddr_read.m0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x200@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of cortex m0+ write to ddr", + "MetricName": "imx95_ddr_write.m0", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x200@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of camera edma read from ddr", + "MetricName": "imx95_ddr_read.camera_edma", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x210@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of camera edma write to ddr", + "MetricName": "imx95_ddr_write.camera_edma", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x210@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi rd read from ddr", + "MetricName": "imx95_ddr_read.isi_rd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x220@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi rd write to ddr", + "MetricName": "imx95_ddr_write.isi_rd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x220@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr y read from ddr", + "MetricName": "imx95_ddr_read.isi_wr_y", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x230@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr y write to ddr", + "MetricName": "imx95_ddr_write.isi_wr_y", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x230@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr u read from ddr", + "MetricName": "imx95_ddr_read.isi_wr_u", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x240@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr u write to ddr", + "MetricName": "imx95_ddr_write.isi_wr_u", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x240@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr v read from ddr", + "MetricName": "imx95_ddr_read.isi_wr_v", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x250@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isi wr v write to ddr", + "MetricName": "imx95_ddr_write.isi_wr_v", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x250@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma1 read from ddr", + "MetricName": "imx95_ddr_read.isp_in_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x260@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma1 write to ddr", + "MetricName": "imx95_ddr_write.isp_in_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x260@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma2 read from ddr", + "MetricName": "imx95_ddr_read.isp_in_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x270@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp input dma2 write to ddr", + "MetricName": "imx95_ddr_write.isp_in_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x270@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma1 read from ddr", + "MetricName": "imx95_ddr_read.isp_out_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma1 write to ddr", + "MetricName": "imx95_ddr_write.isp_out_dma1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma2 read from ddr", + "MetricName": "imx95_ddr_read.isp_out_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of isp output dma2 write to ddr", + "MetricName": "imx95_ddr_write.isp_out_dma2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules read from ddr", + "MetricName": "imx95_ddr_read.camera_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x380\\,axi_id\\=0x200@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ + imx9_ddr0@eddrtq_pm_rd_beat_filt2\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules write to ddr (part1)", + "MetricName": "imx95_ddr_write.camera_all_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x380\\,axi_id\\=0x200@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules write to ddr (part2)", + "MetricName": "imx95_ddr_write.camera_all_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x280@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all camera submodules write to ddr (part3)", + "MetricName": "imx95_ddr_write.camera_all_3", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x290@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display blitter store read from ddr", + "MetricName": "imx95_ddr_read.disp_blit", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x3f0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display blitter write to ddr", + "MetricName": "imx95_ddr_write.disp_blit", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display command sequencer read from ddr", + "MetricName": "imx95_ddr_read.disp_cmd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3f0\\,axi_id\\=0x2b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of display command sequencer write to ddr", + "MetricName": "imx95_ddr_write.disp_cmd", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3f0\\,axi_id\\=0x2b0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all display submodules read from ddr", + "MetricName": "imx95_ddr_read.disp_all", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_rd_beat_filt0\\,axi_mask\\=0x300\\,axi_id\\=0x300@ + imx9_ddr0@eddrtq_pm_rd_beat_filt1\\,axi_mask\\=0x3a0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all display submodules write to ddr (part1)", + "MetricName": "imx95_ddr_write.disp_all_1", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x300\\,axi_id\\=0x300@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + }, + { + "BriefDescription": "bytes of all display submodules write to ddr (part2)", + "MetricName": "imx95_ddr_write.disp_all_2", + "MetricExpr": "( imx9_ddr0@eddrtq_pm_wr_beat_filt\\,axi_mask\\=0x3a0\\,axi_id\\=0x2a0@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx95" + } +] diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index e42efc16723e..ac9b7ca41856 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -284,6 +284,7 @@ class JsonEvent: 'hisi_sccl,hha': 'hisi_sccl,hha', 'hisi_sccl,l3c': 'hisi_sccl,l3c', 'imx8_ddr': 'imx8_ddr', + 'imx9_ddr': 'imx9_ddr', 'L3PMC': 'amd_l3', 'DFPMC': 'amd_df', 'UMCPMC': 'amd_umc', From patchwork Mon Apr 15 02: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: 13629386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A97E0C4345F for ; Mon, 15 Apr 2024 02:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TZPBNHHpeqBpmTYWBChMRIJ3RQqpYtzRcgbCAbGaJkQ=; b=RBS1MsUJjLEGV0 YhtcTP9pCeXUt29uMR3oc90Z4HqS3F7M8Sqx4UK53GwI4pxAzNAOhgqW4GyKrTmVZjm0WOIPko5bB yzYZBnejUMnEasUcCRgdWFcqA43MD/KXTpt+p2aVfsgioVnceGpiS0x/b6Nu1MCZpGSQjrzXdzLfi C80nepn3ctt83G2BQBlRpRs5iLhx6fkA1tTA/AG3uXMSX/u7RtwRb3hSCyPYDUkx1tgyp9bUvgL1g EmXiVSR+kedawDtIk66kRLmMp64Clh6AFSVlSUanvIBx3jy5yL5RL4iKaTJcgxqBg0ffbC67amp+R 0fOjGnJES4EdNsYaUjHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhq-00000006juU-36Ql; Mon, 15 Apr 2024 02:04:26 +0000 Received: from mail-am7eur03on20601.outbound.protection.outlook.com ([2a01:111:f403:260e::601] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwBhj-00000006jjJ-0cE1 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 02:04:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OF/gpYtAGgRSaJqJpjr6kUfq+kEwXM2DlIqQKNCOTa+WQ05HXciyJiWASej6epabX0dUj8GGPTz0eQBmNQ7EeYhCm83uuHsPnm6bLW6/oEDH0SjZLKIKD3YjlaeoSnF4nsV2rkKVFV9Kxz6IiVlPGtZL3j/dQ/tod7QaHVb8VdTjLmBcazj/dlwQo7KkBY4PWDIPpWrBmB4Kk52p4iJcwcfP/kU4vo7zLkt7wrvhPWErZ0uillpbXINZLoiE7fr6Yhz97aESi2sDG+89xFoSvtzHrIYqoMKGYykxjibIz0xOqQkRl2GIMHcjRy5fWfHPac15bDL0n6M12k2ktYK7MQ== 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=OPLf6Nu1UbO2Q+wMwpP+lXWdOxCaeV29SJLd/wLNP7Q=; b=keDaG3+luCG014v5fLkMf2WWjae0nyOgsaPgQFtS33rH+jCRMHbT8EBM9Uz1qRuRufMLUSMjLAQqiOLEbYFgEaCLgBUDuX/8sS6T8i4RVUVirgpntnSSqjbaww808mWdFhQkpIHTcWeEtXfNhLAmjcZowky3raSqI9ZPzNrgtFmbh0lYMLYJCAijDIAvz6H+fyHZrx2T7McSAsAzGjw4ExyTMCb8+XCp0wfZc6ukqJCa5JUkSDcL8J6vuB2B5nIPsWuTqJ179aBxENTpAUXVOJCe2fC5jh8uOk5/YO8zbxvsCMuhvA6navg6XnaiGu37b8QNd1qCC/z+rlOAFXBZtw== 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=OPLf6Nu1UbO2Q+wMwpP+lXWdOxCaeV29SJLd/wLNP7Q=; b=WeZ1cui6L/UbDBC71Ci8L4M+RF6ktYA+ja/ayNwkGIwaPkgZqtwifdKtiMeoV5nT25SdZJHVAW2A9fCbE0qNofB/Vp96HaWY9HwexIsIR93ISaimBk3CrV4MfTt96mknbMf6gLoVq0qI3m57wgATdSFyS1bLQm0Ibozg7FxFIZg= 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 DB9PR04MB9233.eurprd04.prod.outlook.com (2603:10a6:10:361::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 15 Apr 2024 02:04:10 +0000 Received: from DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f]) by DU2PR04MB8822.eurprd04.prod.outlook.com ([fe80::8d2f:ac7e:966a:2f5f%6]) with mapi id 15.20.7452.046; Mon, 15 Apr 2024 02:04:10 +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 v9 8/8] perf vendor events arm64:: Add i.MX93 DDR Performance Monitor metrics Date: Mon, 15 Apr 2024 10:03:53 +0800 Message-Id: <20240415020353.3833367-8-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415020353.3833367-1-xu.yang_2@nxp.com> References: <20240415020353.3833367-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SI2PR02CA0026.apcprd02.prod.outlook.com (2603:1096:4:195::19) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|DB9PR04MB9233:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f1db827-639b-4b49-2f24-08dc5cf056f4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fnHxWxe3weRxr5y0euR9gyUn5yY1f0sCAVZFNWrQ8TiNZPRFpr5LgCFTHvri/07xIo8lL3uw6ZlW0rvDg4vUKKc1crD7DxbO9qXUygtKj9SCRlG/+Zq1k5FL3k2z9cQtJ03nbofUZW3iM37DbWWxBnyrOFKvdbVB87YF262t7kbdehqCbdBqBuNjnjvn6RjaGhoYATW8GBtff9Gy9B2HhWwxOtvQh4vJ4J6khZGCx+eKYDIhBoU3MTei3nkiGITmuVxVS3FjJq4KbQ/tIzlKmGDshJd+qrZ/AoVd1VnyBY5G2uKbF6FIJjAA4dqhr8cBjqlUkG6ODNDa3xeEGQXQYA6PIY6X/ehIVmB4x2U6AV9Dt9DLAJMF8ebWbW1g/xzgTKVAGAhu6NGBRpf+UvpygDQSRgfbjxW8uDnABNO7v6hx0gBBMpnITWT+5XsdGw/pQA7XiSlkbV274xulqy+qEjttiohvf5UFuhO8FRVCJnxu5/GL6azR/e+n4V8ewtItwl0MlVX/1ZuBxjn2+E3KFdRnBqpsZRTyXfJQ+CinrYi/h0GZibQ+bOwS+OOfISImjCF1PYOgeYsLZ3v629kKfBTqjbncl0Dj1h+U2PEzB8p8/4YtpnEunyTLfAzA9ZcY+0I2nOeUbO8OdmMGEapYhS6JJ+BB2AGrdunkWxuIGmv9Ci0s4zMbcGMZk6GPEr6Bj+wu53qYi1NVs0mV9w3Zfs4s0FB8s3DLhpAQsZlck+A= 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)(52116005)(1800799015)(7416005)(366007)(376005)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fqPLuMoNv8DAVZ6IorMvddu0F7X3ZFy9Rs26mDXn8oS4AL02AgTF53PzLHbfkGdn848Wv91BJ3lpzK4QLrmQvSLrUaPpQ5JPz02chd8U0QcNyLjR6Xwc0g64738UkSKPLhQwApkAHW3zJedVzncT2PdmlGnqK8Evq6p2dl6iGc6uuq36YwfnF4ZDsK3woM8+y3iVgzbWKIwQ/MxJDjII5ItIeTyn9+6yPwtPz3tBFz05/H30DQ9SGaPkVmCF1oSXkudBv+yCo7W0ktNC1wZLKSsoUSxvqZr5/98g4x1dXCazSuRtSbGe9BvPlrsWahOHCMSDpJxlq2YxuXjitKoKfI7JFuiKPkrv+6pNWm4jkN52Cl9V9lbiMMazDsi2ozo/+/n6k6lB5uBny/C5dxxE9sM1vmAWG9xogRjcaeArCj4XziAu7G69bX/HsoSrD8JnV4pqMbLsfbxY2aZHEkXjBhddL4dEflgy4541vgn0K7Vz17ySne26asoO1oCRCzoujb8Fg3PH6bw+HhTyNzLJ4Gd0KXPtQHOJ15QRyHSCZO2TmkzG2pq/yBsS4hAZsNH7Brnv/Ml3W49UdVnD+Tru0xLlUmQJ1rbpjtTnBKfke7WPQwuw4z4VAYkpPe2F2KeJ0mITeOJ1AQBesrPHZKGlHPkXTqgs+10ZutvyiRQ6Xc1Dlu2PyKiNeovtVCUWtuMjuU4KDVlmfptajsNYmxtJ5wLuOqKkHt/ZXOibSe7lPRlLRdysO2lA2FpnM1qFAzofY41Vq625Sq8n8AsacDJHZyUQqmxt477e4WCXNEFBXNDhU5r4ge6Kbz9OZFNqX+V/Q1SYR02pIDvrDhtvrWA1wgce4bSwOlSiYAX1wT9J6+LD9FUQl+TrTK42dDMTDehRMCUBQG1pAE5szJC2gbb4kuBmglhldrdpLJpC5z/6A2XgeCM650b+RCAjwJYYWgF/ywqisQE7Do3rL8yxH/4RsnLyjqU7iJjB3DC69xkTf2StssT3oNBRZnDVGzwh9Qk0XEpV90XrNgDou43NIP+rmheq2SWucPe3HldD3vOcFwSVtmTg/pTBdI+c4oEnL2ioJTg9T0Azxgi7Mzjwb6av/l75kc0F8/8/B7lD6iufPGwmuY7Xum2kFwWAEmVr4co5hQhxLUoSHt/Qt7Sxm67luFXxXZOqq0WgDkGtVUc3aFn61Q8QmQ+wWwAXNkr4lr2MRIUJn+kwpp+My5FnsRe3jJ5/Y+nUHgmdVNjesSkcqN6jhPXY0nql+27Ti+5BH7CT4TVkyYSMU2tXBGnE7FexSQPyn6x9jeNtdSEDQhjF1vY0CsaJ1c4E93FpUfa56H/0O5RJtilNeodVTCo7is+6DdasxU7B2u8+Wb9sObU39kmpZLWaIOEv7V+OvZVzkP8844KlS4caTrrNvLCny2Nu/TU5ech/kSvd5mVrintQzkcIuh4xb2BMLfUSra6riXVwWwzvs20qKWZGI0+CBp67dVDimiAgut3EplfKDHG9YgNclDys0V0gTGiyKF/H/JWuQl8G+m9g2Jg08HNaORh2RQCzpSKEa4d3VXDzsCnd3IQb5cqF5TYNGP06fX6Itt7X X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f1db827-639b-4b49-2f24-08dc5cf056f4 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 02:04:10.2157 (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: 7s8HlFyhaltxCCoOPKyUYZVCbb9xnKKISgio2kTtv9JekX2H2vy/w6Udms0S32YKAoi9+KyXGGugxYQGxAH6CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9233 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_190419_227892_0A303AF6 X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- .../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" + } +]