From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: mxs: rename function that sets AUTO_RESTART flag
Date: Wed, 24 Jul 2013 17:54:35 +0200 [thread overview]
Message-ID: <201307241754.35480.marex@denx.de> (raw)
In-Reply-To: <1374674499-22850-1-git-send-email-hector.palacios@digi.com>
Dear Hector Palacios,
> The AUTO_RESTART flag of HW_RTC_PERSISTENT0 register will
> power up the chip automatically 180ms after power down.
> This bit must be enabled by the boot loader to ensure the
> target can start upon hardware reset or watchdog reset
> even when powered from a battery.
>
> Currently the function named 'mxs_power_clear_auto_restart()'
> is setting this flag although the 'clear' in its name suggest
> the opposite.
>
> This patch renames the function to 'mxs_power_set_auto_restart()'
> and removes the comment about EVK revision A which was confusing
> because the function indeed was setting the flag.
Why? The comment seems fully valid to me.
> Signed-off-by: Hector Palacios <hector.palacios@digi.com>
> ---
> arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
> b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c index 5ee2d88..285ac79
> 100644
> --- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
> +++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
> @@ -52,7 +52,7 @@ static void mxs_power_clock2pll(void)
> CLKCTRL_CLKSEQ_BYPASS_CPU);
> }
>
> -static void mxs_power_clear_auto_restart(void)
> +static void mxs_power_set_auto_restart(void)
> {
> struct mxs_rtc_regs *rtc_regs =
> (struct mxs_rtc_regs *)MXS_RTC_BASE;
> @@ -65,10 +65,7 @@ static void mxs_power_clear_auto_restart(void)
> while (readl(&rtc_regs->hw_rtc_ctrl) & RTC_CTRL_CLKGATE)
> ;
>
> - /*
> - * Due to the hardware design bug of mx28 EVK-A
> - * we need to set the AUTO_RESTART bit.
> - */
> + /* Do nothing if flag already set */
You're changing the behavior here and it's not documented. I see no point in
this change while at it.
> if (readl(&rtc_regs->hw_rtc_persistent0) & RTC_PERSISTENT0_AUTO_RESTART)
> return;
>
> @@ -903,7 +900,7 @@ void mxs_power_init(void)
> (struct mxs_power_regs *)MXS_POWER_BASE;
>
> mxs_power_clock2xtal();
> - mxs_power_clear_auto_restart();
> + mxs_power_set_auto_restart();
> mxs_power_set_linreg();
> mxs_power_setup_5v_detect();
Best regards,
Marek Vasut
next prev parent reply other threads:[~2013-07-24 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 14:01 [U-Boot] [PATCH] ARM: mxs: rename function that sets AUTO_RESTART flag Hector Palacios
2013-07-24 15:54 ` Marek Vasut [this message]
2013-07-24 16:08 ` Hector Palacios
2013-07-26 8:50 ` Stefano Babic
2013-07-26 8:58 ` Marek Vasut
2013-08-31 15:51 ` Stefano Babic
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=201307241754.35480.marex@denx.de \
--to=marex@denx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox