From patchwork Mon Apr 15 06:13:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629440 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 D8FB3C00A94 for ; Mon, 15 Apr 2024 06:13:19 +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=XAufrXS91yfkXwJsMvDX7/WTkLEhQtLIRNuv9TJICz0=; b=caLsQ5dc8ZdjTz a+YaQ5j9xNDg+1ZJXmcXx286rrMXPnfcid9U0GEuROlEhuhKBut4V3wkpVDBlG/kkMzK/DjDI+2Mo 8B5NIgRWNpYTcxNjnwcdsGl16YZ3Y4wFaq3IViKWHttYy/BYZuTTIX/NFZ0AWbuRsPXCZDUqaYGg7 wWmO9o+zEsajEzOcwRTJGLmhxEDDzL+vwGlnSUfHwPqtoZ/VmBv5QM6Bzp0doOTZszGJCMQ2UOapR gXuEPgCzIS28jcvt7n3eRbpSI5l/hIm4okFE8EKne4q5c0m+y5pSaI10nuAt4llSvJAOILsrkDTxt EmNTwRZp/S06+0timN4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFaV-0000000778U-02zM; Mon, 15 Apr 2024 06:13:07 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFaR-0000000774s-3M1X for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IKhWsFZse1Nw7Q0rZrOJz1loTd0VubuIAYgRLtdQmIOq+4D9ybyTYUgVqZtXLga5Nn6w2sc38a2EMfMevn0umnySorwlErh/lordlxGp+cOyWd5POYCVPKylPYAozEaEEYBm+sQOPhkD9uIOu3+zehCwbbpWYpFqCqyyBp9DVbShV8FY0c4Hq77LKsjWe6rrEKKuwvb1upmrd0cv+iCHme2cjbqIIXw4FQjUs76uRl54I/pKA2aYOyKAYRef1lS7g+v0zX7dqfs8k4bp0gXU2mtGDcplzbf7vshEYUr3ngL7F9bjat9+0Z5ZIhfbGBfr2BZdn4IOEweQfkAUq13xcA== 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=U4zqsUVbNUyuD1Uu/jGRWGhWbFLjo/W3QFC3VUWV5AQ=; b=D8po42r5QqKcI80StuQjaNGTEDuFmnFUfBZ19xoY1k6+RLtWraznjTfJ4kKIsCn4ZlrpLuB4Y3Cw3A7q0rvqeEFfO2hhMYoBVMoGbY7NDrU99c/PpmNafTksMsnN6Cib2FZ1Vsha3AV/mksLG6+KecrXHHH7VeiJrLcgzkeLCIVWku6aPDUbztS2VdhwNli+MLaQ1LrP8qP2pIFlHIuuyt8GZmRkj6L3J0n7OhFAqluTmyfKFu8DgbvrtwGzVVgZ+k+HFcFxz7LfI93LkDSOBYtpNfLA2c8r2jfGcYwXkc/9d7jIkk1Fzwh25BLDQezbuj5RNww0lgn0OqxePOL6wg== 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=U4zqsUVbNUyuD1Uu/jGRWGhWbFLjo/W3QFC3VUWV5AQ=; b=Pogd6jBDsqcV5F7a6kSdbPcznORyz1EDAsMHZ1RWMv9eXnI3PvQQE3OtC/IlLtUiiZ94muv+XTvDHWIQyo34iLobs52Xj3gbteC66GiZZd7ChHd97OJIG1F//T5QvxPLYfG8HiITWI20REur8pJ8BrO6uZ20Y/HfT8nZbd55VTE= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:12:45 +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 06:12:45 +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 v10 1/8] dt-bindings: perf: fsl-imx-ddr: Add i.MX95 compatible Date: Mon, 15 Apr 2024 14:13:13 +0800 Message-Id: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: 37fdaf6f-0206-466f-bc66-08dc5d1310ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X1jTtVPTIm+Tk3izL1Rh9samVxstjC5x8BTIr0XQSeLd2m3zH0jvFZc7raMcOX52TVs3G03+jI2vDfpQqFUtEs/M6EYEgqGOAz+3PlXF9kfn6Hdu7tWJZ+FRnWHRSeUXoY7fomKPTVCPtMF08xuVCxt0J2RerrykViIMMY+0bnRPHwym3kyw5/JIZoT1HcMOpo/LeTUA+ywRzW8G1nlmvDZVpF4aRjDszZGn2gasUwdFM70whUKqhEs46mHe4abeRUDlLW+jK1tg+t+AsCzqwS30/KGhbN8ybHH9Mn/WbGxA0mLMMyXNFcoqO5Z9dZyYZ71ALYa11d3BYWASVuwvyoJ32ORKD0mli7tgNaab2MYVWgxXTsLis0yFbVQxYuqinYQzndp+hPuThw0g2HoG8d45BNg6hgk6DyyGCNkBiBFRpbudVyMKbVVlrU/6lrPBkEGTsny73He9Rr1e3bcwxvfHvwOpnwWLGLPCsYFZn7V4aIs4R2Km5llswFOxY/c2Lq7uV5fRzc8T50siL6THKgCVRX1xUMqjSKOegIPeUqwMP3kubhgT0HWYGXGHN/KnkePnFmZu/MbUJqnpeC6dkbRd6Z5lAF2HBFQPcU/FM2ubzWcs04kwrzQfDwwa5aW7I8KcsLsMrPbskU5QUYeXyxYPBW/+kqW0DTnNZcEgrOAXg6TehjGYOh9XrQmNPw155C5MrYoqubTF3wWIT44lZnJZnXJFrSO+lnlvg7D37kE= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A8UElxr1RznmLE2IyqqdOHv91P2kKFlUqVmV1RL6VfJEeVxgHas7CV39fCCSiqmBBCdS72Yr1uM/nhAFA0ItgO36ItzBda6tFp7vPhTavlsEFnai8xfxx8Kk9Ygy8aN3CprrSMwGALVc8qHFVhyIUet0HqZkkJ+0ygkQtA7JyDHR3nkJntjNDO3nHnIKJoLKWiKgLXZ3dQUCqYd8A2VrpASh/T0HYevGdwuGDotzjOIDX3e9YGscjhNmh/6J6IyhsPQ8S4HVp+ccF5oTWax3PXfOYVYCj8EjFgdPaKMlJr4TiPpzsxxSoNGaUWYVsat8IaPpwhIplUagpDQKgfnfNvpt18ZyMIh7M/Lf8WO/RHN6Ushai9vHDAEOYey/HJh8sj4hr3zzttV/LyLyKWBAhZaTiRZb4Wafh5qBLMqkDLUvwW6lOVUZLXThnCH641RAQiiaNUA5cRWnr2IVOS9RS1RRw9/CG6vOKEJwMCabQV8w0PE3aA+pJ2mUAw4Nj5k/dZSlcHzAfphmVAYHjhpa8UYXus7MtdCqnzU+dQVgslb0qarX0DFT4yLNZWbmDwTBJP1D0creJmaWPAv8jEPEycQLyPkn1XLSaeEOLQpKqx9Qoj3+TBhhIPPcAhUWVfwyrJYsAE/Zc3OIzVECKRyfR0TN+ZAtQCnECtBA4TLzRjxF4TJmmD3mkJ2CnGeaVqYUf8l/pnFyJpwD45c89zKdApu7Mrx1JR8BMd0rbiL3gk8GrzC7iiTpImYdw4AIRciKvw1/1UKOeBdq7CxYMJYBNEe3e/+mh4smWAq9YgVVRJ8BP8Egf9s613FP6XDprzw6MFVJtXYCWRmS78VRuEy4ddhih5NN6JWFh2i9cRVylGbK/YgexLL47gcgoPxgrnuB28NyDR4E3oDpshkWm/qJ5pep9HesMmroRjM8GxjQFcCGa5VpU6Wzt3EdoUMhUjwGvMEMpm/eWW5Su428k0OtUI+MuPNKoSa/dwvU7c/+jMpPiiPPbfyt8AEhs6UXcqB8lvgrFN7TN1KVnQnaqMipZEvIbYgi6/x2RUENtwhDpj7ltk0sY1Xcge8ShKv5uKJMXCKKT/eI20p0oP6Dw+8hDKydPO6BhJISRsvbX2JT99AxE0F5a358ZAUdUKZXTiMJ+raJ1Nb/gXEzKEv8cUwI5MX41Z9/WmfSGjLPqU7hTZ18whmvMXpLCaccVl8TnGHgUZ82eBy5q8b4iZ7iC4zZM4oF2yDcbqY/UEYrCd+w9DLWibMX1hnuZZLe2Hx1y4vDCb8D/ubA+EqJlILE64pLQnN3q9u3S7nlNhY1irDjKdvZ+G5dsKiyPy7nS+mGVZ49XvYCO4A1kyyME8nFpm6xYPd+jI/+kK68dJ7uhB+V830HUgfFig5pv0Wwoqp6nRPTfVyTY+Xy5NuZ4cW196+Q8WdjL1TG1Jw0+B8D6oNc1nQL4Jm9FHqa3Egys8kfnu0Ez/X492nHlhKUqyEBE9czLR/X/VK9JnOQLIJ4afeoKrsZRrdBRUyUxlYYgZ1d4XwMPs6JYfYEk3IBdlRE+RwtmeHZSstG+Yv0ldCCDrnXmX0u77gcKYV0nOfETJUjqssu X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37fdaf6f-0206-466f-bc66-08dc5d1310ce X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:12:45.1026 (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: 25s+uzwmkENGdoIidTtkHK6I4kEz2OQZQThg+X292z9qHFyxU/WPPDgTU+emVnMuEQmiSVPAl+wQ8Z4TJyehEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231303_855679_4D20D230 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 Changes in v10: - 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 06:13:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629442 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 B07C8C04FF9 for ; Mon, 15 Apr 2024 06:13:25 +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=1nKz0cCJ2PFHutwFNRRW5CP/l6GTrXOJObHtFsaLM9k=; b=AruN2oT6GPNSyd Hrhln64LjlSMZSF8jdmw2/IhmG7yaM55fh5XbQ7So1xZmQWegZERsye6J0HkFUODybgRAJpkKKls9 0yFuq5sGoiQXkpyaf5YP1oYLhFV5t/C77l7pMmG0Ximn8vqJK0sL644kDAsGXnm3NxBoaX08qWR+B KGTTgG0hdhlIReEGMwrwgmdr/5N60tjQm/rECE23jJJua2i32P3nYWnhnoXT/g0sltNtDmyRWkqHf il1rTTRDa1ws9qZsYaaWfeogK+P0UG2/X4CFOVCmYMEu7WeTsuMZgDSnk58lwTLBmajqXFwkOBuSA MI5xYs5QOXK5lNQBbkKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFac-000000077BR-01qI; Mon, 15 Apr 2024 06:13:14 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFaT-0000000774s-2hW5 for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AZHrocj1mZBSMidngHDT6W6Q8kgXUbYqfXdd5q/vwZTQ4ag80aFgvvQAbq6VukHjiiLgwikrKE2v/iUU6/D1vviB39kDBCVFZHlBYcLaUrgUAKXiKSdEmVzpTi7Vl0Znd1++vxclUK4tGTksVyrnLGQENDx99IBUSXfkiuKQ8X2X0Mm++9M8ss4nxTWWoxj0+T5J4BSorfJ9WsiUIdElHfbXqBPI6FRz6Bf3w5Acb6cz82Dy16yV+1Wrvy9mGPGGNEy7UipO2TfE/CUlBNDjRSqISIieUdIMaLKzoOuFm352lrfDhf8sA/sEQ8XC2oQZKCyTMXhD/KGfXVo9zHBZnw== 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=l0sQMBBuEKcx/Sd309ts8fBYek5hfFfQdxYIqFsmDtE=; b=C4v0nrjNt6Ze0kHYJY6N/4xpLnJ8sAM5onKli3iJz1DtqF59oPslcX3UUILPXxGXGeBD8HgzCzJ/zKUuYMriUB4RFtQ6UhDFEvEAi1FCzHvnxaqUTYH47KOHFKIHoyLvb2wOn6PMyhsMkm5SiH5ExkwFUYs8bUQiV+Dn3I6p35dasS3Wjj/ERLQqvNmcMrNDUaNuamkH8JCau3cwhju45Stl0KMprreVV4oqWR//xjGVpu0ZSUlrSEfMAmyFxlQu9DjdXg3SJLP34wCmciYa4z20h1Ix8Dg4ePMLdthvSE6TLQS5isHexeDdqVafUXaOmJF59MbHnni5f/cYhYcGfA== 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=l0sQMBBuEKcx/Sd309ts8fBYek5hfFfQdxYIqFsmDtE=; b=HZEqL4rdvIB5sUaSlLevr7Tp7L+GqWNTQqv8Goa1OraM64xgbqHnJ25rUuf6oEsfJLuPdbca7lgUUdGp+eUuJZLG7I6mKnnohdyrVD21aipsA2H7JrF62A1UIKieI0PApan9KoJfzvz4TFjROesu6fEaZSH0kTb5RIjyQIwzG80= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:12:52 +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 06:12:52 +0000 From: Xu Yang To: frank.li@nxp.com, will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com Cc: 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 v10 2/8] perf: imx_perf: add macro definitions for parsing config attr Date: Mon, 15 Apr 2024 14:13:14 +0800 Message-Id: <20240415061320.3948707-2-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: e7171888-a8ea-44a8-4fb7-08dc5d131517 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OC7c622b+lL8gWo0ozVqRVFFrO0l5Q1GdKe4hCJAYQoEFYzU1BKPPCGbIYlwRw8qaXhzKImGKtskHRVSrVVMe50MwJUqj6UbC8wwo6KCz62krYCQXEwjJuXo2DYhza4avZTD9Unyci2enSgBnYtSthnAszsHwVE0y4drtsCMDZ2gP75wAE0DbUZv0uKXpPWSIrIbR6mXuMehv9f7W50VFNUUx6imc6F4DQud/1Fls2VqsfvJiy6HkMxAIhgtrbmJoe1cbP/sOEYYkggqArMqNP+nQpcpLqilNBwjv4UP5hIAYUcLZDFp8y6/WYtNrztVwnyziF4T72QQkm6fZS81Ktw6QMiEzO3+uGw4d8DM6LyAh/jdK35Ovq+7hSVREP6AotumxtcZ6Ai7E3OEpTB+nOpSXtGYVOV1KRoZzF0+1jx4kP8n5OIIInpy1ODj+d3Lm3mRyWb/f53UV0ufJXz9niU8EQ20g4rJwP9EyCogEm0HgxN1oWLGhj8zmarkFYb1TAWpJkji9KVi/+koEloLm63rSSAe2hLhY6GSv7sBPsItsCbxFSkIsV0MW6Rs98iwSAOypxq89VypHQXPUjAUKyE7CdPHMBVCGeriohiVlOQCEwX4XSxWCYurhNulx9mknRf5jlkvnTiXnTO/6kE261/+b3ULrXVf6r5PIzri2UJfghHRvfDtu/bslOsXThIUDG4QxZvye4BYKqmPOtHH90HtPz5H1se9mLPpm37v2lY= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fsIP6F84A7H9ylWITCzHLn6m5zV28GO3PWUlbvqw9a6sh6n9ozmwvmwBilB/KkqBZbKnnSYRclcwlv8mfmUSsT6wPVnW5aFzGzoXoaJ7L8gPuYktwT2jem62o80tw9vI631uIGV7bqljoZgCNOV0X5U5eEhaH9gPPEGYgCFOE7McJm9wQjphZX0pRUChGZh/kLWIJS0Cu4REkFWpjzpvPhnVMnPmR03/AQbypVllAxfL86BqTLm5JaWvzBDrn2tO8jiH1lHnyCr9iFjXGerqpAaeV/EHtEhSeItJt7wi/ckR26+jO3EWDsPYunhotb/2zO0acivTmW03pBWD4P7Jvt885CLSQlXI8gYTe5WepRhhodaPc9sfCM/D//IgRWj/Kp+6xiwOwzsRKqLLaH1eTNI7ljcImK5x9cZ1YezV2q3UySvMDqSrzaWGRtEl0r2ICd+/6L72uX6GHgnWPbGWN1CbUAbnAFkfvq4HFKi0rMWZqEryiuCmgJGji+Ayiool4DC3+ghe1LugERIOb9Z7uqEnUhar5kYCQ59srmEu5ks2W/gWQYO2JlouZorWHuwxRf1eEABNiM2BTEyYg4xxwzEn4GzYYCV8ISdwJjAnJCcl5udk7uisAXGhyhxEB20qc74TfnNYNaFMk0jG5YbuGevCPRY23fh9iarLW6M/WYACtKBOKr5UThlBYK+Ss16/Tl0tCWz/VQH5Ut9TAH7k51GHf44C02ifSdaYhIyPwtCOIieJBPHgldJknIKTRSsEu0WuP+gNVpAOo4XsYWZMyZRbpT3PvdPg8fueU3gMENGxppDwShTKxLPK3a1ko/Qs2IdWPz38y3zCl8SjpqMeGDfJtH1KVVtFvKiOp38TFgeQUpfa7AI00NrFO2nybDVwc0eGZ8/NIKCWjHoOr5oqwShO/dkwIgpl6GQW6BYvhMVc59ybKnEtRIMHMYmhOwAFOcOB5Z+B3HLw83Ma9AcVKi+FSXYVE0EfpOeQ9JxYoHuPS7bCQGC8+R2sqXcFQq4rRbsT+1AuYnUOOAb7gQhXwyQCd9dQuT9q+iQb/++GlqzGWZNSi0PQw8b2yhMdCrw2/kUsu6tqelp3zcp2JUFLcABJVZZ/KpsoOuFtpgcci/wjAmkxWeR4iC/yNmg1SAzT/zrEhOZqC2GR1Pfi19MFRvaOrcNpmCdjM++bvlJruUvP0lg5zsEmtLqfHxOvlOm4k5Qo+BngyKuRp7zi4TrkwpgtB3nriZztD27WYK/yA6a4fgeEymFuBMOxF9AQf4O5BBeqBn2PVINiQ/bkjEOruQllqyswt2pv4Q0BFltYTGp4O6OQ7irrTwrWYmaLtEgQT/p0FSuVaqoCPjXip2ULum7oehn0xY9mwzeX9abxK07IPdwWXN8RYQhwZXmoxASt2/+EzXSafUrrTZ3oJDzzXTP8R3Xqc/LEdJY9NpHQAVql8Aw41XjOxmflxr2SF+nc3MjBC9u7GiqqVtvYHEgjcHKZwv+1KSIk194NNFRURNiaGhCNKiOxxActdFNQMgzABRq1hmMiNIzv8KbQoTmypTmjdWlh/Hikr/rIjZHwaPKgXxXHSgYuvEg1XZBsN53Q X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7171888-a8ea-44a8-4fb7-08dc5d131517 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:12:52.1420 (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: l372IqxOrdMejBN7y3BrLbOyB7xS2Jwuo6kGNEtClp36v9R0V4SgCRntvxaXBoOnc+RL/yvXFnm6RDj7yvB7rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231305_719495_A4703CDA X-CRM114-Status: GOOD ( 14.35 ) 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 Changes in v10: - no changes --- 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 06:13:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629441 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 8BB3AC4345F for ; Mon, 15 Apr 2024 06:13:24 +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=tPYQ8gD8d4qmroROAkDXCsL1fepWsEAb63+hQgVBQfQ=; b=me66zYBq/he8MC I7LITpphfgmIOf9MpI/sYTXfL05nss0cZeGxtITM/TpAx5DYvxJW2DLeERIYrhX8DWClozwaNKe8W ss6DkMh9geDP7zStvxEvQWebCEmIM4ThKx59cM3Qkj6KqgTsCA7LRopP/MXhmXiVi/GDI6sHjHIRr cyLn77v2C2RnPcWrW3MaBOpOpyZ3tOfOkGnRmCA52LN7oMQQB+ZjCe3GwDEK7+sAf6H2rbMnfgmna j5FqTqcs0Ft1Ch2yacDyBQCZrhGosCSMzVBjaPpD9uTUns7uSICG2i3nVUFQLdFGWkoIyDnNwWt9k kKH+a/3IiOu90LIYZP1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFac-000000077C0-30VD; Mon, 15 Apr 2024 06:13:14 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFaV-0000000774s-1tVR for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z84uOxJUBrgacnDRIiacXos89+lEFR0E7GTkjry760dVCIbXtGRtBDuflJX7YsVuEr4+hXeMetGx2XHwnrbPYNx//yIj1CLA1lOLSMDUchxj3FN4nHTOe4S7AyIUPYBzRWYjiOKy4Fq5dQPH7X9pkhMOPgLG0A3CrbjmEZ/u/2BTlDjgPJpIKOVqrj9DqIot6JFEaCTHF/MK49MLCZmu4G+XLDF4vMhcDfS/1zUi4OzBcg3L2jZ/VvC4LkGrwoN7QGOcVUGG7nbKuj/p6Lk5s3ZK9yvcq1gcZRy9JGyQF0l94RSxBj83py3IjFAklI3dG2upHIA48NjYH6Qwit0bSQ== 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=PPnQK8DmUEGhGNemQYCIGIPePeKmzWr7xrtKs3LCm3Q=; b=GabJ2e3bC+ANG5wzJI0z4jMoaibPENtCYeGyZAHUvXLXwDrnry5ZHqUJ3c6QM6zcEc5WMZ/ZwD4xqb+WWcxIqidiSlCuAmI6eIma06PR8kzTba8gBnW8sVDmlmVLVM3pn0KZPWv77KOTZmnK7ZkT2OnpBxUmg3ERQqK3M9xaVyYTo9t6OXLoaTPZBTlluh0LMEWavd4YrrWGk+84t8WhO5hzUuGJmbMOVraZo+jMrLypQGPCey2xOFQJlVASq9LnVRvC3c4fs8+ZxWfV6ifNQFOiWlcMll3uZAvHVe96uDSma15i+n+UIEsaPSxgbal1smcjRLqwCn5jaKwgB8H9Tw== 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=PPnQK8DmUEGhGNemQYCIGIPePeKmzWr7xrtKs3LCm3Q=; b=G2+13y38HWnAkbffk2HIPbp5qwE/ZX5W38mgQI1ZjdsPPZNZU39JlFVdXNGJUwG+RSGDIwilFXCQG1DkZrbqFy6V/bgxXIXmmhWk1S6ZZMJLceQTFAKpJ182TsERoB0pOdx7e3rH8+kowNJ3BrbdsiOnmoDuyWw3OgdV+ff21ns= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:12:59 +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 06:12:59 +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 v10 3/8] perf: imx_perf: let the driver manage the counter usage rather the user Date: Mon, 15 Apr 2024 14:13:15 +0800 Message-Id: <20240415061320.3948707-3-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: 960165e6-49f5-4e3f-57bc-08dc5d131945 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AYkfQzADWzLcmCbz3lrymxkISz8LKfDMjpPuzpV0/AHlJZG3ffgQYgHpY4NUQ6azScavL0ZM/8tgqk9kjWBeC6nnZxxWAU74WzfIs5uezPMr+efy1vpvn+WmBwLo0R7kQtJfEPMDxXBbAkdzuFWrpMpoYaLnuetaQ6cqT9rd/BM1Xw9HpSWDGehTTaonlK35kkDOEDtfDZ1pl/OAxsafXHKpw1Nyqf42QL1vhOXy2GZpXqYmu3kns8F5PcLh4+Zh/LBX88bl4xR+tpf/Maak1fgayS4WS7nCf7SEN8KyCxOu/nzta+8B8/UZpt4arwwg+d3zaO1liDeffs3TtR6T7HhstSh1PUDeIlzgulK8tqLkDSy2livqVu0uSQrLBQ6OOq0VvvoPP6ax6Lhyrz4Svu/yvWG5MfiMH3JEYMMLo/h/IUqNAuI0AhRdGo4Cm8aTrlBt4fmo9DZjnYe4YKizbJptBflh/z7B0G/CkgPBJGqduNHZtCJgxjpSCKNnn6a9O0wYyHq3m1/+2Y6VDQt3KIq+e9q0hTC/FykMskbu798eeKHWNmty+CYaxuh5MI4lYLWkr1z0EvZR9pdUN9xaTivYNqZ594TdbuRcUtn5nabBzhjNZMidPA+vFtl/exyhMmzA6cM76RCpssTBYXjAMUFYxlOimaPC6kkkQRlbORG7D+3MtqU3CYorbHHy8XUpziWxju4+v9SmjTFaKqCcy62x4vsVKm6r4MCfPY9FvNI= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CE6vnel0eJrs8CHdb8q+EVP54KAG6twXpualwCe6FqWjQsw1eB9byzHXtdKqYWk3CCzafCrCDvLIC+Y05vukajfHK79Nf/HoeOcZcLXCwV/bPTCrauAzy9qKY5aNddKe9Yxs7OuTwhr1+efzc/NCxaN/nwfaU4Fo5rkvxjJ9pFLLqoIJHLCDjnMU1tTtnP/13uSujqNdvtmB6zgNWE5LZdcYEHzY/M+htW5UuQa2MUjSq86SyW5obE9ZVMEi8bQjoGQLhvDtP6TYX+selv3rzF4EIfpiC5R/iRheEZ0GKQW+29XDux6Rn1T4m7HfMm9qNSnLIQN96oUjmblXJRg7T+QReJ85zyVgrQdZHZN80KN0Pv05rGkldizoTCkWu6EE/bCGI+wopDzjJwdcWvug/G1BfLwg9XNoH2wvM0LUptsCBBs4cVAyalpqsyE6CgMCaONwDfoREPiWlJGxp4XLceBMBeCnBJqSRUlH0PPIjCxDmEyDGYEaqwnsf8sPLL1ihSIWS/WANqGjxNBWuf7AS3ZrXoUQKqgqf4U63onNZEykkzlJVwcrkEfOfGiEoL1wC9JbqTqodOa7zi7DPtJF1k3YCdv6N8j4lC1MQznXgQt8jnucAIFqBSJ0Pc3bAi2xTXTeRbNuv7F6Q0UnN3zfBr3kNPVeaY3GmKy+Fqx1id9nRgPLQdTjxw5I6yQFFw+kTOb3W0ob1ElvhCOWvUSHTzjObBAV2XJ0Ptt2G4NUf0K116KXq9l88/7SrRirghtWSgG9KnaEeZNkiov/ps1i4HYd05jDMtI9MZUcVY2ViskdhFFy70TBDpjdrufL2+S3c3LR7hEstHNu3J6CC2vb+4wuf32UtRUMQIYimPE74btWhPs2JX4XUPjEwVpdoaeCJlAp0vCLRSNkKn/dXZngW4q42zFtAdLDD1rEvw0nuqM+b2qh2SCeJ4Yj8dxhrJpBhY/c6Z+jm76YW1Ka/FHtIO/e1RXBPZ0ZNEaBWblB7enV1IfseSOeYVOx4M+Zwr0tGADsEA1VuPvi7cia4IpUJx2UYICwrxW1qRKg1BzDqDVr+HuVHNb2Wax4AgsBUSl8BWszYTft3cw0LlwdH2oQB1KDYGA4jk4fOvpPu9/F+oGyrp6lIyo/t7pd7B3DPhBEWuknOJniKrwLJqoMVbWSISR3pCm9Ph4Eb/Y1dWiVLijT/mzHAs8v3sLc71ycwPYFdcCWxw4wDcg1T66Bu02/1dfv+FXmKE6Bq96kDiSAcwD/6D85NPPG7gnMNjtYPejzzpOUliSmD1dcMDKQWEPFPEVhmFnmQuykrNqdmLyEi59Kl+qYjXKInlfMmIKoxtJ79nkY9OmNZkrYiKX5dkDjp2BRF7A3MCBsu6jFrsVK2eEtkm3qYZZaDyaz4lti0+SGXS5oEST3StTAXUYBQhay8IQupZ75spFbcfzB+UtU7Ka+l5tpU1LZnFyQMDW24fehFj7pF5Sk44wuuYJlukHDX5TrcmMD8Ff+2Vrn1pU5LkkjmH9gPKqfS5yCZ4tv2RuRV76GbgzuEYIP4mIH7q0sDSG2bAC0UlVFAAZ6K8JuEdef//0/uzJzutd04eJerOyJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 960165e6-49f5-4e3f-57bc-08dc5d131945 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:12:59.1686 (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: zAKG1w0c9121jz6/Mmo590vGV1x5hHXIga5nOyKKZVx6tmNZwoPk4eHIWRq5b4mK1UfQPsjNZcrl14UZ5PCPUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231307_532302_968B687F X-CRM114-Status: GOOD ( 14.35 ) 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 attr will be kept for back-compatible but all the value passed down by counter= will be ignored. To mark counter-specific events, counter ID will be encoded into perf_pmu_events_attr.id. Reviewed-by: Frank Li Signed-off-by: Xu Yang --- Changes in v6: - new patch Changes in v7: - no changes Changes in v8: - add Rb tag Changes in v9: - keep 'counter' attr for back-compatible Changes in v10: - add some explanation about 'counter' attr in commit message --- drivers/perf/fsl_imx9_ddr_perf.c | 168 ++++++++++++++++++------------- 1 file changed, 100 insertions(+), 68 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 0017f2c9ef91..3bf054614b49 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -41,9 +41,11 @@ #define NUM_COUNTERS 11 #define CYCLES_COUNTER 0 +#define CYCLES_EVENT_ID 0 #define CONFIG_EVENT GENMASK(7, 0) #define CONFIG_COUNTER GENMASK(15, 8) +#define CONFIG_COUNTER_OFFSET 8 #define to_ddr_pmu(p) container_of(p, struct ddr_pmu, pmu) @@ -130,6 +132,8 @@ static ssize_t ddr_pmu_event_show(struct device *dev, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } +#define ID(counter, id) ((counter << CONFIG_COUNTER_OFFSET) | id) + #define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ (&((struct perf_pmu_events_attr[]) { \ { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ @@ -162,81 +166,81 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_pm_29, 63), /* counter1 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_7, 71), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_0, ID(1, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_1, ID(1, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_2, ID(1, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_3, ID(1, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_4, ID(1, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_5, ID(1, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_6, ID(1, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_riq_7, ID(1, 71)), /* counter2 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, 73), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_0, ID(2, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_1, ID(2, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_2, ID(2, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_3, ID(2, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_4, ID(2, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_5, ID(2, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, ID(2, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* counter3 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, 73), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_1, ID(3, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_2, ID(3, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_3, ID(3, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_4, ID(3, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_5, ID(3, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, ID(3, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* counter4 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, 72), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, 73), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_1, ID(4, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_2, ID(4, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_3, ID(4, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_4, ID(4, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_5, ID(4, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, ID(4, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* counter5 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_1, 65), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_2, 66), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_3, 67), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_4, 68), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_5, 69), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, 70), - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, 71), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, 72), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_1, ID(5, 65)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_2, ID(5, 66)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_3, ID(5, 67)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_4, ID(5, 68)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_5, ID(5, 69)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_6, ID(5, 70)), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_7, ID(5, 71)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq1, ID(5, 72)), /* counter6 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2, 72), + IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_end_0, ID(6, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2, ID(6, 72)), /* counter7 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_2_full, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq0, 65), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_2_full, ID(7, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq0, ID(7, 65)), /* counter8 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_bias_switched, 64), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_4_full, 65), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_bias_switched, ID(8, 64)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_1_4_full, ID(8, 65)), /* counter9 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq1, 65), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_3_4_full, 66), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_wrq1, ID(9, 65)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_3_4_full, ID(9, 66)), /* counter10 specific events */ - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_misc_mrk, 65), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq0, 66), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_misc_mrk, ID(10, 65)), + IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq0, ID(10, 66)), NULL, }; @@ -245,8 +249,8 @@ static const struct attribute_group ddr_perf_events_attr_group = { .attrs = ddr_perf_events_attrs, }; -PMU_FORMAT_ATTR(event, "config:0-7"); -PMU_FORMAT_ATTR(counter, "config:8-15"); +PMU_FORMAT_ATTR(event, "config:0-15"); +PMU_FORMAT_ATTR(counter, "config:16-23"); PMU_FORMAT_ATTR(axi_id, "config1:0-17"); PMU_FORMAT_ATTR(axi_mask, "config2:0-17"); @@ -366,13 +370,10 @@ static void ddr_perf_counter_local_config(struct ddr_pmu *pmu, int config, } } -static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int cfg, int cfg1, int cfg2) +static void ddr_perf_monitor_config(struct ddr_pmu *pmu, int event, + int counter, int axi_id, int axi_mask) { u32 pmcfg1, pmcfg2; - int event, counter; - - event = FIELD_GET(CONFIG_EVENT, 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 06:13:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629443 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 39A97C4345F for ; Mon, 15 Apr 2024 06:13:28 +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=YM/+h78yjIK8u8018snTi0bXehzKj38w1OC+cbjAwKQ=; b=JOWnixGgAPUclK iSrLdPwdE6WDUCzUIA+zDF+DNynuRqQUdqUjjJGqJ8ozjxVm41uuZ493pp78SUG1PHSF77vrVhVeg gf73ENpcqL+q4N9cBrqp8orUqeDkpHVaBEh22oN2M8atbPzvT06b4mt+hDKc7PXrzCJ9fh5VTcuYu OjjiX1ZoKJDBsPjjHVPSdCu43wgiNmilYwF5wA8bRBHY4L41DnD70r9ChbAD7S/BO/R4dcZKnLrPR gpHWjZv4W6uIFC6yHaZ94Rb6LAzBMGPI5xOkTa0CXkUSEYyBbWHdD+Tx3/3i6nmEdZEcUfVfWVj81 FinulJcBXjwq8eIuRtUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFae-000000077Cc-142M; Mon, 15 Apr 2024 06:13:16 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFaX-0000000774s-1ehM for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O9aEtQ8e5oDRFLWqLHZjca3F9BYtSxep8X5W05AUehsb4ueBedXeA2zq3asi0Bo8NHi2uWhAO3rhOyU9P4bUJ6aGUU80cUz3+kbI2qHXF9t7q98m/j0g2mWT5vFIz28/A5J2qn6gYnJFIg2tLGskxH38tVmOQNuZYhxbUSapJblEwliq8tI7RQxfzdjQ69/soIubPXIcNJUp6clSyoMm9auK6g6JZrWBpv0712GIiYVtsU0vE2YImF60pdNDimU6L6x6RXnY5BGTuSxPQ+b+51sVS4WNrtwEopWxkjpUvzsG9ernGzGRAeCwSTdnKARZiKf5WfJXqlrvqqnovciSvQ== 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=bzuh7egtsYe15xOxiyjZGFDCZAv120F2ZFvgrgM0YDE=; b=T34gtNbQudmvsW9WvavpyszYKzof4mAymvq8hg5/ZUrk7gwcuIuopmK3o1oBz5cix6Q/6oWJMNam/m+5gxBDml5a+eLEBYFwJY0iUHCSzZzUpBPI3oWGAxGlykR7DhwZoguwntilq1kkyEVspyfD9QtVCdwhbDZKkMvEsAU+t/630l7NfPYtsmOL1qcq62ROOaktEMys1hp4/1vuHEv3UCuBvqhDiHFwEw5WKKA4+GKkMbzrCmYi9Aa/on0peaD6odxXzUSnbkZ9E/ipzQJARq28HZ/ai9/5r+gxZW5nbmVBSv6Ms1HWD8Xu/WplfH020FNoCDTvZ/BivBLsis+5Aw== 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=bzuh7egtsYe15xOxiyjZGFDCZAv120F2ZFvgrgM0YDE=; b=QPhqDMuRSJ3AsRzpCrbSIeFJej5lIPlGrfNe1WFnouj9HH4DrBNXmOhcqrQ1gOvr7h1bza26yajC8xF9SPugcy1NCEgJm8OwAzrqMCsgMes1YRQGey0E2SU8y4DUnjJgwrzCHOC6ua6+c+B5oPBq5jLQR2bYv44vOXwHN0sm9dY= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:13:06 +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 06:13:06 +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 v10 4/8] perf: imx_perf: refactor driver for imx93 Date: Mon, 15 Apr 2024 14:13:16 +0800 Message-Id: <20240415061320.3948707-4-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: 64e3f308-1ad3-4997-f63c-08dc5d131dd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U5nXtm5BNzvXznQZQJfVx313w0WU06BoVyKdeRdK3uzQLYVz6J9houlJprrv1NQLZzv87miicjX0ejSlv5s14RbBe5uINo9Hjj/DsQOLd5S+iPilCSSJoc8Efx4aKBmWWU5+cL7bTOHrXgjn6x723y0qr86CsRmtZYVBF+kS1KJPbUaSiux37XrRRjazPPFLN/ptfsKWaXyJ4uURFFYy6xi7e8D3RzXAR7FtNKTap5Cokl7lZl4eIw62M5V25qMWHMuFfu/fJWpZqoHooIQ5hkmHOX3ek9SzmCSiYeucoomKB4GCbCDkm5s34+3L7v/5Y/aWkpKKAoIk32/1ArmEhVKfyAABOlaQrrdQ/1wKRBrbSOX+ozhUvkuM1YOq4+afVGDLKe5z/kkqcb2bDN2MGDVd/SP98KRif0GRmKs4lOkVYOjs0LW3mo5tMP5Cdm6tTkORPp4xUllmiZjNX8q36uLnEFmoAloxHZvPTLrV6rnVnbql6lF06USuVuqySvi79AbtjqPZMYB7Ma/wlzlbRleWtlbI8a0G/7T8CosdXeZ2WUV2NgVTl82ND47FkEUqFqRSC+TdZZYG4Z1iBTpcDsjX11WuFU9IOXt6bxn6hj3DWy+M/M5G2/voyTkwABKvFPkfubarDoUA0FTR1ICmnrC+2c2R/CGsuvkBzeF6Cgzjy9Pt51xML4OgMcAUNwcNaaEU0mOzewzqtsb7Z1hanPQvMn1qmD+dkDISK1NtYJ4= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m8bd/sGjtn6lui9p3A9LOfMWGP4llWt5wuU6mdOhVsKAuNR+pRZI3MErHAcGUHCNcGnILGAjOMHrOry6npxxTldHfKVxlMFrMJc4CuP2b2uVEs4mBTFUizawBR9K3wUdZY6Ad5ySlOqA8ob39GleVrptxDb8BMyzhCiNOprr8r0VYzs859c6dzyzf1EzNKBhxoiZzW1L1BMAJG7tukiRgN8JleHo+iLDr1zVx+kvnSE8p+uUCt0HCrbwU3C5afUT0PtBwLXIR3mY7M1SHK360kIBuChHh/J5F8KNEjiVhaeWBCjC/l07aNTBI/o5xQxVnd/1LaTDQjN945TVMzRaQuMj/VWNtyrp8Lu0ONfnRyHn1KZIQ7tudyH7ghQV/2pQ2dKbyhyhHmhuLnCeIqZiafCeTY+5+U5bKyrkVQ4i5yTemnM0wJZzcHGqYgTlyLD6rvdgYRUd1hQMRsLgBJM8HFQHSMwE7Bv7ZkVGBY1RzcuBXggA1xl227AdCzt4zTLThAcs8i1xJ9wU9vWABboRBugiLoLVtqXF/tSGignP8bUJwtPqUihnzY0UnjFFH/7oOIUfHJs3yvSiqpO8gfLtAWSEDHPQgqCXLowA6sGYDFJNSGiJn3goiJo0HtFGGIt9BJgQdO+Y5Teh2Syl0W16ZhDgi5BhfvYXJhuMQ7ADpsinxaUFNGUjTyqcctkAhiDi4vX/a3uc3ZDROkP3/cTBHHLP/MYGY7x4+heHMSbR9/hAxLGiEPYzxiethV2qa5oUW9UaTIVYCNW6pkarihnKHnkpSBq0/yCq1ePiD5xo5f658HqO4Sip1IB94XHsSZypA5ynXbRubFk+0JejKyesbF2Lq+qCXy2qqP3EoyTxJ5i3co6WEDGgGzmRHiiCyu7zYviTncplx/D8QXAjPdoG1sLpg6NMRkjZQwU/8M0PvpEpl9UsTVfsfRNHeuPv2JGQzWleY9Q1xCQRebpd8rLTapwymrjKRz162pQHJ3AF9S6+VC0PxiA7q/xLrdMfuGlPBVvYXT/mkDmYpAqQSYTF/+JyEWWraiISzuBNOuyIWT7E6ySrUIff/NZCByz+Vbc81wCJaqUDd9XlwMFtQ8IkBXjdEMnRlLXFDwtqeSyXJbX6Lj5l+p0VvP5Gfnrw7nZune/D7Y/+OtN62eNqjiYl6KBGNIVOy2SNqPNuRJzzX9KXSVfwo40VGDOGUr21BbM7fwdvspWB8YmGklwccuD2X6FgjMzp0cvEtFZElunQNLGsWh3pi4K6opuAmoER3WxyvpG5ua3k+mUIAgYIO8749gHHhtdB/FOJBIBIYGB+oiygtGBuag+rhJgYkmeuzuTW10NwijJdGaCHpMybxW4WzSkN1txPaMk5IbS+NN2iTQ5MdUGK+Tq/OL5higyTvkPwYoRROxQWzTHHuDM+08veyDMPEvYIMoGCmPW1xRyfjMfVtTqwaDLyZlQpI+g9wEEwG/wrvxEn4FAOSJxw163zkJ555iwUuhQ5aMH0UEJGMJk9us63Yq4jYPJi1QtUJF0szYOr2C4PxUway9/4Z1xunPZ9CXDiJbUmSL/c3UYpA9oqnU0XPXFzf6xDT5HWJ6c8 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64e3f308-1ad3-4997-f63c-08dc5d131dd2 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:13:06.7923 (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: xqGtycyAT8vU94WCfvndopEnvke4XIzzYdXhIhQdeDdO6gDnoJwM8nz8umvUJ8ANwoGxeycST9xJKHygHT//Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231309_481786_A916D3B8 X-CRM114-Status: GOOD ( 20.31 ) 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 Changes in v10: - no changes --- drivers/perf/fsl_imx9_ddr_perf.c | 106 ++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 3bf054614b49..dffe7c1e4809 100644 --- a/drivers/perf/fsl_imx9_ddr_perf.c +++ b/drivers/perf/fsl_imx9_ddr_perf.c @@ -11,14 +11,14 @@ #include /* Performance monitor configuration */ -#define PMCFG1 0x00 -#define PMCFG1_RD_TRANS_FILT_EN BIT(31) -#define PMCFG1_WR_TRANS_FILT_EN BIT(30) -#define PMCFG1_RD_BT_FILT_EN BIT(29) -#define PMCFG1_ID_MASK GENMASK(17, 0) +#define PMCFG1 0x00 +#define MX93_PMCFG1_RD_TRANS_FILT_EN BIT(31) +#define MX93_PMCFG1_WR_TRANS_FILT_EN BIT(30) +#define MX93_PMCFG1_RD_BT_FILT_EN BIT(29) +#define MX93_PMCFG1_ID_MASK GENMASK(17, 0) -#define PMCFG2 0x04 -#define PMCFG2_ID GENMASK(17, 0) +#define PMCFG2 0x04 +#define MX93_PMCFG2_ID GENMASK(17, 0) /* Global control register affects all counters and takes priority over local control registers */ #define PMGC0 0x40 @@ -76,6 +76,11 @@ static const struct imx_ddr_devtype_data imx93_devtype_data = { .identifier = "imx93", }; +static inline bool is_imx93(struct ddr_pmu *pmu) +{ + return pmu->devtype_data == &imx93_devtype_data; +} + static const struct of_device_id imx_ddr_pmu_dt_ids[] = { {.compatible = "fsl,imx93-ddr-pmu", .data = &imx93_devtype_data}, { /* sentinel */ } @@ -123,23 +128,36 @@ static const struct attribute_group ddr_perf_cpumask_attr_group = { .attrs = ddr_perf_cpumask_attrs, }; +struct imx9_pmu_events_attr { + struct device_attribute attr; + u64 id; + const void *devtype_data; +}; + static ssize_t ddr_pmu_event_show(struct device *dev, struct device_attribute *attr, char *page) { - struct perf_pmu_events_attr *pmu_attr; + struct imx9_pmu_events_attr *pmu_attr; - pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr); + pmu_attr = container_of(attr, struct imx9_pmu_events_attr, attr); return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } #define ID(counter, id) ((counter << CONFIG_COUNTER_OFFSET) | id) -#define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ +#define DDR_PMU_EVENT_ATTR_COMM(_name, _id, _data) \ + (&((struct imx9_pmu_events_attr[]) { \ { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ - .id = _id, } \ + .id = _id, \ + .devtype_data = _data, } \ })[0].attr.attr) +#define IMX9_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, NULL) + +#define IMX93_DDR_PMU_EVENT_ATTR(_name, _id) \ + DDR_PMU_EVENT_ATTR_COMM(_name, _id, &imx93_devtype_data) + static struct attribute *ddr_perf_events_attrs[] = { /* counter0 cycles event */ IMX9_DDR_PMU_EVENT_ATTR(cycles, 0), @@ -185,7 +203,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_6, ID(2, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_ld_wiq_7, ID(2, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_empty, ID(2, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_trans_filt, ID(2, 73)), /* imx93 specific*/ /* counter3 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_0, ID(3, 64)), @@ -197,7 +215,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_6, ID(3, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_collision_7, ID(3, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_full, ID(3, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_wr_trans_filt, ID(3, 73)), /* imx93 specific*/ /* counter4 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_0, ID(4, 64)), @@ -209,7 +227,7 @@ static struct attribute *ddr_perf_events_attrs[] = { IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_6, ID(4, 70)), IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_row_open_7, ID(4, 71)), IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pmon_ld_rdq2_rmw, ID(4, 72)), - IMX9_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), + IMX93_DDR_PMU_EVENT_ATTR(eddrtq_pm_rd_beat_filt, ID(4, 73)), /* imx93 specific*/ /* counter5 specific events */ IMX9_DDR_PMU_EVENT_ATTR(ddrc_qx_valid_start_0, ID(5, 64)), @@ -244,9 +262,29 @@ static struct attribute *ddr_perf_events_attrs[] = { NULL, }; +static umode_t +ddr_perf_events_attrs_is_visible(struct kobject *kobj, + struct attribute *attr, int unused) +{ + struct pmu *pmu = dev_get_drvdata(kobj_to_dev(kobj)); + struct ddr_pmu *ddr_pmu = to_ddr_pmu(pmu); + struct imx9_pmu_events_attr *eattr; + + eattr = container_of(attr, typeof(*eattr), attr.attr); + + if (!eattr->devtype_data) + return attr->mode; + + if (eattr->devtype_data != ddr_pmu->devtype_data) + return 0; + + return attr->mode; +} + static const struct attribute_group ddr_perf_events_attr_group = { .name = "events", .attrs = ddr_perf_events_attrs, + .is_visible = ddr_perf_events_attrs_is_visible, }; PMU_FORMAT_ATTR(event, "config:0-15"); @@ -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 06:13:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629444 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 A4BACC4345F for ; Mon, 15 Apr 2024 06:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AHlCw3QuT02Gs7Lldxt2lyKeZZqnEfu9uA//Gkm2FB4=; b=ndbphoH/rduCq0 DMI9SCfVONUFffr0K13Bihk5j5jrcH3ws7v2lrQicaQxsgMDWgpGEZzRajWImmVUE5BMegVfZ5Ye2 148FUTUyaRwfB1D5XzAV9iwQar7uL1qLAWRfn5D0tK7DocU3Dlc887qFxTUAnFMimaz+HmZjtYsZp oyYcnaDc6JQItS7AsYJDlP1fCaaNBohgq+jw2uxDEgpFZ1qEtFA4DwkbFUsfX2yJbe00g14C+eQEj gBzQIsz2FoSzMK3NcHnkg7Ad8m0tzI4ViANM5lTyI/CGQQDpdg1EeWv0txUd5jmPolc5A4GEKGnEw d/4UXN03RDy3Zi7wK5ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFay-000000077Ph-0446; Mon, 15 Apr 2024 06:13:36 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFam-000000077H9-0Fjz for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZOFLaIaf6Q2PvFuzI+1DLRe4xJCHt8GphHV0Up4m/HXHFJIBTHhOlNDexclfgzTw1fGu+cBe1jzTFjZViWBHuRv9wmJNSx/XkVnLdfFc48nsSLDbC0ufIEr3ZhAfXX/X5G0Jr7eBJSFLEh78+K5QttEKEL8pLiYBOWxBT2/yd1FE/tbeUw1EuBdleP5yUjxowCiDi1LHW7DUO61MBzS/r5wtbmwRbgPr6gwGxhuHkJm/sYTHmgmVkY5n062WGGipGVGlMnvCxaYmehm7rX11nCJCD03K5D35uvpIuTN4hwvQ1khJtmWqiZpjXIuso/C9JA09jSDUxrOvGaSIU0JCw== 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=Jf9LqYACnhBC27tNhtlzyMC4brhwEzNKeAmPlcHa2t0=; b=R+b/YGR9P43Sor2ltP6yEUC4AsZ6c649lC4l54SxeeKdceFUfILLI47qSdldBkrjcZkMiqjGrXmzop7YR8p2Cxe0vSvRA96TETL5yRvKmQeZLl8bdslqbgrqmrSLae/yC6wQgZoQS5uTr/lnpXnXAk3VcQttKB6D3zzavC2ydhgP2RYchrOkCJAb4r/3hpGJB0GZLYyH7LhSU/9Y8wUIwoanfh5zYIZJQcEfQ/029ZYdmHh8JoVEiEwoFHg1P1xdpRzLZuoxbt+n4nQ3QeqMKA3eL10xioYyAo1gSHVnBkzb1l6xRCRig/mvmSZlExEwrWp2t7YrTRDj9gjgFDcwJA== 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=Jf9LqYACnhBC27tNhtlzyMC4brhwEzNKeAmPlcHa2t0=; b=Qp7ojtgeX/Zxg2d1n/65tc0xmiYoDNBrTP9sAE8xrcsgTHOk/ayxM+ViV7+8BldM1gpR0UCh3RTGQLJNdUCAFCdFlSAUVpqRJxV+qnnr/z92VRmLUJRXa9dXpD954DFeI0xdnijjPvH/kHQVPlo6rTEtMdiBJY9sBLbx+WYJnKk= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:13:14 +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 06:13:14 +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 v10 5/8] perf: imx_perf: fix counter start and config sequence Date: Mon, 15 Apr 2024 14:13:17 +0800 Message-Id: <20240415061320.3948707-5-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: b0bc4ca4-5bc6-41f9-7ce2-08dc5d1321fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YXXrMacHjHiRfNLUaS/rX6tLyH0EE+pzCyM3SI2dRJFF+qbZ25nCu+7R1hLGaFEynDT0AWvOvbFz9ONvwz6a/Xw3wS1ZMUmuockbODFbmHvbDc22vEU2Ykl2b5Cvg0aCmNsDKmbn8kDwz71DGaZOSe/UBpLkZdp+Tr9yeVWrrDpkT2b4urYjfHPbAWfnQ2HtCi311/F5kxRXKSgHrYAJXUL9pmfQSVii82vW+iIxbEmXo7Zedhtfdtv7k30k1QdThKWRenW1fwMN6hApRYWosB4aFSA/1WdjVEVgPNyRYqRfx4QKAcbe1/RwjER0mCQesyciBxsdWxGAmQsbbiXFAK/3l9Yoe0nMjABZeRutm92nQbOBvz/D7PSTKxLQ035gR5iJeBL4IUQ8p/kQseL1UrMpRFjveTAKrsUe/0xg83W2WhzFuxC03X3CIsh6XcecPclEsEkMdq3TLDJC+TcH3x/+nt5BchekErrX355OkLYDUUib0VLQ2Lu1yfdHhB6zrHDk452GX8ewCj/rYfeplOTypkudUwNaWzEd16m2rjYbjCBmM82KaKlCBmq5UPxWjpdo82AZo7H5n5pOCH24UR3NM/h/RhPP6S52RHND+/57r519xuIYKmzO6Q0xaN2PBcO72Oua8XkNiu0MuCcBxIxcft9dvlXLuMAGem8vTPpXsugOsK7pHjzA1a9IhzaaBbggPZ2d+cEdAf/kjYCwcg4Nn8Q6tTXH9pw2XTZA0CQ= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +PIOVpIH8BPpl82MPlHR23qY26nglsO3/xz28XvBJcLrDVrI4xuINw7vEmX2Jyu6qWgq3LeL1f1aNV1rHxz9Av4/MK9xZC3A+2ToiaoJgY5xFkyCaySDFQ2rr0vF4SmrGV3drkGAY0OpBQmV+pGJRIS+nWU1uinHPmNTJG30gO0+m+KD1JWnOhH1VxjIRG6BNkanPAPwJPosanN8wWr5v22oPXesLoA8ABGDmkWWeV74vpLQctUwnKLzwLiXHkhhpxZOmsfxEf10qZ/OcugSjLod+eV4UknzGgwNYMSXEzT4rEcJ/el9xwTzY0VCpoHpwJdV5qLbJ7POFhD1KDgBzPsgwuImLTjttFn7cnt47ctwqDD8AZvY+iU9v/oBCYIc0HWOwcjHYy/iVmLsGjDOHO/yfVMyWwYFJKI7KzcHjJg3PYGjBMIRVzD5wWxbzrcpuxEtTBeNj4OpSOZ7wXcq3fQiPIFC+14EdCyeeyVl1YY4kym9D2GzZyvY0OIrcuvA/pxdJWUruin95d/eMfY8qT8HiBPmr1Nu+e0SZBlAm6JB/2Kd1oOvatreTtiX42dCmWESUjC7EQoOuwkQGcbhsFTI/Vs2OQy5E/fr2pwwpWUoK6/u04fDhylUmWfime0c/AxmTySmq0bnVRXwoPYQ0obVbOP4fbwuYEC2MD405uPyZZG44ncRWWsa/Z0kVySwIHBXCnscmT97M53NXpgu69btzu/cEhyDARTTj5e4bDXmRQ/Bz3Kwt8/T1h/fch+/5KpReIdTBJ/fO4olPiFv3dl7SrzOCPtBFPIRU9bYEILHnglwvYOPkLH3oWri57k/3CA1jbYhzYvcpSVuMEHUMWUf6Dd99gTqpYlnGCBAnNONfnm+iwz2gUMU61Pv+aNf/CeemM5nRc6MFOr/FG3/NKYVQy+PtyXTR7Vp8xW6dJZgH7cIjz/520UwshQe6OH9EVNEdQAUlZKOoKMmSg7xudYa+MkyRdV3+39VizqdS93aXtgpNzp1LTVV01OyU2B9qpChKZyLjo+6O0kaEI2HTknmn8BzA2nj6e+g8gcFglavSVfIvuY6QneXbHY8HTjHj8bTYC5BY25DqvtxVC/hxPxeil/ifa8pi1rLYWf8jduuHFGZcCOUpF54JayOXyyoXG/AHFnZ/bWfNj6vD2i3uzClUFveXhPVTiVF4tSO1aqmcrMybKsB1VzRJlseTAjF4bZ0ux56vTUJrgJUJ86ay5f5iBEcZryWatg5N7v/2V5JxFSdXg+VEh0Z283zvQEAHWja29OUx7EjtUZIBZ7ZAMMI0MuVE5+l7RlfVn8X+j+EVeGmexUyqQEc6iO6ZM00tBOLqx1BTnSddUKNZc+KNCMXWzKxZKjsaUn8ZEKgtrqtr0Taq6yeoSHuXsbnMiOvesleg3DE0t6jkV5R3LiGv4qYcHu+IY8pgopjzL9HNkiXuCOzLeashjby7AekLPf/RpPg//8Ovc27V2EPfpyX8NS35/vMvvKvftWnULfIfJvn6WNaa1sRWa7JD+AzKOCT2xY4UIzvGIGDtEObPjeuXddgdrCeSe/9X5lpTZsPwJ9dxJw5bMJZN+M8lX/EP++G X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0bc4ca4-5bc6-41f9-7ce2-08dc5d1321fd X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:13:14.1051 (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: Pzxq7IRI/wiFEqFqn9RMj1JIt7LFFbozl+jc5d1j5BZoDFXbwPlsWLRf2tk/zrUNJ8eKSpEzxMb6VJOrTsgeSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231324_116155_F1EB60DF X-CRM114-Status: GOOD ( 13.33 ) 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 Changes in v10: - no changes --- drivers/perf/fsl_imx9_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index dffe7c1e4809..53cb2842956d 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 06:13:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629445 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 81373C00A94 for ; Mon, 15 Apr 2024 06:13:49 +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=F3ct2n6t/NORHv9k3OgX/aBABcReO9nA9cAboRKS8z4=; b=XUWjHs79YYt/0e 4X3vNosmWsg81zFaGD0r+tgQ/54yBdqfEUTBmPYw65frSvAc7LxQzOamx57lmUVmloz30b6NU3swU Pzva6/dOGokpY5/iySCJc7u5NPRZWp8ETcD7YuwZ53SQ8YvIs1k302pyCJ7NWuI2vIaeHAnucirUr xRkEnhuc/vFXI3eKRfAkvN2kOhU4ZRhdecCV4NVq/UJshlxo05/Nt/z8ePE3NZeOGtjxXdIzfFbX6 2fJpUItaQnDDYLvngcEq2W9Ea4WG2m+ZGBB6HjPMWi+PFTH9QqxmF7lzgY9Hzs+gXDCeIfopchEM5 hePelL7xlqJTyAok8LVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFb0-000000077Qq-0yBL; Mon, 15 Apr 2024 06:13:38 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFao-000000077H9-0Ltp for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jUFn7sMDO9RwVot94u/YFqkDlsLfUl/sAPfn+ZC33AeZNaST7Z1znc1tTjeXOVMMNbIKiUS+sTp4UryK7vNmx7kNWMb502jDxprGYIMyh/QQOv0+ulerjcHRkR6m4APyBbmFtgw+RWszZfBjMeNmD0x3712vuHm6XVNFEAV/QUBbX7ovST4G38FZX0B8mI1UGcwNCzSp/zTA9+2Pcbk15kFXzD3JvMXc0rswtqssNqubPIy/Sj8C+fKJpTo5RwQR+kNZZC82y1qPgtTNenP7PvT5M694qPyKUFuZSQpu9mOVEpHL3TV7YSuHIqOob7piX0wNXiXVmg2s0DqOf0YlYA== 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=Dew3/NayzFR8KnIidVroghb9ImW1Btyh3d0++4mXQSM=; b=hVMRaL3y01erz5Psm2L3WZ3HA0ObhECpiN95MGyYZ5LfWUZ3mSmokbEA3yyExBEh7igGYHyS7fYHOJbntu3oA+mDAyKZhKDWV97E6igtTmsanLzAGRWEj2N8AmKTNJNUinPbz0BSfx3Rv7ew5cm7tztbI0TGDKGYqBuUVAH8EvBhMlxtlqDtmkjkc1xbz/GoyyDcUe10UeZJrPD9ZzIyQbN3jA4kfkJ/SvSFAiK8BgH7lyDzvpdVklHrvwyeA1MIh0CvHNFcu6yfqiiholi4550laz0HOv3IfBImS9V4+M6pjpzVJKiBl/CbShvRfTi1LhCBSgCeJ9wqaA932hvo2g== 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=Dew3/NayzFR8KnIidVroghb9ImW1Btyh3d0++4mXQSM=; b=Jkr3xotBgFJ1f8ElL1CQjKwXlaATv3kD4w+6Ju56I2Czu/HHbCkANpP5UcG9BVP8Ju4mAXm3W1UaTU+phXsQ/mnqrHmsXvOt94rfgT4KNEzSDngnkhn2obCrrsyDF5WQRcCvVSVm2fk8FLK71+KKl2nZIq5nv7we16sHVezgcUY= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:13:21 +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 06:13:21 +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 v10 6/8] perf: imx_perf: add support for i.MX95 platform Date: Mon, 15 Apr 2024 14:13:18 +0800 Message-Id: <20240415061320.3948707-6-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: 12e93536-426d-470b-6689-08dc5d132689 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2XBp05TaRLA+dMDmMRefwY9h6NDS9ahTC24Ud0/0KrHEPg2VR5CbXERjU8CagQHGya8STD30XG2khmHYAJKPJNL4xkBm1/Avcgskw+8JKwbRME1rMfEHdZd5eBskz5sGaoQauKsbFQQULoHBmnEOycUsnvcp7ipfiHU18hnGsYPXYG+IQemZvnLIlIPdVy9MpwUc418yRErrhnyoFLi930G49AfiWWKN19Hj55hC+/O3uhWKdzuLQOxclAK6x4yDmSVwzVALjWgHQeTBRBcTFe9SU2h8yuNgYmued1uuj42rNWcTxG9KiHTwimaLFUcyvT2ZRBdSayChquPIJ7fQLNK8bTzwzBjPcBf0dg5T7VkfZq/AHM+lC/FCuAmLAdduA76AOW8utok7E6uhmhOZJo0M/hrkZnnEwtaTwECrU+sTz4OuAp1gLFH1YWyC5lmkcieHhz/2YeN4l9wAyN5IclE6clpaLmmeMNTAcFmMqrE85ROIk/ud1BiiA6X+xwTUYeuMOHtV/j1Zhvg5JtmjtONLZVfrTw+k19i3KboaTuLHAxTr6cuZPsunjajx4Te9s6NYYVRSpSHMOVC5FoOkdF/dufVcBDT716QwxixSH+wF9LKdzwv/sB0ThJD0OP9bbhAKsFk3A2+DYvFNzv9FA0OruYXGvdXXn4N3+uOxFVcVj7+lpVSHEPZ6X7OReibOrf39BfxB4ztxP9TzFbKCzFk0xDF9DOINtOtuuymM9Yw= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Of+Xlb3i1o92wisqAoI1LCzOwWmiEdtvVQUMZsZQZqLlOZbfWsx1lRF7uk3jgdVha8jxY4xLFjxSH/6C9qk9nkv13VNH9T5IzYTM3AnEGJ9RXUtYswZQOqr2MyYTe+OAXIoF8WBZw796fM2DJDDKXyhPjqkmTAromFfWr/dyJvMT6s+SjBTMs9ggdHbiq1vfPSsksJFrVHbSnnWT6CUIfMQpJ7WvJ4jn6jzfqGg4/nH0VJ2+y+PoGKPK5eg/wGbxjk+j9JqVVG5k3n6OKuSpNWgGQMh3O/XWjNAacIShDL9TqLY14ttAr59K+lckG6GiEEbh6uKmtR1jnxegmjzAe44BCtjXZx5GSDWGH1SYAgFgEn6OL5KypvpHuF6tXaPf/VQNgHYEtff3Pj6y247azWe/NA9DG7LpvYOIuuQLvo6MawVht5sVRLap0qIPo6pBBqnaR76Yj/1JfirZFeuwoAHf7eribAPAB8UNlAiD8oXAokt99y0tYUAji2EDnSX9nfepH+LIcaX4KT72iuGSbXzCSMH48ZlR6XwUQ0iBs7a/F042wEIS8sqaQcprM9KZWzMp/nijB1hYDiFOD9o+Dj87jupDFZEDabxBhPwc3gT+5OI/jDd840q0zSlBF9Ltik+n9lNXbSw2Mri2NPe3WLNze9eyF2SwCtFj/sXaoOO6WVL6FzQ67OksJrxHXaZSqvYlDRbzIi+GZJyKHeN92AxX9JJgxl7omYtKGvVkSsRKb0x+o3qKZDeaFN6k64Xn+iQ9fBSdWe2dasbFmQeeteTPnf7c5nBZJgZoyLCAEvqdbVV77hiC+q5ytBm3gbpZNBb/ln7aeN5TBdrxUK16GCU3OrcZbBGep+gDF9bMQ/bc+LYW3pUVYbW66KRA3zZc4W8Fnqtp5rIx3CoacpmIEJiHD1dr17IxlrXbCMSfFDDXV05p/Eg437F0oadc+1Uw4YLSgqxJMNZVxbOzr43rweQXx0Uyr6tbmiGl4xF1b0c5W78FTZbvcxl28+medg22uJgTcKYFXolID+fGuJJiIX0sQiNguJpnK1oodahwYhVM0fWmiQJ3h1AxD/Q9TTx0MOuc8aQ2OQ4Zz/WGxHGT7hTRsjT/2ANOt+RF+kzepKaud9z2ny0ydCxRK4hu7th8hVUucVdn2CFVart8n15mMSl0dZe6Y2vcK++UFadRXl++YrVrXJ4s7dqVQgZd2ufxJ5Cg0Nv9LEnqMxgiy4+qKAM0SvTdvPbTekXt9O1ZI9jEBMpE8RyYEYgNXdLtY19dMYBpnIC+1lQNAWJr2g6Fc1HkbIx4hseLV1SyQYagvqr+OCfl5lYamZhG14m9Jk5QWbwUXorSG1ei4BitzLBdC8bMx0EqKKZyPTVj4tXeJ8/q+VfNKqqDAO4L3QZm8ymEwqw9yZzxNMYndORJd90x2t0uqcM+UsYahMob6R67M8Nh2WXnaWayolec1GqTQu8ESZzho1ean15GdTZw4vNUh3Gd43U3FCxsxfgVEmvFPyaP8a51uB7aAO21coMWzOkeKiqd/aB+MD+IVDicvTNJekDaHIE4Rgp22t12OgKJwuSDzhOdB8KSgSya51eWvyQJ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12e93536-426d-470b-6689-08dc5d132689 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:13:21.4507 (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: rEGNQPhjz+tyHpLlwahDwRziXIzQf3jbYRAEMKwj/+vlz1YZBwhJvc5dJO+kA5iM5RKAd755K5EhfUgEtcIy+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231326_264205_CE57A206 X-CRM114-Status: GOOD ( 19.78 ) 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 Changes in v10: - no changes --- drivers/perf/fsl_imx9_ddr_perf.c | 89 ++++++++++++++++++++++++++++++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c index 53cb2842956d..d55845c19278 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 06:13:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629447 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 E69B8C4345F for ; Mon, 15 Apr 2024 06:14: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=GyRZEZDQtiZm0MZl3lXhx7B91uCmiD9/CbOnTx+sgag=; b=DQ2hmoVhasqmnW /onK01ZP1y4VZSVQTq49ikRTS+KOQj3nX/1hQSkTSnlqo3tvGP//sMblVI3Pblh0OcKg/mw8TcOMM E88s8MdtD8byaypW56FREXJ1gtKs+4b8D5Sm9ZdIlV7LG6hPeXeJ5B9UFRzoCaw3b3Qq7QPv0lAF6 G5UjV4mAMkqglJ9FqZ49hqMroLOh0qmmHntaqADhnqJ+hU2IA5XBxhm99lFGaOD2ek3icg/Siccnl BtiCmDDvw+Jz8K+xv+sR0BvHXgHPrSKzjtRgIBg+refo3erimkJvRVTxJUNHQw984izoBjKtHME9+ v38XLNWYSFtgvLgeK2VA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFbH-000000077bQ-3gAC; Mon, 15 Apr 2024 06:13:55 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFau-000000077MH-28XY for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VHTz+r5/0TivSkirTBMLq4AFPmJ7LPB+2rrTrpmtymG5AjI+7Hc3qCH7U52HowLBgqx0XbECekFUkQY1Uys2SzAWW0iHZG0gg+A95AWGQm7VzpPGz2qfFAq3y+BtGXBflGQnymDV8+K0BftISUh81vVsL9Oaj962J/TVDaRzRhAMZuOVk9p7LzlsAw+wMxkNySvzLYZ88Xfwfnzusi3jRvESfZl1JR9MtZ8pNmFOW/FOZioba2SzVuKae1EKcxQQgdz4a+IMBGUt2vGdmdAC9FAigsRc6WTW9My5Vr+76Lvo6eypH+LMxAdIybLm+NmlVfSfKwUFV8VyDNvGpzzC8g== 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=9pm34x0EXhKCN49EklYNIaJSmOw6/RsKCfVpTwGXX6M=; b=do+lJzBckeca9KwV1feBBd1XFmV3oIHasyYJJbrJ7hw8xGthZDyVc73sYSUg6Xrm2Pznh+ainnZwRdtD9UiM1VqCHZQNN0mNAJ0Vkro+TdQsvLG/FtPEEoGO8SH6cYpuo6C2cJ33OqJ0m9DI/6FViLludmLrVxz6epU5yvC1grzAJNt+i4HiNw1G5uXvn0PDtaixtvIBKkiBhflwvCYzBG6MxH3xrpV43kVHV9JUaTGqp6oQNH+Eflai8d5ahWw44w1bKMe09dvtPmNFrOO+6tjhU6Ho3KaGLONSbInCNZztxBmCluc4yc3AzCfcXwYEaMIr+pKIEq4manmdOS2S5Q== 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=9pm34x0EXhKCN49EklYNIaJSmOw6/RsKCfVpTwGXX6M=; b=diT3bGTMJMpl6zsu/B2Agp7HRO90xHUrcB2COjuFlgiW76vSvP/12ZNaOHgNHriaWNtMhg1bbaJy6jFEMD3HENQt+CZhMCu+fvQahDOsc/386O3R8Y4vf+ryYt32UELgKis0lAGJ7TxMZ4leyy7SPGpYUtGGUhTF4vG4Yc3Njvo= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:13:29 +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 06:13:29 +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 v10 7/8] perf vendor events arm64:: Add i.MX95 DDR Performance Monitor metrics Date: Mon, 15 Apr 2024 14:13:19 +0800 Message-Id: <20240415061320.3948707-7-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: 3127847b-3fdf-43d9-b571-08dc5d132ae9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xdoDjSJdJ81Ot1WZEFjkoUxxjofRn/NDjMjRyCbz94kfXlB22TCrCTdIui+3IsXTHRe/k2hTDJzYthdxMdUk8/s3VnYPvEuHOo3JJmXQOawEts3oyVNnKtW0VMvklYu3GGGX/mwg34rALqT7gnD09eJhk49zRJJrDI23DaamO1BsNG2QsmDqL9cVl3DqFkGOoWwBuhv6hbcQZ3OQJeWruXjfLvRESyvRXqiiylPQrxQdFxKrx1as3TnUN0WIz8ZIqpjXhnNhoJKmD/OqCyLJ5nGKcd92SB7QU6UkzfSg8mOIqDD8xtAplqCK31sfV7+8PcXFOzOZpmNJrrbnksy/6YIPLxIHZNXeMr20kPSyfBr0vfRbblBjvEUvXNkiQPdlNogJCQTi7swAnjV6wPDBVZQvAM7NpO/gjStwQq2YRBrBe2uezawBqPefoaMljoFsYblPSNyA+Ogj0F/7q312DJ/5WQCHiNEDOs8bWS+fyK/ddAQZCZgznI2GCwByFFRIX97sbnnWuO5jzW0cMUQzBYUTe1uDBwv89ez2Dvxuo7IV4jWhJhH1gSonhIUnUGwpCBKrFqQoC50WQGxnXchMsSCBZDzlgQsRqyC27uJ3meSlWzzaSs6FVsg/8KLxPzZQzZSw/c/CRZ66gAjlo5bsxRrY/2JRh2JxuOC2WcGcOMzcXvh6P9rWLrk9apGiSovGF+XCnO/LhliKpTIy61J6xT04INjMY7Jep8DbJ1BSod4= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QaLsbgStUyAvZIYbBPrQNvO5eyTdOPD5e5Mp+AQe7kd1D2d7emgOIDD7ll63Xl1zGWO3zGDzEA06LFvkLFEMvUnwV0liCgWVjEwWDq2RJokfi6DC69a7vQ0efFLpMkMCpAWSzoJXnfU+Jhm8URz9uACezzkqN7P2GZj2wGOYOYNDwtt/3o22m5REDszQTYbaM+8IXsqttGwU8saU6dM5V+zITfx6dSpvi7rYo9F7xGVkSXM32+q0q7/IOGIJXrK/hxNtM17rydjBpIMCcawH9fnvZg23KcidvbKPoiz+LVfHFu3wtlwyzqHiAVRKgwRH1UfSoFR+L6i3js/eFuHdUx1k68i/NXfDkapga/9gtuF8yBrMJNSWhU14sJBqn6+oEBThiWkCWipPTWYVdpaFdl4jnPAFGmyAd1IosUVKyC2E/6ZzW27Mw9nFn45wmQPXBTtWf8BgJ5WrgDytCItoL07FjIVzRuOqrKrnMiGSwNk+S+u6i51ZPLIGhmy+x/BC+7XSnGDqyu/eZhnGbNzh4DcBPiIbKYjIUYZBOVGslA075rQqcUzn6PubJZ6UaIWBUqpo8ViwLuD+tV9aCNtfHzCb7xfhzjQJN8WW4QmNTIVPC0q/7bE5opmHOofPQYDNDSHuSZqpiYIeq0uc9t+IULzftd+3sp9BFLOss+nXGmuBTCPar/ZAHf6yWtcYIMZBXgH1/z3lV62GtGzobIC5L4YhIAqXwehD6R0ys7QA+tytMGtgIJ7dwnru3XdhqeQch4joRFtjJvqsSCbfX6lxk11NeE0zLhR3bgL0eMyRV3vA4DBgNqycr2oSsJAE0UwQBSS7NAm5na9ybupgyMY+W9ezGodn1RDqhGnGVdXr9LLmiHHDB4UE7ONcJArY05UIRUAxYljhyFONFIrX3fpLsU599m6eL0T6WeYyXDffpLNNuea3N2+qdT5Cw4uuzxIgxvUvAvh/bsrSI/Jzwyim0vQTYLe+dl9Ex6rEFaHXOzmZi8X/4h0OLXlmFLqg+1ZaX6BdZ2ZLWpBuC/uyfYsIFCVgq2yDgX1DC5b8xEV/f6bzWTwJTpFmRelGCk7RKMpueCtL1zux6OvLx3TB3fflndz0MO6iohUegQkqUYxH4hQ5waiEXcmF/42Q9QRas7bMg6MKG9kuJog2xxWaLT/s9iPEZjlZVFOSNY5idOVjYQmWEXPsZOWM2CKCjpnPG+LcFAphHYfORTmX0+kOZFeksTIey6wfCpgdj13a42FoBXfQ5Nm8ixJkxbAQyZz8fburbiPifgXHU4cSh5p+od3sfPu2VAVldVM14uzg2ZHmYQvIWJC5L45UTdE0S7icWAT/9bWx5Zf2jJ+HdyYJpXLa/yf3OxTHmAAe+3LRRbbKV5cASofkhyfzct/OF8eFfRxUn1gBbHmTfvf7L7SxfNIcomx9kzdcF5h44RdrSO/1ywp4BpKm2BQvwsFXmuEQZvpwRHIm7lXtRoB61JBc5PHo0A4dDkPalG53Jb+rqpfUNecjHZulF60Y/m4ZF9haGUXHHUj3CuXAb1FNZqdpSmlOvdnlt3sEQyJbTsdcxvU/y5YqABGejhbowvXng7K0H3rg X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3127847b-3fdf-43d9-b571-08dc5d132ae9 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:13:28.9800 (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: RhV7stdeOUlzpRa7AXcI8Shkyl/KvSZIiWP99qJA1w2gpTB0vzReZpqPsFvDih9SfV+vx8BDQH+RXQeNWS3I3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231332_938365_008A00A8 X-CRM114-Status: GOOD ( 14.08 ) 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 Changes in v10: - 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 06:13:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yang X-Patchwork-Id: 13629446 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 F2A83C00A94 for ; Mon, 15 Apr 2024 06:14: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=EinFCo7z2CVSNAG8GemMgHo/gLkTlpepMBSR7VfdG1c=; b=dmrPu4eO8T/HwF iyOKfEVWMvcD6ca87lbmlsNV3rh+mePelIR2PdklV0MWiOtEYRwEl75T9z82tnIAkudHfasiK8G1T 3fXnQeJMUmACeEo6AjWX53iFey5u7ZzphK8BHrJ9nWHODSbiyCwxTxFwKpAxTpAXR3ceGUNN7lVVv n5ZPTMQ2BdktLTZbjBmkttV9aCX3W31R7l5ZsZ2nyhKrwLX9ZVoa9J05dcCo8+JOaQ4EMoVP9cKV2 1kYgi3kuLWMsD8XhqDtnqLU5RoED4AN4EGKEyYzuafxKAty90uNnPIE1lFgaGNuVUFrCSFCvYhI07 YiqleGzBZ1+0Lam6TBXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFbK-000000077ck-2b4a; Mon, 15 Apr 2024 06:13:58 +0000 Received: from mail-he1eur04on20601.outbound.protection.outlook.com ([2a01:111:f403:260f::601] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwFb4-000000077MH-0DpN for linux-arm-kernel@lists.infradead.org; Mon, 15 Apr 2024 06:13:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MkOpoeskJ6X7VrhetWH9+OSJSdKoBtSnYax0zp4pbMtN25Xf6NjxsvtVxaltv5uCybPSdxlaLDHJ5dqY8nnaoKUPiyMDYlFeBhYFVKO/RThkuJwyvlkWAimdH5CU0cPo7iYxDouXJVKzeBLGN8cQ4fBogqSE164YIu86IsSm0huqU4CAaWT+BwCf+zJvDC6xVqR2J7OsqSFq7wzUepzOq5r8RpBp6pb9bVo5opy+moL90xkrZaMes5zxzrN8dGesjgr5FcGSqMKtVpFXs5NW2pW9dLSN3kiZUslCTIhDMKXEIQ5Np7fOUs61pAaTWl47Q1s3sTxSsb3qhtLky9iGAQ== 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=hBUyQjIrMYdgiJ+kX+6NtTB/cwMwzx64deIcsYIdVYU=; b=K0f4aDHl06rXjkv2goIFaI0lzvt8nFZipm2UBqkIwz/kuP3km2cWB1Ylk2AMIB0fnW5YF9LMHNkzD8dAkwjqXh8BjsJ8QnAx8H3K6WmJth50F0fK4Ci8C11YKyMNbx8YVF36/gRkNCPh+tgY/t2ZnuKchGZEd5D6jXGSGpZwzytwoaK1DWR8Qn9moIG8zVgaBL+tIlZGVNz3BN4mM43Z2lDjPQKTun1Lr6Cww9T0vArXyftc+CtYVoemIW1wdODQeEcw1V9y/f4p+VgUL+5W5rtoG8XT136+h8GPpruxcJtwItJPCYzAxclb0vCpoqQeATheA5b4YHaUNf32URw95A== 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=hBUyQjIrMYdgiJ+kX+6NtTB/cwMwzx64deIcsYIdVYU=; b=Yl4de1KfNlsy5V0C03W0hng172n6tfc5bMTNSvAN44kqJanMYuGLG54JukAo1t86E2rCcGfYcIDKQw0aK2ov5B5m318HiveDJ+wAFQvXRG4jUiaiHv3pPu2CFU+JAjPV7thEXsVfqlM9xWN7tnw+Jxlp0B5ZMNfE0GMUffGndPI= 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 PA1PR04MB10117.eurprd04.prod.outlook.com (2603:10a6:102:454::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Mon, 15 Apr 2024 06:13:36 +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 06:13:36 +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 v10 8/8] perf vendor events arm64:: Add i.MX93 DDR Performance Monitor metrics Date: Mon, 15 Apr 2024 14:13:20 +0800 Message-Id: <20240415061320.3948707-8-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240415061320.3948707-1-xu.yang_2@nxp.com> References: <20240415061320.3948707-1-xu.yang_2@nxp.com> X-ClientProxiedBy: SG2PR02CA0034.apcprd02.prod.outlook.com (2603:1096:3:18::22) To DU2PR04MB8822.eurprd04.prod.outlook.com (2603:10a6:10:2e1::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8822:EE_|PA1PR04MB10117:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d74ba00-050c-4798-0b0e-08dc5d132f34 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 18BNEh352gPMNWF3Arp3GuczjkiTikGYdy9Vt0V2xr9Nj1ZgvdqlJZysRTICVWU76IN8FdTOdkGnphImbJM46RWP+D2tA3nqKTS1AErTjH3uqoIz+JSChZ1baNjQM12/N6uL81SaooMc3JuOgLFKvL2MaXE7Od0nw4QTA2szjXLdcep8G3CLwpbowl4I5uyhvjcIUj4a97v0z4W2w701CZF9X5TpWtVA9W1zSByLu7ZfJOK7KltsM9b/CMhMPFrX47Fz0TGPC64DtrhdFSwBaSZOfv1G0VhNID/S7qU0j3CnPINWf+mP0b0rOJI5+ORz3Ssy5pqKS/OPAWXfzLhUUN0GjptciGZSTE+pLpfO5W6/DbjIMzEAMPTxWocYETlo+X9PBl4CIgw1CyJ7QEOGMVZAjqsmcaz+5BoM4Bl2uLSyOKw6DimnGQyKALAjDgeVEiCZik0mKTLwKh4zLSwW8e+E4v3kAmJt2ntOWKySkmMXbN6vloKaRWbEX/24yWHCn24V9wZwLaUme2xFGKo0+p7I7Ze8qTL8Deafm5UN/prlxnMKasU8DQzjT7wb6UxZwLajhXleE6HW8KltzZSZ8ISbuxPtSYP0ZFQNA1euOIqu8MQ0H/Vz+lBELMBlLJTQhLTS2WXJBlud3+2yjsqN8QZ18DDK5Gsjqntcm29V18FVJOriMb1pOG83FZizCuRzLjCWnbP+agtovZr38lrLtYWTFX0jA7xifqb3j0DkV2A= 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)(376005)(7416005)(1800799015)(366007)(38350700005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fDu312fYh7hltzGlFwtoxjDWEPhEP6ssc/SHdhGW9wHNI6Aw/Id4vGyHu8RgA4+P3x6TEaIUvAnQ0byFRwIqTXetyqM+12bcohNeNljKn5dNfLAvHCX5RUU+uq777W2Kr8YkAV06Mdh0jO2W2+ZtBxZwhHl30xMlBrVzZ45MeTRbMpVg8lZS09x+xrLogo7RRYE52mZ58OUDzh1ra/Nc2MJ4notb3O8FBmI0fIWY3Djv6s9dkoXv5zVs0zAfrURnwjWRtW7BQ6iewY0Ylnrl+fyhM7C+l14bk4CtAizqFJ/gV6jFLERPIoeUr3O7Wj/8EN2x35q0R7k+RGcgXr5XnefARyFqlc0+s05B7IpTeYI0uKUHTwOypL8hWv6qYIAkwNQxejZP6VSTtAyzpsWTT7G5vaw62oUEjTeZGfI1l7it3Cc1zUmzmZ2q3Xiqxba67KBqg6ggQoWmz2o4crIcWfm0nZ0Zou4uv8sDrytRGIA3vTErpgi8dDJS76BLHFI32jnuMotoGq0Pk/fHSHe+kS7n76e1NhSM5P758IXPgIDXDEtzgsOJcqWbSzxe1PEx5Hh1J+TgsEyEjgGaiUci3QyFb26negOHQaxBrdw4KECKWzOfmYjpIkRAdgVsRqKshy3ddVM3o9O2/FsUXhu+acDKzLYgLmzhIr2TiOBMsqO2jpMR9hUiPXzjr8t/JvYAKuXz3ULfEc0VBfGPACFAE54knfQW1zPxowPUCdT1cFjBD9w6Hu+kCyu9a2CsXSTcfJjsdGFrSzyOq/jgveTW12dfUnHlaE87aQpCrTqJ1iVyXCEooQMYJFHxcywKo7pXZPjOySl3RmxIc6XcSbnhsUcdDGwW+eh2mjVaqfl+Og3eQLxkeu6pn+AFhz/l9tdqGUvQUCxQ3H1el6GjDPvTK8hR8akStoRBRkz4C4M8tfl6bYDD4yIOuPZif1R9SUwdG6j591uHJiw6+zArCl68tHmd6esKr/HXeRNpirHkNpAH5liY84A5BWsiyUGdW0NnQCGOqq4rUrsQHG7/HVWZF3kuMhJk6tvmn19neC3wZRNrJ0Nbw+WU0NbJD7i8Qezup4HgZDSs0IMDOOZf3PQuEsGvlDPaeJSjiyb1iZ/yrH5m6BUbHCgVtJdr3ZsXmveHx1s3MMuRYBNFV9NHoOf1R5luAG6TKIijIEg4dcnB4kBIozzPOlA/epbYhj98ExeH+bajenzb7sNNtyoui29eFjoxd2EjTgy75d21roDfJcX250m0UbGV2Y3fZtnVpjpJvfIe0ArCEc+KeCQLS5jJFw2rGBZCLrQI94A6jbzDtVJmmndYuR6g5lt5BEAn/fgIRBvy55vHVTG3rAFCkMLUisGp5Jy4GwYZTHlxm3jn61uwEIYDDdBWu8eg/qIkCechHfoR2ERWi2LPZrBCLfrchBoiuToTa1eC2vPoBHzGwUBFMCN1vl1f1mSnplqF5ge8aViJoOGV1lhcJ7ZVK3W2uEqfilA0k/YfLLk8BkKhfVyiORVyXC+K0g3/phgYL/9PzqnkNf4TBAv8NX/RWZxbPHgVKUyCcQ/iUQimNMPjnBSnAyCvjjGe675KkHgBt1Va X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d74ba00-050c-4798-0b0e-08dc5d132f34 X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8822.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 06:13:35.9439 (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: JQM8OxwUAK8I9IPgJ60dkbhHyDzWFM1VrGgSI5vvTR3ltTnaS5Rl63o5zCcEMh/3bSprewcxrBczIXicL1sZLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR04MB10117 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240414_231342_217142_5D4132B5 X-CRM114-Status: GOOD ( 12.25 ) 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 Changes in v10: - no changes --- .../arch/arm64/freescale/imx93/sys/ddrc.json | 9 +++++++ .../arm64/freescale/imx93/sys/metrics.json | 26 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json new file mode 100644 index 000000000000..eeeae4d49fce --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/ddrc.json @@ -0,0 +1,9 @@ +[ + { + "BriefDescription": "ddr cycles event", + "EventCode": "0x00", + "EventName": "imx93_ddr.cycles", + "Unit": "imx9_ddr", + "Compat": "imx93" + } +] diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json new file mode 100644 index 000000000000..4d2454ca1259 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx93/sys/metrics.json @@ -0,0 +1,26 @@ +[ + { + "BriefDescription": "bandwidth usage for lpddr4x evk board", + "MetricName": "imx93_bandwidth_usage.lpddr4x", + "MetricExpr": "(((( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8 ) + (( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32 )) / duration_time) / (3733 * 1000000 * 2)", + "ScaleUnit": "1e2%", + "Unit": "imx9_ddr", + "Compat": "imx93" + }, + { + "BriefDescription": "bytes all masters read from ddr", + "MetricName": "imx93_ddr_read.all", + "MetricExpr": "( imx9_ddr0@ddrc_pm_0@ ) * 2 * 8", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx93" + }, + { + "BriefDescription": "bytes all masters write to ddr", + "MetricName": "imx93_ddr_write.all", + "MetricExpr": "( imx9_ddr0@ddrc_pm_3@ + imx9_ddr0@ddrc_pm_5@ + imx9_ddr0@ddrc_pm_7@ + imx9_ddr0@ddrc_pm_9@ - imx9_ddr0@ddrc_pm_2@ - imx9_ddr0@ddrc_pm_4@ - imx9_ddr0@ddrc_pm_6@ - imx9_ddr0@ddrc_pm_8@ ) * 32", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx9_ddr", + "Compat": "imx93" + } +]