From: Scott Wood Date: Wed, 13 Aug 2014 18:49:50 -0500 Subject: [U-Boot] [PATCH 3/9] mpc85xx: watchdog initialisation added In-Reply-To: <1401779120-20306-4-git-send-email-rainer.boschung@keymile.com> References: <1401779120-20306-1-git-send-email-rainer.boschung@keymile.com> <1401779120-20306-4-git-send-email-rainer.boschung@keymile.com> Message-ID: <1407973790.7427.205.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2014-06-03 at 09:05 +0200, Rainer Boschung wrote: > Function to inititialize the cpu watchdog added. > > Signed-off-by: Rainer Boschung > --- > arch/powerpc/cpu/mpc85xx/cpu.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c > index 684d400..6274f92 100644 > --- a/arch/powerpc/cpu/mpc85xx/cpu.c > +++ b/arch/powerpc/cpu/mpc85xx/cpu.c > @@ -310,6 +310,14 @@ __weak unsigned long get_tbclk (void) > > > #if defined(CONFIG_WATCHDOG) > +#define WATCHDOG_MASK (TCR_WP(63) | TCR_WRC(3) | TCR_WIE) > +void > +init_85xx_watchdog(void) > +{ > + mtspr(SPRN_TCR, (mfspr(SPRN_TCR) & ~WATCHDOG_MASK) | > + TCR_WP(CONFIG_WATCHDOG_PRESC) | TCR_WRC(CONFIG_WATCHDOG_RC)); > +} These config symbols require documentation, and defaults to avoid breaking the build of existing mpc85xx boards that enable CONFIG_WATCHDOG (even if you add this later in the patchset, you're breaking bisectability). -Scott