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