Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3057832ybt; Mon, 29 Jun 2020 14:09:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWFRBkHAXuvfn7s+2mF3bSqM/Lhc127Bw9PbVKRsYVvd6mCitdRnuUM+CB5PCHORrpJ/9x X-Received: by 2002:a05:6402:ca3:: with SMTP id cn3mr20549220edb.64.1593464980235; Mon, 29 Jun 2020 14:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593464980; cv=none; d=google.com; s=arc-20160816; b=yEkYi1UR77/gZ49SwlB6DVR66Xb6JDq5SjAA04Y2ES2qLLOAf+Z5vKxTi71EpRIzHO 3xWk+hBhh93CI85vYNOU3s3Apsmb0KSYCOCfCLBuLJ96k4Xq97LVTHUpuRaj8RyDu7qH guzJMM19u1haPExFUiBZdBFdI2pf3zswFOMlwdseSfEIy58/5560VnyX9gPKxDAUrgVo QfY6VOh0dPPJGlH83fmZCmKuyGdvzciNZKTCSWBGyhIctmGdZEvrjdFmOk4g0cn1DKTn b1eD1IpA0GYMKcFsUjonUqhTRHK7uBaIwi5JivUDmVE5QDD73/I7MfXRpAYgeuXkdOtk uz5g== 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=LmoPe2SauK8cs9bRn6bTRLzxO3FPfMTTx1fSlCe95d8=; b=p/iElp0+U8yK4wq45QwBS6NhWvUa8A38JJ464HiZ2c5K8P33FEIckjO6JablsYLtJr ReyeAdxHuEGw/L0p54z8O9Q4A6AM2jWuNhsnh123fa8+HWEGhCD0uiiqBW3EB/VsE2CM ouReOtU7nGknKApILul9LiiNiAUrHfO0GRW3i4E0abxBSSq6E/S0bSJSCXL1K39ZNOkA wOsbutv4x0m4Hafs5Tcm13Y3PWiiK1MAdwFMHA2n+4iFLSBh3S+YUgI2fnasu43SRaY7 cIuTXK9zkHvDpS3iPUORI6Dl+4XOcMw5Rh1ObBkT7ZLPGBChvpss8bSqRMkUP+oj0Q8e jO0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=gKkqbViB; 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 z9si282797ejw.604.2020.06.29.14.09.17; Mon, 29 Jun 2020 14:09:40 -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=@sifive.com header.s=google header.b=gKkqbViB; 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 S2390298AbgF2VGI (ORCPT + 99 others); Mon, 29 Jun 2020 17:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731006AbgF2TMm (ORCPT ); Mon, 29 Jun 2020 15:12:42 -0400 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB892C08C5EE for ; Sun, 28 Jun 2020 21:28:19 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id w17so6394890otl.4 for ; Sun, 28 Jun 2020 21:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LmoPe2SauK8cs9bRn6bTRLzxO3FPfMTTx1fSlCe95d8=; b=gKkqbViBG7WBVI5NjrSJyQpjokEKocyZ3xjP0GI/wEF4IAQ7TEArhrPTCE+86csn4t ztJcVsQFb2Orb6efdvOELarX0CiP0FF2xymfqPLneU0JpjIBn6WmXIplFSoK/jeHnG0W QOLquAkwHNFaNJBDm11vaWQpobVgNFAP61VOwdt7aqGlfRNUnW9u514s+inD30VQ4b6R 30GBa2KaGsG4Lcrs82P7D3k9iiSws9rXH2MkssoFiSefo1r/OFakPuV0gEiPCcZbtJdr fqc9J32Vk9mDg9Swwavm1Y2ft01ftY/ulLiRRebj6eG6tThHnF7ciSywIQjkC/6ioRRN V1PQ== 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=LmoPe2SauK8cs9bRn6bTRLzxO3FPfMTTx1fSlCe95d8=; b=QTlqsdzSqHDJiOtV/+yiRJYjkYNYEMQ6h6syLhgCiiucD4ADaCQv7aqWBGGR/OI/XQ NJGJNXDva6X+zmDh9v21rqrRNU2p68HwpUHBTiMGE6EzWng58fAXxwa6o451xRik04ZY X+Geis5UYlhJvDqmR/ouPivXfHqu/xkhSu/nI/lPTLJLAP6on9i0dkRuArZY5kb52TxE osWFEgvagiGRpBrv3e6OwHPY7AVjmGGe3Mmy2GgI6PgOhPdTOX046myKmoOKpVcaXGlX T3C8galNgOsr6+6vHv9+KsuoNU8+r4wAFskQ5hsA3t6zjOdmt28LEP4dpHLERlf7vgXW dxbA== X-Gm-Message-State: AOAM531VqbyLo+zDRzmSY7gJVoyyLGIrRsawtb3W8ObgnUxAESbBrgB/ ndmcvEBCgnM3fUt0aQsEHgV8PmgEH6df0BxL9hUec0erAIg= X-Received: by 2002:a9d:186:: with SMTP id e6mr12147068ote.33.1593404899159; Sun, 28 Jun 2020 21:28:19 -0700 (PDT) MIME-Version: 1.0 References: <3de3a480517d167a3faae086aa8ab0c0c7141d99.1593397455.git.zong.li@sifive.com> In-Reply-To: From: Zong Li Date: Mon, 29 Jun 2020 12:28:08 +0800 Message-ID: Subject: Re: [RFC PATCH 1/6] dt-bindings: riscv: Add YAML documentation for PMU To: Anup Patel 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 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? > > 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