summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/edb7312
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-22 21:49:17 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-22 21:49:17 +0000
commit1dad9e780ad4ed4603a0b36bd82bf260273341e5 (patch)
tree0877d330f9a18b1bd4d409cf647103182c70fcad /c/src/lib/libbsp/arm/edb7312
parent2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-1dad9e780ad4ed4603a0b36bd82bf260273341e5.tar.bz2
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, console/uart.c: 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/bspclean.c: Removed.
Diffstat (limited to 'c/src/lib/libbsp/arm/edb7312')
-rw-r--r--c/src/lib/libbsp/arm/edb7312/ChangeLog9
-rw-r--r--c/src/lib/libbsp/arm/edb7312/Makefile.am4
-rw-r--r--c/src/lib/libbsp/arm/edb7312/configure.ac9
-rw-r--r--c/src/lib/libbsp/arm/edb7312/console/uart.c24
-rw-r--r--c/src/lib/libbsp/arm/edb7312/startup/bspclean.c40
5 files changed, 39 insertions, 47 deletions
diff --git a/c/src/lib/libbsp/arm/edb7312/ChangeLog b/c/src/lib/libbsp/arm/edb7312/ChangeLog
index f0d3cf95d8..d78ebf87e9 100644
--- a/c/src/lib/libbsp/arm/edb7312/ChangeLog
+++ b/c/src/lib/libbsp/arm/edb7312/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * Makefile.am, configure.ac, console/uart.c: 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/bspclean.c: Removed.
+
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, startup/linkcmds: Use top level shared
diff --git a/c/src/lib/libbsp/arm/edb7312/Makefile.am b/c/src/lib/libbsp/arm/edb7312/Makefile.am
index 5260503698..902170137a 100644
--- a/c/src/lib/libbsp/arm/edb7312/Makefile.am
+++ b/c/src/lib/libbsp/arm/edb7312/Makefile.am
@@ -30,8 +30,8 @@ include_HEADERS += ../../arm/shared/comm/uart.h
startup_SOURCES = ../../shared/bsppost.c ../../shared/bsplibc.c \
../../shared/bspgetworkarea.c ../../shared/bsppretaskinghook.c \
../../shared/bsppredriverhook.c startup/bspstart.c \
- startup/bspclean.c ../../shared/bootcard.c ../../shared/sbrk.c \
- ../../shared/gnatinstallhandler.c
+ ../../shared/bspclean.c ../../shared/bootcard.c ../../shared/sbrk.c \
+ startup/bspreset.c ../../shared/gnatinstallhandler.c
clock_SOURCES = clock/clockdrv.c
console_SOURCES = console/uart.c ../../shared/console.c
diff --git a/c/src/lib/libbsp/arm/edb7312/configure.ac b/c/src/lib/libbsp/arm/edb7312/configure.ac
index 9f81f27d74..38b8eec14e 100644
--- a/c/src/lib/libbsp/arm/edb7312/configure.ac
+++ b/c/src/lib/libbsp/arm/edb7312/configure.ac
@@ -18,6 +18,15 @@ RTEMS_PROG_CCAS
RTEMS_CHECK_NETWORKING
AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
+RTEMS_BSPOPTS_SET([BSP_PRESS_KEY_FOR_RESET],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_PRESS_KEY_FOR_RESET],
+[If defined, print a message and wait until pressed before resetting
+ board when application exits.])
+
+RTEMS_BSPOPTS_SET([BSP_RESET_BOARD_AT_EXIT],[*],[1])
+RTEMS_BSPOPTS_HELP([BSP_RESET_BOARD_AT_EXIT],
+[If defined, reset the board when the application exits.])
+
RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
# Explicitly list all Makefiles here
diff --git a/c/src/lib/libbsp/arm/edb7312/console/uart.c b/c/src/lib/libbsp/arm/edb7312/console/uart.c
index 381eae680b..17a6d4caa1 100644
--- a/c/src/lib/libbsp/arm/edb7312/console/uart.c
+++ b/c/src/lib/libbsp/arm/edb7312/console/uart.c
@@ -5,12 +5,12 @@
*
* 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> /* Must be before libio.h */
#include <rtems/libio.h>
#include <termios.h>
@@ -107,9 +107,6 @@ int uart_poll_read(int minor)
return c;
}
-static void _BSP_null_char( char c ) {uart_write_polled(0, c);}
-BSP_output_char_function_type BSP_output_char = _BSP_null_char;
-
static int uart_write(int minor, const char *buf, int len)
{
volatile uint32_t *data_reg;
@@ -156,3 +153,20 @@ static void uart_init(int minor)
0x17); /* 9600 baud */
}
+
+/*
+ * Debug IO support
+ */
+static void _BSP_null_char(char c)
+{
+ uart_write_polled(0, c);
+}
+
+static int _BSP_get_char(void)
+{
+ return uart_poll_read(0);
+}
+
+BSP_output_char_function_type BSP_output_char = _BSP_null_char;
+
+BSP_polling_getchar_function_type BSP_poll_char = _BSP_get_char;
diff --git a/c/src/lib/libbsp/arm/edb7312/startup/bspclean.c b/c/src/lib/libbsp/arm/edb7312/startup/bspclean.c
deleted file mode 100644
index abdbed15a8..0000000000
--- a/c/src/lib/libbsp/arm/edb7312/startup/bspclean.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Cirrus EP7312 BSP Shutdown code
- *
- * Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
- *
- * 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 <stdio.h>
-#include <bsp.h>
-#include <rtems/bspIo.h>
-#include <rtems/libio.h>
-
-int uart_poll_read(int);
-
-void rtemsReboot (void)
-{
- asm volatile ("b _start");
-}
-
-void bsp_cleanup(void)
-{
- static char line[]="\nEXECUTIVE SHUTDOWN! Any key to reboot...";
- /*
- * AT this point, the console driver is disconnected => we must
- * use polled output/input. This is exactly what printk
- * does.
- */
- printk("\n");
- printk(line);
- while (uart_poll_read(0) < 0) continue;
-
- /* rtemsReboot(); */
-}