diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-11-25 18:58:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2000-11-25 18:58:05 +0000 |
commit | c8471315ff9c38541f5623375a85166890788cd7 (patch) | |
tree | 205114008dd25aa2bcd78360934da0661ebc0302 /c/src/lib/libbsp/mips/jmr3904/startup | |
parent | 2000-11-25 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-c8471315ff9c38541f5623375a85166890788cd7.tar.bz2 |
2000-11-25 Joel Sherrill <joel@OARcorp.com>
* The JMR BSP is for a Toshiba TX39 evaluation board but
can also be used with the mips simulator in gdb.
* .cvsignore, ChangeLog, Makefile.am, README, bsp_specs,
configure.in, clock/.cvsignore, clock/Makefile.am,
clock/clockdrv.c, console/.cvsignore, console/Makefile.am,
console/console-io.c, include/.cvsignore,
include/Makefile.am, include/bsp.h, start/.cvsignore,
start/Makefile.am, start/regs.S, start/start.S,
startup/.cvsignore, startup/Makefile.am, startup/bspstart.c,
startup/linkcmds, wrapup/.cvsignore, wrapup/Makefile.am: New files.
Diffstat (limited to 'c/src/lib/libbsp/mips/jmr3904/startup')
-rw-r--r-- | c/src/lib/libbsp/mips/jmr3904/startup/.cvsignore | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am | 40 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c | 117 | ||||
-rw-r--r-- | c/src/lib/libbsp/mips/jmr3904/startup/linkcmds | 121 |
4 files changed, 280 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/.cvsignore b/c/src/lib/libbsp/mips/jmr3904/startup/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/c/src/lib/libbsp/mips/jmr3904/startup/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am b/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am new file mode 100644 index 0000000000..4dd270fbea --- /dev/null +++ b/c/src/lib/libbsp/mips/jmr3904/startup/Makefile.am @@ -0,0 +1,40 @@ +## +## $Id$ +## + +AUTOMAKE_OPTIONS = foreign 1.4 + +VPATH = @srcdir@:@srcdir@/../../../shared + +PGM = $(ARCH)/startup.rel + +C_FILES = bspclean.c bsplibc.c bsppost.c bspstart.c bootcard.c main.c sbrk.c \ + gnatinstallhandler.c +C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) + +OBJS = $(C_O_FILES) + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../../../../../../automake/compile.am +include $(top_srcdir)/../../../../../../automake/lib.am + +# +# (OPTIONAL) Add local stuff here using += +# + +$(PGM): $(OBJS) + $(make-rel) + +$(PROJECT_RELEASE)/lib/linkcmds: linkcmds + $(INSTALL_DATA) $< $@ + +# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile +TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds + +all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES) + +.PRECIOUS: $(PGM) + +EXTRA_DIST = bspclean.c bspstart.c exit.c linkcmds setvec.c + +include $(top_srcdir)/../../../../../../automake/local.am diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c new file mode 100644 index 0000000000..1143386ada --- /dev/null +++ b/c/src/lib/libbsp/mips/jmr3904/startup/bspstart.c @@ -0,0 +1,117 @@ +/* + * This routine starts the application. It includes application, + * board, and monitor specific initialization and configuration. + * The generic CPU dependent initialization has been performed + * before this routine is invoked. + * + * COPYRIGHT (c) 1989-2000. + * 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.OARcorp.com/rtems/license.html. + * + * $Id$ + */ + +#include <string.h> + +#include <bsp.h> +#include <rtems/libio.h> +#include <rtems/libcsupport.h> + +/* + * The original table from the application and our copy of it with + * some changes. + */ + +extern rtems_configuration_table Configuration; + +rtems_configuration_table BSP_Configuration; + +rtems_cpu_table Cpu_table; + +char *rtems_progname; + +/* + * Use the shared implementations of the following routines + */ + +void bsp_postdriver_hook(void); +void bsp_libc_init( void *, unsigned32, int ); + +/* + * Function: bsp_pretasking_hook + * Created: 95/03/10 + * + * Description: + * BSP pretasking hook. Called just before drivers are initialized. + * Used to setup libc and install any BSP extensions. + * + * NOTES: + * Must not use libc (to do io) from here, since drivers are + * not yet initialized. + * + */ + +void bsp_pretasking_hook(void) +{ + extern int HeapBase; + extern int HeapSize; + void *heapStart = &HeapBase; + unsigned long heapSize = (unsigned long)&HeapSize; + unsigned long ramSpace; + + bsp_libc_init(heapStart, (unsigned32) heapSize, 0); + +#ifdef RTEMS_DEBUG + rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); +#endif + +} + +/* + * bsp_start + * + * This routine does the bulk of the system initialization. + */ + +void bsp_start( void ) +{ + extern int _end; + extern int WorkspaceBase; + /* Configure Number of Register Caches */ + + Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ + Cpu_table.postdriver_hook = bsp_postdriver_hook; + Cpu_table.interrupt_stack_size = 4096; + + if ( BSP_Configuration.work_space_size >(512*1024) ) + _sys_exit( 1 ); + + BSP_Configuration.work_space_start = (void *) &WorkspaceBase; +} + +/* XXX */ +void clear_cache( void *address, size_t n ) +{ +} + +/* Structure filled in by get_mem_info. Only the size field is + actually used (to clear bss), so the others aren't even filled in. */ + +struct s_mem +{ + unsigned int size; + unsigned int icsize; + unsigned int dcsize; +}; + + +void +get_mem_info (mem) + struct s_mem *mem; +{ + mem->size = 0x1000000; /* XXX figure out something here */ +} + diff --git a/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds b/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds new file mode 100644 index 0000000000..76943945e5 --- /dev/null +++ b/c/src/lib/libbsp/mips/jmr3904/startup/linkcmds @@ -0,0 +1,121 @@ +/* + * $Id$ + * + * Based on jmr3904app-dram.ld from newlib 1.8.2 + */ + +/* + * Declare some sizes. + */ +_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0; +_RamSize = DEFINED(_RamSize) ? _RamSize : 1M; +HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; +_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; + +SECTIONS +{ + . = 0x8800000; + .text : + { + _ftext = . ; + *(.init) + eprol = .; + *(.text) + *(.text.*) + *(.gnu.linkonce.t*) + *(.mips16.fn.*) + *(.mips16.call.*) + PROVIDE (__runtime_reloc_start = .); + *(.rel.sdata) + PROVIDE (__runtime_reloc_stop = .); + *(.fini) + etext = .; + _etext = .; + } + . = .; + .rdata : { + *(.rdata) + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } + _fdata = ALIGN(16); + .data : { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + CONSTRUCTORS + } + . = ALIGN(8); + _gp = . + 0x8000; + __global = _gp; + .lit8 : { + *(.lit8) + } + .lit4 : { + *(.lit4) + } + .sdata : { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s*) + } + . = ALIGN(4); + edata = .; + _edata = .; + _fbss = .; + .sbss : { + *(.sbss) + *(.scommon) + } + .bss : { + _bss_start = . ; + *(.bss) + *(COMMON) + . = ALIGN (64); + _stack_init = .; + . += _StackSize; + _clear_end = .; + WorkspaceBase = .; + . += 64K; /* reserve some memory for workspace */ + HeapBase = .; + . += HeapSize; /* reserve some memory for heap */ + } + end = .; + _end = .; + + +/* Put starting stack in SRAM (8 Kb); this size is the same as the stack from + the original script (when everything was in SRAM). */ + __stack = 0x8000A000; + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to + the beginning of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } +} |