diff mbox

[U-Boot,v5,1/3] mpc85xx: support board-specific reset function

Message ID 1321910434-3067-2-git-send-email-iws@ovro.caltech.edu
State Accepted
Delegated to: Kumar Gala
Headers show

Commit Message

Ira Snyder Nov. 21, 2011, 9:20 p.m. UTC
This is useful for boards which cannot be reset in the usual way for the
85xx CPU. An example is a board which can only be reset by a hardware
watchdog.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
---

Unchanged from v1.

 arch/powerpc/cpu/mpc85xx/cpu.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

Comments

Kumar Gala Nov. 29, 2011, 3:07 p.m. UTC | #1
On Nov 21, 2011, at 3:20 PM, Ira W. Snyder wrote:

> This is useful for boards which cannot be reset in the usual way for the
> 85xx CPU. An example is a board which can only be reset by a hardware
> watchdog.
> 
> Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
> ---
> 
> Unchanged from v1.
> 
> arch/powerpc/cpu/mpc85xx/cpu.c |   17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)

applied to 85xx

- k
diff mbox

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 49c0551..c1815e8 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -42,6 +42,16 @@ 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Default board reset function
+ */
+static void
+__board_reset(void)
+{
+	/* Do nothing */
+}
+void board_reset(void) __attribute__((weak, alias("__board_reset")));
+
 int checkcpu (void)
 {
 	sys_info_t sysinfo;
@@ -215,7 +225,12 @@  int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	mtspr(DBCR0,val);
 #else
 	volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-	out_be32(&gur->rstcr, 0x2);	/* HRESET_REQ */
+
+	/* Attempt board-specific reset */
+	board_reset();
+
+	/* Next try asserting HRESET_REQ */
+	out_be32(&gur->rstcr, 0x2);
 	udelay(100);
 #endif