Date: Mon, 13 Nov 2006 18:18:32 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 109864 for review Message-ID: <200611131818.kADIIW17059315@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109864 Change 109864 by sam@sam_ebb on 2006/11/13 18:18:09 Grr, fix it; write key to the correct register. Turns out my guess on units conversion for the timer register was close enough--it's a 66.66MHz clock. Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_wdog.c#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_wdog.c#2 (text+ko) ==== @@ -68,22 +68,21 @@ { struct ixpwdog_softc *sc = arg; u_int u = cmd & WD_INTERVAL; - uint32_t ena; - WR4(sc, IXP425_OST_WDOG, OST_WDOG_KEY_MAJICK); - ena = RD4(sc, IXP425_OST_WDOG_ENAB); - if (cmd && u <= 35) { - /* XXX what are the units? */ + WR4(sc, IXP425_OST_WDOG_KEY, OST_WDOG_KEY_MAJICK); + if (cmd && 4 <= u && u <= 35) { + WR4(sc, IXP425_OST_WDOG_ENAB, 0); + /* approximate 66.66MHz cycles */ WR4(sc, IXP425_OST_WDOG, 2<<(u - 4)); /* NB: reset on timer expiration */ WR4(sc, IXP425_OST_WDOG_ENAB, - ena | OST_WDOG_ENAB_CNT_ENA | OST_WDOG_ENAB_RST_ENA); + OST_WDOG_ENAB_CNT_ENA | OST_WDOG_ENAB_RST_ENA); *error = 0; } else { /* disable watchdog */ - WR4(sc, IXP425_OST_WDOG_ENAB, ena &~ OST_WDOG_ENAB_CNT_ENA); + WR4(sc, IXP425_OST_WDOG_ENAB, 0); } - WR4(sc, IXP425_OST_WDOG, 0); + WR4(sc, IXP425_OST_WDOG_KEY, 0); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611131818.kADIIW17059315>