Changeset 6440903c in rtems


Ignore:
Timestamp:
Dec 5, 2013, 9:26:08 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
5df9bf6
Parents:
e4927ece
git-author:
Sebastian Huber <sebastian.huber@…> (12/05/13 09:26:08)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/16/13 14:15:41)
Message:

bsps/m68k: Add and use linkcmds.base

Location:
c/src/lib/libbsp/m68k
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/Makefile.am

    re4927ece r6440903c  
    33## Descend into the @RTEMS_BSP_FAMILY@ directory
    44SUBDIRS = @RTEMS_BSP_FAMILY@
     5
     6include_bspdir = $(includedir)/bsp
     7include_bsp_HEADERS = shared/include/linker-symbols.h
     8
     9dist_project_lib_DATA = shared/startup/linkcmds.base
    510
    611EXTRA_DIST = shared/m68kpretaskinghook.c
     
    1419EXTRA_DIST += shared/gdbstub/m68k-stub.c shared/gdbstub/gdb_if.h
    1520
     21include $(srcdir)/preinstall.am
    1622include $(top_srcdir)/../../../automake/subdirs.am
    1723include $(top_srcdir)/../../../automake/local.am
  • c/src/lib/libbsp/m68k/genmcf548x/Makefile.am

    re4927ece r6440903c  
    44
    55include_bspdir = $(includedir)/bsp
    6 
    7 dist_project_lib_DATA = bsp_specs
    86
    97include_HEADERS = include/bsp.h
     
    1917noinst_LIBRARIES = libbspstart.a
    2018libbspstart_a_SOURCES = start/start.S
     19
     20dist_project_lib_DATA = bsp_specs
     21dist_project_lib_DATA += startup/linkcmds.m5484FireEngine.flash
     22dist_project_lib_DATA += startup/linkcmds.COBRA5475
     23dist_project_lib_DATA += startup/linkcmds.m5484FireEngine
     24
    2125project_lib_DATA = start.$(OBJEXT)
    22 
    2326project_lib_DATA += startup/linkcmds
    24 EXTRA_DIST = startup/linkcmds.m5484FireEngine.flash
    25 EXTRA_DIST += startup/linkcmds.COBRA5475
    26 EXTRA_DIST += startup/linkcmds.m5484FireEngine
    2727
    2828noinst_LIBRARIES += libbsp.a
  • c/src/lib/libbsp/m68k/genmcf548x/include/bsp.h

    re4927ece r6440903c  
    7777#define CONSOLE_PORT        0
    7878
    79 #define RAM_END 0x4000000 /* 64 MB */
    80 
    8179/* functions */
    8280
  • c/src/lib/libbsp/m68k/genmcf548x/preinstall.am

    re4927ece r6440903c  
    3434PREINSTALL_DIRS += $(PROJECT_INCLUDE)/bsp/$(dirstamp)
    3535
    36 $(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
    37         $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
    38 PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
    39 
    4036$(PROJECT_INCLUDE)/bsp.h: include/bsp.h $(PROJECT_INCLUDE)/$(dirstamp)
    4137        $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp.h
     
    5854PREINSTALL_FILES += $(PROJECT_INCLUDE)/coverhd.h
    5955
     56$(PROJECT_LIB)/bsp_specs: bsp_specs $(PROJECT_LIB)/$(dirstamp)
     57        $(INSTALL_DATA) $< $(PROJECT_LIB)/bsp_specs
     58PREINSTALL_FILES += $(PROJECT_LIB)/bsp_specs
     59
     60$(PROJECT_LIB)/linkcmds.m5484FireEngine.flash: startup/linkcmds.m5484FireEngine.flash $(PROJECT_LIB)/$(dirstamp)
     61        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.m5484FireEngine.flash
     62PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.m5484FireEngine.flash
     63
     64$(PROJECT_LIB)/linkcmds.COBRA5475: startup/linkcmds.COBRA5475 $(PROJECT_LIB)/$(dirstamp)
     65        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.COBRA5475
     66PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.COBRA5475
     67
     68$(PROJECT_LIB)/linkcmds.m5484FireEngine: startup/linkcmds.m5484FireEngine $(PROJECT_LIB)/$(dirstamp)
     69        $(INSTALL_DATA) $< $(PROJECT_LIB)/linkcmds.m5484FireEngine
     70PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.m5484FireEngine
     71
    6072$(PROJECT_LIB)/start.$(OBJEXT): start.$(OBJEXT) $(PROJECT_LIB)/$(dirstamp)
    6173        $(INSTALL_DATA) $< $(PROJECT_LIB)/start.$(OBJEXT)
  • c/src/lib/libbsp/m68k/genmcf548x/start/start.S

    re4927ece r6440903c  
    4848\*===============================================================*/
    4949#include <rtems/asm.h>
     50#include <bsp/linker-symbols.h>
    5051
    5152/*===============================================================*\
     
    5859.extern mcf548x_init
    5960.extern boot_card
    60 .extern _SpInit
    6161
    6262/*===============================================================*\
     
    7676PUBLIC (InterruptVectorTable)
    7777SYM(InterruptVectorTable):
    78 INITSP:         .long   _SpInit                 /* Initial SP             */
     78INITSP:         .long   bsp_initstack_end       /* Initial SP             */
    7979INITPC:         .long   start                   /* Initial PC             */
    8080vector002:      .long   asm_default_interrupt   /* Access Error           */
     
    336336| Start of code                                                   |
    337337\*===============================================================*/
     338.text
    338339PUBLIC (start)
    339340SYM(start):
     
    411412    jsr     mcf548x_init                /* Initialize mcf548x peripherals */
    412413
    413     move.l  #_SpInit,sp                 /* relocate sp */
     414    move.l  #bsp_initstack_end,sp       /* relocate sp */
    414415
    415416    clrl    d0                          /* clear d0 */
  • c/src/lib/libbsp/m68k/genmcf548x/startup/init548x.c

    re4927ece r6440903c  
    4444\*===============================================================*/
    4545
    46 #include <rtems.h>
    4746#include <bsp.h>
     47
     48#include <string.h>
     49
     50#include <bsp/linker-symbols.h>
    4851
    4952#if defined(HAS_LOW_LEVEL_INIT)
     
    6770extern uint8_t _CodeFlashBase[];
    6871extern uint8_t RamBase[];
    69 extern uint32_t InterruptVectorTable[];
    70 extern uint32_t _VectorRam[];
    7172
    7273void gpio_init(void);
     
    7879void mcf548x_init(void)
    7980    {
    80     uint32_t n;
    81     uint8_t *dp, *sp;
    82 
    8381#if defined(HAS_LOW_LEVEL_INIT)
    8482    /* set XLB arbiter timeouts */
     
    9492#endif /* defined(HAS_LOW_LEVEL_INIT) */
    9593
    96     /* Copy the vector table to RAM */
    97     if (_VectorRam != InterruptVectorTable)
    98     {
    99         for( n = 0; n < 256; n++)
    100           {
    101       _VectorRam[n] = InterruptVectorTable[n];
    102           }
     94    /* Copy the vector table to RAM if necessary */
     95    if (bsp_vector0_size == bsp_vector1_size) {
     96      memcpy(bsp_vector1_begin, bsp_vector0_begin, (size_t) bsp_vector1_size);
     97      m68k_set_vbr((uint32_t)bsp_vector1_begin);
    10398    }
    10499
    105     m68k_set_vbr((uint32_t)_VectorRam);
    106 
    107100    /* Move initialized data from ROM to RAM. */
    108     if (_DataRom != _DataRam)
    109     {
    110                 n = _DataEnd - _DataRam;
    111         sp = (uint8_t *)_DataRom;
    112         dp = (uint8_t *)_DataRam;
    113                 while(n--)
    114            *dp++ = *sp++;
    115      }
     101    if (bsp_section_data_begin != bsp_section_data_load_begin) {
     102      memcpy(
     103        bsp_section_data_begin,
     104        bsp_section_data_load_begin,
     105        (size_t) bsp_section_data_size
     106      );
     107    }
    116108
    117109    /* Zero uninitialized data */
    118     if (_BssStart != _BssEnd)
    119     {
    120                 n = _BssEnd - _BssStart;
    121         sp = (uint8_t *)_BssStart;
    122         while (n--)
    123             *sp++ = 0;
    124     }
    125 
     110    memset(bsp_section_bss_begin, 0, (size_t) bsp_section_bss_size);
    126111}
    127112/********************************************************************/
  • c/src/lib/libbsp/m68k/genmcf548x/startup/linkcmds.COBRA5475

    re4927ece r6440903c  
    6363_BootFlashSize  = DEFINED(_BootFlashSize)  ? _BootFlashSize : (32 * 1024*1024);
    6464
    65 _VectorRam      = DEFINED(_VectorRam)      ? _VectorRam : _SdramBase;
    66 _DataRam        = DEFINED(_DataRam)        ? _DataRam   : _data_dest_start;
    67 _DataRom        = DEFINED(_DataRom)        ? _DataRom   : _data_src_start;
    68 _DataEnd        = DEFINED(_DataEnd)        ? _DataEnd   : _data_dest_end;
    69 _BssStart       = DEFINED(_BssStart)       ? _BssStart  : _clear_start;
    70 _BssEnd         = DEFINED(_BssEnd)         ? _BssEnd    : _clear_end;
    71 _SpInit         = DEFINED(_SpInit)         ? _SpInit    : _EndInitStackSpace;
     65bsp_initstack_size = DEFINED(StackSize)    ? StackSize  : 0x800;  /* 2 kB   */
    7266
    73 _InitStackSize  = DEFINED(StackSize)       ? StackSize  : 0x800;  /* 2 kB   */
    74 _TopRamReserved = DEFINED(_TopRamReserved) ? _TopRamReserved : 0;
    75 
    76 RamBase        = DEFINED(_SdramBase)      ? _SdramBase : _SdramBase;
    77 RamSize        = DEFINED(_SdramSize)      ? _SdramSize : _SdramSize;
    78 HeapSize       = DEFINED(HeapSize)       ? HeapSize   : 0x0;
    79 _VBR            = DEFINED(_VBR)            ? _VBR       : RamBase;
     67_VBR            = DEFINED(_VBR)            ? _VBR       : _SdramBase;
    8068
    8169__MBAR          = DEFINED(__MBAR)          ? __MBAR     : 0xFE000000;
    8270
    83 ENTRY(start)
    8471MEMORY
    8572{
    86     sdram      : ORIGIN = 0xF0040000, LENGTH = 128M - 256K
     73    sdram      : ORIGIN = 0xF0000000, LENGTH = 128M
    8774    boot_flash : ORIGIN = 0xFC000000, LENGTH = 32M
    8875}
    8976
    90 SECTIONS
    91 {
    92      
    93     _header_offset = 0;
    94    
    95     /*
    96      * Text, data and bss segments .vectors         
    97      */   
    98     .vectors : {
    99                  *(.vectors*)
    100                } >sdram
    101     .text : {
    102        
    103         *(.text*)
    104         *(.ram_code)
     77REGION_ALIAS ("REGION_TEXT", sdram);
     78REGION_ALIAS ("REGION_TEXT_LOAD", sdram);
     79REGION_ALIAS ("REGION_DATA", sdram);
     80REGION_ALIAS ("REGION_DATA_LOAD", sdram);
    10581
    106         /*
    107          * C++ constructors/destructors
    108          */
    109         *(.gnu.linkonce.t.*)
    110 
    111         /*
    112          * Initialization and finalization code.
    113               *
    114               * Various files can provide initialization and finalization
    115          * functions.  crtbegin.o and crtend.o are two instances. The
    116          * body of these functions are in .init and .fini sections. We
    117          * accumulate the bodies here, and prepend function prologues
    118          * from crti.o and function epilogues from crtn.o. crti.o must
    119          * be linked first; crtn.o must be linked last.  Because these
    120          * are wildcards, it doesn't matter if the user does not
    121          * actually link against crti.o and crtn.o; the linker won't
    122          * look for a file to match a wildcard.  The wildcard also
    123          * means that it doesn't matter which directory crti.o and
    124          * crtn.o are in.
    125          */
    126         PROVIDE (_init = .);
    127         *crti.o(.init)
    128         *(.init)
    129         *crtn.o(.init)
    130         PROVIDE (_fini = .);
    131         *crti.o(.fini)
    132         *(.fini)
    133         *crtn.o(.fini)
    134 
    135         /*
    136          * Special FreeBSD sysctl sections.
    137          */
    138         . = ALIGN (16);
    139         __start_set_sysctl_set = .;
    140         *(set_sysctl_*);
    141         __stop_set_sysctl_set = ABSOLUTE(.);
    142         *(set_domain_*);
    143         *(set_pseudo_*);
    144 
    145 
    146         /*
    147          * C++ constructors/destructors
    148          *
    149          * gcc uses crtbegin.o to find the start of the constructors
    150          * and destructors so we make sure it is first.  Because this
    151          * is a wildcard, it doesn't matter if the user does not
    152          * actually link against crtbegin.o; the linker won't look for
    153          * a file to match a wildcard.  The wildcard also means that
    154          * it doesn't matter which directory crtbegin.o is in. The
    155          * constructor and destructor list are terminated in
    156          * crtend.o.  The same comments apply to it.
    157          */
    158         . = ALIGN (16);
    159         *crtbegin.o(.ctors)
    160         *(.ctors)
    161         *crtend.o(.ctors)
    162         *crtbegin.o(.dtors)
    163         *(.dtors)
    164         *crtend.o(.dtors)
    165 
    166         /*
    167          * Exception frame info
    168          */
    169         . = ALIGN (16);
    170         *(.eh_frame)
    171 
    172         /*
    173          * Read-only data
    174          */
    175         . = ALIGN (16);
    176         _rodata_start = . ;
    177         *(.rodata*)
    178         *(.gnu.linkonce.r*)
    179        
    180         . = ALIGN (16);
    181 
    182         *(.console_gdb_xfer)
    183         *(.bootstrap_data)
    184         . = ALIGN(16);
    185         _estuff = .;
    186     PROVIDE (_etext = .);
    187     } >sdram
    188        
    189         .data : {
    190         /*.data : {*/
    191             PROVIDE( _data_dest_start = . );
    192             PROVIDE( _copy_start = .);
    193             *(.data*)
    194             *(.gnu.linkonce.d*)
    195             *(.gcc_except_table*)
    196             *(.jcr)
    197             . = ALIGN (16);
    198             PROVIDE (_edata = .);
    199         PROVIDE (_copy_end = .);
    200         PROVIDE (_data_dest_end = . );
    201         } >sdram
    202 
    203         _data_src_start = _etext; /*LOADADDR(.data);*/
    204         _data_src_end = _data_src_start + SIZEOF(.data);       
    205        
    206         .bss : {
    207                PROVIDE (_clear_start = .);
    208                 *(.bss*)
    209                 *(COMMON)
    210                 . = ALIGN (16);
    211                 PROVIDE (end = .);
    212                 PROVIDE (_clear_end = .);
    213                 . = ALIGN (4);
    214                 PROVIDE (_StartInitStackSpace = .);
    215                 /*. = _StartInitStackSpace + _InitStackSize;*/
    216                 . += _InitStackSize;
    217                 PROVIDE (_EndInitStackSpace = .);
    218                 PROVIDE (WorkAreaBase = .);
    219         } >sdram
    220   /* Stabs debugging sections.  */
    221   .stab 0 : { *(.stab) }
    222   .stabstr 0 : { *(.stabstr) }
    223   .stab.excl 0 : { *(.stab.excl) }
    224   .stab.exclstr 0 : { *(.stab.exclstr) }
    225   .stab.index 0 : { *(.stab.index) }
    226   .stab.indexstr 0 : { *(.stab.indexstr) }
    227   .comment 0 : { *(.comment) }
    228 
    229 PROVIDE (end_of_all = .); 
    230 }
     82INCLUDE linkcmds.base
  • c/src/lib/libbsp/m68k/genmcf548x/startup/linkcmds.m5484FireEngine

    re4927ece r6440903c  
    6464_CodeFlashSize  = DEFINED(_CodeFlashSize)  ? _CodeFlashSize : (16 * 1024*1024);
    6565
    66 _VectorRam      = DEFINED(_VectorRam)      ? _VectorRam : _SdramBase;
    67 _DataRam        = DEFINED(_DataRam)        ? _DataRam   : _data_dest_start;
    68 _DataRom        = DEFINED(_DataRom)        ? _DataRom   : _data_src_start;
    69 _DataEnd        = DEFINED(_DataEnd)        ? _DataEnd   : _data_dest_end;
    70 _BssStart       = DEFINED(_BssStart)       ? _BssStart  : _clear_start;
    71 _BssEnd         = DEFINED(_BssEnd)         ? _BssEnd    : _clear_end;
    72 _SpInit         = DEFINED(_SpInit)         ? _SpInit    : _EndInitStackSpace;
     66bsp_initstack_size = DEFINED(StackSize)    ? StackSize  : 0x800;  /* 2 kB   */
    7367
    74 _InitStackSize  = DEFINED(StackSize)       ? StackSize  : 0x800;  /* 2 kB   */
    75 _TopRamReserved = DEFINED(_TopRamReserved) ? _TopRamReserved : 0;
    76 
    77 RamBase        = DEFINED(_SdramBase)      ? _SdramBase : _SdramBase;
    78 RamSize        = DEFINED(_SdramSize)      ? _SdramSize : _SdramSize;
    79 HeapSize       = DEFINED(HeapSize)       ? HeapSize   : 0x0;
    80 _VBR            = DEFINED(_VBR)            ? _VBR       : RamBase;
     68_VBR            = DEFINED(_VBR)            ? _VBR       : _SdramBase;
    8169
    8270__MBAR          = DEFINED(__MBAR)          ? __MBAR     : 0x10000000;
    8371
    84 ENTRY(start)
    8572MEMORY
    8673{
    87     sdram      : ORIGIN = 0x400     , LENGTH = 64M - 0x400
     74    sdram      : ORIGIN = 0x00000000, LENGTH = 64M
    8875    code_flash : ORIGIN = 0xE0000000, LENGTH = 16M
    8976    boot_flash : ORIGIN = 0xFF800000, LENGTH = 2M
    9077}
    9178
    92 SECTIONS
    93 {
    94      
    95     _header_offset = 0;
    96    
    97     /*
    98      * Text, data and bss segments .vectors         
    99      */   
    100     .vectors : {
    101                  *(.vectors*)
    102                } >sdram
    103     .text : {
    104        
    105         *(.text*)
    106         *(.ram_code)
     79REGION_ALIAS ("REGION_TEXT", sdram);
     80REGION_ALIAS ("REGION_TEXT_LOAD", sdram);
     81REGION_ALIAS ("REGION_DATA", sdram);
     82REGION_ALIAS ("REGION_DATA_LOAD", sdram);
    10783
    108         /*
    109          * C++ constructors/destructors
    110          */
    111         *(.gnu.linkonce.t.*)
    112 
    113         /*
    114          * Initialization and finalization code.
    115               *
    116               * Various files can provide initialization and finalization
    117          * functions.  crtbegin.o and crtend.o are two instances. The
    118          * body of these functions are in .init and .fini sections. We
    119          * accumulate the bodies here, and prepend function prologues
    120          * from crti.o and function epilogues from crtn.o. crti.o must
    121          * be linked first; crtn.o must be linked last.  Because these
    122          * are wildcards, it doesn't matter if the user does not
    123          * actually link against crti.o and crtn.o; the linker won't
    124          * look for a file to match a wildcard.  The wildcard also
    125          * means that it doesn't matter which directory crti.o and
    126          * crtn.o are in.
    127          */
    128         PROVIDE (_init = .);
    129         *crti.o(.init)
    130         *(.init)
    131         *crtn.o(.init)
    132         PROVIDE (_fini = .);
    133         *crti.o(.fini)
    134         *(.fini)
    135         *crtn.o(.fini)
    136 
    137         /*
    138          * Special FreeBSD sysctl sections.
    139          */
    140         . = ALIGN (16);
    141         __start_set_sysctl_set = .;
    142         *(set_sysctl_*);
    143         __stop_set_sysctl_set = ABSOLUTE(.);
    144         *(set_domain_*);
    145         *(set_pseudo_*);
    146 
    147 
    148         /*
    149          * C++ constructors/destructors
    150          *
    151          * gcc uses crtbegin.o to find the start of the constructors
    152          * and destructors so we make sure it is first.  Because this
    153          * is a wildcard, it doesn't matter if the user does not
    154          * actually link against crtbegin.o; the linker won't look for
    155          * a file to match a wildcard.  The wildcard also means that
    156          * it doesn't matter which directory crtbegin.o is in. The
    157          * constructor and destructor list are terminated in
    158          * crtend.o.  The same comments apply to it.
    159          */
    160         . = ALIGN (16);
    161         *crtbegin.o(.ctors)
    162         *(.ctors)
    163         *crtend.o(.ctors)
    164         *crtbegin.o(.dtors)
    165         *(.dtors)
    166         *crtend.o(.dtors)
    167 
    168         /*
    169          * Exception frame info
    170          */
    171         . = ALIGN (16);
    172         *(.eh_frame)
    173 
    174         /*
    175          * Read-only data
    176          */
    177         . = ALIGN (16);
    178         _rodata_start = . ;
    179         *(.rodata*)
    180         *(.gnu.linkonce.r*)
    181        
    182         . = ALIGN (16);
    183 
    184         *(.console_gdb_xfer)
    185         *(.bootstrap_data)
    186         . = ALIGN(16);
    187         _estuff = .;
    188     PROVIDE (_etext = .);
    189     } >sdram
    190        
    191         .data : {
    192         /*.data : {*/
    193             PROVIDE( _data_dest_start = . );
    194             PROVIDE( _copy_start = .);
    195             *(.data*)
    196             *(.gnu.linkonce.d*)
    197             *(.gcc_except_table*)
    198             *(.jcr)
    199             . = ALIGN (16);
    200             PROVIDE (_edata = .);
    201         PROVIDE (_copy_end = .);
    202         PROVIDE (_data_dest_end = . );
    203         } >sdram
    204 
    205         _data_src_start = _etext; /*LOADADDR(.data);*/
    206         _data_src_end = _data_src_start + SIZEOF(.data);       
    207        
    208         .bss : {
    209                PROVIDE (_clear_start = .);
    210                 *(.bss*)
    211                 *(COMMON)
    212                 . = ALIGN (16);
    213                 PROVIDE (end = .);
    214                 PROVIDE (_clear_end = .);
    215                 . = ALIGN (4);
    216                 PROVIDE (_StartInitStackSpace = .);
    217                 /*. = _StartInitStackSpace + _InitStackSize;*/
    218                 . += _InitStackSize;
    219                 PROVIDE (_EndInitStackSpace = .);
    220                 PROVIDE (WorkAreaBase = .);
    221         } >sdram
    222   /* Stabs debugging sections.  */
    223   .stab 0 : { *(.stab) }
    224   .stabstr 0 : { *(.stabstr) }
    225   .stab.excl 0 : { *(.stab.excl) }
    226   .stab.exclstr 0 : { *(.stab.exclstr) }
    227   .stab.index 0 : { *(.stab.index) }
    228   .stab.indexstr 0 : { *(.stab.indexstr) }
    229   .comment 0 : { *(.comment) }
    230 
    231 PROVIDE (end_of_all = .); 
    232 }
     84INCLUDE linkcmds.base
  • c/src/lib/libbsp/m68k/genmcf548x/startup/linkcmds.m5484FireEngine.flash

    re4927ece r6440903c  
    6464_CodeFlashSize = DEFINED(_CodeFlashSize)  ? _CodeFlashSize : (16 * 1024 * 1024);
    6565
    66 _VectorRam     = DEFINED(_VectorRam)      ? _VectorRam     : _SdramBase;
    67 _DataRam       = DEFINED(_DataRam)        ? _DataRam       : _data_dest_start;
    68 _DataRom       = DEFINED(_DataRom)        ? _DataRom       : _data_src_start;
    69 _DataEnd       = DEFINED(_DataEnd)        ? _DataEnd       : _data_dest_end;
    70 _BssStart      = DEFINED(_BssStart)       ? _BssStart      : _clear_start;
    71 _BssEnd        = DEFINED(_BssEnd)         ? _BssEnd        : _clear_end;
    72 _SpInit        = DEFINED(_SpInit)         ? _SpInit        : _EndInitStackSpace;
    73 _InitStackSize = DEFINED(StackSize)       ? StackSize      : 0x2000;  /* 8 kB   */
    74 _TopRamReserved= DEFINED(_TopRamReserved) ? _TopRamReserved : 0;
     66bsp_initstack_size = DEFINED(StackSize)    ? StackSize  : 0x800;  /* 2 kB   */
    7567
    76 RamBase       = DEFINED(_SdramBase)      ? _SdramBase      : _SdramBase;
    77 RamSize       = DEFINED(_SdramSize)      ? _SdramSize      : _SdramSize;
    78 HeapSize      = DEFINED(HeapSize)       ? HeapSize       : 0x0;
    79 _VBR           = DEFINED(_VBR)            ? _VBR            : RamBase;
     68_VBR            = DEFINED(_VBR)            ? _VBR       : _SdramBase;
    8069
    81 __MBAR         = DEFINED(__MBAR)          ? __MBAR          : 0x10000000;
     70__MBAR          = DEFINED(__MBAR)          ? __MBAR     : 0x10000000;
    8271
    83 ENTRY(start)
    8472MEMORY
    8573{
    86     sdram      : ORIGIN = 0x400     , LENGTH = 64M - 0x400
     74    sdram      : ORIGIN = 0x00000000, LENGTH = 64M
    8775    code_flash : ORIGIN = 0xE0000000, LENGTH = 16M
    8876    boot_flash : ORIGIN = 0xFF800000, LENGTH = 2M
    8977}
    9078
    91 SECTIONS
    92 {
    93      
    94     _header_offset = 0;
    95    
    96     /*
    97      * Text, data and bss segments .vectors         
    98      */   
    99     .vectors : {
    100                  *(.vectors*)
    101                } >boot_flash
    102     .text : {
    103        
    104         *(.text*)
    105         *(.ram_code)
     79REGION_ALIAS ("REGION_TEXT", boot_flash);
     80REGION_ALIAS ("REGION_TEXT_LOAD", boot_flash);
     81REGION_ALIAS ("REGION_DATA", sdram);
     82REGION_ALIAS ("REGION_DATA_LOAD", boot_flash);
    10683
    107         /*
    108          * C++ constructors/destructors
    109          */
    110         *(.gnu.linkonce.t.*)
    111 
    112         /*
    113          * Initialization and finalization code.
    114               *
    115               * Various files can provide initialization and finalization
    116          * functions.  crtbegin.o and crtend.o are two instances. The
    117          * body of these functions are in .init and .fini sections. We
    118          * accumulate the bodies here, and prepend function prologues
    119          * from crti.o and function epilogues from crtn.o. crti.o must
    120          * be linked first; crtn.o must be linked last.  Because these
    121          * are wildcards, it doesn't matter if the user does not
    122          * actually link against crti.o and crtn.o; the linker won't
    123          * look for a file to match a wildcard.  The wildcard also
    124          * means that it doesn't matter which directory crti.o and
    125          * crtn.o are in.
    126          */
    127         PROVIDE (_init = .);
    128         *crti.o(.init)
    129         *(.init)
    130         *crtn.o(.init)
    131         PROVIDE (_fini = .);
    132         *crti.o(.fini)
    133         *(.fini)
    134         *crtn.o(.fini)
    135 
    136         /*
    137          * Special FreeBSD sysctl sections.
    138          */
    139         . = ALIGN (16);
    140         __start_set_sysctl_set = .;
    141         *(set_sysctl_*);
    142         __stop_set_sysctl_set = ABSOLUTE(.);
    143         *(set_domain_*);
    144         *(set_pseudo_*);
    145 
    146 
    147         /*
    148          * C++ constructors/destructors
    149          *
    150          * gcc uses crtbegin.o to find the start of the constructors
    151          * and destructors so we make sure it is first.  Because this
    152          * is a wildcard, it doesn't matter if the user does not
    153          * actually link against crtbegin.o; the linker won't look for
    154          * a file to match a wildcard.  The wildcard also means that
    155          * it doesn't matter which directory crtbegin.o is in. The
    156          * constructor and destructor list are terminated in
    157          * crtend.o.  The same comments apply to it.
    158          */
    159         . = ALIGN (16);
    160         *crtbegin.o(.ctors)
    161         *(.ctors)
    162         *crtend.o(.ctors)
    163         *crtbegin.o(.dtors)
    164         *(.dtors)
    165         *crtend.o(.dtors)
    166 
    167         /*
    168          * Exception frame info
    169          */
    170         . = ALIGN (16);
    171         *(.eh_frame)
    172 
    173         /*
    174          * Read-only data
    175          */
    176         . = ALIGN (16);
    177         _rodata_start = . ;
    178         *(.rodata*)
    179         *(.gnu.linkonce.r*)
    180        
    181         . = ALIGN (16);
    182 
    183         *(.console_gdb_xfer)
    184         *(.bootstrap_data)
    185         . = ALIGN(16);
    186         _estuff = .;
    187     PROVIDE (_etext = .);
    188     } >boot_flash
    189        
    190         .data : AT(LOADADDR(.text) + SIZEOF(.text)) {
    191         /*.data : {*/
    192             PROVIDE( _data_dest_start = . );
    193             PROVIDE( _copy_start = .);
    194             *(.data*)
    195             *(.gnu.linkonce.d*)
    196             *(.gcc_except_table*)
    197             *(.jcr)
    198             . = ALIGN (16);
    199             PROVIDE (_edata = .);
    200         PROVIDE (_copy_end = .);
    201         PROVIDE (_data_dest_end = . );
    202         } >sdram
    203 
    204         _data_src_start = _etext; /*LOADADDR(.data);*/
    205         _data_src_end = _data_src_start + SIZEOF(.data);       
    206        
    207         .bss : {
    208                PROVIDE (_clear_start = .);
    209                 *(.bss*)
    210                 *(COMMON)
    211                 . = ALIGN (16);
    212                 PROVIDE (end = .);
    213                 PROVIDE (_clear_end = .);
    214                 . = ALIGN (4);
    215                 PROVIDE (_StartInitStackSpace = .);
    216                 /*. = _StartInitStackSpace + _InitStackSize;*/
    217                 . += _InitStackSize;
    218                 PROVIDE (_EndInitStackSpace = .);
    219                 PROVIDE (WorkAreaBase = .);
    220         } >sdram
    221   /* Stabs debugging sections.  */
    222   .stab 0 : { *(.stab) }
    223   .stabstr 0 : { *(.stabstr) }
    224   .stab.excl 0 : { *(.stab.excl) }
    225   .stab.exclstr 0 : { *(.stab.exclstr) }
    226   .stab.index 0 : { *(.stab.index) }
    227   .stab.indexstr 0 : { *(.stab.indexstr) }
    228   .comment 0 : { *(.comment) }
    229 
    230 PROVIDE (end_of_all = .); 
    231 }
     84INCLUDE linkcmds.base
Note: See TracChangeset for help on using the changeset viewer.