diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 10:35:35 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-20 13:52:14 +0200 |
commit | 99648958668d3a33ee57974479b36201fe303f34 (patch) | |
tree | 6f27ea790e2823c6156e71219a4f54680263fac6 /bsps/mips/csb350 | |
parent | bsps: Move start files to bsps (diff) | |
download | rtems-99648958668d3a33ee57974479b36201fe303f34.tar.bz2 |
bsps: Move startup files to bsps
Adjust build support files to new directory layout.
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'bsps/mips/csb350')
-rw-r--r-- | bsps/mips/csb350/start/bsp_specs | 9 | ||||
-rw-r--r-- | bsps/mips/csb350/start/bspreset.c | 24 | ||||
-rw-r--r-- | bsps/mips/csb350/start/bspstart.c | 44 | ||||
-rw-r--r-- | bsps/mips/csb350/start/linkcmds | 235 |
4 files changed, 312 insertions, 0 deletions
diff --git a/bsps/mips/csb350/start/bsp_specs b/bsps/mips/csb350/start/bsp_specs new file mode 100644 index 0000000000..87638cc027 --- /dev/null +++ b/bsps/mips/csb350/start/bsp_specs @@ -0,0 +1,9 @@ +%rename endfile old_endfile +%rename startfile old_startfile + +*startfile: +%{!qrtems: %(old_startfile)} \ +%{!nostdlib: %{qrtems: crti.o%s crtbegin.o%s}} + +*endfile: +%{!qrtems: %(old_endfile)} %{qrtems: crtend.o%s crtn.o%s} diff --git a/bsps/mips/csb350/start/bspreset.c b/bsps/mips/csb350/start/bspreset.c new file mode 100644 index 0000000000..811a6f96c7 --- /dev/null +++ b/bsps/mips/csb350/start/bspreset.c @@ -0,0 +1,24 @@ +/* + * COPYRIGHT (c) 1989-2008. + * 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.org/license/LICENSE. + */ + +#include <rtems.h> +#include <bsp/bootcard.h> +#include <libcpu/au1x00.h> + +void bsp_reset(void) +{ + void (*reset_func)(void); + + reset_func = (void *)0xbfc00000; + + mips_set_sr( 0x00200000 ); /* all interrupts off, boot exception vectors */ + + /* Try to restart bootloader */ + reset_func(); +} diff --git a/bsps/mips/csb350/start/bspstart.c b/bsps/mips/csb350/start/bspstart.c new file mode 100644 index 0000000000..5b9a6aed82 --- /dev/null +++ b/bsps/mips/csb350/start/bspstart.c @@ -0,0 +1,44 @@ +/** + * @file + * + * 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-2012. + * 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.org/license/LICENSE. + */ + +#include <string.h> + +#include <bsp.h> +#include <libcpu/au1x00.h> +#include <libcpu/isr_entries.h> +#include <bsp/irq-generic.h> + +void bsp_start( void ); + +au1x00_uart_t *uart0 = (au1x00_uart_t *)AU1X00_UART0_ADDR; +au1x00_uart_t *uart3 = (au1x00_uart_t *)AU1X00_UART3_ADDR; + +/* + * bsp_start + * + * This routine does the bulk of the system initialization. + */ +void bsp_start( void ) +{ + unsigned int compare = 0; + + mips_set_sr( 0x7f00 ); /* all interrupts unmasked but globally off */ + /* depend on the IRC to take care of things */ + __asm__ volatile ("mtc0 %0, $11\n" :: "r" (compare)); + bsp_interrupt_initialize(); +} diff --git a/bsps/mips/csb350/start/linkcmds b/bsps/mips/csb350/start/linkcmds new file mode 100644 index 0000000000..b11b73bf42 --- /dev/null +++ b/bsps/mips/csb350/start/linkcmds @@ -0,0 +1,235 @@ +/* + * Linker script for CSB350 AU1100 based board + */ + +/* . = 0x80020000; */ + +/* + * Declare some sizes. + */ + +_sdram_base = DEFINED(_sdram_base) ? _sdram_base : 0x80400000; +_sdram_size = DEFINED(_sdram_size) ? _sdram_size : 12M; + +/* standard items provided by RTEMS linkcmds files */ +RamBase = _sdram_base; +RamSize = _sdram_size; +HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; +_StackSize = DEFINED(_StackSize) ? _StackSize : 0x4000; + +ENTRY(_start) +STARTUP(start.o) + +MEMORY +{ + ram : ORIGIN = 0x80400000, LENGTH = 12M +} + +SECTIONS +{ + .text : + { + _ftext = . ; + + */start.o(.text) + + *(.text*) + *(.gnu.linkonce.t*) + *(.mips16.fn.*) + *(.mips16.call.*) + *(.reginfo*) + PROVIDE (__runtime_reloc_start = .); + *(.rel.sdata) + *(.rel.dyn) + PROVIDE (__runtime_reloc_stop = .); + + /* + * Special FreeBSD sysctl sections. + */ + . = ALIGN (16); + __start_set_sysctl_set = .; + *(set_sysctl_*); + __stop_set_sysctl_set = ABSOLUTE(.); + *(set_domain_*); + *(set_pseudo_*); + + *(.gcc_except_table*) + *(.eh_frame_hdr) + *(.eh_frame) + } >ram + + .init : + { + KEEP(*(.init)) + + } > ram + + .fini : + { + KEEP(*(.fini)) + + } >ram + + + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + + KEEP (*crtbegin.o(.ctors)) + + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } >ram + + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + + etext = .; + _etext = .; + } >ram + + + + .rdata : + { + *(.rdata) + *(.rodata) + *(.rodata.*) + KEEP (*(SORT(.rtemsroset.*))) + *(.gnu.linkonce.r*) + } >ram + + .tdata : { + _TLS_Data_begin = .; + *(.tdata .tdata.* .gnu.linkonce.td.*) + _TLS_Data_end = .; + } >ram + + .tbss : { + _TLS_BSS_begin = .; + *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) + _TLS_BSS_end = .; + } >ram + + _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; + _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; + _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; + _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; + _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; + _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); + + .data : + { + _fdata = ALIGN(16); + + *(.data) + *(.data.*) + KEEP (*(SORT(.rtemsrwset.*))) + *(.gnu.linkonce.d*) + } >ram + + .jcr : + { + . = ALIGN(8); + KEEP (*(.jcr)) + + _gp = ALIGN(16) + 0x7440; + __global = _gp; + } >ram + + .lit8 : + { + *(.lit8) + } >ram + + .lit4 : + { + *(.lit4) + } >ram + + .sdata : + { + *(.sdata*) + *(.gnu.linkonce.s*) + } >ram + + .sbss : + { + edata = .; + _edata = .; + _fbss = .; + *(.sbss*) + *(.scommon) + } >ram + + + .bss : + { + _bss_start = . ; + *(.bss .bss.* .gnu.linkonce.b.*) + *(COMMON) + . = ALIGN (64); + _stack_limit = .; + . += _StackSize; + __stack = .; + _stack_init = .; + _clear_end = .; + end = .; + _end = .; + . = ALIGN (1024); + WorkAreaBase = .; + + } >ram + + +/* +** 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) } +} |