Message ID | 20221125112105.427045-3-apatel@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3940749wrr; Fri, 25 Nov 2022 03:27:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf6FNfBQZSbfDqDtICDB4x2lbKGoUATy2I7RE8ga9/ioT/LD5ZKZ/GiRXcKQDPse2I+ujlAh X-Received: by 2002:a17:906:fcac:b0:7ba:a9cb:8643 with SMTP id qw12-20020a170906fcac00b007baa9cb8643mr7912493ejb.298.1669375664181; Fri, 25 Nov 2022 03:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669375664; cv=none; d=google.com; s=arc-20160816; b=zJtqrTCYVsMXKwBhwxOk+b++AieCyfTwGpzU/OPoJJRDmKgsfDdd+UK/A2uLo2NFIW oqsRMQSs+p1RRf4lbq06TBgUUWHrakNYBrKaX7d+g7nO8OiBw5a2WNO5zoQz4vS/v/VP KhHQUq1Oh0HeMCfHuuhpoBZroZodeVGmuzojgY3ZHhDa2yT03+NNczPjrB7MoxH5e0s7 8Wnq+q1Z8r+/HIRrnGmB39XwzWjLWj6cHhmvLSSktLHB5Fe0fmR3p6H8UTsQIrtY+Ikk g2SCmuTHBgKzp1QPpOmuWZVqgnGec3udzfs7qsa8gGjO+Sm8eQQPXydNih//sVBHkYgF 4mGg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=q0TnuhgNTurF6Ds7AQpDNaCEPKEhITVFc7KbMlz7Wws=; b=qzOWyV80Z8qpKj375UjfqySWEEEVun3LSv5pf/9oHCII5amVcztga/R33JO3hhQQgT S+Dti6pcDR9FRhJqg/7RxJsdqyRfbyk3pabYoGMD6Mv+BYT8fe/LTQJpByIj5RBRsJwO uIH7anyCW1V+NQ/iw6TwkDDnqBqprP0l6ukwshG8ZVSsymuKIoEJ+PE/ksxFEm5cs0tm 1zoZqbxkTjqgB0ohQ+ShNUmqNvzKrkNLVyxiw+1oORQZU83RYEIGUfXMc6bNU+5C+DmH Kjznz07KtE4dwqtcxVcK/TAott2twrKiIRfqsYORS5Ivxzmc6IlzgqdKudIlu5q1EgFh 67Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=IUt6mjNq; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a170906118b00b0078de51e658esi2171638eja.208.2022.11.25.03.27.19; Fri, 25 Nov 2022 03:27: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=@ventanamicro.com header.s=google header.b=IUt6mjNq; 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 S229821AbiKYLWP (ORCPT <rfc822;zxc52fgh@gmail.com> + 99 others); Fri, 25 Nov 2022 06:22:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbiKYLVk (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 25 Nov 2022 06:21:40 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C60DE27918 for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 03:21:39 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id b21so3723186plc.9 for <linux-kernel@vger.kernel.org>; Fri, 25 Nov 2022 03:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q0TnuhgNTurF6Ds7AQpDNaCEPKEhITVFc7KbMlz7Wws=; b=IUt6mjNqfvLPBWph0ZsbRARzlsokmk2fZM/PK9Ux17pbEufTSB0fdGB4L/1rUvGDyu 8K+kp7ETHm0Czj0vmb/F47Q5JQupZzVyC1v22fnJNdFmiT5DBelkCQJM+jFPjGg+sRUt ghfUI1bWGsd5fmTblOzCs4hiquuXSB8hz8lrnQoKjYLyMowOrPvtDk23OL+4HVQsgwdf FUEQIaPeOPhoh1vMgMyNnhvgOcrjWBGwty/eeAYbcZjflbKDXoz9XEjF9ygyA933dGHn fvbRr9N3WRX7U6wCSaau9lmQDrDBzmUzo+qHJfEzdXXvwOZEHJLWLsySWnKIFS8y0ZdV N6hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q0TnuhgNTurF6Ds7AQpDNaCEPKEhITVFc7KbMlz7Wws=; b=Lz/iKyX0kqw3BCTErxsNIcFE4WfnuglQyOPVWHo+sgKoL6P5xpZBgd1aC8qej7uMYm dDbcQZVgGiL+1PUHIn00X53eXVubAi5/G8dREu3YBzYSFVhhy8T2b6MiYTbKin1NtXC0 awSyc152EvOHLL6E3rDUNrn0EjdZyJLErjnwKZ4ru6W/2lRKhe0wWtaInzKxI0De8SJl RC6KeD9dtooCBiIIn/2Ow5L24M2/JBIsbtDEdU9IX+rfQua452NzypgkDN9xnoRy7a+l WYJuJHOUQYGYLCOn3Mh62L3ROwA4/YqzBzBCQ9Vpgn+f5bIacMiGBxHuX4azS8kvMEuu Zzlg== X-Gm-Message-State: ANoB5pkeyp2v9OZZiWAWJxdIBvL1vvtdKvG70tO3Wnh2Puv+AmY0ZFoT /sqrbOFMb9QrgBwmFFVAw8X78A== X-Received: by 2002:a17:90a:5d15:b0:213:e74b:b691 with SMTP id s21-20020a17090a5d1500b00213e74bb691mr46264890pji.81.1669375299079; Fri, 25 Nov 2022 03:21:39 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id e66-20020a621e45000000b0057488230704sm2834335pfe.219.2022.11.25.03.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:21:38 -0800 (PST) From: Anup Patel <apatel@ventanamicro.com> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de> Cc: Andrew Jones <ajones@ventanamicro.com>, Atish Patra <atishp@atishpatra.org>, Samuel Holland <samuel@sholland.org>, Anup Patel <anup@brainfault.org>, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Anup Patel <apatel@ventanamicro.com> Subject: [PATCH v3 2/3] dt-bindings: timer: Add bindings for the RISC-V timer device Date: Fri, 25 Nov 2022 16:51:04 +0530 Message-Id: <20221125112105.427045-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221125112105.427045-1-apatel@ventanamicro.com> References: <20221125112105.427045-1-apatel@ventanamicro.com> 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_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750467256676240344?= X-GMAIL-MSGID: =?utf-8?q?1750467256676240344?= |
Series |
Improve CLOCK_EVT_FEAT_C3STOP feature setting
|
|
Commit Message
Anup Patel
Nov. 25, 2022, 11:21 a.m. UTC
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 <apatel@ventanamicro.com>
---
.../bindings/timer/riscv,timer.yaml | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 Documentation/devicetree/bindings/timer/riscv,timer.yaml
Comments
Hey Anup, For the future, could you please CC me on all patches in a series that I have previously reviewed? On Fri, Nov 25, 2022 at 04:51:04PM +0530, 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 <apatel@ventanamicro.com> > --- > .../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 <anup@brainfault.org> > + > +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: > + type: boolean > + description: > + If present, the timer interrupt can't wake up the CPU from > + suspend/idle state. I'm really not sure about this... I would be inclined to think that if someone does not specify then we should assume that they took the scroogiest view of the spec and so do not get events during suspend. I suppose you could then argue that their DT is wrong & it's their fault though. Plus the existing platforms behave this way & we avoid having to retrofit stuff here. > + > +additionalProperties: false > + > +required: > + - compatible > + - interrupts-extended > + > +examples: > + - | > + timer { > + compatible = "riscv,timer"; > + interrupts-extended = <&cpu1intc 5>, > + <&cpu2intc 5>, > + <&cpu3intc 5>, > + <&cpu4intc 5>; > + }; > +... > -- > 2.34.1 >
On Fri, Nov 25, 2022 at 6:40 PM Conor Dooley <conor.dooley@microchip.com> wrote: > > Hey Anup, > > For the future, could you please CC me on all patches in a series that I > have previously reviewed? Okay. > > On Fri, Nov 25, 2022 at 04:51:04PM +0530, 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 <apatel@ventanamicro.com> > > --- > > .../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 <anup@brainfault.org> > > + > > +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: > > + type: boolean > > + description: > > + If present, the timer interrupt can't wake up the CPU from > > + suspend/idle state. > > I'm really not sure about this... I would be inclined to think that if > someone does not specify then we should assume that they took the > scroogiest view of the spec and so do not get events during suspend. > > I suppose you could then argue that their DT is wrong & it's their fault > though. Plus the existing platforms behave this way & we avoid having to > retrofit stuff here. Yes, the DT property is defined to keep things working for existing platforms. IMO, people should always read the DT bindings document at time of creating DT for their platform. If there are queries then they can always shoot email to the maintainers on LKML. > > > + > > +additionalProperties: false > > + > > +required: > > + - compatible > > + - interrupts-extended > > + > > +examples: > > + - | > > + timer { > > + compatible = "riscv,timer"; > > + interrupts-extended = <&cpu1intc 5>, > > + <&cpu2intc 5>, > > + <&cpu3intc 5>, > > + <&cpu4intc 5>; > > + }; > > +... > > -- > > 2.34.1 > > Regards, Anup
On Fri, Nov 25, 2022 at 07:18:48PM +0530, Anup Patel wrote: > On Fri, Nov 25, 2022 at 6:40 PM Conor Dooley <conor.dooley@microchip.com> wrote: > > > > Hey Anup, > > > > For the future, could you please CC me on all patches in a series that I > > have previously reviewed? > > Okay. > > > > > On Fri, Nov 25, 2022 at 04:51:04PM +0530, 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 <apatel@ventanamicro.com> > > > --- > > > .../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 <anup@brainfault.org> > > > + > > > +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: > > > + type: boolean > > > + description: > > > + If present, the timer interrupt can't wake up the CPU from > > > + suspend/idle state. > > > > I'm really not sure about this... I would be inclined to think that if > > someone does not specify then we should assume that they took the > > scroogiest view of the spec and so do not get events during suspend. > > > > I suppose you could then argue that their DT is wrong & it's their fault > > though. Plus the existing platforms behave this way & we avoid having to > > retrofit stuff here. > > Yes, the DT property is defined to keep things working for > existing platforms. > > IMO, people should always read the DT bindings document at time of > creating DT for their platform. If there are queries then they can always > shoot email to the maintainers on LKML. Aye, I suppose so. For every platform that may exist that this change hurts, there's likely another one that it fixes a timer for... /shrug Binding itself looks grand though & we are in lessor of two evils territory, so: Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks for turning around a v3 promptly Anup! Conor. > > > + > > > +additionalProperties: false > > > + > > > +required: > > > + - compatible > > > + - interrupts-extended > > > + > > > +examples: > > > + - | > > > + timer { > > > + compatible = "riscv,timer"; > > > + interrupts-extended = <&cpu1intc 5>, > > > + <&cpu2intc 5>, > > > + <&cpu3intc 5>, > > > + <&cpu4intc 5>; > > > + }; > > > +... > > > -- > > > 2.34.1 > > > > > Regards, > Anup
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 <anup@brainfault.org> + +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: + type: boolean + description: + If present, the timer interrupt can't wake up the CPU from + suspend/idle state. + +additionalProperties: false + +required: + - compatible + - interrupts-extended + +examples: + - | + timer { + compatible = "riscv,timer"; + interrupts-extended = <&cpu1intc 5>, + <&cpu2intc 5>, + <&cpu3intc 5>, + <&cpu4intc 5>; + }; +...