Lines Matching +full:external +full:- +full:signal

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
73 {"fsl,imx6sx-wdt", 1},
74 {"fsl,imx6sl-wdt", 1},
75 {"fsl,imx6q-wdt", 1},
76 {"fsl,imx53-wdt", 1},
77 {"fsl,imx51-wdt", 1},
78 {"fsl,imx50-wdt", 1},
79 {"fsl,imx35-wdt", 1},
80 {"fsl,imx27-wdt", 1},
81 {"fsl,imx25-wdt", 1},
82 {"fsl,imx21-wdt", 1},
90 return (bus_read_2(sc->sc_res[MEMRES], offs)); in RD2()
97 bus_write_2(sc->sc_res[MEMRES], offs, val); in WR2()
108 mtx_lock(&sc->sc_mtx); in imx_wdog_enable()
109 if (timeout != sc->sc_timeout) { in imx_wdog_enable()
110 sc->sc_timeout = timeout; in imx_wdog_enable()
113 reg |= ((2 * timeout - 1) << WDOG_CR_WT_SHIFT); in imx_wdog_enable()
119 /* Watchdog active, can disable rom-boot watchdog. */ in imx_wdog_enable()
120 if (sc->sc_pde_enabled) { in imx_wdog_enable()
121 sc->sc_pde_enabled = false; in imx_wdog_enable()
125 mtx_unlock(&sc->sc_mtx); in imx_wdog_enable()
139 device_printf(sc->sc_dev, "Can not be disabled.\n"); in imx_watchdog()
154 * When configured for external reset, the actual reset is supposed to in imx_wdog_intr()
155 * happen when some external device responds to the assertion of the in imx_wdog_intr()
156 * WDOG_B signal by asserting the POR signal to the chip. This in imx_wdog_intr()
158 * simultaneously with WDOG_B, and if the external reset happens we'll in imx_wdog_intr()
160 * a software reset. That code will see that external reset is in imx_wdog_intr()
164 imx_wdog_cpu_reset(BUS_SPACE_PHYSADDR(sc->sc_res[MEMRES], WDOG_CR_REG)); in imx_wdog_intr()
176 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in imx_wdog_probe()
190 sc->sc_dev = dev; in imx_wdog_attach()
192 if (bus_alloc_resources(dev, imx_wdog_spec, sc->sc_res)) { in imx_wdog_attach()
197 mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "imx_wdt", MTX_DEF); in imx_wdog_attach()
200 * If we're configured to assert an external reset signal, set up the in imx_wdog_attach()
202 * purpose is to backstop the external reset. Don't worry if the in imx_wdog_attach()
205 if (ofw_bus_has_prop(sc->sc_dev, "fsl,ext-reset-output")) { in imx_wdog_attach()
207 bus_setup_intr(sc->sc_dev, sc->sc_res[IRQRES], in imx_wdog_attach()
209 &sc->sc_ih); in imx_wdog_attach()
214 * Note whether the rom-boot so-called "power-down" watchdog is active, in imx_wdog_attach()
218 sc->sc_pde_enabled = true; in imx_wdog_attach()
222 /* If there is a timeout-sec property, activate the watchdog. */ in imx_wdog_attach()
223 if (OF_getencprop(ofw_bus_get_node(sc->sc_dev), "timeout-sec", in imx_wdog_attach()
226 device_printf(sc->sc_dev, "ERROR: bad timeout-sec " in imx_wdog_attach()
231 device_printf(sc->sc_dev, "watchdog enabled using " in imx_wdog_attach()
232 "timeout-sec property value %u\n", timeout); in imx_wdog_attach()
240 device_busy(sc->sc_dev); in imx_wdog_attach()