162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
262306a36Sopenharmony_ci# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
362306a36Sopenharmony_ci%YAML 1.2
462306a36Sopenharmony_ci---
562306a36Sopenharmony_ci$id: http://devicetree.org/schemas/watchdog/atmel,at91sam9-wdt.yaml#
662306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
762306a36Sopenharmony_ci
862306a36Sopenharmony_cititle: Atmel Watchdog Timers
962306a36Sopenharmony_ci
1062306a36Sopenharmony_cimaintainers:
1162306a36Sopenharmony_ci  - Eugen Hristev <eugen.hristev@microchip.com>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciproperties:
1462306a36Sopenharmony_ci  compatible:
1562306a36Sopenharmony_ci    const: atmel,at91sam9260-wdt
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci  reg:
1862306a36Sopenharmony_ci    maxItems: 1
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci  clocks:
2162306a36Sopenharmony_ci    maxItems: 1
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci  interrupts:
2462306a36Sopenharmony_ci    maxItems: 1
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci  atmel,max-heartbeat-sec:
2762306a36Sopenharmony_ci    description:
2862306a36Sopenharmony_ci      Should contain the maximum heartbeat value in seconds. This value
2962306a36Sopenharmony_ci      should be less or equal to 16. It is used to compute the WDV field.
3062306a36Sopenharmony_ci    maximum: 16
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci  atmel,min-heartbeat-sec:
3362306a36Sopenharmony_ci    description:
3462306a36Sopenharmony_ci      Should contain the minimum heartbeat value in seconds. This value
3562306a36Sopenharmony_ci      must be smaller than the max-heartbeat-sec value. It is used to
3662306a36Sopenharmony_ci      compute the WDD field.
3762306a36Sopenharmony_ci    maximum: 16
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci  atmel,watchdog-type:
4062306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/string
4162306a36Sopenharmony_ci    description: |
4262306a36Sopenharmony_ci      Should be hardware or software.
4362306a36Sopenharmony_ci    oneOf:
4462306a36Sopenharmony_ci      - description:
4562306a36Sopenharmony_ci          Hardware watchdog uses the at91 watchdog reset.
4662306a36Sopenharmony_ci        const: hardware
4762306a36Sopenharmony_ci      - description: |
4862306a36Sopenharmony_ci          Software watchdog uses the watchdog interrupt
4962306a36Sopenharmony_ci          to trigger a software reset.
5062306a36Sopenharmony_ci        const: software
5162306a36Sopenharmony_ci    default: hardware
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ci  atmel,reset-type:
5462306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/string
5562306a36Sopenharmony_ci    description: |
5662306a36Sopenharmony_ci      Should be proc or all. This is valid only when using hardware watchdog.
5762306a36Sopenharmony_ci    oneOf:
5862306a36Sopenharmony_ci      - description:
5962306a36Sopenharmony_ci          Assert peripherals and processor reset signals.
6062306a36Sopenharmony_ci        const: all
6162306a36Sopenharmony_ci      - description:
6262306a36Sopenharmony_ci          Assert the processor reset signal.
6362306a36Sopenharmony_ci        const: proc
6462306a36Sopenharmony_ci    default: all
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci  atmel,disable:
6762306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/flag
6862306a36Sopenharmony_ci    description:
6962306a36Sopenharmony_ci      Should be present if you want to stop the watchdog.
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci  atmel,idle-halt:
7262306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/flag
7362306a36Sopenharmony_ci    description: |
7462306a36Sopenharmony_ci      Should be present if you want to stop the watchdog when
7562306a36Sopenharmony_ci      entering idle state.
7662306a36Sopenharmony_ci      CAUTION: This property should be used with care, it actually makes the
7762306a36Sopenharmony_ci      watchdog not counting when the CPU is in idle state, therefore the
7862306a36Sopenharmony_ci      watchdog reset time depends on mean CPU usage and will not reset at all
7962306a36Sopenharmony_ci      if the CPU stops working while it is in idle state, which is probably
8062306a36Sopenharmony_ci      not what you want.
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci  atmel,dbg-halt:
8362306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/flag
8462306a36Sopenharmony_ci    description: |
8562306a36Sopenharmony_ci      Should be present if you want to stop the watchdog when
8662306a36Sopenharmony_ci      entering debug state.
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_cirequired:
8962306a36Sopenharmony_ci  - compatible
9062306a36Sopenharmony_ci  - reg
9162306a36Sopenharmony_ci  - clocks
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ciallOf:
9462306a36Sopenharmony_ci  - $ref: watchdog.yaml#
9562306a36Sopenharmony_ci  - if:
9662306a36Sopenharmony_ci      properties:
9762306a36Sopenharmony_ci        atmel,reset-type:
9862306a36Sopenharmony_ci          enum:
9962306a36Sopenharmony_ci            - all
10062306a36Sopenharmony_ci            - proc
10162306a36Sopenharmony_ci    then:
10262306a36Sopenharmony_ci      properties:
10362306a36Sopenharmony_ci        atmel,watchdog-type:
10462306a36Sopenharmony_ci          const: hardware
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_cidependencies:
10762306a36Sopenharmony_ci  atmel,reset-type: ['atmel,watchdog-type']
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_ciunevaluatedProperties: false
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ciexamples:
11262306a36Sopenharmony_ci  - |
11362306a36Sopenharmony_ci    #include <dt-bindings/interrupt-controller/irq.h>
11462306a36Sopenharmony_ci
11562306a36Sopenharmony_ci    watchdog@fffffd40 {
11662306a36Sopenharmony_ci        compatible = "atmel,at91sam9260-wdt";
11762306a36Sopenharmony_ci        reg = <0xfffffd40 0x10>;
11862306a36Sopenharmony_ci        interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>;
11962306a36Sopenharmony_ci        clocks = <&clk32k>;
12062306a36Sopenharmony_ci        timeout-sec = <15>;
12162306a36Sopenharmony_ci        atmel,watchdog-type = "hardware";
12262306a36Sopenharmony_ci        atmel,reset-type = "all";
12362306a36Sopenharmony_ci        atmel,dbg-halt;
12462306a36Sopenharmony_ci        atmel,idle-halt;
12562306a36Sopenharmony_ci        atmel,max-heartbeat-sec = <16>;
12662306a36Sopenharmony_ci        atmel,min-heartbeat-sec = <0>;
12762306a36Sopenharmony_ci    };
128