From patchwork Wed Sep 6 09:40:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu-Chien Peter Lin X-Patchwork-Id: 1830344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xWuR7SH7; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=hpJOyN6X; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RggYx6VbHz1yh5 for ; Wed, 6 Sep 2023 21:46:13 +1000 (AEST) 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=Bftq9LwU6Cx/JkDJpRdLWclLv2u2cPHsiq0NUEB6UzY=; b=xWuR7SH718B3BP e0S9hamPz0CfPG1VkW2U4gbkEmyEHD3GZYfcvGb+oPphW0UyoJ9jLPeahfI3jXATLDyk6TPmY+Yzv Yr+faEGyyLiBJwnVqHLXdfJI1yUPU4TWymj1EZnFOX3uxunCwVGxrEV0Gi0pdnvNgIW/c8yZb4h75 //qQKe60JCsJfY3ltAnEUBXESiyx/bd7Da4FdLyFOnyv0lWPWpKQwBo9GChUixh5S8QHI9z5mCd1w EdPU7iSj6QwhaPPSPOBcpm2SgKg+ycHDheP1Fl7NtUqTVJLRAFUP5M2wYiYgOcAFrN3ftVozQanSb VUzCyoECv90qkfmn6cfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdqyu-008x2o-2r; Wed, 06 Sep 2023 11:46:01 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdp3i-007yOm-0y for opensbi@bombadil.infradead.org; Wed, 06 Sep 2023 09:42:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=a/7yMlYY4XXSBeV1ijUfZeN8HCxDHMt0DtI9npOmtCQ=; b=hpJOyN6XbUUDytGT9AqJ17LKJM gQby3jXwxT3qD18YJ6HAdmlhWGUgZs4k1cOfmFEnUlCA4CMsae2pxsmxHmJTMU8+mHP+5OY+csktm 74cYhvAk3u9vaJ8AIWEX1Due4aVQef072kx4oO8LspctfxGrb8BASzJo2fZH+k3rdFghoFXGxIs2J XtChjocjMU8hhS6cmW+9RnUxKEOo9odmP88eBu8c9XqxzcLLxubSV5I59PGt91UFBgs/I8pT9T6NY fJyJsgJ98W5zJXgCJMh1cmkJT4skytm99YXiXpt/vkj66wG8acW1YSmcLUq1whpauYJ9EFbGn7Xje fBxfAi4Q==; Received: from 60-248-80-70.hinet-ip.hinet.net ([60.248.80.70] helo=Atcsqr.andestech.com) by casper.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1qdp3b-0019vO-SU for opensbi@lists.infradead.org; Wed, 06 Sep 2023 09:42:48 +0000 Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 3869g4jh000427; Wed, 6 Sep 2023 17:42:04 +0800 (+08) (envelope-from peterlin@andestech.com) Received: from swlinux02.andestech.com (10.0.15.183) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.498.0; Wed, 6 Sep 2023 17:42:01 +0800 From: Yu Chien Peter Lin To: CC: , , , , , , , , Yu Chien Peter Lin Subject: [PATCH 0/6] Add Andes PMU extension support Date: Wed, 6 Sep 2023 17:40:45 +0800 Message-ID: <20230906094051.3957564-1-peterlin@andestech.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.0.15.183] X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: Atcsqr.andestech.com 3869g4jh000427 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230906_104244_635242_F6780826 X-CRM114-Status: UNSURE ( 7.06 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.6 on casper.infradead.org summary: Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 TVD_RCVD_IP Message was received from an IP address -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch series enables perf tool to utilize Andes PMU extension via PMU SBI calls, provides PMU device callbacks for event sampling and mode filtering. We also provide a PMU node example of AX45MP in the last patch. The OpenSBI and Linux patches can be found on Andes Technology GitHub - https://github.com/andestech/opensbi/commits/andes-pmu-support - https://github.com/andestech/linux/commits/andes-pmu-support Yu Chien Peter Lin (6): sbi: sbi_pmu: Add hw_counter_filter_mode() to pmu device platform: include: andes45: Add PMU related CSR defines platform: andes: Add Andes custom PMU support platform: andes: Enable Andes PMU for AE350 platform: rzfive: Enable Andes PMU for RZ/Five docs: pmu: Add Andes PMU node example docs/pmu_support.md | 87 ++++++++++++++++++++++ include/sbi/sbi_pmu.h | 6 ++ lib/sbi/sbi_pmu.c | 5 +- platform/generic/Kconfig | 2 + platform/generic/andes/Kconfig | 4 + platform/generic/andes/ae350.c | 2 + platform/generic/andes/andes_pmu.c | 85 +++++++++++++++++++++ platform/generic/andes/objects.mk | 1 + platform/generic/include/andes/andes45.h | 26 +++++++ platform/generic/include/andes/andes_pmu.h | 12 +++ platform/generic/renesas/rzfive/rzfive.c | 2 + 11 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 platform/generic/andes/andes_pmu.c create mode 100644 platform/generic/include/andes/andes_pmu.h