mpc85xx: support board-specific reset function
authorIra W. Snyder <iws@ovro.caltech.edu>
Mon, 21 Nov 2011 21:20:32 +0000 (13:20 -0800)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 29 Nov 2011 14:48:06 +0000 (08:48 -0600)
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>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/cpu/mpc85xx/cpu.c

index 49c0551692985ebca9bc9fe0fc26dfd15acb5196..c1815e8860dd34069af7feefe890de1dcf4fc7fa 100644 (file)
 
 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