Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp62230rwb; Wed, 30 Nov 2022 22:06:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf66VKwL19BGooK4U6bFz/m+u7bWAxG2R0fRSlIHcZPVpsy19GhqfxglzGOi1mmqIPv1qZnf X-Received: by 2002:a17:90b:48c8:b0:20b:25f6:3e30 with SMTP id li8-20020a17090b48c800b0020b25f63e30mr69714349pjb.227.1669874804408; Wed, 30 Nov 2022 22:06:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669874804; cv=none; d=google.com; s=arc-20160816; b=k6MpU2ugXJo0xkSaaDidOlUgr6HRprbyObZTCUqKyttoV+/BBgDxtaVdFHbsJ0pV5r 7IIhjNfP0FHKVmJJZ69HbyWoL5IHxevSJX5nV71R4aYL3T/k3zF7rdyfIpgaHzG9Pgzg qkXa9L2jxlICMf3vlN8YLpwjYSMQ+VX67Zo6fbF1/L7cfyApNMNChiKyQSJJqgOn9c9q HThE4UvZISHZWi7hIXS7+oj5CnyeFG3YpKBNaU0IkHPkHJBWJins0JJKAIMVNN0eEjJp P6E3aTfIJeIMglt+n0ATpTvoopbtmfXyxftVfp01C6xq7+nG+ywGqajco7MtceuU6H2B 9xsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HDYDeayhp4F4jLRjy3U5o4B4dnh5i5WiJ3M1AeVO0Es=; b=hDN7Dy4IUS2RxmrJ0/4WNphnS/OH7QuNn2fti/Na8GhHaT+qyDN6HydpiIwMeegtxF BQaWiegwL3URWYafa3DJQVq4zT2BwT4xsmzYY6UfLBotWnut1Jm9SM9y5TIRbVglgC/L hjMFa6uC7QIUAJ8N76uPhKOdFcktEHrGjytoVfHxh9n3sgCu1Flwo8jm1FOeUPLVLZ4W IywEZCMpHcfv8Jf0bjg8/GRMyHbZBJwoO/BLNaKpkzZkA1L2aHsgPr7GnhVYpUMRvWOg /gmDCi8xJp+/Te/YihZ0mGt31BXWzGqbKKczXnM6Hj2N7V78RUBDFFOBgC5ycNssiI/G nT7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=Tsm30sLR; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e3-20020a17090301c300b00189380323f7si4057653plh.318.2022.11.30.22.06.34; Wed, 30 Nov 2022 22:06:44 -0800 (PST) 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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=Tsm30sLR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbiLAF5F (ORCPT + 83 others); Thu, 1 Dec 2022 00:57:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbiLAF5B (ORCPT ); Thu, 1 Dec 2022 00:57:01 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32A75A6B43 for ; Wed, 30 Nov 2022 21:57:00 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id d20so1053319edn.0 for ; Wed, 30 Nov 2022 21:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HDYDeayhp4F4jLRjy3U5o4B4dnh5i5WiJ3M1AeVO0Es=; b=Tsm30sLRx+XONDFQARwXuUPZLtEfeqP8NxElshdDEZhXiD0xnAutmZsWAGl6A1IDKo 6liGNzk55cc05ZHG2S0v6q7RZlfXS3Zo/r/nOsSmpxIj5enr0gIYcMx9EALve1jwytbu xjXGjZFIF8Q5HgGwsh+1izmOkwfOVccj0ZLwJ9CeECteokWqMCJLmdDnBxx0SWP2FrBh 3+3VVjSQXA3s1fTi6j1bzDRJXe2Xs2Rm2k6EUMZQ1JkDoVvkRMvs3TqNy9+TwydqAV/m 0GpLpOafoCdyOP6MsswvykBJr1Xivm25ntJdANH+w5TZxfesJEBNOLe1/PM77qHQggca fNYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HDYDeayhp4F4jLRjy3U5o4B4dnh5i5WiJ3M1AeVO0Es=; b=LiL1AAqeHvfp87SoE8k4nzxvBVQ9xjQql6THpHrnKZsrsDMt00oiaAqsx7wa/RKbpe P8cHOajP3Nl5hyFQ3sggU/VlRfNzBS30zUl8Pw3Ilve4lpclt20XiwnkIWSjRpeHb49J e8a11e3vpyXpT+9eOK+FBvO/TB8laFQqBqNCzEp6SqkKIEThoKCimQEVTgmWyLIM409A Qi/Xsd0/TqYICpanXfgJ0GnFXG2wR1fLX/nj85R10Z7Zp+qNOEkQduKT9rp8IklIZvay EbmYTeJJQ0BKTNy156MtvhXS/ZCPb9Kg1EcplTthZs/Qzn9jcCnk2qHJUDSHp+cALGZr r1Tg== X-Gm-Message-State: ANoB5pnj0GI18ZSn+r5fiKUoQdG9FStrOK0aSWUde/HY1rRcr4Z2sU+Q uPzJwCd8j9EVKWUNzMM9X0n8JJ/bBbEcSF8yApv2Rg== X-Received: by 2002:a05:6402:d78:b0:46b:a177:9d84 with SMTP id ec56-20020a0564020d7800b0046ba1779d84mr7265836edb.134.1669874218518; Wed, 30 Nov 2022 21:56:58 -0800 (PST) MIME-Version: 1.0 References: <20221129140313.886192-1-apatel@ventanamicro.com> <20221129140313.886192-3-apatel@ventanamicro.com> <174d93be-bedf-bf8c-4a66-284931a997b3@sholland.org> In-Reply-To: <174d93be-bedf-bf8c-4a66-284931a997b3@sholland.org> From: Anup Patel Date: Thu, 1 Dec 2022 11:26:47 +0530 Message-ID: Subject: Re: [PATCH v4 2/3] dt-bindings: timer: Add bindings for the RISC-V timer device To: Samuel Holland Cc: Anup Patel , Rob Herring , Krzysztof Kozlowski , Palmer Dabbelt , Paul Walmsley , Daniel Lezcano , Thomas Gleixner , Andrew Jones , Atish Patra , Conor Dooley , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=ham 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 On Wed, Nov 30, 2022 at 10:15 AM Samuel Holland wrote: > > On 11/29/22 08:03, Anup Patel wrote: > > We add DT bindings for a separate RISC-V timer DT node which can > > be used to describe implementation specific behaviour (such as > > timer interrupt not triggered during non-retentive suspend). > > > > Signed-off-by: Anup Patel > > Reviewed-by: Conor Dooley > > --- > > .../bindings/timer/riscv,timer.yaml | 52 +++++++++++++++++++ > > 1 file changed, 52 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/timer/riscv,timer.yaml > > > > diff --git a/Documentation/devicetree/bindings/timer/riscv,timer.yaml b/Documentation/devicetree/bindings/timer/riscv,timer.yaml > > new file mode 100644 > > index 000000000000..cf53dfff90bc > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/timer/riscv,timer.yaml > > @@ -0,0 +1,52 @@ > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/timer/riscv,timer.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: RISC-V timer > > + > > +maintainers: > > + - Anup Patel > > + > > +description: |+ > > + RISC-V platforms always have a RISC-V timer device for the supervisor-mode > > + based on the time CSR defined by the RISC-V privileged specification. The > > + timer interrupts of this device are configured using the RISC-V SBI Time > > + extension or the RISC-V Sstc extension. > > + > > + The clock frequency of RISC-V timer device is specified via the > > + "timebase-frequency" DT property of "/cpus" DT node which is described > > + in Documentation/devicetree/bindings/riscv/cpus.yaml > > + > > +properties: > > + compatible: > > + enum: > > + - riscv,timer > > + > > + interrupts-extended: > > + minItems: 1 > > + maxItems: 4096 # Should be enough? > > + > > + riscv,timer-cant-wake-cpu: > > I don't want to derail getting this merged, but if you do end up sending > another version, could you please spell out the word "cannot" here and > in the code? The missing apostrophe makes this jarring (and an entirely > different word). Okay, I will update. > > > + type: boolean > > + description: > > + If present, the timer interrupt can't wake up the CPU from > > + suspend/idle state. > > And in that case I would also suggest clarifying this as "one or more > suspend/idle states", since the limitation does not apply to all idle > states. At least it should never apply to the architectural WFI state; > for the SBI idle state binding, it only applies to those with the > "local-timer-stop" property. Okay, I will update. > > > + > > +additionalProperties: false > > + > > +required: > > + - compatible > > + - interrupts-extended > > + > > +examples: > > + - | > > + timer { > > + compatible = "riscv,timer"; > > + interrupts-extended = <&cpu1intc 5>, > > + <&cpu2intc 5>, > > + <&cpu3intc 5>, > > + <&cpu4intc 5>; > > The CLINT and PLIC bindings also include the M-mode interrupts. Should > we do the same here? The RISC-V timer uses SBI time extension or RISC-V Sstc extension hence it is only for S-mode software. In other words, the RISC-V timer is a S-mode only timer. The M-mode software is supposed to have its own platform specific MMIO based timer. Regards, Anup