From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2][repost] arm: Kirkwood: add SYSRSTn Duration Counter Support
Date: Wed, 19 Aug 2009 09:20:07 +0200 [thread overview]
Message-ID: <20090819072007.5C6CD833DBD2@gemini.denx.de> (raw)
In-Reply-To: <1250679240-17557-1-git-send-email-prafulla@marvell.com>
Dear Prafulla Wadaskar,
In message <1250679240-17557-1-git-send-email-prafulla@marvell.com> you wrote:
> I am sorry for previous post v2, pls ignore it, this is the right patch for the same
This comment does not belong to the commit message. Please move below
the "---" line.
> This feature can be used to trigger special command "sysrstcmd" using
> reset key long press event and environment variable "sysrstdelay" is set
> (useful for reset to factory or manufacturing mode execution)
>
> Kirkwood SoC implements a hardware-based SYSRSTn duration counter.
> When SYSRSTn is asserted low, a SYSRSTn duration counter is running.
> The counter value is stored in the SYSRSTn Length Counter Register
> The counter is based on the 25-MHz reference clock (40ns)
> It is a 29-bit counter, yielding a maximum counting duration of
> 2^29/25 MHz (21.4 seconds). When the counter reach its maximum value,
> it remains at this value until counter reset is triggered by setting
> bit 31 of KW_REG_SYSRST_CNT
>
> Implementation:
> Upon long reset assertion (> ${sysrstdleay} in secs) sysrstcmd will be
That's a typo, it's "sysrstdelay", right? Please fix while we are at
it.
> +static void kw_sysrst_action(void)
> +{
> + int ret;
> + char *s = getenv("sysrstcmd");
> +
> + if (!s) {
> + printf("Error.. %s failed, check sysrstcmd\n",
> + __FUNCTION__);
> + return;
Why is this considered an error? I think it is perfectly legal to not
define this environment variable. For example, it is also no error to
set "bootdelay" and not define "bootcmd". I think we should implement
consistent behaviour.
> + }
> +
> + printf("Starting %s process...\n", __FUNCTION__);
This should be a debug(), I think. Don't produce too much output.
> + if (ret < 0)
> + printf("Error.. %s failed\n", __FUNCTION__);
> + else
> + printf("%s process finished\n", __FUNCTION__);
Ditto - please turn into debug().
> +
> +static void kw_sysrst_check(void)
> +{
> + u32 sysrst_cnt, sysrst_dly;
> + char *s;
> +
> + /*
> + * no action if sysrstdelay environment variable is not defined
> + */
> + s = getenv("sysrstdelay");
> + if (s == NULL)
> + return;
> +
> + /* read sysrstdelay value */
> + sysrst_dly = (u32) simple_strtoul(s, NULL, 10);
> +
> + /* read SysRst Length counter register (bits 28:0) */
> + sysrst_cnt = (0x1fffffff & readl(KW_REG_SYSRST_CNT));
> + printf("H/w Rst hold time: %d.%d secs\n",
> + sysrst_cnt / SYSRST_CNT_1SEC_VAL,
> + sysrst_cnt % SYSRST_CNT_1SEC_VAL);
This should be debvug(), too ?
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If a person (a) is poorly, (b) receives treatment intended to make
him better, and (c) gets better, then no power of reasoning known to
medical science can convince him that it may not have been the
treatment that restored his health.
- Sir Peter Medawar, The Art of the Soluble
next prev parent reply other threads:[~2009-08-19 7:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 10:54 [U-Boot] [PATCH v2][repost] arm: Kirkwood: add SYSRSTn Duration Counter Support Prafulla Wadaskar
2009-08-19 7:20 ` Wolfgang Denk [this message]
2009-08-20 8:53 ` Prafulla Wadaskar
2009-08-20 9:37 ` Wolfgang Denk
2009-08-20 10:00 ` Prafulla Wadaskar
2009-08-21 22:07 ` Wolfgang Denk
2009-08-24 7:45 ` Prafulla Wadaskar
2009-08-19 22:29 ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-20 2:53 ` Prafulla Wadaskar
2009-08-20 5:20 ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-20 9:46 ` Prafulla Wadaskar
2009-08-20 10:41 ` Prafulla Wadaskar
2009-08-20 16:34 ` Jean-Christophe PLAGNIOL-VILLARD
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=20090819072007.5C6CD833DBD2@gemini.denx.de \
--to=wd@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