From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/9] ARM: pxa: use gpio reset
Date: Fri, 1 Apr 2011 19:35:16 +0100 [thread overview]
Message-ID: <20110401183516.GC8482@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1301625568-16583-4-git-send-email-haojian.zhuang@marvell.com>
On Fri, Apr 01, 2011 at 10:39:23AM +0800, Haojian Zhuang wrote:
> Watchdog reset will clear RTC and some configuration registers. GPIO reset
> doesn't have this impact. So replace watchdog reset by gpio reset.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
> ---
> arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | 8 ++++++++
> arch/arm/mach-pxa/reset.c | 16 ++++++++++++----
> 2 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
> index e4fb466..28bc2a9 100644
> --- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
> +++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
> @@ -37,6 +37,14 @@
> #define PVCR __REG(0x40F50100) /* Power Manager Voltage Change Control Register */
> #define PCMD(x) __REG(0x40F50110 + ((x) << 2))
>
> +#define PMCR_BIE (1 << 0) /* Interrupt Enable for nBATT_FAULT */
> +#define PMCR_BIS (1 << 1) /* Interrupt Status for nBATT_FAULT */
> +#define PMCR_TIE (1 << 10) /* Interrupt Enable for XScale Core Frequency Change */
> +#define PMCR_TIS (1 << 11) /* Interrupt Status for XScale Core Frequency Change */
> +#define PMCR_VIE (1 << 12) /* Interrupt Enable for VCC_APPS and VCC_SRAM Voltage Change */
> +#define PMCR_VIS (1 << 13) /* Interrupt Status for VCC_APPS and VCC_SRAM Voltage Change */
> +#define PMCR_SWGR (1 << 31) /* Software GPIO Reset */
> +
> /*
> * Slave Power Managment Unit
> */
> diff --git a/arch/arm/mach-pxa/reset.c b/arch/arm/mach-pxa/reset.c
> index 01e9d64..611d537 100644
> --- a/arch/arm/mach-pxa/reset.c
> +++ b/arch/arm/mach-pxa/reset.c
> @@ -12,6 +12,7 @@
>
> #include <mach/regs-ost.h>
> #include <mach/reset.h>
> +#include <mach/pxa3xx-regs.h>
>
> unsigned int reset_status;
> EXPORT_SYMBOL(reset_status);
> @@ -75,10 +76,17 @@ static void do_gpio_reset(void)
>
> static void do_hw_reset(void)
> {
> - /* Initialize the watchdog and let it fire */
> - OWER = OWER_WME;
> - OSSR = OSSR_M3;
> - OSMR3 = OSCR + 368640; /* ... in 100 ms */
> + if (cpu_is_pxa3xx() || cpu_is_pxa95x()) {
> + /* GPIO reset that is defined in silicons */
> + PSPR = 0x5c014000;
> + PMCR = (PMCR & (PMCR_BIE | PMCR_TIE | PMCR_VIE))
> + | PMCR_SWGR;
> + } else {
> + /* Initialize the watchdog and let it fire */
> + OWER = OWER_WME;
> + OSSR = OSSR_M3;
> + OSMR3 = OSCR + 368640; /* ... in 100 ms */
> + }
> }
Why not separate the above into two functions - do_wd_reset() and
do_gpio_reset(), and have the selection of which is to be used in
the initialization path?
next prev parent reply other threads:[~2011-04-01 18:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <040101>
2011-04-01 2:39 ` [PATCH 1/9] ARM: pxa: add clk_set_rate() Haojian Zhuang
2011-04-01 2:39 ` [PATCH 2/9] ARM: pxa: enable sparsemem in saarb Haojian Zhuang
2011-04-01 2:39 ` [PATCH 3/9] ARM: mmp: remove redundant macro definition in mfp Haojian Zhuang
2011-04-01 2:39 ` [PATCH 4/9] ARM: pxa: use gpio reset Haojian Zhuang
2011-04-01 2:39 ` [PATCH 5/9] ARM: mmp: set correct uart according to board Haojian Zhuang
2011-04-01 2:39 ` [PATCH 6/9] ARM: mmp: update the reset implementation Haojian Zhuang
2011-04-01 2:39 ` [PATCH 7/9] ARM: pxa: align NR_BUILTIN_GPIO with GPIO interrupt number Haojian Zhuang
2011-04-01 2:39 ` [PATCH 8/9] ARM: mmp: align NR_BUILTIN_GPIO with gpio " Haojian Zhuang
2011-04-01 2:39 ` [PATCH 9/9] ARM: mmp: enable max7312 gpio expander in dkb Haojian Zhuang
2011-04-01 18:36 ` Russell King - ARM Linux
2011-07-05 7:14 ` Eric Miao
2011-04-01 18:35 ` Russell King - ARM Linux [this message]
2011-04-03 10:39 ` [PATCH 4/9] ARM: pxa: use gpio reset Igor Grinberg
2011-04-01 4:51 ` [PATCH 3/9] ARM: mmp: remove redundant macro definition in mfp Eric Miao
2011-04-01 5:09 ` Haojian Zhuang
2011-04-01 5:31 ` Eric Miao
2011-04-01 5:45 ` Haojian Zhuang
2011-04-01 6:47 ` Eric Miao
2011-04-01 3:45 ` [PATCH 2/9] ARM: pxa: enable sparsemem in saarb Eric Miao
2011-04-01 4:35 ` Haojian Zhuang
2011-04-01 5:10 ` Eric Miao
2011-04-01 18:33 ` Russell King - ARM Linux
2011-04-02 6:48 ` Eric Miao
2011-04-01 18:31 ` Russell King - ARM Linux
2011-04-01 3:36 ` [PATCH 1/9] ARM: pxa: add clk_set_rate() Eric Miao
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=20110401183516.GC8482@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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).