From owner-p4-projects@FreeBSD.ORG Mon Nov 13 18:25:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BB40316A47B; Mon, 13 Nov 2006 18:25:13 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 962E316A416 for ; Mon, 13 Nov 2006 18:25:13 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D44F43F82 for ; Mon, 13 Nov 2006 18:18:53 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kADIIWOl059318 for ; Mon, 13 Nov 2006 18:18:32 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kADIIW17059315 for perforce@freebsd.org; Mon, 13 Nov 2006 18:18:32 GMT (envelope-from sam@freebsd.org) Date: Mon, 13 Nov 2006 18:18:32 GMT Message-Id: <200611131818.kADIIW17059315@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 109864 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2006 18:25:14 -0000 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