xref: /freebsd/sys/contrib/device-tree/Bindings/watchdog/atmel,at91sam9-wdt.yaml (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
3%YAML 1.2
4---
5$id: http://devicetree.org/schemas/watchdog/atmel,at91sam9-wdt.yaml#
6$schema: http://devicetree.org/meta-schemas/core.yaml#
7
8title: Atmel Watchdog Timers
9
10maintainers:
11  - Eugen Hristev <eugen.hristev@microchip.com>
12
13properties:
14  compatible:
15    const: atmel,at91sam9260-wdt
16
17  reg:
18    maxItems: 1
19
20  clocks:
21    maxItems: 1
22
23  interrupts:
24    maxItems: 1
25
26  atmel,max-heartbeat-sec:
27    description:
28      Should contain the maximum heartbeat value in seconds. This value
29      should be less or equal to 16. It is used to compute the WDV field.
30    maximum: 16
31
32  atmel,min-heartbeat-sec:
33    description:
34      Should contain the minimum heartbeat value in seconds. This value
35      must be smaller than the max-heartbeat-sec value. It is used to
36      compute the WDD field.
37    maximum: 16
38
39  atmel,watchdog-type:
40    $ref: /schemas/types.yaml#/definitions/string
41    description: |
42      Should be hardware or software.
43    oneOf:
44      - description:
45          Hardware watchdog uses the at91 watchdog reset.
46        const: hardware
47      - description: |
48          Software watchdog uses the watchdog interrupt
49          to trigger a software reset.
50        const: software
51    default: hardware
52
53  atmel,reset-type:
54    $ref: /schemas/types.yaml#/definitions/string
55    description: |
56      Should be proc or all. This is valid only when using hardware watchdog.
57    oneOf:
58      - description:
59          Assert peripherals and processor reset signals.
60        const: all
61      - description:
62          Assert the processor reset signal.
63        const: proc
64    default: all
65
66  atmel,disable:
67    $ref: /schemas/types.yaml#/definitions/flag
68    description:
69      Should be present if you want to stop the watchdog.
70
71  atmel,idle-halt:
72    $ref: /schemas/types.yaml#/definitions/flag
73    description: |
74      Should be present if you want to stop the watchdog when
75      entering idle state.
76      CAUTION: This property should be used with care, it actually makes the
77      watchdog not counting when the CPU is in idle state, therefore the
78      watchdog reset time depends on mean CPU usage and will not reset at all
79      if the CPU stops working while it is in idle state, which is probably
80      not what you want.
81
82  atmel,dbg-halt:
83    $ref: /schemas/types.yaml#/definitions/flag
84    description: |
85      Should be present if you want to stop the watchdog when
86      entering debug state.
87
88required:
89  - compatible
90  - reg
91  - clocks
92
93allOf:
94  - $ref: watchdog.yaml#
95  - if:
96      properties:
97        atmel,reset-type:
98          enum:
99            - all
100            - proc
101    then:
102      properties:
103        atmel,watchdog-type:
104          const: hardware
105
106dependencies:
107  atmel,reset-type: ['atmel,watchdog-type']
108
109unevaluatedProperties: false
110
111examples:
112  - |
113    #include <dt-bindings/interrupt-controller/irq.h>
114
115    watchdog@fffffd40 {
116        compatible = "atmel,at91sam9260-wdt";
117        reg = <0xfffffd40 0x10>;
118        interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
119        clocks = <&clk32k>;
120        timeout-sec = <15>;
121        atmel,watchdog-type = "hardware";
122        atmel,reset-type = "all";
123        atmel,dbg-halt;
124        atmel,idle-halt;
125        atmel,max-heartbeat-sec = <16>;
126        atmel,min-heartbeat-sec = <0>;
127    };
128