From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:51:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D454E67C; Fri, 13 Dec 2013 22:51:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A64D616A2; Fri, 13 Dec 2013 22:51:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMp93m062294; Fri, 13 Dec 2013 22:51:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMp9DF062293; Fri, 13 Dec 2013 22:51:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132251.rBDMp9DF062293@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259360 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:51:09 -0000 Author: ian Date: Fri Dec 13 22:51:09 2013 New Revision: 259360 URL: http://svnweb.freebsd.org/changeset/base/259360 Log: MFC r257595: Comments and style(9) only, no functional changes. Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 22:50:12 2013 (r259359) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 22:51:09 2013 (r259360) @@ -158,34 +158,33 @@ bus_dma_get_range_nb(void) return (0); } +/* + * This code which manipulates the watchdog hardware is here to implement + * cpu_reset() because the watchdog is the only way for software to reset the + * chip. Why here and not in imx_wdog.c? Because there's no requirement that + * the watchdog driver be compiled in, but it's nice to be able to reboot even + * if it's not. + */ void imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr) { + const struct pmap_devmap *pd; + volatile uint16_t * pcr; /* - * This code which manipulates the watchdog hardware is here to - * implement cpu_reset() because the watchdog is the only way for - * software to reset the chip. Why here and not in imx_wdog.c? Because - * there's no requirement that the watchdog driver be compiled in, but - * it's nice to be able to reboot even if it's not. + * The deceptively simple write of WDOG_CR_WDE enables the watchdog, + * sets the timeout to its minimum value (half a second), and also + * clears the SRS bit which results in the SFTW (software-requested + * reset) bit being set in the watchdog status register after the reset. + * This is how software can distinguish a reset from a wdog timeout. */ - volatile uint16_t * pcr; - const struct pmap_devmap *pd; - if ((pd = pmap_devmap_find_pa(wdcr_physaddr, 2)) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { pcr = (uint16_t *)(pd->pd_va + (wdcr_physaddr - pd->pd_pa)); - /* - * This deceptively simple write enables the watchdog, sets the timeout - * to its minimum value (half a second), and also clears the SRS bit - * which results in the SFTW (software-requested reset) bit being set in - * the watchdog status register after the reset. This is how software - * can distinguish a requested reset from a wdog timeout. - */ *pcr = WDOG_CR_WDE; } - while (1) + for (;;) continue; }