Re: [PATCH 4/4] arch/powerpc/44x/fsp2: wdt tcr update instead of whole rewrite

From: Benjamin Herrenschmidt
Date: Fri May 19 2017 - 06:31:05 EST


On Mon, 2017-05-15 at 16:07 +0300, Ivan Mikhaylov wrote:
> +#ifdef CONFIG_FSP2
> +ÂÂÂÂÂÂÂ/*
> +ÂÂÂÂÂÂÂ * Prevent a kernel panic caused by unintentionally clearing TCR
> + * watchdog bits. At this point in the kernel boot, the watchdog has
> + * already been enabled by u-boot. The original code's attempt to
> +ÂÂÂÂÂÂÂ * write to the TCR register results in an inadvertent clearing of the
> +ÂÂÂÂÂÂÂ * watchdog configuration bits, causing the 440 to reset.
> +ÂÂÂÂÂÂÂ */
> +ÂÂÂÂÂÂÂtcr = mfspr(SPRN_TCR);
> +ÂÂÂÂÂÂÂtcr &= TCR_WP_MASK; /* clear all bits except for TCR[WP] */
> +ÂÂÂÂÂÂÂtcr |= TCR_DIE; /* enable decrementer */
> +ÂÂÂÂÂÂÂmtspr(SPRN_TCR, tcr);
> +#else

This should be a runtime test, not a compile time option.

Cheers,
Ben.