xref: /freebsd/sys/contrib/device-tree/Bindings/watchdog/aspeed,ast2400-wdt.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1*7d0873ebSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*7d0873ebSEmmanuel Vadot%YAML 1.2
3*7d0873ebSEmmanuel Vadot---
4*7d0873ebSEmmanuel Vadot$id: http://devicetree.org/schemas/watchdog/aspeed,ast2400-wdt.yaml#
5*7d0873ebSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*7d0873ebSEmmanuel Vadot
7*7d0873ebSEmmanuel Vadottitle: Aspeed watchdog timer controllers
8*7d0873ebSEmmanuel Vadot
9*7d0873ebSEmmanuel Vadotmaintainers:
10*7d0873ebSEmmanuel Vadot  - Andrew Jeffery <andrew@codeconstruct.com.au>
11*7d0873ebSEmmanuel Vadot
12*7d0873ebSEmmanuel Vadotproperties:
13*7d0873ebSEmmanuel Vadot  compatible:
14*7d0873ebSEmmanuel Vadot    enum:
15*7d0873ebSEmmanuel Vadot      - aspeed,ast2400-wdt
16*7d0873ebSEmmanuel Vadot      - aspeed,ast2500-wdt
17*7d0873ebSEmmanuel Vadot      - aspeed,ast2600-wdt
18*7d0873ebSEmmanuel Vadot
19*7d0873ebSEmmanuel Vadot  reg:
20*7d0873ebSEmmanuel Vadot    maxItems: 1
21*7d0873ebSEmmanuel Vadot
22*7d0873ebSEmmanuel Vadot  clocks:
23*7d0873ebSEmmanuel Vadot    maxItems: 1
24*7d0873ebSEmmanuel Vadot    description: >
25*7d0873ebSEmmanuel Vadot      The clock used to drive the watchdog counter. From the AST2500 no source
26*7d0873ebSEmmanuel Vadot      other than the 1MHz clock can be selected, so the clocks property is
27*7d0873ebSEmmanuel Vadot      optional.
28*7d0873ebSEmmanuel Vadot
29*7d0873ebSEmmanuel Vadot  aspeed,reset-type:
30*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/string
31*7d0873ebSEmmanuel Vadot    enum:
32*7d0873ebSEmmanuel Vadot      - cpu
33*7d0873ebSEmmanuel Vadot      - soc
34*7d0873ebSEmmanuel Vadot      - system
35*7d0873ebSEmmanuel Vadot      - none
36*7d0873ebSEmmanuel Vadot    default: system
37*7d0873ebSEmmanuel Vadot    description: >
38*7d0873ebSEmmanuel Vadot      The watchdog can be programmed to generate one of three different types of
39*7d0873ebSEmmanuel Vadot      reset when a timeout occcurs.
40*7d0873ebSEmmanuel Vadot
41*7d0873ebSEmmanuel Vadot      Specifying 'cpu' will only reset the processor on a timeout event.
42*7d0873ebSEmmanuel Vadot
43*7d0873ebSEmmanuel Vadot      Specifying 'soc' will reset a configurable subset of the SoC's controllers
44*7d0873ebSEmmanuel Vadot      on a timeout event. Controllers critical to the SoC's operation may remain
45*7d0873ebSEmmanuel Vadot      untouched. The set of SoC controllers to reset may be specified via the
46*7d0873ebSEmmanuel Vadot      aspeed,reset-mask property if the node has the aspeed,ast2500-wdt or
47*7d0873ebSEmmanuel Vadot      aspeed,ast2600-wdt compatible.
48*7d0873ebSEmmanuel Vadot
49*7d0873ebSEmmanuel Vadot      Specifying 'system' will reset all controllers on a timeout event, as if
50*7d0873ebSEmmanuel Vadot      EXTRST had been asserted.
51*7d0873ebSEmmanuel Vadot
52*7d0873ebSEmmanuel Vadot      Specifying 'none' will cause the timeout event to have no reset effect.
53*7d0873ebSEmmanuel Vadot      Another watchdog engine on the chip must be used for chip reset operations.
54*7d0873ebSEmmanuel Vadot
55*7d0873ebSEmmanuel Vadot  aspeed,alt-boot:
56*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
57*7d0873ebSEmmanuel Vadot    description: >
58*7d0873ebSEmmanuel Vadot      Direct the watchdog to configure the SoC to boot from the alternative boot
59*7d0873ebSEmmanuel Vadot      region if a timeout occurs.
60*7d0873ebSEmmanuel Vadot
61*7d0873ebSEmmanuel Vadot  aspeed,external-signal:
62*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
63*7d0873ebSEmmanuel Vadot    description: >
64*7d0873ebSEmmanuel Vadot      Assert the timeout event on an external signal pin associated with the
65*7d0873ebSEmmanuel Vadot      watchdog controller instance. The pin must be muxed appropriately.
66*7d0873ebSEmmanuel Vadot
67*7d0873ebSEmmanuel Vadot  aspeed,ext-pulse-duration:
68*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
69*7d0873ebSEmmanuel Vadot    description: >
70*7d0873ebSEmmanuel Vadot      The duration, in microseconds, of the pulse emitted on the external signal
71*7d0873ebSEmmanuel Vadot      pin.
72*7d0873ebSEmmanuel Vadot
73*7d0873ebSEmmanuel Vadot  aspeed,ext-push-pull:
74*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
75*7d0873ebSEmmanuel Vadot    description: >
76*7d0873ebSEmmanuel Vadot      If aspeed,external-signal is specified in the node, set the external
77*7d0873ebSEmmanuel Vadot      signal pin's drive type to push-pull. If aspeed,ext-push-pull is not
78*7d0873ebSEmmanuel Vadot      specified then the pin is configured as open-drain.
79*7d0873ebSEmmanuel Vadot
80*7d0873ebSEmmanuel Vadot  aspeed,ext-active-high:
81*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
82*7d0873ebSEmmanuel Vadot    description: >
83*7d0873ebSEmmanuel Vadot      If both aspeed,external-signal and aspeed,ext-push-pull are specified in
84*7d0873ebSEmmanuel Vadot      the node, set the pulse polarity to active-high. If aspeed,ext-active-high
85*7d0873ebSEmmanuel Vadot      is not specified then the pin is configured as active-low.
86*7d0873ebSEmmanuel Vadot
87*7d0873ebSEmmanuel Vadot  aspeed,reset-mask:
88*7d0873ebSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
89*7d0873ebSEmmanuel Vadot    minItems: 1
90*7d0873ebSEmmanuel Vadot    maxItems: 2
91*7d0873ebSEmmanuel Vadot    description: >
92*7d0873ebSEmmanuel Vadot      A bitmask indicating which peripherals will be reset if the watchdog
93*7d0873ebSEmmanuel Vadot      timer expires. On AST2500 SoCs this should be a single word defined using
94*7d0873ebSEmmanuel Vadot      the AST2500_WDT_RESET_* macros; on AST2600 SoCs this should be a two-word
95*7d0873ebSEmmanuel Vadot      array with the first word defined using the AST2600_WDT_RESET1_* macros,
96*7d0873ebSEmmanuel Vadot      and the second word defined using the AST2600_WDT_RESET2_* macros.
97*7d0873ebSEmmanuel Vadot
98*7d0873ebSEmmanuel Vadotrequired:
99*7d0873ebSEmmanuel Vadot  - compatible
100*7d0873ebSEmmanuel Vadot  - reg
101*7d0873ebSEmmanuel Vadot
102*7d0873ebSEmmanuel VadotallOf:
103*7d0873ebSEmmanuel Vadot  - if:
104*7d0873ebSEmmanuel Vadot      anyOf:
105*7d0873ebSEmmanuel Vadot        - required:
106*7d0873ebSEmmanuel Vadot            - aspeed,ext-push-pull
107*7d0873ebSEmmanuel Vadot        - required:
108*7d0873ebSEmmanuel Vadot            - aspeed,ext-active-high
109*7d0873ebSEmmanuel Vadot        - required:
110*7d0873ebSEmmanuel Vadot            - aspeed,reset-mask
111*7d0873ebSEmmanuel Vadot    then:
112*7d0873ebSEmmanuel Vadot      properties:
113*7d0873ebSEmmanuel Vadot        compatible:
114*7d0873ebSEmmanuel Vadot          enum:
115*7d0873ebSEmmanuel Vadot            - aspeed,ast2500-wdt
116*7d0873ebSEmmanuel Vadot            - aspeed,ast2600-wdt
117*7d0873ebSEmmanuel Vadot  - if:
118*7d0873ebSEmmanuel Vadot      required:
119*7d0873ebSEmmanuel Vadot        - aspeed,ext-active-high
120*7d0873ebSEmmanuel Vadot    then:
121*7d0873ebSEmmanuel Vadot      required:
122*7d0873ebSEmmanuel Vadot        - aspeed,ext-push-pull
123*7d0873ebSEmmanuel Vadot
124*7d0873ebSEmmanuel VadotadditionalProperties: false
125*7d0873ebSEmmanuel Vadot
126*7d0873ebSEmmanuel Vadotexamples:
127*7d0873ebSEmmanuel Vadot  - |
128*7d0873ebSEmmanuel Vadot    watchdog@1e785000 {
129*7d0873ebSEmmanuel Vadot        compatible = "aspeed,ast2400-wdt";
130*7d0873ebSEmmanuel Vadot        reg = <0x1e785000 0x1c>;
131*7d0873ebSEmmanuel Vadot        aspeed,reset-type = "system";
132*7d0873ebSEmmanuel Vadot        aspeed,external-signal;
133*7d0873ebSEmmanuel Vadot    };
134*7d0873ebSEmmanuel Vadot  - |
135*7d0873ebSEmmanuel Vadot    #include <dt-bindings/watchdog/aspeed-wdt.h>
136*7d0873ebSEmmanuel Vadot    watchdog@1e785040 {
137*7d0873ebSEmmanuel Vadot        compatible = "aspeed,ast2600-wdt";
138*7d0873ebSEmmanuel Vadot        reg = <0x1e785040 0x40>;
139*7d0873ebSEmmanuel Vadot        aspeed,reset-type = "soc";
140*7d0873ebSEmmanuel Vadot        aspeed,reset-mask = <AST2600_WDT_RESET1_DEFAULT
141*7d0873ebSEmmanuel Vadot                            (AST2600_WDT_RESET2_DEFAULT & ~AST2600_WDT_RESET2_LPC)>;
142*7d0873ebSEmmanuel Vadot    };
143