Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9636491rwp; Thu, 20 Jul 2023 07:43:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlG7hU6Q55MhoBW7bKz8AfyTSC9QtG5OQR5voViIUgyQDBasFOQ3olziUaiv72PV6czLgtxT X-Received: by 2002:a19:4f02:0:b0:4fb:73d1:58e5 with SMTP id d2-20020a194f02000000b004fb73d158e5mr1460648lfb.53.1689864201212; Thu, 20 Jul 2023 07:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689864201; cv=none; d=google.com; s=arc-20160816; b=1BvNuYvQbqBxrj+p7YV79FV+WuL2bbzMKQH0Alg4tvpT9DRop4gDcwIIYqht7L7NW1 PU6N5KZ3e1RrUUgEFQ0/e+5CdjWoR3eGaxYhzNZJ15Eq/uQ6IFhnQmc2qdrpJgsFFcWm S4YZewg8kX0Fs7E2a+N+tFFSw0WHG6PtNOqwxVD5MNQDiaHC/bYN8aBRk5IZqWv+ujIh Ak10CNLeBZsmhMIGI6ftv1K1YPK/YpNbveVd1uRpwQCx7ySGWquBPwgHZaaOpBFJhgv6 jjKoAjQPe/JSBlisGXiFlBdbM1Vl24DKA+yq+LaMG8JAnDBoz4SWFYm3CqjK82sjOJH0 hyYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=fXSLhAf39ywnScbmnhUoNCy7kFUzY0ELotpofi8TE5U=; fh=3xx+wG6Hepspt/NGSiUiBnZHuzLdFpZMT+jv1oVA3Fs=; b=y2q7Ipz9K/GsQGmv6q0gNVPnFLMoKWyKmILHwRQLgZjTJOhB/DVq6eEM6oYVAT+liH 23s8gvGorA6G+uYnAzQvHbbcsWsC8PuT37Ev9Tv7r5tQdiooyHOs7GHq3Cz5obE+4CPI /+sRIRili8MtdbkPQxBI0E5Cs/7PAPfD5JvjTkR9lEta0YOedevQbKOipl9YGya6uKsj Rd1WJudwIs2DhCZrcgAh2OMAPWnVi3sz4DJKbBxd3n6aThavIEXl7A+gEAiT4iVuTwbZ kVdxl9mXAIo5LRVvvnkF6K5y+YF3k/gulqga7Zr72sQjNyvu/J8/RASmVIUJFjkJE0La 6xCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=D3+J1Yn1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m2-20020a50ef02000000b00521ae63ee65si899508eds.639.2023.07.20.07.42.55; Thu, 20 Jul 2023 07:43:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=D3+J1Yn1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231360AbjGTNv6 (ORCPT + 99 others); Thu, 20 Jul 2023 09:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbjGTNv4 (ORCPT ); Thu, 20 Jul 2023 09:51:56 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10E031FC8 for ; Thu, 20 Jul 2023 06:51:51 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-668704a5b5bso709437b3a.0 for ; Thu, 20 Jul 2023 06:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1689861110; x=1690465910; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fXSLhAf39ywnScbmnhUoNCy7kFUzY0ELotpofi8TE5U=; b=D3+J1Yn1+oN7iuHEQFcdEwrOcaGE9JOdjW/Hxv4MDNhJcvvM5sYZkkTba3DnvsqtU8 cqVc0jFG+k0/ItS+PfskCaXWDZtoualQxOQlD1pshPlpJdThRy7Vxgar+Qptw+PdK7TU uiHHnIXyolAVg1qQTAyZp9MO5Weaf2pyOB+m0aBZTEg2o/zRIC+hyUG6kXztXgVzCv4M nKxfLo+XAX8mqtBm33vPfiU8+28JUKCqq8l+D8FIXpyn4hIdX0SSBgnxiSudYTd4iisz xaGl8/9nmExGOS56wNW85e8qGWyYsAKTDUxtaQHRy1ZZxgPs97BbJe2XIJ+LU1Oiz8xd VEaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689861110; x=1690465910; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fXSLhAf39ywnScbmnhUoNCy7kFUzY0ELotpofi8TE5U=; b=gLUa6byJeeZ74H9jaFPHgEU8n161mrPZSHQfvRH5Vs7XaBdHmq9od7oLpS5EDZThMF WCDpl80gcMSYtBHtaLvFo3IUq8A6rK46wF58f8+lsB7E1yfkpea7Xo/XBoYFJOPaXvxj SfzfBNUpzYGiDy7GGoecm9UGukK0k3kd6rAF77ndKg2FQsAYvN8ABglj0wkxecCHbq9R A354hPtFLzxYPzUjjE+0H8n/6B3NSKR5KrEyAIGXeiVRLdEmdfMgwpgjs0/6GJ5u96GH f/XMJdNa2M53OCNkJpL+DDBC8jj6lIcm46rZMMPGFRPRv/zrUItWSipbKklN2cP0+SXd EYLg== X-Gm-Message-State: ABy/qLbv65jn6D3kYc77ySnzwWuJ5JEI6uYH/OHyWtWy9kvrvWAbFteZ MhZPG4qO/u6ln9fOMe+Kxm5Tww== X-Received: by 2002:a05:6a20:12cf:b0:137:8036:ab93 with SMTP id v15-20020a056a2012cf00b001378036ab93mr4425186pzg.40.1689861110312; Thu, 20 Jul 2023 06:51:50 -0700 (PDT) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id j18-20020aa78d12000000b00679fef56287sm1197529pfe.147.2023.07.20.06.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 06:51:49 -0700 (PDT) From: Eric Lin To: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, palmer@dabbelt.com, paul.walmsley@sifive.com, will@kernel.org, mark.rutland@arm.com, tglx@linutronix.de, peterz@infradead.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: zong.li@sifive.com, greentime.hu@sifive.com, vincent.chen@sifive.com, Eric Lin Subject: [PATCH v2 0/3] Add SiFive Private L2 cache and PMU driver Date: Thu, 20 Jul 2023 21:51:18 +0800 Message-Id: <20230720135125.21240-1-eric.lin@sifive.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds the SiFive Private L2 cache controller driver and Performance Monitoring Unit (PMU) driver. The Private L2 cache communicates with both the upstream L1 caches and downstream L3 cache or memory, enabling a high- performance cache subsystem. It is also responsible for managing requests from the L1 instruction and data caches of the core. The Private L2 Performance Monitoring Unit (PMU) consists of a set of event-programmable counters and their event selector registers. The registers are available to control the behavior of the counters. Changes since v1: - Rebased on Linux-6.5-rc2 - Change pl2 cache compatible string to lowercase - Add cpuhp_remove_state() after pl2 cache driver probe fail - Return 0 instead of return ret at the end of sifive_pl2_cache_init() - Cut down the pl2 cache config log lines in pl2_config_read() - Sorting the variable by types in sifive_pl2_cache_dev_probe() - Change the error message when failing to find the CPU node - Add pl2 PMU driver to support per-task profile - Move the pl2 PMU driver implementation to the drivers/perf folder - Keep only one pl2 cache compatible string suggested by Krzysztof and Conor - Addressed Krzysztof's and Conor's comments on DT binding Eric Lin (2): dt-bindings: riscv: sifive: Add SiFive Private L2 cache controller soc: sifive: Add SiFive private L2 cache driver Greentime Hu (1): soc: sifive: Add SiFive private L2 cache PMU driver .../bindings/cache/sifive,pl2cache.yaml | 62 ++ drivers/perf/Kconfig | 10 + drivers/perf/Makefile | 1 + drivers/perf/sifive_pl2_pmu.c | 602 ++++++++++++++++++ drivers/soc/sifive/Kconfig | 8 + drivers/soc/sifive/Makefile | 1 + drivers/soc/sifive/sifive_pl2.h | 29 + drivers/soc/sifive/sifive_pl2_cache.c | 202 ++++++ include/linux/cpuhotplug.h | 1 + 9 files changed, 916 insertions(+) create mode 100644 Documentation/devicetree/bindings/cache/sifive,pl2cache.yaml create mode 100644 drivers/perf/sifive_pl2_pmu.c create mode 100644 drivers/soc/sifive/sifive_pl2.h create mode 100644 drivers/soc/sifive/sifive_pl2_cache.c -- 2.40.1