From: Lokesh Vutla <lokeshvutla@ti.com>
To: linux-omap@vger.kernel.org, paul@pwsan.com
Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
tony@atomide.com, nsekhar@ti.com, t-kristo@ti.com
Subject: Re: [RFC PATCH] ARM: DRA: hwmod: RTC: Add reset function for RTC
Date: Thu, 20 Nov 2014 15:02:03 +0530 [thread overview]
Message-ID: <546DB513.6000104@ti.com> (raw)
In-Reply-To: <1416199402-3865-1-git-send-email-lokeshvutla@ti.com>
Hi Paul,
On Monday 17 November 2014 10:13 AM, Lokesh Vutla wrote:
> RTC IP have kicker feature which prevents spurious writes to its registers.
> In order to write into any of the RTC registers, KICK values has te be
> written to KICK registers. Currently hwmod is updating the IDLEMODE in rtc
> sysconfig register without writing into any kick register which is a noop.
> When autoidle is allowed for rtc, interruts are not received until IDLEMODE
> is set to SIDLE_SMART_WKUP.
> Adding a reset function to unlock RTC registers so that IDLEMODE is
> updated.
Ping..!!
Is this patch acceptable?
Thanks and regards,
Lokesh
>
> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
> ---
> arch/arm/mach-omap2/omap_hwmod.h | 1 +
> arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 1 +
> arch/arm/mach-omap2/omap_hwmod_reset.c | 23 +++++++++++++++++++++++
> 3 files changed, 25 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
> index 512f809..3703f99 100644
> --- a/arch/arm/mach-omap2/omap_hwmod.h
> +++ b/arch/arm/mach-omap2/omap_hwmod.h
> @@ -744,6 +744,7 @@ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
> */
>
> extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
> +int omap_hwmod_rtc_unlock(struct omap_hwmod *oh);
>
> /*
> * Chip variant-specific hwmod init routines - XXX should be converted
> diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> index 5684f11..90e1df4 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
> @@ -1584,6 +1584,7 @@ static struct omap_hwmod_class_sysconfig dra7xx_rtcss_sysc = {
> static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = {
> .name = "rtcss",
> .sysc = &dra7xx_rtcss_sysc,
> + .reset = &omap_hwmod_rtc_unlock,
> };
>
> /* rtcss */
> diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
> index 65e186c..b825a28 100644
> --- a/arch/arm/mach-omap2/omap_hwmod_reset.c
> +++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
> @@ -30,6 +30,12 @@
>
> #include "omap_hwmod.h"
>
> +#define RTC_KICK0_REG_OFFSET 0x6c
> +#define RTC_KICK1_REG_OFFSET 0x70
> +
> +#define RTC_KICK0_VALUE 0x83E70B13
> +#define RTC_KICK1_VALUE 0x95A4F1E0
> +
> /**
> * omap_hwmod_aess_preprogram - enable AESS internal autogating
> * @oh: struct omap_hwmod *
> @@ -51,3 +57,20 @@ int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
>
> return 0;
> }
> +
> +/**
> + * omap_hwmod_rtc_unlock - Reset and unlock the Kicker mechanism.
> + * @oh: struct omap_hwmod *
> + *
> + * RTC IP have kicker feature. This prevents spurious writes to its registers.
> + * In order to write into any of the RTC registers, KICK values has te be
> + * written in respective KICK registers. This is needed for hwmod to write into
> + * sysconfig register.
> + */
> +int omap_hwmod_rtc_unlock(struct omap_hwmod *oh)
> +{
> + omap_hwmod_write(RTC_KICK0_VALUE, oh, RTC_KICK0_REG_OFFSET);
> + omap_hwmod_write(RTC_KICK1_VALUE, oh, RTC_KICK1_REG_OFFSET);
> +
> + return 0;
> +}
>
next prev parent reply other threads:[~2014-11-20 9:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 4:43 [RFC PATCH] ARM: DRA: hwmod: RTC: Add reset function for RTC Lokesh Vutla
2014-11-20 9:32 ` Lokesh Vutla [this message]
2014-11-20 16:56 ` Paul Walmsley
2014-11-25 4:02 ` Lokesh Vutla
2014-11-26 7:04 ` Paul Walmsley
2014-11-27 4:40 ` Lokesh Vutla
2015-01-02 22:53 ` Paul Walmsley
[not found] ` <alpine.DEB.2.02.1501022252580.27058-rwI8Ez+7Ko+d5PgPZx9QOdBPR1lH4CV8@public.gmane.org>
2015-02-12 16:41 ` Paul Walmsley
2015-02-13 5:37 ` Lokesh Vutla
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=546DB513.6000104@ti.com \
--to=lokeshvutla@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=nsekhar@ti.com \
--cc=paul@pwsan.com \
--cc=t-kristo@ti.com \
--cc=tony@atomide.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).