xref: /linux/Documentation/watchdog/mlx-wdt.rst (revision b4db9f840283caca0d904436f187ef56a9126eaa)
1=========================
2Mellanox watchdog drivers
3=========================
4
5for x86 based system switches
6=============================
7
8This driver provides watchdog functionality for various Mellanox
9Ethernet and Infiniband switch systems.
10
11Mellanox watchdog device is implemented in a programmable logic device.
12
13There are 2 types of HW watchdog implementations.
14
15Type 1:
16  Actual HW timeout can be defined as a power of 2 msec.
17  e.g. timeout 20 sec will be rounded up to 32768 msec.
18  The maximum timeout period is 32 sec (32768 msec.),
19  Get time-left isn't supported
20
21Type 2:
22  Actual HW timeout is defined in sec. and it's the same as
23  a user-defined timeout.
24  Maximum timeout is 255 sec.
25  Get time-left is supported.
26
27Type 3:
28  Same as Type 2 with extended maximum timeout period.
29  Maximum timeout is 65535 sec.
30
31Type 1 HW watchdog implementation exist in old systems and
32all new systems have type 2 HW watchdog.
33Two types of HW implementation have also different register map.
34
35Type 3 HW watchdog implementation can exist on all Mellanox systems
36with new programmer logic device.
37It's differentiated by WD capability bit.
38Old systems still have only one main watchdog.
39
40Mellanox system can have 2 watchdogs: main and auxiliary.
41Main and auxiliary watchdog devices can be enabled together
42on the same system.
43There are several actions that can be defined in the watchdog:
44system reset, start fans on full speed and increase register counter.
45The last 2 actions are performed without a system reset.
46Actions without reset are provided for auxiliary watchdog device,
47which is optional.
48Watchdog can be started during a probe, in this case it will be
49pinged by watchdog core before watchdog device will be opened by
50user space application.
51Watchdog can be initialised in nowayout way, i.e. oncse started
52it can't be stopped.
53
54This mlx-wdt driver supports both HW watchdog implementations.
55
56Watchdog driver is probed from the common mlx_platform driver.
57Mlx_platform driver provides an appropriate set of registers for
58Mellanox watchdog device, identity name (mlx-wdt-main or mlx-wdt-aux),
59initial timeout, performed action in expiration and configuration flags.
60watchdog configuration flags: nowayout and start_at_boot, hw watchdog
61version - type1 or type2.
62The driver checks during initialization if the previous system reset
63was done by the watchdog. If yes, it makes a notification about this event.
64
65Access to HW registers is performed through a generic regmap interface.
66Programmable logic device registers have little-endian order.
67