From 6e27be70e131b10e67b75ea033fccbd77c95cf6d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 4 Jun 2009 16:23:11 +0000 Subject: 2009-06-04 Xi Yang * .cvsignore, ChangeLog, Makefile.am, README, bsp_specs, configure.ac, preinstall.am, console/uarts.c, include/bsp.h, include/bspopts.h.in, include/tm27.h, start/start.S, startup/bspstart.c, startup/linkcmds, startup/memmap.c: New files. --- c/src/lib/libbsp/arm/gumstix/startup/bspstart.c | 45 +++++ c/src/lib/libbsp/arm/gumstix/startup/linkcmds | 219 ++++++++++++++++++++++++ c/src/lib/libbsp/arm/gumstix/startup/memmap.c | 19 ++ 3 files changed, 283 insertions(+) create mode 100755 c/src/lib/libbsp/arm/gumstix/startup/bspstart.c create mode 100755 c/src/lib/libbsp/arm/gumstix/startup/linkcmds create mode 100755 c/src/lib/libbsp/arm/gumstix/startup/memmap.c (limited to 'c/src/lib/libbsp/arm/gumstix/startup') diff --git a/c/src/lib/libbsp/arm/gumstix/startup/bspstart.c b/c/src/lib/libbsp/arm/gumstix/startup/bspstart.c new file mode 100755 index 0000000000..33e8efe87c --- /dev/null +++ b/c/src/lib/libbsp/arm/gumstix/startup/bspstart.c @@ -0,0 +1,45 @@ +/* + * By Yang Xi . + * + * 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 +#include +#include +#include + +/* Function prototypes */ +extern void rtems_irq_mngt_init(void); + +/* + * + * NAME: bsp_start_default - BSP initialization function + * + * DESCRIPTION: + * This function is called before RTEMS is initialized and used + * adjust the kernel's configuration. + * + * This function also configures the CPU's memory protection unit. + * + * RESTRICTIONS/LIMITATIONS: + * Since RTEMS is not configured, no RTEMS functions can be called. + * + */ +void bsp_start_default( void ) +{ + /* disable interrupts */ + XSCALE_INT_ICMR = 0x0; + rtems_exception_init_mngt(); + rtems_irq_mngt_init(); +} /* bsp_start */ + +/* + * By making this a weak alias for bsp_start_default, a brave soul + * can override the actual bsp_start routine used. + */ +void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default"))); diff --git a/c/src/lib/libbsp/arm/gumstix/startup/linkcmds b/c/src/lib/libbsp/arm/gumstix/startup/linkcmds new file mode 100755 index 0000000000..53f9ccd94d --- /dev/null +++ b/c/src/lib/libbsp/arm/gumstix/startup/linkcmds @@ -0,0 +1,219 @@ +/* + * GUMSTIX linkcmd by Yang Xi . Borrow form CSB337 linkcmd. + * + * 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$ + */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", + "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) + +MEMORY +{ + sdram : ORIGIN = 0xA0000000, LENGTH = 64M + sram : ORIGIN = 0x00000000, LENGTH = 16K +} + +/* + * Declare some sizes. + */ +_sdram_base = DEFINED(_sdram_base) ? _sdram_base : 0xA0000000; +_sdram_size = DEFINED(_sdram_size) ? _sdram_size : 64M; + +RamBase = _sdram_base; +RamSize = _sdram_size; +HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; + +_sram_base = DEFINED(_sram_base) ? _sram_base : 0x00000000; +_sram_size = DEFINED(_sram_size) ? _sram_size : 16K; + + + +_irq_stack_size = DEFINED(_irq_stack_size) ? _irq_stack_size : 0x1000; +_fiq_stack_size = DEFINED(_fiq_stack_size) ? _fiq_stack_size : 0x400; +_abt_stack_size = DEFINED(_abt_stack_size) ? _abt_stack_size : 0x100; +_svc_stack_size = DEFINED(_svc_stack_size) ? _svc_stack_size : 0x1000; + + + +/* Do we need any of these for elf? + __DYNAMIC = 0; */ + +SECTIONS +{ + .base : + { + + arm_exception_table = .; + . += 64; + } > sdram + +/* } > sram*/ + + + .init : + { + KEEP (*(.init)) + } > sdram /*=0*/ + + .text : + { + _text_start = .; + CREATE_OBJECT_SYMBOLS + *(.text) + *(.text.*) + + /* + * Special FreeBSD sysctl sections. + */ + . = ALIGN (16); + __start_set_sysctl_set = .; + *(set_sysctl_*); + __stop_set_sysctl_set = ABSOLUTE(.); + *(set_domain_*); + *(set_pseudo_*); + + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7) + *(.glue_7t) + + /* I think these come from the ld docs: */ + ___CTOR_LIST__ = .; + LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2) + *(.ctors) + LONG(0) + ___CTOR_END__ = .; + ___DTOR_LIST__ = .; + LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2) + *(.dtors) + LONG(0) + ___DTOR_END__ = .; + + _etext = .; + PROVIDE (etext = .); + } > sdram + + .fini : + { + KEEP (*(.fini)) + } > sdram /*=0*/ + + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d*) + *(.jcr) + SORT(CONSTRUCTORS) + _edata = .; + } > sdram + + .eh_frame : { *(.eh_frame) } > sdram + .data1 : { *(.data1) } > sdram + .eh_frame : { *(.eh_frame) } > sdram + .gcc_except_table : { *(.gcc_except_table) } > sdram + + .rodata : + { + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } > sdram + + .bss : + { + _bss_start_ = .; + _clear_start = .; + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN(64); + _clear_end = .; + + . = ALIGN (256); + _abt_stack = .; + . += _abt_stack_size; + + . = ALIGN (256); + _irq_stack = .; + . += _irq_stack_size; + + . = ALIGN (256); + _fiq_stack = .; + . += _fiq_stack_size; + + . = ALIGN (256); + _svc_stack = .; + . += _svc_stack_size; + + _bss_end_ = .; + _end = .; + __end = .; + +/* + * Ideally, the MMU's translation table would be in SRAM. But we need + * 16K which is the size of SRAM. If we do the mapping right, the TLB + * should be big enough that to hold all the translations that matter, + * so keeping the table in SDRAM won't be a problem. + */ + . = ALIGN (16 * 1024); + _ttbl_base = .; + . += (16 * 1024); + + + . = ALIGN (1024); + _bss_free_start = .; + WorkAreaBase = .; + + } > sdram + + +/* Debugging stuff follows? */ + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* 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) } +/* .stack 0x80000 : { _stack = .; *(.stack) }*/ + /* These must appear regardless of . */ +} + diff --git a/c/src/lib/libbsp/arm/gumstix/startup/memmap.c b/c/src/lib/libbsp/arm/gumstix/startup/memmap.c new file mode 100755 index 0000000000..cf1921d753 --- /dev/null +++ b/c/src/lib/libbsp/arm/gumstix/startup/memmap.c @@ -0,0 +1,19 @@ +/* + * Gumstix Memory Map + * 2008 By Yang Xi + * Copyright (c) 2004 by Cogent Computer Systems + * Written by Jay Monkman + * + * $Id$ + */ + +#include +#include + +mmu_sect_map_t mem_map[] = { +/* */ + {0x40000000, 0x40000000, 20, MMU_CACHE_NONE}, /*Map I/O*/ + {0xA0000000, 0x00000000, 1, MMU_CACHE_NONE}, /*sram*/ + {0xA0000000, 0xA0000000, 64, MMU_CACHE_WBACK}, /* SDRAM */ + {0x00000000, 0x00000000, 0, 0} /* The end */ +}; -- cgit v1.2.3