1*9287e466SIan Lepore.\" 2*9287e466SIan Lepore.\" Copyright (c) 2018 Ian Lepore <ian@freebsd.org> 3*9287e466SIan Lepore.\" All rights reserved. 4*9287e466SIan Lepore.\" 5*9287e466SIan Lepore.\" Redistribution and use in source and binary forms, with or without 6*9287e466SIan Lepore.\" modification, are permitted provided that the following conditions 7*9287e466SIan Lepore.\" are met: 8*9287e466SIan Lepore.\" 9*9287e466SIan Lepore.\" 1. Redistributions of source code must retain the above copyright 10*9287e466SIan Lepore.\" notice, this list of conditions and the following disclaimer. 11*9287e466SIan Lepore.\" 2. Redistributions in binary form must reproduce the above copyright 12*9287e466SIan Lepore.\" notice, this list of conditions and the following disclaimer in the 13*9287e466SIan Lepore.\" documentation and/or other materials provided with the distribution. 14*9287e466SIan Lepore.\" 15*9287e466SIan Lepore.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16*9287e466SIan Lepore.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17*9287e466SIan Lepore.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18*9287e466SIan Lepore.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19*9287e466SIan Lepore.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20*9287e466SIan Lepore.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21*9287e466SIan Lepore.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22*9287e466SIan Lepore.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23*9287e466SIan Lepore.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24*9287e466SIan Lepore.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25*9287e466SIan Lepore.\" 26*9287e466SIan Lepore.Dd July 7, 2018 27*9287e466SIan Lepore.Dt IMX_WDOG 4 28*9287e466SIan Lepore.Os 29*9287e466SIan Lepore.Sh NAME 30*9287e466SIan Lepore.Nm imx_wdog 31*9287e466SIan Lepore.Nd device driver for the NXP i.MX5 and i.MX6 watchdog timer 32*9287e466SIan Lepore.Sh SYNOPSIS 33*9287e466SIan LeporeTo compile this driver into the kernel, 34*9287e466SIan Leporeplace the following line in your 35*9287e466SIan Leporekernel configuration file: 36*9287e466SIan Lepore.Bd -ragged -offset indent 37*9287e466SIan Lepore.Cd "device imxwdt" 38*9287e466SIan Lepore.Ed 39*9287e466SIan Lepore.Pp 40*9287e466SIan LeporeAlternatively, to load the driver as a 41*9287e466SIan Leporemodule at boot time, place the following line in 42*9287e466SIan Lepore.Xr loader.conf 5 : 43*9287e466SIan Lepore.Bd -literal -offset indent 44*9287e466SIan Leporeimx_wdog_load="YES" 45*9287e466SIan Lepore.Ed 46*9287e466SIan Lepore.Sh DESCRIPTION 47*9287e466SIan LeporeThe 48*9287e466SIan Lepore.Nm 49*9287e466SIan Leporedriver provides 50*9287e466SIan Lepore.Xr watchdog 4 51*9287e466SIan Leporesupport for the watchdog timer present on NXP i.MX5 and i.MX6 processors. 52*9287e466SIan LeporeThe i.MX watchdog hardware supports programmable timeouts ranging from 53*9287e466SIan Lepore0.5 to 128 seconds, in half-second increments. 54*9287e466SIan LeporeOnce activated, the watchdog hardware cannot be deactivated, but the 55*9287e466SIan Leporetimeout period can be changed to any valid non-zero value. 56*9287e466SIan Lepore.Pp 57*9287e466SIan LeporeAt power-on, a special 16-second 58*9287e466SIan Lepore.Sq power-down timer 59*9287e466SIan Leporemode is automatically enabled by the hardware. 60*9287e466SIan LeporeIt will assert the external WDOG_B signal, which may be connected to 61*9287e466SIan Leporeexternal hardware that causes the system to reset or power-down. 62*9287e466SIan LeporeThe power-down timer is often reset by the boot loader (typically U-Boot). 63*9287e466SIan LeporeIf the power-down timer is still active at the time when the normal 64*9287e466SIan Leporewatchdog is first enabled, the 65*9287e466SIan Lepore.Nm 66*9287e466SIan Leporedriver automatically disables it. 67*9287e466SIan Lepore.Pp 68*9287e466SIan LeporeThe 69*9287e466SIan Lepore.Nm 70*9287e466SIan Leporedriver supports the FDT 71*9287e466SIan Lepore.Va fsl,external-reset 72*9287e466SIan Leporeproperty by enabling the assertion of the WDOG_B external timeout signal 73*9287e466SIan Leporewhen the property is present. 74*9287e466SIan LeporeWhen running this way, the need to reset the system due to watchdog 75*9287e466SIan Leporetimeout is signaled by driving the WDOG_B line low; some external 76*9287e466SIan Leporeentity is expected to assert the chip's POR pin in response. 77*9287e466SIan LeporeThe 78*9287e466SIan Lepore.Nm 79*9287e466SIan Leporedriver attempts to backstop this external reset by scheduling an 80*9287e466SIan Leporeinterrupt to occur as well. 81*9287e466SIan LeporeThe interrupt handler waits 1 second for the external reset to occur, 82*9287e466SIan Leporethen it triggers a normal software reset. 83*9287e466SIan LeporeNote that the WDOG_B signal can be configured to use a variety of 84*9287e466SIan Leporepins on the chip. 85*9287e466SIan LeporeFor the 86*9287e466SIan Lepore.Va fsl,external-reset 87*9287e466SIan Leporeproperty to be effective, the signal must be connected to an appropriate 88*9287e466SIan Leporepin by the system's FDT pinctrl data. 89*9287e466SIan Lepore.Pp 90*9287e466SIan LeporeThe 91*9287e466SIan Lepore.Nm 92*9287e466SIan Leporedriver supports the FDT 93*9287e466SIan Lepore.Va timeout-secs 94*9287e466SIan Leporeproperty by enabling the watchdog as soon as the driver attaches, 95*9287e466SIan Leporeusing the given timeout value. 96*9287e466SIan LeporeThis extends watchdog protection to much of the system startup process, 97*9287e466SIan Leporebut it still requires that 98*9287e466SIan Lepore.Xr watchdogd 4 99*9287e466SIan Leporebe configured to service the watchdog. 100*9287e466SIan Lepore.Sh SEE ALSO 101*9287e466SIan Lepore.Xr fdt 4 , 102*9287e466SIan Lepore.Xr watchdog 4 , 103*9287e466SIan Lepore.Xr watchdog 8 , 104*9287e466SIan Lepore.Xr watchdogd 8 , 105*9287e466SIan Lepore.Xr watchdog 9 106*9287e466SIan Lepore.Sh HISTORY 107*9287e466SIan LeporeThe 108*9287e466SIan Lepore.Nm 109*9287e466SIan Leporedriver first appeared in 110*9287e466SIan Lepore.Fx 10.0 . 111