summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-22 21:50:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-22 21:50:17 +0000
commit2fb1805ab69bf0dbe1e383230355018b3ca5d079 (patch)
treed7e9bbec1a41035be0647c9c118780aad5f1307d /c
parent2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-2fb1805ab69bf0dbe1e383230355018b3ca5d079.tar.bz2
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, console/console.c, include/bsp.h: Use standardized bsp_cleanup() which can optionally print a message, poll for user to press key, and call bsp_reset(). Using this eliminates the various bsp_cleanup() implementations which had their own implementation and variety of string constants. * startup/bspreset.c: New file. * startup/bspclean.c: Removed.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/ChangeLog10
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/Makefile.am3
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/console/console.c7
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h6
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/startup/bspclean.c78
-rw-r--r--c/src/lib/libbsp/powerpc/gen83xx/startup/bspreset.c36
6 files changed, 55 insertions, 85 deletions
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog b/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
index 172ab230fa..f1295e0acd 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
+++ b/c/src/lib/libbsp/powerpc/gen83xx/ChangeLog
@@ -1,5 +1,15 @@
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+ * Makefile.am, console/console.c, include/bsp.h: Use standardized
+ bsp_cleanup() which can optionally print a message, poll for user to
+ press key, and call bsp_reset(). Using this eliminates the various
+ bsp_cleanup() implementations which had their own implementation and
+ variety of string constants.
+ * startup/bspreset.c: New file.
+ * startup/bspclean.c: Removed.
+
+2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
* include/bsp.h, network/network.c: Fix missed name change.
2008-09-22 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
index d3a26810ca..7fa781a1b2 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/gen83xx/Makefile.am
@@ -53,7 +53,8 @@ startup_SOURCES = ../../shared/bsplibc.c \
../shared/src/tictac.c \
startup/cpuinit.c \
startup/bspstart.c \
- startup/bspclean.c \
+ ../../shared/bspclean.c \
+ startup/bspreset.c \
../../shared/bspgetworkarea.c \
startup/uboot_support.c \
../shared/uboot_getenv.c
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/console/console.c b/c/src/lib/libbsp/powerpc/gen83xx/console/console.c
index 6acb7578f5..cd28a7de44 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/console/console.c
+++ b/c/src/lib/libbsp/powerpc/gen83xx/console/console.c
@@ -277,3 +277,10 @@ int bsp_uart_pollRead(int minor)
{
return Console_Port_Tbl [0].pDeviceFns->deviceRead(0);
}
+
+int bsp_get_char(void)
+{
+ return bsp_uart_pollRead(0);
+}
+
+BSP_polling_getchar_function_type BSP_poll_char = bsp_get_char;
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h b/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h
index 846cd62749..41949828ed 100644
--- a/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/gen83xx/include/bsp.h
@@ -32,10 +32,6 @@
#define CONFIG_MPC83XX
#define CONFIG_HAS_ETH1
-/* 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
-
#endif /* MPC8313ERDB */
#include <libcpu/powerpc-utility.h>
@@ -98,8 +94,6 @@ extern const size_t bsp_uboot_board_info_size;
#endif /* HAS_UBOOT */
-#define MUST_WAIT_FOR_INTERRUPT 0
-
#define BSP_UART1_MINOR 0
#define BSP_UART2_MINOR 1
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspclean.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspclean.c
deleted file mode 100644
index c5326cd28d..0000000000
--- a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspclean.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file
- *
- * @ingroup mpc83xx
- *
- * @brief Source for BSP startup code.
- */
-
-/*
- * Copyright (c) 2008
- * Embedded Brains GmbH
- * Obere Lagerstr. 30
- * D-82178 Puchheim
- * Germany
- * rtems@embedded-brains.de
- *
- * 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 <string.h>
-
-#include <rtems.h>
-#include <rtems/bspIo.h>
-
-#include <bsp.h>
-#include <bsp/bootcard.h>
-
-extern int bsp_uart_pollRead(int minor);
-
-void bsp_reset(void)
-{
- #ifdef MPC8313ERDB
- _ISR_Set_level( 0 );
-
- /* Set Reset Protection Register (RPR) to "RSTE" */
- mpc83xx.res.rpr = 0x52535445;
-
- /*
- * Wait for Control Register Enabled in the
- * Reset Control Enable Register (RCER).
- */
- while (mpc83xx.res.rcer != 0x00000001) {
- /* Wait */
- }
-
- /* Set Software Hard Reset in the Reset Control Register (RCR) */
- mpc83xx.res.rcr = 0x00000002;
- #else /* MPC8313ERDB */
-
- /* Do nothing */
-
- #endif /* MPC8313ERDB */
-}
-
-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 ( bsp_uart_pollRead(0) == -1 ) {
- /* Wait */
- }
- #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)
- bsp_reset();
- #endif
-}
diff --git a/c/src/lib/libbsp/powerpc/gen83xx/startup/bspreset.c b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspreset.c
new file mode 100644
index 0000000000..2319549c5a
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/gen83xx/startup/bspreset.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2008
+ * Embedded Brains GmbH
+ * Obere Lagerstr. 30
+ * D-82178 Puchheim
+ * Germany
+ * rtems@embedded-brains.de
+ *
+ * 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 <bsp.h>
+#include <bsp/bootcard.h>
+
+void bsp_reset(void)
+{
+ _ISR_Set_level( 0 );
+
+ /* Set Reset Protection Register (RPR) to "RSTE" */
+ mpc83xx.res.rpr = 0x52535445;
+
+ /*
+ * Wait for Control Register Enabled in the
+ * Reset Control Enable Register (RCER).
+ */
+ while (mpc83xx.res.rcer != 0x00000001) {
+ /* Wait */
+ }
+
+ /* Set Software Hard Reset in the Reset Control Register (RCR) */
+ mpc83xx.res.rcr = 0x00000002;
+}