summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-16 19:03:48 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-09-16 19:03:48 +0000
commit18aa55eebbc7dabbcb9a87ded4ed25c22dd790b0 (patch)
tree0055595794c4ef785c7ef2fff3682f99b0f55e2d /c/src/lib/libbsp
parent2008-09-16 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-18aa55eebbc7dabbcb9a87ded4ed25c22dd790b0.tar.bz2
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.
Diffstat (limited to 'c/src/lib/libbsp')
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/ChangeLog7
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/Makefile.am6
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/configure.ac2
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c19
-rw-r--r--c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds2
-rw-r--r--c/src/lib/libbsp/m68k/uC5282/ChangeLog7
-rw-r--r--c/src/lib/libbsp/m68k/uC5282/Makefile.am7
-rw-r--r--c/src/lib/libbsp/m68k/uC5282/configure.ac2
-rw-r--r--c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c49
-rw-r--r--c/src/lib/libbsp/m68k/uC5282/startup/linkcmds8
10 files changed, 42 insertions, 67 deletions
diff --git a/c/src/lib/libbsp/m68k/mvme147s/ChangeLog b/c/src/lib/libbsp/m68k/mvme147s/ChangeLog
index da0196a62c..f4bc048330 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/ChangeLog
+++ b/c/src/lib/libbsp/m68k/mvme147s/ChangeLog
@@ -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
diff --git a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
index ce38091f78..175e7306f4 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
+++ b/c/src/lib/libbsp/m68k/mvme147s/Makefile.am
@@ -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
diff --git a/c/src/lib/libbsp/m68k/mvme147s/configure.ac b/c/src/lib/libbsp/m68k/mvme147s/configure.ac
index 353e7a701d..027c725381 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/configure.ac
+++ b/c/src/lib/libbsp/m68k/mvme147s/configure.ac
@@ -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
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
index ef843e4c4f..cc21805b25 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/mvme147s/startup/bspstart.c
@@ -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;
}
diff --git a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
index f04a886a84..fb8e14ef41 100644
--- a/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/mvme147s/startup/linkcmds
@@ -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
diff --git a/c/src/lib/libbsp/m68k/uC5282/ChangeLog b/c/src/lib/libbsp/m68k/uC5282/ChangeLog
index 42f44e01da..bd85fd9d00 100644
--- a/c/src/lib/libbsp/m68k/uC5282/ChangeLog
+++ b/c/src/lib/libbsp/m68k/uC5282/ChangeLog
@@ -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
diff --git a/c/src/lib/libbsp/m68k/uC5282/Makefile.am b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
index 1611e21834..e3355bb96b 100644
--- a/c/src/lib/libbsp/m68k/uC5282/Makefile.am
+++ b/c/src/lib/libbsp/m68k/uC5282/Makefile.am
@@ -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
diff --git a/c/src/lib/libbsp/m68k/uC5282/configure.ac b/c/src/lib/libbsp/m68k/uC5282/configure.ac
index b445ec2693..35d3f7eed1 100644
--- a/c/src/lib/libbsp/m68k/uC5282/configure.ac
+++ b/c/src/lib/libbsp/m68k/uC5282/configure.ac
@@ -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
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c b/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c
index ebbda06d6e..289e4b836f 100644
--- a/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c
@@ -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>
/*
@@ -33,6 +29,12 @@
#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
* described in "Device Errata MCF5282DE", Rev. 1.7, 09/2004:
@@ -171,12 +173,6 @@ void _CPU_cache_invalidate_1_data_line(const void *addr)
}
/*
- * 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
* prints a call backtrace
@@ -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);
}
diff --git a/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds b/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
index 43cc352ccd..6c82f6d91a 100644
--- a/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
+++ b/c/src/lib/libbsp/m68k/uC5282/startup/linkcmds
@@ -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 ;
/*