* [PATCH] Alchemy: fix reset for MTX-1 and XXS1500
@ 2011-02-21 13:28 Florian Fainelli
2011-02-21 20:38 ` br1
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2011-02-21 13:28 UTC (permalink / raw)
To: linux-mips; +Cc: ralf, br1
Since commit 32fd6901 (MIPS: Alchemy: get rid of common/reset.c)
Alchemy-based boards use their own reset function. For MTX-1 and XXS1500,
the reset function pokes at the BCSR.SYSTEM_RESET register, but this does
not work. According to Bruno Randolf, this was not tested when written.
Previously, the generic au1000_restart() routine called the board specific
reset function, which for MTX-1 and XXS1500 did not work, but finally made
a jump to the reset vector, which really triggers a system restart. Fix
reboot for both targets by jumping to the reset vector.
CC: Bruno Randolf <br1@einfach.org>
CC: stable@kernel.org
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Stable: 2.6.34+
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index 6398fa9..40b84b9 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -54,8 +54,8 @@ int mtx1_pci_idsel(unsigned int devsel, int assert);
static void mtx1_reset(char *c)
{
- /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
- au_writel(0x00000000, 0xAE00001C);
+ /* Jump to the reset vector */
+ __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
}
static void mtx1_power_off(void)
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c
index b43c918..80c521e 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -36,8 +36,8 @@
static void xxs1500_reset(char *c)
{
- /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
- au_writel(0x00000000, 0xAE00001C);
+ /* Jump to the reset vector */
+ __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
}
static void xxs1500_power_off(void)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Alchemy: fix reset for MTX-1 and XXS1500
2011-02-21 13:28 [PATCH] Alchemy: fix reset for MTX-1 and XXS1500 Florian Fainelli
@ 2011-02-21 20:38 ` br1
2011-03-14 14:24 ` Ralf Baechle
0 siblings, 1 reply; 3+ messages in thread
From: br1 @ 2011-02-21 20:38 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mips, ralf, br1
> Since commit 32fd6901 (MIPS: Alchemy: get rid of common/reset.c)
> Alchemy-based boards use their own reset function. For MTX-1 and XXS1500,
> the reset function pokes at the BCSR.SYSTEM_RESET register, but this does
> not work. According to Bruno Randolf, this was not tested when written.
Well, I don´t know wether it was tested or not, but since it
doesn´t work i think we can assume it wasn´t.
> Previously, the generic au1000_restart() routine called the board specific
> reset function, which for MTX-1 and XXS1500 did not work, but finally made
> a jump to the reset vector, which really triggers a system restart. Fix
> reboot for both targets by jumping to the reset vector.
>
> CC: Bruno Randolf <br1@einfach.org>
> CC: stable@kernel.org
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> Stable: 2.6.34+
>
> diff --git a/arch/mips/alchemy/mtx-1/board_setup.c
> b/arch/mips/alchemy/mtx-1/board_setup.c
> index 6398fa9..40b84b9 100644
> --- a/arch/mips/alchemy/mtx-1/board_setup.c
> +++ b/arch/mips/alchemy/mtx-1/board_setup.c
> @@ -54,8 +54,8 @@ int mtx1_pci_idsel(unsigned int devsel, int assert);
>
> static void mtx1_reset(char *c)
> {
> - /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
> - au_writel(0x00000000, 0xAE00001C);
> + /* Jump to the reset vector */
> + __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
> }
>
> static void mtx1_power_off(void)
> diff --git a/arch/mips/alchemy/xxs1500/board_setup.c
> b/arch/mips/alchemy/xxs1500/board_setup.c
> index b43c918..80c521e 100644
> --- a/arch/mips/alchemy/xxs1500/board_setup.c
> +++ b/arch/mips/alchemy/xxs1500/board_setup.c
> @@ -36,8 +36,8 @@
>
> static void xxs1500_reset(char *c)
> {
> - /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
> - au_writel(0x00000000, 0xAE00001C);
> + /* Jump to the reset vector */
> + __asm__ __volatile__("jr\t%0"::"r"(0xbfc00000));
> }
>
> static void xxs1500_power_off(void)
> --
> 1.7.1
>
>
Acked-by: Bruno Randolf <br1@einfach.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Alchemy: fix reset for MTX-1 and XXS1500
2011-02-21 20:38 ` br1
@ 2011-03-14 14:24 ` Ralf Baechle
0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2011-03-14 14:24 UTC (permalink / raw)
To: br1; +Cc: Florian Fainelli, linux-mips
On Mon, Feb 21, 2011 at 09:38:27PM +0100, br1@einfach.org wrote:
> Acked-by: Bruno Randolf <br1@einfach.org>
Thanks, applied.
Ralf
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-14 14:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21 13:28 [PATCH] Alchemy: fix reset for MTX-1 and XXS1500 Florian Fainelli
2011-02-21 20:38 ` br1
2011-03-14 14:24 ` Ralf Baechle
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.