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

* Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add
	use of bsp_get_work_area() in its own file and rely on BSP Framework
	to perform more initialization. Remove unnecessary includes of
	rtems/libio.h and rtems/libcsupport.h.
This commit is contained in:
Joel Sherrill
2008-09-16 19:03:48 +00:00
parent a993d456cd
commit 18aa55eebb
10 changed files with 42 additions and 67 deletions

View File

@@ -1,3 +1,10 @@
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add
use of bsp_get_work_area() in its own file and rely on BSP Framework
to perform more initialization. Remove unnecessary includes of
rtems/libio.h and rtems/libcsupport.h.
2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h: Review of all bsp_cleanup() implementations. In this

View File

@@ -29,9 +29,9 @@ dist_project_lib_DATA += startup/linkcmds
startup_SOURCES = ../../shared/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c ../../shared/bsppredriverhook.c \
startup/bspstart.c ../../shared/bootcard.c \
../../m68k/shared/m68kpretaskinghook.c \
../../shared/sbrk.c ../../m68k/shared/setvec.c \
../../shared/gnatinstallhandler.c
../../shared/bsppretaskinghook.c ../../m68k/shared/setvec.c \
../../m68k/shared/m68kbspgetworkarea.c ../../m68k/shared/setvec.c \
../../shared/sbrk.c ../../shared/gnatinstallhandler.c
clock_SOURCES = ../mvme147/clock/ckinit.c
console_SOURCES = ../mvme147/console/console.c \
../../shared/dummy_printk_support.c

View File

@@ -15,6 +15,8 @@ RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm])
RTEMS_CANONICALIZE_TOOLS
RTEMS_PROG_CCAS
RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@@ -18,35 +18,18 @@
* $Id$
*/
#include <string.h>
#include <bsp.h>
#include <rtems/libio.h>
#include <rtems/libcsupport.h>
/*
* Use the shared implementations of the following routines
*/
void bsp_libc_init( void *, uint32_t, int );
void bsp_pretasking_hook(void); /* m68k version */
/*
* bsp_start
*
* This routine does the bulk of the system initialization.
*/
void bsp_start( void )
{
m68k_isr_entry *monitors_vector_table;
int index;
uint8_t node_number;
extern void *_WorkspaceBase;
extern void *_RamSize;
extern unsigned long _M68k_Ramsize;
_M68k_Ramsize = (unsigned long)&_RamSize; /* RAM size set in linker script */
monitors_vector_table = (m68k_isr_entry *)0; /* 147Bug Vectors are at 0 */
m68k_set_vbr( monitors_vector_table );
@@ -129,6 +112,4 @@ void bsp_start( void )
rtems_cache_enable_instruction();
rtems_cache_enable_data();
Configuration.work_space_start = (void *) &_WorkspaceBase;
}

View File

@@ -21,7 +21,7 @@
*/
_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
_RamSize = DEFINED(_RamSize) ? _RamSize : 4M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
MEMORY

View File

@@ -1,3 +1,10 @@
2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add
use of bsp_get_work_area() in its own file and rely on BSP Framework
to perform more initialization. Remove unnecessary includes of
rtems/libio.h and rtems/libcsupport.h.
2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/bsp.h: Review of all bsp_cleanup() implementations. In this

View File

@@ -27,9 +27,10 @@ dist_project_lib_DATA += startup/linkcmds
startup_SOURCES = startup/bspclean.c ../../shared/bsplibc.c \
../../shared/bsppost.c ../../shared/bsppredriverhook.c \
../../m68k/shared/m68kpretaskinghook.c startup/init5282.c \
startup/bspstart.c ../../shared/bootcard.c ../../shared/sbrk.c \
../../m68k/shared/setvec.c ../../shared/gnatinstallhandler.c
../../shared/bsppretaskinghook.c ../../m68k/shared/m68kbspgetworkarea.c \
startup/init5282.c startup/bspstart.c ../../shared/bootcard.c \
../../shared/sbrk.c ../../m68k/shared/setvec.c \
../../shared/gnatinstallhandler.c
clock_SOURCES = clock/clock.c
console_SOURCES = console/console.c
timer_SOURCES = timer/timer.c

View File

@@ -19,6 +19,8 @@ RTEMS_CHECK_NETWORKING
AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
# Explicitly list all Makefiles here
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

View File

@@ -19,11 +19,7 @@
*/
#include <bsp.h>
#include <rtems/libio.h>
#include <rtems/error.h>
#include <rtems/libcsupport.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
/*
@@ -32,6 +28,12 @@
#define VME_ONE_BASE 0x30000000
#define VME_TWO_BASE 0x31000000
/*
* Linker Script Defined Variables
*/
extern char _RamSize[];
extern char _RamBase[];
/*
* CPU-space access
* The NOP after writing the CACR is there to address the following issue as
@@ -170,12 +172,6 @@ void _CPU_cache_invalidate_1_data_line(const void *addr)
#endif
}
/*
* Use the shared implementations of the following routines
*/
void bsp_libc_init( void *, uint32_t, int );
void bsp_pretasking_hook(void); /* m68k version */
/*
* The Arcturus boot ROM prints exception information improperly
* so use this default exception handler instead. This one also
@@ -185,7 +181,6 @@ static void handler(int pc)
{
int level;
static volatile int reent;
extern char _RamSize[];
rtems_interrupt_disable(level);
if (reent++) bsp_reset(0);
@@ -227,34 +222,13 @@ static void handler(int pc)
void bsp_start( void )
{
int i;
extern char _WorkspaceBase[];
extern char _RamBase[], _RamSize[];
extern unsigned long _M68k_Ramsize;
_M68k_Ramsize = (unsigned long)_RamSize; /* RAM size set in linker script */
/*
* Allocate the memory for the RTEMS Work Space. This can come from
* a variety of places: hard coded address, malloc'ed from outside
* RTEMS world (e.g. simulator or primitive memory manager), or (as
* typically done by stock BSPs) by subtracting the required amount
* of work space from the last physical address on the CPU board.
* Set up default exception handler
*/
/*
* Set up default exception handler
*/
for (i = 2 ; i < 256 ; i++)
if (i != (32+2)) /* Catch all but bootrom system calls */
*((void (**)(int))(i * 4)) = handler;
/*
* Need to "allocate" the memory for the RTEMS Workspace and
* tell the RTEMS configuration where it is. This memory is
* not malloc'ed. It is just "pulled from the air".
*/
Configuration.work_space_start = (void *)_WorkspaceBase;
for (i = 2 ; i < 256 ; i++)
if (i != (32+2)) /* Catch all but bootrom system calls */
*((void (**)(int))(i * 4)) = handler;
/*
* Invalidate the cache and disable it
@@ -301,9 +275,10 @@ void bsp_start( void )
MCF5282_GPIO_PJPAR |= 0x06;
}
extern char _CPUClockSpeed[];
uint32_t bsp_get_CPU_clock_speed(void)
{
extern char _CPUClockSpeed[];
return( (uint32_t)_CPUClockSpeed);
}

View File

@@ -17,10 +17,10 @@
/*
* Declare some locations and sizes.
*/
_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0 ;
_RamSize = DEFINED(_RamSize) ? _RamSize : 16M ;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0 ;
_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000 ;
_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
_RamSize = DEFINED(_RamSize) ? _RamSize : 16M;
_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0;
_FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x10000000;
_FlashSize = DEFINED(_FlashSize) ? _FlashSize : 4M ;
/*