Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3057395ybt; Mon, 29 Jun 2020 14:09:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+ymrnpqFyX2KCJgSle0dtN0kSb0LzucTy/LZ1NkVPQVoQscrCAA00GPOP6QJIStPiYjni X-Received: by 2002:a05:6402:1346:: with SMTP id y6mr19815365edw.192.1593464941877; Mon, 29 Jun 2020 14:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593464941; cv=none; d=google.com; s=arc-20160816; b=naK2YYuzb/h6akauGzJ/hsv/dhKkdgDdPxYykNAv03JqCoMKoD7eLULG57LJEZGo/X HmTe8gBqI/v6DzMrGLtrqwQv9nX7gOw8ckFkXOxI2CNEABhwzlFpkTAY16X2fYFlVnF2 4o1maaCarFM22bfELELyB+FL1PDlEoKLs+gKvGCn/AH6VSffMe90g2KV7A6gGsbFjJQI XjNjUM9BDg2a4Miza01miwBW98ljLnBnupHc57v7kPmkLCNUHZ2OAV8Bht8bnldtr8ld 0eVQG2zm01vfLsMbxQwk7Z9evxqZEuBMKo6A2ImNMqCHNN5sKtxm80Offm+MR+pshxlV xenQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jqfpvi3iYp3AoWQd6MSO7doKcVpn2TJcLUHhv2lCYnI=; b=s06QqqWia3oxRPlUuWqAKixV/n4S/dDdz6wwUbaB27aJ15WHeGPPlMk3Kuj6WwZcTj Hfp5jszZ6p/SNchPLPVwPdXOOFBLKTySMndGLHIir7EXzS47jIO0EsumwBs7R4YelYXK A+uY/hf+Z+lE/bD4ygALYhVCSjGjIIrN+lZ15y8tDGp2XyWaRF4Y8tZ2yTqm7zpVG1Mo 2Qr+JRkQhSke8AbdzlJd1M/3QAIiDClFw1/3feFHhWdT8pk12W1C+eGC+sLu02Jddaz6 RFaqN7w/1DbkUAIGKCwQrjxsLbxKCKGB8rQcHpg6j+M7oIK9Lb9VAu52pqtT7TSiUUNy 2z4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=P+epqYZl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y24si309158edv.573.2020.06.29.14.08.39; Mon, 29 Jun 2020 14:09:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=P+epqYZl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731227AbgF2VFX (ORCPT + 99 others); Mon, 29 Jun 2020 17:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730964AbgF2TMn (ORCPT ); Mon, 29 Jun 2020 15:12:43 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA116C08C5E0 for ; Sun, 28 Jun 2020 21:09:37 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id h5so15067864wrc.7 for ; Sun, 28 Jun 2020 21:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jqfpvi3iYp3AoWQd6MSO7doKcVpn2TJcLUHhv2lCYnI=; b=P+epqYZloSbYG+AbCi/vnUslABKw6dTGUxMtmqk70qo8e+GHDnz6Dbj5BXuIthZXlr 0CUpkny20y3Yi7lcLdxO2389kQqc1CTuKFzUqM8HFZl6leu+QHNMNupx6coQ9Xamlt8J UrVTd09fowebynpt5CnTRX6sTrUk3AEUOWSufL5JBNhUQc3w+a8ju9ea9wskW6zcwJIV Nk9jFaS8B2u61i4nClqxT+s5PbGTbUnE59r5ZZC+wzzFr3EQ1+J4+KrFqIXMj1UJ8dko PHGqVkikH/7/UHJnsmnU0RCBkuyeJOQlXlvXwZG8auj4EAlsUCItoyML8iPmiC3N6of5 oQXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jqfpvi3iYp3AoWQd6MSO7doKcVpn2TJcLUHhv2lCYnI=; b=juKw5KT5U3FgKGuix7FmYB/VbmAMYzUW6YttjE5ZHA9q9Bo0qMVKLY9VNShciq1iN7 wcq2YcCrjMvfA79uxcXBJtGZYFO7dcCbiWF5B4zUwpVLB8g4Hvm9ncku1FHCx1/5fpxR SIF9/kmkK1PUA0D7XGcojUC7zkHtMmpire0Bi6ZmRKTnIBRM0hbUCo+vuN7mvNsocs7e nZwUq/cNVJxXJkW+bby1Yo7yeSX4H1LQ25rxh7gP1MD6EL4f3xkyrBkXlV8KxxjuCjJB RK3J9sVkWpxntDKiEnyEPZF7TyhRE1TriDTOaTV34saiQOLwSARlCNfQ/6Qi1MPGFJ+v GGkw== X-Gm-Message-State: AOAM5312paaV0/wKEU+M3QnAfUaLHnCeFsVZvNhorVVsn27TNM5xWZQk 6bTK+jREf3MnzHgQecGjh8mQWfxjcwjJlqQtooVOVxI2 X-Received: by 2002:adf:ff87:: with SMTP id j7mr9282883wrr.128.1593403776321; Sun, 28 Jun 2020 21:09:36 -0700 (PDT) MIME-Version: 1.0 References: <3de3a480517d167a3faae086aa8ab0c0c7141d99.1593397455.git.zong.li@sifive.com> In-Reply-To: <3de3a480517d167a3faae086aa8ab0c0c7141d99.1593397455.git.zong.li@sifive.com> From: Anup Patel Date: Mon, 29 Jun 2020 09:39:24 +0530 Message-ID: Subject: Re: [RFC PATCH 1/6] dt-bindings: riscv: Add YAML documentation for PMU To: Zong Li Cc: Palmer Dabbelt , Paul Walmsley , linux-riscv , "linux-kernel@vger.kernel.org List" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 8:49 AM Zong Li wrote: > > Add device tree bindings for performance monitor unit. And it passes the > dt_binding_check verification. > > Signed-off-by: Zong Li > --- > .../devicetree/bindings/riscv/pmu.yaml | 59 +++++++++++++++++++ > 1 file changed, 59 insertions(+) > create mode 100644 Documentation/devicetree/bindings/riscv/pmu.yaml > > diff --git a/Documentation/devicetree/bindings/riscv/pmu.yaml b/Documentation/devicetree/bindings/riscv/pmu.yaml > new file mode 100644 > index 000000000000..f55ccbc6c685 > --- /dev/null > +++ b/Documentation/devicetree/bindings/riscv/pmu.yaml > @@ -0,0 +1,59 @@ > +# SPDX-License-Identifier: GPL-2.0 > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/riscv/pmu.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: RISC-V Performance Monitor Units > + > +maintainers: > + - Zong Li > + - Paul Walmsley > + - Palmer Dabbelt > + > +properties: > + compatible: > + items: > + - const: riscv,pmu > + > + riscv,width-base-cntr: > + description: The width of cycle and instret CSRs. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + riscv,width-event-cntr: > + description: The width of hpmcounter CSRs. > + $ref: /schemas/types.yaml#/definitions/uint32 The terms "base" and "event" is confusing because we only have counters with no interrupt associated with it. The RISC-V spec defines 3 counters and rest are all implementation specific counters. I suggest using the terms "spec counters" and "impl counters" instead of "base counters" and "event counters". Further, "riscv,width" properties are redundant because RISC-V spec clearly tells that counters are 64bit for both RV32 and RV64. > + > + riscv,n-event-cntr: > + description: The number of hpmcounter CSRs. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > + riscv,hw-event-map: > + description: The mapping of generic hardware events. Default is no mapping. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + > + riscv,hw-cache-event-map: > + description: The mapping of generic hardware cache events. > + Default is no mapping. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + > +required: > + - compatible > + - riscv,width-base-cntr > + - riscv,width-event-cntr > + - riscv,n-event-cntr > + > +additionalProperties: false > + > +examples: > + - | > + pmu { > + compatible = "riscv,pmu"; > + riscv,width-base-cntr = <64>; > + riscv,width-event-cntr = <40>; > + riscv,n-event-cntr = <2>; > + riscv,hw-event-map = <0x0 0x0 0x1 0x1 0x3 0x0202 0x4 0x4000>; > + riscv,hw-cache-event-map = <0x010201 0x0102 0x010204 0x0802>; > + }; > + > +... > -- > 2.27.0 > Regards, Anup