1.. SPDX-License-Identifier: GPL-2.0 2 3============= 4NPCM Watchdog 5============= 6 7The NPCM watchdog driver can report reset-cause information on 8``nuvoton,npcm750-wdt`` and ``nuvoton,npcm845-wdt`` systems. 9 10Userspace can read the latched reset cause through 11``WDIOC_GETBOOTSTATUS``. When ``CONFIG_WATCHDOG_SYSFS`` is enabled, the 12same value is also visible through ``/sys/class/watchdog/watchdogN/bootstatus``. 13 14The mapping is fixed in the driver. It exposes the SoC reset indications 15through the generic watchdog bootstatus flags and is not configurable from 16Device Tree. 17 18.. list-table:: Reset-cause mapping 19 :header-rows: 1 20 21 * - Platform 22 - Reset indication 23 - Bootstatus flag 24 - Reported meaning 25 * - NPCM750 and NPCM845 26 - ``PORST`` 27 - ``WDIOF_OVERHEAT`` 28 - power-on reset 29 * - NPCM750 and NPCM845 30 - ``CORST`` 31 - ``WDIOF_FANFAULT`` 32 - core reset 33 * - NPCM750 and NPCM845 34 - ``SWR1RST`` 35 - ``WDIOF_EXTERN1`` 36 - software reset source 1 37 * - NPCM750 and NPCM845 38 - ``SWR2RST`` 39 - ``WDIOF_EXTERN2`` 40 - software reset source 2 41 * - NPCM750 and NPCM845 42 - ``SWR3RST`` 43 - ``WDIOF_POWERUNDER`` 44 - software reset source 3 45 * - NPCM750 46 - ``SWR4RST`` 47 - ``WDIOF_POWEROVER`` 48 - software reset source 4 49 * - NPCM845 50 - ``TIP reset`` (``INTCR2[25]``) 51 - ``WDIOF_POWEROVER`` 52 - TIP reset 53 54``WDIOF_CARDRESET`` is reported only for the watchdog instance whose own 55reset-status bit is latched. On systems with three watchdog instances, this 56maps ``WD0RST``, ``WD1RST``, and ``WD2RST`` to ``watchdog0``, ``watchdog1``, 57and ``watchdog2`` respectively. 58 59The driver may report ``WDIOF_CARDRESET`` together with one or more of the 60reset-cause flags listed above. 61 62On NPCM750, the driver samples ``RESSR``. When reset bits are still latched, 63it clears them and stores the sampled value in ``SCRPAD2`` so later watchdog 64probes can report the same boot-time state. 65 66On NPCM845, the driver samples ``INTCR2``. When reset bits are still latched, 67it clears them and stores the sampled value in ``SCRPAD10`` so later watchdog 68probes can report the same boot-time state. 69 70The WPCM450 watchdog continues to operate without this reset-indication 71mapping. 72