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.
This commit is contained in:
Joel Sherrill
2007-07-06 21:09:33 +00:00
parent 1611e8ca95
commit 0a029a5ee5
7 changed files with 86 additions and 27 deletions

View File

@@ -1,3 +1,13 @@
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>
* clock/clock.c, console/console.c: Add clock HW initialization missed

View File

@@ -110,7 +110,7 @@ tod_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
include_bsp_HEADERS += vectors/vectors.h
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 \
../../shared/gnatinstallhandler.c startup/cpuinit.c start/start.S

View File

@@ -116,6 +116,7 @@
uint32_t mpc5200_uart_avail_mask = GEN5200_UART_AVAIL_MASK;
#if defined(UARTS_USE_TERMIOS_INT)
uint8_t psc_minor_to_irqname[NUM_PORTS] =
{BSP_SIU_IRQ_PSC1,
BSP_SIU_IRQ_PSC2,
@@ -123,22 +124,21 @@ uint8_t psc_minor_to_irqname[NUM_PORTS] =
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));
uuchrptr = memchr(psc_minor_to_irqname, name, sizeof(psc_minor_to_irqname));
if (chrptr != NULL) {
minor = chrptr - psc_minor_to_irqname;
}
else {
} else {
minor = -1;
}
return minor;
}
#endif
static void A_BSP_output_char(char c);
BSP_output_char_function_type BSP_output_char = A_BSP_output_char;

View File

@@ -108,6 +108,10 @@
#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"
#endif
@@ -208,7 +212,7 @@ void bsp_cleanup(void);
#define PRINTK_MINOR PSC1_MINOR
#define SINGLE_CHAR_MODE
#define UARTS_USE_TERMIOS_INT 1
/* #define UARTS_USE_TERMIOS_INT 1 */
/* #define SHOW_MORE_INIT_SETTINGS 1 */
/* ata modes */

View File

@@ -473,9 +473,7 @@ skip_ROM_start:
xor r3, r3, r3
xor r4, r4, r4 /* Clear argc and argv */
#if 1
bl SYM (boot_card) /* Call the first C routine */
#endif
#if defined(BRS5L)
twiddle:

View File

@@ -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
}

View File

@@ -184,7 +184,9 @@ void initialize_exceptions()
for (i=0; i <= exception_config.exceptSize; i++)
{
#if defined(SHOW_MORE_INIT_SETTINGS)
printk("installing exception number %d\n", i);
#endif
if (!ppc_vector_is_valid(i))
continue;