Message ID | 20200510105807.880-4-Sergey.Semin@baikalelectronics.ru (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [v2,1/7] dt-bindings: watchdog: Convert DW WDT binding to DT schema | expand |
On Sun, May 10, 2020 at 01:58:03PM +0300, Serge Semin wrote: > In case if DW Watchdog IP core is built with WDT_USE_FIX_TOP == false, > a custom timeout periods are used to preset the timer counter. In > this case that periods should be specified in a new "snps,watchdog-tops" > property of the DW watchdog dts node. > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Paul Burton <paulburton@kernel.org> > Cc: Ralf Baechle <ralf@linux-mips.org> > Cc: Arnd Bergmann <arnd@arndb.de> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: linux-mips@vger.kernel.org > > --- > > Rob, I had to remove your Reviewed-by tag, since the patch needed > to be updated a bit (see changelog). > > Changelog v2: > - Rearrange SoBs. > - Move $ref to the root level of the "snps,watchdog-tops" property > so does the constraints. > - Add default TOP values array. > - Discard the label definition from the new bindings example. > --- > .../bindings/watchdog/snps,dw-wdt.yaml | 33 +++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml b/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml > index 5bf6dc6377f3..cc741fb5a685 100644 > --- a/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml > +++ b/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml > @@ -39,6 +39,24 @@ properties: > description: Phandle to the DW Watchdog reset lane > maxItems: 1 > > + snps,watchdog-tops: > + $ref: /schemas/types.yaml#/definitions/uint32-array > + description: | > + DW APB Watchdog custom timer intervals - Timeout Period ranges (TOPs). > + Each TOP is a number loaded into the watchdog counter at the moment of > + the timer restart. The counter decrementing happens each tick of the > + reference clock. Therefore the TOPs array is equivalent to an array of > + the timer expiration intervals supported by the DW APB Watchdog. Note > + DW APB Watchdog IP-core might be synthesized with fixed TOP values, > + in which case this property is unnecessary with default TOPs utilized. > + default: [0x0001000 0x0002000 0x0004000 0x0008000 > + 0x0010000 0x0020000 0x0040000 0x0080000 > + 0x0100000 0x0200000 0x0400000 0x0800000 > + 0x1000000 0x2000000 0x4000000 0x8000000] > + items: > + minItems: 16 > + maxItems: 16 Drop 'items' and move these up a level. That may have given you some issues, but I made some fixes recently. With that, Reviewed-by: Rob Herring <robh@kernel.org> Rob
On Mon, May 18, 2020 at 02:40:37PM -0600, Rob Herring wrote: > On Sun, May 10, 2020 at 01:58:03PM +0300, Serge Semin wrote: > > In case if DW Watchdog IP core is built with WDT_USE_FIX_TOP == false, > > a custom timeout periods are used to preset the timer counter. In > > this case that periods should be specified in a new "snps,watchdog-tops" > > property of the DW watchdog dts node. > > > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> > > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > > Cc: Paul Burton <paulburton@kernel.org> > > Cc: Ralf Baechle <ralf@linux-mips.org> > > Cc: Arnd Bergmann <arnd@arndb.de> > > Cc: Philipp Zabel <p.zabel@pengutronix.de> > > Cc: linux-mips@vger.kernel.org > > > > --- > > > > Rob, I had to remove your Reviewed-by tag, since the patch needed > > to be updated a bit (see changelog). > > > > Changelog v2: > > - Rearrange SoBs. > > - Move $ref to the root level of the "snps,watchdog-tops" property > > so does the constraints. > > - Add default TOP values array. > > - Discard the label definition from the new bindings example. > > --- > > .../bindings/watchdog/snps,dw-wdt.yaml | 33 +++++++++++++++++++ > > 1 file changed, 33 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml b/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml > > index 5bf6dc6377f3..cc741fb5a685 100644 > > --- a/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml > > +++ b/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml > > @@ -39,6 +39,24 @@ properties: > > description: Phandle to the DW Watchdog reset lane > > maxItems: 1 > > > > + snps,watchdog-tops: > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > + description: | > > + DW APB Watchdog custom timer intervals - Timeout Period ranges (TOPs). > > + Each TOP is a number loaded into the watchdog counter at the moment of > > + the timer restart. The counter decrementing happens each tick of the > > + reference clock. Therefore the TOPs array is equivalent to an array of > > + the timer expiration intervals supported by the DW APB Watchdog. Note > > + DW APB Watchdog IP-core might be synthesized with fixed TOP values, > > + in which case this property is unnecessary with default TOPs utilized. > > + default: [0x0001000 0x0002000 0x0004000 0x0008000 > > + 0x0010000 0x0020000 0x0040000 0x0080000 > > + 0x0100000 0x0200000 0x0400000 0x0800000 > > + 0x1000000 0x2000000 0x4000000 0x8000000] > > + items: > > + minItems: 16 > > + maxItems: 16 > > Drop 'items' and move these up a level. That may have given you some > issues, but I made some fixes recently. Ok. Thanks. -Sergey > > With that, > > Reviewed-by: Rob Herring <robh@kernel.org> > > Rob
diff --git a/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml b/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml index 5bf6dc6377f3..cc741fb5a685 100644 --- a/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml +++ b/Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml @@ -39,6 +39,24 @@ properties: description: Phandle to the DW Watchdog reset lane maxItems: 1 + snps,watchdog-tops: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: | + DW APB Watchdog custom timer intervals - Timeout Period ranges (TOPs). + Each TOP is a number loaded into the watchdog counter at the moment of + the timer restart. The counter decrementing happens each tick of the + reference clock. Therefore the TOPs array is equivalent to an array of + the timer expiration intervals supported by the DW APB Watchdog. Note + DW APB Watchdog IP-core might be synthesized with fixed TOP values, + in which case this property is unnecessary with default TOPs utilized. + default: [0x0001000 0x0002000 0x0004000 0x0008000 + 0x0010000 0x0020000 0x0040000 0x0080000 + 0x0100000 0x0200000 0x0400000 0x0800000 + 0x1000000 0x2000000 0x4000000 0x8000000] + items: + minItems: 16 + maxItems: 16 + unevaluatedProperties: false required: @@ -55,4 +73,19 @@ examples: clocks = <&per_base_clk>; resets = <&wdt_rst>; }; + + - | + watchdog@ffd02000 { + compatible = "snps,dw-wdt"; + reg = <0xffd02000 0x1000>; + interrupts = <0 171 4>; + clocks = <&per_base_clk>; + clock-names = "tclk"; + snps,watchdog-tops = <0x000000FF 0x000001FF 0x000003FF + 0x000007FF 0x0000FFFF 0x0001FFFF + 0x0003FFFF 0x0007FFFF 0x000FFFFF + 0x001FFFFF 0x003FFFFF 0x007FFFFF + 0x00FFFFFF 0x01FFFFFF 0x03FFFFFF + 0x07FFFFFF>; + }; ...
In case if DW Watchdog IP core is built with WDT_USE_FIX_TOP == false, a custom timeout periods are used to preset the timer counter. In this case that periods should be specified in a new "snps,watchdog-tops" property of the DW watchdog dts node. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Paul Burton <paulburton@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: linux-mips@vger.kernel.org --- Rob, I had to remove your Reviewed-by tag, since the patch needed to be updated a bit (see changelog). Changelog v2: - Rearrange SoBs. - Move $ref to the root level of the "snps,watchdog-tops" property so does the constraints. - Add default TOP values array. - Discard the label definition from the new bindings example. --- .../bindings/watchdog/snps,dw-wdt.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+)