Message ID | 20221121042545.421532-1-uwu@icenowy.me |
---|---|
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 q4csp1386364wrr; Sun, 20 Nov 2022 20:36:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cTRi2T5OOt0zRT0aiLEBMk6dBj81ZqV04vkS3+ZRLkzmbMn/munthYoaq7PNeddxOYQZR X-Received: by 2002:a17:906:144e:b0:78d:cd72:8e3e with SMTP id q14-20020a170906144e00b0078dcd728e3emr13523373ejc.212.1669005416229; Sun, 20 Nov 2022 20:36:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669005416; cv=pass; d=google.com; s=arc-20160816; b=wtQd5I3nfvfQsfC6Nr9YFNiLxgS/c9RZ7d8Aoa2E6VgeTTruskdUasB8z9QYmqoEY7 6bxfzS3+eLS2dEBixx4uSWcEoAMsHvbroXYfkXIrBAEBu7JHDpJCwHqUloAmh0MTg7OJ VoBnAjGc5fQUkxf8FuaeAVrJnKSmMmnHOWKuAEbrPVk5SmdWUChBoGfERGkGZ3xP0kVA pGHGrwInRkO2Yw5OPqhf6IGj8daHupgLxqzVI7kmu/6wO4oZZXtAem4nRgSFrDbRTOdj NryVVfbFX+5hvRRAwKPDfR/+yLSkQu4LqpP8oD5/CCrjyrPtyoGf1FY8klpsVJQr6+nW BeIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MQp3Bcww7uwH34e0QnChRkJJwq/5NAzIg0lalgR19co=; b=XMG2xrlHgxHRTwI4mgp2OHE5X/0V50KI04M5aejUHtPowGE1sJ5dr1+31RYz/DJ3X4 Zq9d9Dy2UJ9hz3IWL1jvVrkDZvqwpMKe0Fhwr6LM7BE9UP8XwGTYVucZpXXNAgIjgl3p ZB5mwN3v8qxJTkmbrbvFoBqfLgPqR5oSNxrYfQk5bn3lCN6LWLKqyoikZospcoFpcCfy wdGR+sYW2HdfhH7RXtQd9PrjoOFxfH/jzRC1TCrjRg/3rICj9A/AgrVMKhc2TCq18/FD 5jpT6eQfcv2D6nr1W0YDobvrB9+jpf/6eKk183oETGhDueBYty95WCSHC2+ATdVEfyxV 8K/g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@icenowy.me header.s=zmail header.b=CyMiwpmL; arc=pass (i=1 spf=pass spfdomain=icenowy.me dkim=pass dkdomain=icenowy.me dmarc=pass fromdomain=icenowy.me>); 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 wg6-20020a17090705c600b007a11c253eaasi7472391ejb.809.2022.11.20.20.36.31; Sun, 20 Nov 2022 20:36:56 -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=@icenowy.me header.s=zmail header.b=CyMiwpmL; arc=pass (i=1 spf=pass spfdomain=icenowy.me dkim=pass dkdomain=icenowy.me dmarc=pass fromdomain=icenowy.me>); 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 S229502AbiKUE0S (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 99 others); Sun, 20 Nov 2022 23:26:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbiKUE0K (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 20 Nov 2022 23:26:10 -0500 Received: from sender4-op-o18.zoho.com (sender4-op-o18.zoho.com [136.143.188.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCD25248E3; Sun, 20 Nov 2022 20:26:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669004756; cv=none; d=zohomail.com; s=zohoarc; b=NtsxhcrC2wzFQZOlFCxsJZPDDQFKsEBsNkR7UEv2lxf1ucCsV6yrCYhh5KpYYqKz9dXzLtTIVnWlL5Mz6dJhA/OzEp02o+b/A7Tv/LKFcZR6Ec3TT/Ysv8hDTbRzueyc3XnzFrMzSLaSjqQw5N4vsytluBpKgx9nRFhd9Q7UcMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669004756; h=Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=MQp3Bcww7uwH34e0QnChRkJJwq/5NAzIg0lalgR19co=; b=I4pi6Ji0iUgRMNAS9d4rKn2cf4HlU+ux9mYoa9D4f3654iieJgQgvBBXsRJJBKzKSNhihIFBkB4LzZu9Pq+PkiKpvLu6l4VZt6C/Ar97DkWi23mpcVyteZw5sUsW4gV3ojCS8SsnLxWy2dRcumfgGxjtcKqnFsy1sM9ChaFtuXU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=icenowy.me; spf=pass smtp.mailfrom=uwu@icenowy.me; dmarc=pass header.from=<uwu@icenowy.me> DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1669004756; s=zmail; d=icenowy.me; i=uwu@icenowy.me; h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Transfer-Encoding:Reply-To; bh=MQp3Bcww7uwH34e0QnChRkJJwq/5NAzIg0lalgR19co=; b=CyMiwpmLl7/Whx6Sai27+Bqy58g7Yq2HjxGs92yFF6og+Ltfq2e5UtRruKwRP5a4 9YdwTka9zZa0npfTQxcLi1x9R7pk/zrqPui33H7+1q0FvC2+40limBgXpOFq/BjBNrI 386P/oCMKY+XZ0LA49IkIgeDKrSB5iHWO+mFM8Tg= Received: from edelgard.fodlan.icenowy.me (112.94.100.29 [112.94.100.29]) by mx.zohomail.com with SMTPS id 1669004754310175.0741417958027; Sun, 20 Nov 2022 20:25:54 -0800 (PST) From: Icenowy Zheng <uwu@icenowy.me> To: Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Karol Gugala <kgugala@antmicro.com>, Mateusz Holenko <mholenko@antmicro.com>, Gabriel Somlo <gsomlo@gmail.com>, Joel Stanley <joel@jms.id.au> Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Icenowy Zheng <uwu@icenowy.me> Subject: [PATCH 1/2] dt-bindings: timer: add a binding for LiteX Timer Date: Mon, 21 Nov 2022 12:25:44 +0800 Message-Id: <20221121042545.421532-1-uwu@icenowy.me> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-0.4 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,URIBL_BLACK autolearn=no 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?1750079023368949139?= X-GMAIL-MSGID: =?utf-8?q?1750079023368949139?= |
Series |
[1/2] dt-bindings: timer: add a binding for LiteX Timer
|
|
Commit Message
Icenowy Zheng
Nov. 21, 2022, 4:25 a.m. UTC
The LiteX SoC generator has a timer core, which by default only
generates a simple down counter.
Add a DT binding for it.
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
---
.../bindings/timer/litex,timer.yaml | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 Documentation/devicetree/bindings/timer/litex,timer.yaml
Comments
On 21/11/2022 05:25, Icenowy Zheng wrote: > The LiteX SoC generator has a timer core, which by default only > generates a simple down counter. Subject: drop second, redundant "bindings". > > Add a DT binding for it. > > Signed-off-by: Icenowy Zheng <uwu@icenowy.me> > --- > .../bindings/timer/litex,timer.yaml | 52 +++++++++++++++++++ > 1 file changed, 52 insertions(+) > create mode 100644 Documentation/devicetree/bindings/timer/litex,timer.yaml > > diff --git a/Documentation/devicetree/bindings/timer/litex,timer.yaml b/Documentation/devicetree/bindings/timer/litex,timer.yaml > new file mode 100644 > index 000000000000..bece07586c6b > --- /dev/null > +++ b/Documentation/devicetree/bindings/timer/litex,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/litex,timer.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: LiteX Timer > + > +maintainers: > + - Icenowy Zheng <uwu@icenowy.me> > + > +description: | > + The LiteX Timer is a count-down timer that is defaultly embedded > + into all LiteX SoCs, unless explicitly disabled. It's fed directly > + by the system clock like other LiteX peripherals. > + > +properties: > + compatible: > + const: litex,timer No model name/number? If it is part of Soc, then a SoC specific number is expected usually. > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + clocks: > + maxItems: 1 > + > + litex,width: > + description: > + The width of the timer's value, specified as the width argument > + when creating an instance of litex.soc.cores.Timer. This lacks type ($ref) and units in description, but more important - why this is not part of compatible? Is it a width of register(s)? And what is "instance of litex.soc.cores.Timer"? Is it configurable, soft-core? BTW, there is reg-io-width property. > + > +required: > + - compatible > + - reg > + - interrupts > + - clocks > + - litex,width > + > +additionalProperties: false > + > +examples: > + - | > + timer@a0006000 { Use 4 spaces for example indentation. > + compatible = "litex,timer"; > + reg = <0xa0006000 0x20>; > + clocks = <&sys_clk>; > + interrupts = <17>; > + litex,width = <32>; > + }; Best regards, Krzysztof
在 2022-11-21星期一的 11:19 +0100,Krzysztof Kozlowski写道: > On 21/11/2022 05:25, Icenowy Zheng wrote: > > The LiteX SoC generator has a timer core, which by default only > > generates a simple down counter. > > Subject: drop second, redundant "bindings". > > > > > Add a DT binding for it. > > > > Signed-off-by: Icenowy Zheng <uwu@icenowy.me> > > --- > > .../bindings/timer/litex,timer.yaml | 52 > > +++++++++++++++++++ > > 1 file changed, 52 insertions(+) > > create mode 100644 > > Documentation/devicetree/bindings/timer/litex,timer.yaml > > > > diff --git > > a/Documentation/devicetree/bindings/timer/litex,timer.yaml > > b/Documentation/devicetree/bindings/timer/litex,timer.yaml > > new file mode 100644 > > index 000000000000..bece07586c6b > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/timer/litex,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/litex,timer.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: LiteX Timer > > + > > +maintainers: > > + - Icenowy Zheng <uwu@icenowy.me> > > + > > +description: | > > + The LiteX Timer is a count-down timer that is defaultly embedded > > + into all LiteX SoCs, unless explicitly disabled. It's fed > > directly > > + by the system clock like other LiteX peripherals. > > + > > +properties: > > + compatible: > > + const: litex,timer > > No model name/number? If it is part of Soc, then a SoC specific > number > is expected usually. Ah it's part of a SoC generator, as a default core. [1] If you like, I think the version of LiteX SoC generator itself could be added, like `litex,timer-22.08`. > > > + > > + reg: > > + maxItems: 1 > > + > > + interrupts: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 1 > > + > > + litex,width: > > + description: > > + The width of the timer's value, specified as the width > > argument > > + when creating an instance of litex.soc.cores.Timer. > > This lacks type ($ref) and units in description, but more important - > why this is not part of compatible? Is it a width of register(s)? > > And what is "instance of litex.soc.cores.Timer"? Is it configurable, > soft-core? Yes, it is a configurable soft core, although the configuration of a non-32-bit counter is only available when directly generating this core w/o using the full SoC generator (the full SoC generator defaults to 32-bit). > > BTW, there is reg-io-width property. This is not register I/O width, it's only the width of the counter. And because of the LiteX CSR bus nature, all registers after this will be automatically moved if this register's size goes beyond the alignment (current all LiteX support in Linux mainline assumes 32-bit alignment, which is also the default configuration). > > > + > > +required: > > + - compatible > > + - reg > > + - interrupts > > + - clocks > > + - litex,width > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + timer@a0006000 { > > Use 4 spaces for example indentation. Thanks, will change this in the next iteration. > > > + compatible = "litex,timer"; > > + reg = <0xa0006000 0x20>; > > + clocks = <&sys_clk>; > > + interrupts = <17>; > > + litex,width = <32>; > > + }; > > Best regards, > Krzysztof > [1] https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/timer.py
On 21/11/2022 15:39, Icenowy Zheng wrote: > 在 2022-11-21星期一的 11:19 +0100,Krzysztof Kozlowski写道: >> On 21/11/2022 05:25, Icenowy Zheng wrote: >>> The LiteX SoC generator has a timer core, which by default only >>> generates a simple down counter. >> >> Subject: drop second, redundant "bindings". >> >>> >>> Add a DT binding for it. >>> >>> Signed-off-by: Icenowy Zheng <uwu@icenowy.me> >>> --- >>> .../bindings/timer/litex,timer.yaml | 52 >>> +++++++++++++++++++ >>> 1 file changed, 52 insertions(+) >>> create mode 100644 >>> Documentation/devicetree/bindings/timer/litex,timer.yaml >>> >>> diff --git >>> a/Documentation/devicetree/bindings/timer/litex,timer.yaml >>> b/Documentation/devicetree/bindings/timer/litex,timer.yaml >>> new file mode 100644 >>> index 000000000000..bece07586c6b >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/timer/litex,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/litex,timer.yaml# >>> +$schema: http://devicetree.org/meta-schemas/core.yaml# >>> + >>> +title: LiteX Timer >>> + >>> +maintainers: >>> + - Icenowy Zheng <uwu@icenowy.me> >>> + >>> +description: | >>> + The LiteX Timer is a count-down timer that is defaultly embedded >>> + into all LiteX SoCs, unless explicitly disabled. It's fed >>> directly >>> + by the system clock like other LiteX peripherals. >>> + >>> +properties: >>> + compatible: >>> + const: litex,timer >> >> No model name/number? If it is part of Soc, then a SoC specific >> number >> is expected usually. > > Ah it's part of a SoC generator, as a default core. [1] > > If you like, I think the version of LiteX SoC generator itself could be > added, like `litex,timer-22.08`. How can you be sure that all soft-cores from Litex will be exactly the same and use the same compatible? The naming is poor here, but I don't know whether some arbitrary version number is the solution. > >> >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + interrupts: >>> + maxItems: 1 >>> + >>> + clocks: >>> + maxItems: 1 >>> + >>> + litex,width: >>> + description: >>> + The width of the timer's value, specified as the width >>> argument >>> + when creating an instance of litex.soc.cores.Timer. >> >> This lacks type ($ref) and units in description, but more important - >> why this is not part of compatible? Is it a width of register(s)? >> >> And what is "instance of litex.soc.cores.Timer"? Is it configurable, >> soft-core? > > Yes, it is a configurable soft core, although the configuration of a > non-32-bit counter is only available when directly generating this core > w/o using the full SoC generator (the full SoC generator defaults to > 32-bit). > >> >> BTW, there is reg-io-width property. > > This is not register I/O width, it's only the width of the counter. > > And because of the LiteX CSR bus nature, all registers after this will > be automatically moved if this register's size goes beyond the > alignment (current all LiteX support in Linux mainline assumes 32-bit > alignment, which is also the default configuration). OK Best regards, Krzysztof
On Mon, 21 Nov 2022 12:25:44 +0800, Icenowy Zheng wrote: > The LiteX SoC generator has a timer core, which by default only > generates a simple down counter. > > Add a DT binding for it. > > Signed-off-by: Icenowy Zheng <uwu@icenowy.me> > --- > .../bindings/timer/litex,timer.yaml | 52 +++++++++++++++++++ > 1 file changed, 52 insertions(+) > create mode 100644 Documentation/devicetree/bindings/timer/litex,timer.yaml > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/timer/litex,timer.yaml: properties:litex,width: 'oneOf' conditional failed, one must be fixed: 'type' is a required property hint: A vendor boolean property can use "type: boolean" /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/timer/litex,timer.yaml: properties:litex,width: 'oneOf' conditional failed, one must be fixed: 'enum' is a required property 'const' is a required property hint: A vendor string property with exact values has an implicit type from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/timer/litex,timer.yaml: properties:litex,width: 'oneOf' conditional failed, one must be fixed: '$ref' is a required property 'allOf' is a required property hint: A vendor property needs a $ref to types.yaml from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# hint: Vendor specific properties must have a type and description unless they have a defined, common suffix. from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20221121042545.421532-1-uwu@icenowy.me This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command.
diff --git a/Documentation/devicetree/bindings/timer/litex,timer.yaml b/Documentation/devicetree/bindings/timer/litex,timer.yaml new file mode 100644 index 000000000000..bece07586c6b --- /dev/null +++ b/Documentation/devicetree/bindings/timer/litex,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/litex,timer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: LiteX Timer + +maintainers: + - Icenowy Zheng <uwu@icenowy.me> + +description: | + The LiteX Timer is a count-down timer that is defaultly embedded + into all LiteX SoCs, unless explicitly disabled. It's fed directly + by the system clock like other LiteX peripherals. + +properties: + compatible: + const: litex,timer + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + litex,width: + description: + The width of the timer's value, specified as the width argument + when creating an instance of litex.soc.cores.Timer. + +required: + - compatible + - reg + - interrupts + - clocks + - litex,width + +additionalProperties: false + +examples: + - | + timer@a0006000 { + compatible = "litex,timer"; + reg = <0xa0006000 0x20>; + clocks = <&sys_clk>; + interrupts = <17>; + litex,width = <32>; + };