Changeset 50bb7627 in rtems


Ignore:
Timestamp:
Oct 12, 2000, 12:56:07 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
ec45e86
Parents:
6c68186
Message:

2000-10-12 John S Gwynne <jgwynne@…>

  • start/start.c: Modified to support generation of ram_init.
  • start/ram_init.ld, BSP/start/ram_init.sed: New files. These changes enable RTEMS to automatically generate the ram_init file used by gdb with the BDM patches. The 332 has on-board chip select lines (for RAM and FLASH) that must be configured before use of these peripherals. These patches parse data from start.c where the chip select lines are configured in the runtime executable and automatically generates the gdb initialization file using the same settings. A great time saver. A similar file, ram_init_FW (flash writable), is also generated that the flash programming tool uses.
  • start/Makefile.am: Modified to support above.
  • CPU/sim.h: Modified to support above.
  • startup/except_vect_332_ROM.S: Moved to start so it would not be included in libbsp.a. Moving it to start ensures it is available as a single object file.
  • start/except_vect_332_ROM.S: Moved from startup.
  • startup/linkcmds, startup/linkcmds_ROM: Fixes to the memory map shown in the comments.
Location:
c/src/lib/libbsp/m68k/efi332
Files:
2 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/efi332/ChangeLog

    r6c68186 r50bb7627  
     12000-10-12      John S Gwynne <jgwynne@mrcday.com>
     2
     3        * start/start.c: Modified to support generation of ram_init.
     4        * start/ram_init.ld, BSP/start/ram_init.sed: New files.
     5        These changes enable RTEMS to automatically generate
     6        the ram_init file used by gdb with the BDM patches. The 332 has
     7        on-board chip select lines (for RAM and FLASH) that must be
     8        configured before use of these peripherals. These patches parse
     9        data from start.c where the chip select lines are configured in
     10        the runtime executable and automatically generates the gdb
     11        initialization file using the same settings. A great time saver.
     12        A similar file, ram_init_FW (flash writable), is also generated
     13        that the flash programming tool uses.
     14        * start/Makefile.am: Modified to support above.
     15        * CPU/sim.h: Modified to support above.
     16        * startup/except_vect_332_ROM.S: Moved to start so it would not
     17        be included in libbsp.a.  Moving it to start ensures it is
     18        available as a single object file.
     19        * start/except_vect_332_ROM.S: Moved from startup.
     20        * startup/linkcmds, startup/linkcmds_ROM: Fixes to the memory map
     21        shown in the comments.
     22
    1232000-09-29      Charles-Antoine Gauthier <charles.gauthier@nrc.ca>
    224
  • c/src/lib/libbsp/m68k/efi332/start/Makefile.am

    r6c68186 r50bb7627  
    2323        $(INSTALL_DATA) $< $@
    2424
    25 TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o
     25$(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o: \
     26    $(ARCH)/except_vect_332_ROM.o
     27        $(INSTALL_DATA) $< $@
     28
     29$(PROJECT_RELEASE)/lib/ram_init$(LIB_VARIANT): \
     30    $(ARCH)/ram_init
     31        $(INSTALL_DATA) $< $@
     32
     33$(PROJECT_RELEASE)/lib/ram_init_FW$(LIB_VARIANT): \
     34    $(ARCH)/ram_init_FW
     35        $(INSTALL_DATA) $< $@
     36
     37$(ARCH)/ram_init: $(srcdir)/start.c $(srcdir)/ram_init.ld \
     38    $(srcdir)/ram_init.sed
     39        sed -f $(srcdir)/ram_init.sed $(srcdir)/start.c >$(ARCH)/ram_init.S
     40        $(CC) -D SIM_CRB=0x0000 -E $(ARCH)/ram_init.S >$(ARCH)/ram_init1.S
     41        sed "/.org/ {N; s/\n/%/; P;}; /\.text/P; D;" $(ARCH)/ram_init1.S | \
     42           sort | sed "h;1{s/.*/.data/;P;g;};s/%.*//;P;g;s/.*%//;" \
     43           >$(ARCH)/ram_init2.S
     44        $(CC) -nostdlib -Wl,-T$(srcdir)/ram_init.ld $(ARCH)/ram_init2.S \
     45           -o $(ARCH)/ram_init
     46
     47$(ARCH)/ram_init_FW: $(srcdir)/ram_init.ld $(ARCH)/ram_init.S
     48        $(CC) -D FLASHWRITE -D SIM_CRB=0x0000 -E $(ARCH)/ram_init.S \
     49           >$(ARCH)/ram_init_FW1.S
     50        sed "/.org/ {N; s/\n/%/; P;}; /\.text/P; D;" $(ARCH)/ram_init_FW1.S | \
     51           sort | sed "h;1{s/.*/.data/;P;g;};s/%.*//;P;g;s/.*%//;" \
     52           >$(ARCH)/ram_init_FW2.S
     53        $(CC) -nostdlib -Wl,-T$(srcdir)/ram_init.ld $(ARCH)/ram_init_FW2.S \
     54           -o $(ARCH)/ram_init_FW
     55
     56TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/start$(LIB_VARIANT).o \
     57    $(PROJECT_RELEASE)/lib/ram_init$(LIB_VARIANT) \
     58    $(PROJECT_RELEASE)/lib/ram_init_FW$(LIB_VARIANT) \
     59    $(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o
    2660
    2761all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
     
    2963.PRECIOUS: $(PGM)
    3064
    31 EXTRA_DIST = start.c
     65EXTRA_DIST = start.c except_vect_332_ROM.S ram_init.ld ram_init.sed
    3266
    3367include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/m68k/efi332/start/start.c

    r6c68186 r50bb7627  
    113113#ifdef FLASHWRITE
    114114  *CSORBT = (unsigned short int)
    115     ( BothBytes | ReadWrite | SyncAS | WaitStates_0 | UserSupSpace );
     115    ( BothBytes | ReadWrite | SyncAS | WaitStates_2 | UserSupSpace );
    116116#else /* FLASHWRITE */
    117117  *CSORBT = (unsigned short int)
     
    186186  /* Port E and F Pin Assignment Register */
    187187  /*    see section 9 of the SIM Reference Manual */
    188   *PEPAR = (unsigned char) 0;
     188  *PEPAR = (unsigned char) 0xc3; /* siz1|siz0|dsack1|dsack0 */
    189189  *PFPAR = (unsigned char) 0;
    190190
  • c/src/lib/libbsp/m68k/efi332/startup/Makefile.am

    r6c68186 r50bb7627  
    1313C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1414
    15 S_FILES = except_vect_332_ROM.S
     15S_FILES =
    1616S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
    1717
     
    3838        $(INSTALL_DATA) $< $@
    3939
    40 $(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o: \
    41     $(ARCH)/except_vect_332_ROM.o
    42         $(INSTALL_DATA) $< $@
    43 
    4440# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile
    4541TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/linkcmds \
    46     $(PROJECT_RELEASE)/lib/linkcmds_ROM \
    47     $(PROJECT_RELEASE)/lib/except_vect_332_ROM$(LIB_VARIANT).o
     42    $(PROJECT_RELEASE)/lib/linkcmds_ROM
    4843
    4944all-local: $(ARCH) $(OBJS) $(PGM) $(TMPINSTALL_FILES)
     
    5146.PRECIOUS: $(PGM)
    5247
    53 EXTRA_DIST = bspclean.c bspstart.c except_vect_332_ROM.S linkcmds \
    54     linkcmds_ROM
     48EXTRA_DIST = bspclean.c bspstart.c linkcmds linkcmds_ROM
    5549
    5650include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/m68k/efi332/startup/linkcmds

    r6c68186 r50bb7627  
    1010 * The memory map looks like this:
    1111 * +--------------------+ <- low memory
     12 * |        _RamBase    |
    1213 * | .text              |
    1314 * |        etext       |
     
    2425 * |        _end        | start of heap, used by sbrk()
    2526 * +--------------------+
     27 * |         _WorkspaceBase
     28 * |    work space      |
     29 * |        heapStart   |
    2630 * |    heap space      |
    27  * |        _ENDHEAP    |
    28  * |    stack space     |
    29  * |        __stack     | top of stack
     31 * |        _RamEnd     | top of stack
    3032 * +--------------------+ <- high memory
    3133 */
  • c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM

    r6c68186 r50bb7627  
    99
    1010/*
     11 * The memory map looks like this:
    1112 * ROM:
    1213 * +--------------------+ <- low memory
     
    2324 * RAM:
    2425 * +--------------------+ <- low memory
     26 * |        _RamBase    |
    2527 * | .data              | initialized data goes here
    2628 * |        _sdata      |
     
    2830 * +--------------------+
    2931 * | .bss               |
    30  * |        __bss_start | start of bss, cleared by crt0
     32 * |        _clear_start| start of bss, cleared by crt0
    3133 * |        _end        | start of heap, used by sbrk()
    3234 * +--------------------+
     35 * |         _WorkspaceBase
     36 * |    work space      |
     37 * |        heapStart   |
    3338 * |    heap space      |
    34  * |        _ENDHEAP    |
    35  * |    stack space     |
    36  * |        __stack     | top of stack
     39 * |        _RamEnd     | top of stack
    3740 * +--------------------+ <- high memory
    3841 */
     42
     43/*
     44 * Declare some sizes.
     45 */
     46_RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000;
     47_RamSize = DEFINED(_RamSize) ? _RamSize : 0x40000;
     48_RamEnd = _RamBase + _RamSize;
     49_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
     50_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    3951
    4052MEMORY
    4153{
    4254  rom     : ORIGIN = 0x00000, LENGTH = 256K
    43   ram     : ORIGIN = 0x80000, LENGTH = 512K
     55  ram     : ORIGIN = 0x80000, LENGTH = 256K
    4456}
    4557
    46 _RamBase = DEFINED(_RamBase) ? _RamBase : 0x080000;
    47 
    48 __end_of_ram = 0x100000;
    4958_copy_data_from_rom = 1;
    5059
     
    5463SECTIONS
    5564{
    56   .text :
     65        ram : {
     66                . = .;
     67        } >ram
     68
     69        /*
     70         * Text, data and bss segments
     71         */
     72        .text : {
     73    *(.text)
     74
     75                /*
     76                 * C++ constructors/destructors
     77                 */
     78                *(.gnu.linkonce.t.*)
     79
     80                /*
     81                 * Initialization and finalization code.
     82                 *
     83                 * Various files can provide initialization and finalization
     84                 * functions.  crtbegin.o and crtend.o are two instances. The
     85                 * body of these functions are in .init and .fini sections. We
     86                 * accumulate the bodies here, and prepend function prologues
     87                 * from crti.o and function epilogues from crtn.o. crti.o must
     88                 * be linked first; crtn.o must be linked last.  Because these
     89                 * are wildcards, it doesn't matter if the user does not
     90                 * actually link against crti.o and crtn.o; the linker won't
     91                 * look for a file to match a wildcard.  The wildcard also
     92                 * means that it doesn't matter which directory crti.o and
     93                 * crtn.o are in.
     94                 */
     95                PROVIDE (_init = .);
     96                *crti.o(.init)
     97                *(.init)
     98                *crtn.o(.init)
     99                PROVIDE (_fini = .);
     100                *crti.o(.fini)
     101                *(.fini)
     102                *crtn.o(.fini)
     103
     104                /*
     105                 * C++ constructors/destructors
     106                 *
     107                 * gcc uses crtbegin.o to find the start of the constructors
     108                 * and destructors so we make sure it is first.  Because this
     109                 * is a wildcard, it doesn't matter if the user does not
     110                 * actually link against crtbegin.o; the linker won't look for
     111                 * a file to match a wildcard.  The wildcard also means that
     112                 * it doesn't matter which directory crtbegin.o is in. The
     113                 * constructor and destructor list are terminated in
     114                 * crtend.o.  The same comments apply to it.
     115                 */
     116                . = ALIGN (16);
     117                *crtbegin.o(.ctors)
     118    *(.ctors)
     119                *crtend.o(.ctors)
     120                *crtbegin.o(.dtors)
     121    *(.dtors)
     122                *crtend.o(.dtors)
     123
     124                /*
     125                 * Exception frame info
     126                 */
     127                . = ALIGN (16);
     128                *(.eh_frame)
     129
     130                /*
     131                 * Read-only data
     132                 */
     133                . = ALIGN (16);
     134                _rodata_start = . ;
     135                *(.rodata)
     136                *(.gnu.linkonce.r*)
     137
     138                 . = ALIGN (16);
     139                PROVIDE (_etext = .);
     140        } >rom
     141  .data :
     142        AT ( ADDR(.text) + SIZEOF( .text ) )
    57143  {
    58     CREATE_OBJECT_SYMBOLS
    59     text_start = .;
    60     _text_start = .;
    61     *(.text)
    62     . = ALIGN (16);
    63 
    64     *(.eh_fram)
    65     . = ALIGN (16);
    66 
    67     etext = ALIGN(0x10);
    68     _etext = .;
    69     __CTOR_LIST__ = .;
    70     LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
    71     *(.ctors)
    72     LONG(0)
    73     __CTOR_END__ = .;
    74     __DTOR_LIST__ = .;
    75     LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
    76     *(.dtors)
    77     LONG(0)
    78     __DTOR_END__ = .;
    79     *(.lit)
    80     *(.shdata)
    81     _endtext = .;
    82   } > rom
    83   .gcc_exc :
    84   AT ( ADDR(.text) + SIZEOF( .text ) )
    85   {
    86     *(.gcc_exc)
    87   } > ram
    88   .data :
    89   {
    90     data_start = .;
    91     _data_start = .;
    92     _sdata = . ;
     144                PROVIDE (_copy_start = .);
    93145    *(.data)
    94     CONSTRUCTORS
    95     edata = ALIGN(0x10);
    96     _edata = .;
    97   } > ram
    98   .shbss :
    99   {
    100     *(.shbss)
    101   } > ram
    102   .bss :
    103   {
    104     __bss_start = ALIGN(0x8);
    105     bss_start = .;
    106     _bss_start = .;
     146                *(.gnu.linkonce.d*)
     147                *(.gcc_except_table)
     148                . = ALIGN (16);
     149                PROVIDE (_edata = .);
     150                PROVIDE (_copy_end = .);
     151        } >ram
     152        .bss : {
     153                _clear_start = .;
    107154    *(.bss)
    108155    *(COMMON)
    109     end = .;
    110     _end = ALIGN(0x8);
    111     __end = ALIGN(0x8);
    112   } > ram
    113   .stab . (NOLOAD) :
    114   {
    115     [ .stab ]
    116   }
    117   .stabstr . (NOLOAD) :
    118   {
    119     [ .stabstr ]
    120   }
     156                . = ALIGN (16);
     157                PROVIDE (end = .);
     158
     159                . += _StackSize;
     160                . = ALIGN (16);
     161                _stack_init = .;
     162                _clear_end = .;
     163
     164                _WorkspaceBase = .;
     165        } >ram
     166
     167  /* Stabs debugging sections.  */
     168  .stab 0 : { *(.stab) }
     169  .stabstr 0 : { *(.stabstr) }
     170  .stab.excl 0 : { *(.stab.excl) }
     171  .stab.exclstr 0 : { *(.stab.exclstr) }
     172  .stab.index 0 : { *(.stab.index) }
     173  .stab.indexstr 0 : { *(.stab.indexstr) }
     174  .comment 0 : { *(.comment) }
     175
     176  /* DWARF debug sections.
     177     Symbols in the DWARF debugging sections are relative to the beginning
     178     of the section so we begin them at 0.  */
     179  /* DWARF 1 */
     180  .debug          0 : { *(.debug) }
     181  .line           0 : { *(.line) }
     182 
     183  /* GNU DWARF 1 extensions */
     184  .debug_srcinfo  0 : { *(.debug_srcinfo) }
     185  .debug_sfnames  0 : { *(.debug_sfnames) }
     186 
     187  /* DWARF 1.1 and DWARF 2 */
     188  .debug_aranges  0 : { *(.debug_aranges) }
     189  .debug_pubnames 0 : { *(.debug_pubnames) }
     190 
     191  /* DWARF 2 */
     192  .debug_info     0 : { *(.debug_info) }
     193  .debug_abbrev   0 : { *(.debug_abbrev) }
     194  .debug_line     0 : { *(.debug_line) }
     195  .debug_frame    0 : { *(.debug_frame) }
     196  .debug_str      0 : { *(.debug_str) }
     197  .debug_loc      0 : { *(.debug_loc) }
     198  .debug_macinfo  0 : { *(.debug_macinfo) }
     199 
     200  /* SGI/MIPS DWARF 2 extensions */
     201  .debug_weaknames 0 : { *(.debug_weaknames) }
     202  .debug_funcnames 0 : { *(.debug_funcnames) }
     203  .debug_typenames 0 : { *(.debug_typenames) }
     204  .debug_varnames  0 : { *(.debug_varnames) }
     205  /* These must appear regardless of  .  */
    121206}
Note: See TracChangeset for help on using the changeset viewer.