All of lore.kernel.org
 help / color / mirror / Atom feed
From: York Sun <york.sun@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4] armv8/ls2080a: configure PMU's PCTBENR to enable WDT
Date: Tue, 7 Jun 2016 08:56:41 -0700	[thread overview]
Message-ID: <5756EEB9.4030603@nxp.com> (raw)
In-Reply-To: <1465291101-39307-1-git-send-email-B56489@freescale.com>

On 06/07/2016 02:28 AM, Yunhui Cui wrote:
> From: Yunhui Cui <yunhui.cui@nxp.com>
> 
> The SP805-WDT module on LS2080A and LS2085A, requires configuration
> of PMU's PCTBENR register to enable watchdog counter decrement and
> reset signal generation. In order not to affect the sp805wdt driver
> frame, we enable the watchdog clk in advance.
> 
> Signed-off-by: Yunhui Cui <yunhui.cui@nxp.com>
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/cpu.c                | 15 +++++++++++++++
>  arch/arm/include/asm/arch-fsl-layerscape/immap_lsch3.h |  1 +
>  2 files changed, 16 insertions(+)
> 
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> index d939900..1ac1067 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
> @@ -639,6 +639,10 @@ int timer_init(void)
>  #ifdef CONFIG_FSL_LSCH3
>  	u32 __iomem *cltbenr = (u32 *)CONFIG_SYS_FSL_PMU_CLTBENR;
>  #endif
> +#ifdef CONFIG_LS2080A
> +	u32 __iomem *pctbenr = (u32 *)FSL_PMU_PCTBENR_OFFSET;
> +	u32 pmu_val;
> +#endif
>  #ifdef COUNTER_FREQUENCY_REAL
>  	unsigned long cntfrq = COUNTER_FREQUENCY_REAL;
>  
> @@ -653,6 +657,17 @@ int timer_init(void)
>  	out_le32(cltbenr, 0xf);
>  #endif
>  
> +#ifdef CONFIG_LS2080A
> +/*
> + * In certain Layerscape SoCs, the clock for each core's
> + * has an enable bit in the PMU Physical Core Time Base Enable
> + * Register (PCTBENR), which allows the watchdog to operate.
> + */
> +pmu_val = in_le32(pctbenr);
> +pmu_val |= 0xff;
> +out_le32(pctbenr, pmu_val);
> +#endif
> +

You could use setbits_le32() instead of three lines.
Also inappropriate indentation.

York

  reply	other threads:[~2016-06-07 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07  9:18 [U-Boot] [PATCH v4] armv8/ls2080a: configure PMU's PCTBENR to enable WDT Yunhui Cui
2016-06-07 15:56 ` York Sun [this message]
2016-06-08  2:40   ` Yunhui Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5756EEB9.4030603@nxp.com \
    --to=york.sun@nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.