Index: c/src/lib/libbsp/powerpc/gen5200/ChangeLog
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/ChangeLog	(revision 1611e8ca954f49e5f2f0eabcabd663209e04c6d1)
+++ c/src/lib/libbsp/powerpc/gen5200/ChangeLog	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -1,2 +1,12 @@
+2007-07-06	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile.am: Add startup/bspclean.c
+	* console/console.c: Remove warning.
+	* include/bsp.h: Add conditionals for prompt for reset and resetting
+	board.
+	* start/start.S: Remove if 1 around section.
+	* vectors/vectors_init.c: Do not print unless noisy init enabled.
+	* startup/bspclean.c: New file. Will prompt for reset and reset.
+
 2007-07-06	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: c/src/lib/libbsp/powerpc/gen5200/Makefile.am
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/Makefile.am	(revision 1611e8ca954f49e5f2f0eabcabd663209e04c6d1)
+++ c/src/lib/libbsp/powerpc/gen5200/Makefile.am	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -111,5 +111,5 @@
 
 noinst_PROGRAMS += startup.rel
-startup_rel_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
+startup_rel_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
     ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
     ../../shared/sbrk.c ../shared/uboot_dump_bdinfo.c \
Index: c/src/lib/libbsp/powerpc/gen5200/console/console.c
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/console/console.c	(revision 1611e8ca954f49e5f2f0eabcabd663209e04c6d1)
+++ c/src/lib/libbsp/powerpc/gen5200/console/console.c	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -117,27 +117,27 @@
 uint32_t mpc5200_uart_avail_mask = GEN5200_UART_AVAIL_MASK;
 
-uint8_t psc_minor_to_irqname[NUM_PORTS] =
-  {BSP_SIU_IRQ_PSC1,
-   BSP_SIU_IRQ_PSC2,
-   BSP_SIU_IRQ_PSC3,
-   BSP_SIU_IRQ_PSC4,
-   BSP_SIU_IRQ_PSC5,
-   BSP_SIU_IRQ_PSC6};
-static int mpc5200_psc_irqname_to_minor(int name)
-{
-  int minor;
-  uint8_t *chrptr;
-
-  chrptr = memchr(psc_minor_to_irqname,
-		  name,
-		  sizeof(psc_minor_to_irqname));
-  if (chrptr != NULL) {
-    minor = chrptr - psc_minor_to_irqname;
-  }
-  else {
-    minor = -1;
-  }
-  return minor;
-}
+#if defined(UARTS_USE_TERMIOS_INT)
+  uint8_t psc_minor_to_irqname[NUM_PORTS] =
+    {BSP_SIU_IRQ_PSC1,
+     BSP_SIU_IRQ_PSC2,
+     BSP_SIU_IRQ_PSC3,
+     BSP_SIU_IRQ_PSC4,
+     BSP_SIU_IRQ_PSC5,
+     BSP_SIU_IRQ_PSC6};
+
+  static int mpc5200_psc_irqname_to_minor(int name)
+  {
+    int minor;
+    uint8_t *chrptr;
+
+    uuchrptr = memchr(psc_minor_to_irqname, name, sizeof(psc_minor_to_irqname));
+    if (chrptr != NULL) {
+      minor = chrptr - psc_minor_to_irqname;
+    } else {
+      minor = -1;
+    }
+    return minor;
+  }
+#endif
 
 static void A_BSP_output_char(char c);
Index: c/src/lib/libbsp/powerpc/gen5200/include/bsp.h
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/include/bsp.h	(revision 1611e8ca954f49e5f2f0eabcabd663209e04c6d1)
+++ c/src/lib/libbsp/powerpc/gen5200/include/bsp.h	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -109,4 +109,8 @@
 #define	MBAR         0xF0000000
 
+/* We want to prompt for a reset and then reset the board */
+#define BSP_PRESS_KEY_FOR_RESET 1
+#define BSP_RESET_BOARD_AT_EXIT 1
+
 #else
 #error "board type not defined"
@@ -209,5 +213,5 @@
 
 #define SINGLE_CHAR_MODE
-#define UARTS_USE_TERMIOS_INT   1
+/* #define UARTS_USE_TERMIOS_INT   1 */
 /* #define SHOW_MORE_INIT_SETTINGS 1 */
 
Index: c/src/lib/libbsp/powerpc/gen5200/start/start.S
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/start/start.S	(revision 1611e8ca954f49e5f2f0eabcabd663209e04c6d1)
+++ c/src/lib/libbsp/powerpc/gen5200/start/start.S	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -474,8 +474,6 @@
         xor     r4, r4, r4	 		/* Clear argc and argv */
         
-#if 1     
         bl      SYM (boot_card)			/* Call the first C routine */
-#endif
-	
+
 #if defined(BRS5L)
 twiddle:				
Index: c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
+++ c/src/lib/libbsp/powerpc/gen5200/startup/bspclean.c	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -0,0 +1,45 @@
+/*
+ *  This is a dummy bsp_cleanup routine.
+ *
+ *  COPYRIGHT (c) 1989-1999.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <rtems/bspIo.h>
+#include <bsp.h>
+#include <mpc5200.h>
+
+extern int mpc5200_uart_pollRead(int minor);
+
+void bsp_cleanup( void )
+{
+  #if defined(BSP_PRESS_KEY_FOR_RESET)
+    printk( "\nEXECUTIVE SHUTDOWN! Any key to reboot..." );
+
+    /*
+     * Wait for a key to be pressed
+     */
+    while ( mpc5200_uart_pollRead(0) == -1 ) ;
+  #endif
+
+  /*
+   *  Check both conditions -- if you want to ask for reboot, then
+   *  you must have meant to reset the board.
+   */
+  #if defined(BSP_PRESS_KEY_FOR_RESET) || defined(BSP_RESET_BOARD_AT_EXIT)
+    /*
+     * Now reset the CPU
+     */
+    _ISR_Set_level( 0 );
+
+    mpc5200.gpt[0].count_in = 0xf;
+    mpc5200.gpt[0].emsel = 0x9004;
+  #endif 
+}
Index: c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c
===================================================================
--- c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c	(revision 1611e8ca954f49e5f2f0eabcabd663209e04c6d1)
+++ c/src/lib/libbsp/powerpc/gen5200/vectors/vectors_init.c	(revision 0a029a5ee5261bd5388a638fef553d42bc0e23a3)
@@ -185,5 +185,7 @@
   	{
 
-    printk("installing exception number %d\n", i);
+    #if defined(SHOW_MORE_INIT_SETTINGS)
+      printk("installing exception number %d\n", i);
+    #endif
 
   	if (!ppc_vector_is_valid(i))
