Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3042336ybt; Mon, 29 Jun 2020 13:43:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdT93DoSW3hjuMUXRyvnx8WsYrbPpS0CgbR41klCb0hPWZTzdYGZlEaP6JfzBdeW4RC9aD X-Received: by 2002:a50:ee01:: with SMTP id g1mr12385095eds.264.1593463410081; Mon, 29 Jun 2020 13:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593463410; cv=none; d=google.com; s=arc-20160816; b=tge0mb/kCnnsh9QT7D6eetfMPhmAdBLlRRPhUqiCp+JO5LfhsDFn/QGYyXP3FyxZ4M RvnYTDBIZ8vcfJxWBNzDIGodTQkW4VGc09BFR+f5yqv161HaaSth7MVX+r/GKVO2NVFl g97nsaW3XcsBIyDIjPYEvy+egV5CQFUUtvBAokTtyMmuGTLFYGryB6JPcv7XazLFL58W F+X8qMiR7rhLbuFDtLLb8/lhCamOqjyXap03PNTPcASWE7pwb+D900ry5oLHgtcrsp/3 My9wJp1psWzICj5UXatg5JEI96a+YlagC708lC7dAOVxiwpXNKNNCYP4bZNfKWJRWp0R ZKZg== 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=w5TN/E+I/toiXQHven0Tzugxh2KMUYh+rGvqZtXPFqc=; b=XFoJKEPqdpCn/TRHNd/IhzRzTvoNxsmP8I78fMqFHIwSLUiGHTVzIcZx7jauuMqR4j Y7/A7sNKdaAWzV42kmOcYBIrSfbm1J4S95GtezrjQMXZroeCQiuo8d7ZJMqJwKXKgUvz YFnuKWUZGxikOTu/TLZgv0VhWy6QZ+apczD0+Bf7GOAqzTgS5TgakaWS+qF9cLJjK7QA teuKY2fVZSvtXpP04M+FVG4mX2Rjn9Hw+kAdqYvjzHFY783Adr/ftZeuJD0qlstlX3ES 3wLXLRNwoJkmu+uaamT40LahyLkJcumbv9xK2Lu870o7sMsz05sZyMz12QNUWcGLTlpN wIlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=DbOoHUOm; 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 eb6si451749edb.608.2020.06.29.13.43.07; Mon, 29 Jun 2020 13:43:30 -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=DbOoHUOm; 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 S2389623AbgF2Ul7 (ORCPT + 99 others); Mon, 29 Jun 2020 16:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731667AbgF2TOF (ORCPT ); Mon, 29 Jun 2020 15:14:05 -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 59C2FC08C5F5 for ; Sun, 28 Jun 2020 21:38:13 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id a6so15119721wrm.4 for ; Sun, 28 Jun 2020 21:38:13 -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=w5TN/E+I/toiXQHven0Tzugxh2KMUYh+rGvqZtXPFqc=; b=DbOoHUOmfQBZBfBNFane+FwAaHv/bwA4VJs02OP7/NQNzlgmAGGz8UAXpjyqJYWkWO lm3GQYeLEBYB3MeEeqbQ8mIgKzaeoKai8O7tfiiBvcCtspXG+x/4tAOj78h5r6vHLvJi yWpC08Obs+4iBuqHftKl3Bn3SfBNIuigiw29OI0yJdgRBhoTj+or98IuAdcphVqfYb3m HGv2tyNo26cQpy9n3zw2l/Zt7w/Z/D9LFKvVh10U+JkrO8gIm2hm18bn7L1OyF4/x29E 2bMCmsg58kYdvLQ7G4AexzjVTQyP9usYuuFQhVnufbsrxs7ANsbczV299xhg5jKhi7hE o2XQ== 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=w5TN/E+I/toiXQHven0Tzugxh2KMUYh+rGvqZtXPFqc=; b=npYs03amu7Yl+dP9dUp4Bg6SsRC71nEGlqLTHklyK95Ls8cTH3KtuWzOdxWKvPh1Gj AsAw4UiUNW3K0BrTj4qapwGN/WXvNDacfE2GcUW7BH1lvD7m76qYUU24Jzmqv5x+CjXm J/UpPwAicF395700Hbmpg/eDBK9qEN74LbKGggJIMsDnCX8otAC1afwap2Na/oi4yIjs dGz2bAvPJM/loExiQ5rx6a9xV81JVTrcE0ZRUPhchlK/OWPHAklAtFwd6YtfR7jeMmQg 6KZDJB3OZKXp9myXGUkT4YezSuWqBf9gmsBIWOveI5L9TQbQF3qfYg3WHUBmwN4Nv70j 6gVA== X-Gm-Message-State: AOAM5321rUyJRSPXa1DV+jhT0pIZrUPHZJAjU7OqGZvM1GEpLEf5FG/t Cc6tqBnrNfj6fXxT0T5VG7XvGILg12pfBZxkYwpi/g== X-Received: by 2002:a5d:4107:: with SMTP id l7mr15738900wrp.144.1593405491943; Sun, 28 Jun 2020 21:38:11 -0700 (PDT) MIME-Version: 1.0 References: <3de3a480517d167a3faae086aa8ab0c0c7141d99.1593397455.git.zong.li@sifive.com> In-Reply-To: From: Anup Patel Date: Mon, 29 Jun 2020 10:07:57 +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 9:58 AM Zong Li wrote: > > On Mon, Jun 29, 2020 at 12:09 PM Anup Patel wrote: > > > > 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. > > As I know, there are 2 counters of spec definition: cycle and instret. > What is the 3rd counter you mentioned? TIME is a counter CSR. > > > > > I suggest using the terms "spec counters" and "impl counters" > > instead of "base counters" and "event counters". > > OK, they are good to me. Let me change it. > > > > > > 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