2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>

* Makefile.am, configure.ac, startup/bspstart.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/bspreset.c: New file.
	* startup/bspclean.c: Removed.
This commit is contained in:
Joel Sherrill
2008-09-22 21:49:15 +00:00
parent d50ba03d7a
commit 34e9f2ac32
6 changed files with 50 additions and 57 deletions
+10
View File
@@ -1,3 +1,13 @@
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, startup/bspstart.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/bspreset.c: New file.
* startup/bspclean.c: Removed.
2008-09-19 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, startup/linkcmds: Use top level shared
+2 -1
View File
@@ -27,7 +27,8 @@ dist_project_lib_DATA += startup/linkcmds
startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
../../shared/bsppredriverhook.c ../../shared/bspgetworkarea.c \
../../shared/bsppretaskinghook.c startup/bspstart.c startup/bspclean.c \
../../shared/bsppretaskinghook.c startup/bspstart.c \
../../shared/bspclean.c startup/bspreset.c \
startup/memmap.c ../../shared/bootcard.c ../../shared/sbrk.c \
../../shared/gnatinstallhandler.c
console_SOURCES = console/uarts.c ../../shared/console.c
+9
View File
@@ -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
@@ -1,38 +0,0 @@
/*
* Cogent CSB337 Shutdown code
*
* Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.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 dbgu_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 (dbgu_poll_read(0) < 0) continue;
}
@@ -0,0 +1,29 @@
/*
* Cogent CSB337 - AT91RM9200 Startup code
*
* Copyright (c) 2004 by Cogent Computer Systems
* Written by Jay Monkman <jtm@lopingdog.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 <bsp.h>
#include <at91rm9200.h>
#include <at91rm9200_pmc.h>
#include <at91rm9200_emac.h>
void bsp_reset(void)
{
rtems_interrupt_level level;
rtems_interrupt_disable(level);
/* Enable the watchdog timer, then wait for the world to end. */
ST_REG(ST_WDMR) = ST_WDMR_RSTEN | 1;
while(1);
}
@@ -101,21 +101,3 @@ static void fix_mac_addr(void)
* can override the actual bsp_start routine used.
*/
void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));
/*
* Reset the system.
*
* This functions enables the watchdog and waits for it to
* fire, thus resetting the system.
*/
void bsp_reset(void)
{
rtems_interrupt_level level;
rtems_interrupt_disable(level);
/* Enable the watchdog timer, then wait for the world to end. */
ST_REG(ST_WDMR) = ST_WDMR_RSTEN | 1;
while(1);
}