Changeset 0f707111 in rtems


Ignore:
Timestamp:
Sep 15, 2008, 10:05:14 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
f1359069
Parents:
8446486f
Message:

2008-09-15 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add use of bsp_get_work_area() in its own file and rely on BSP Framework to perform more initialization.
  • startup/bspgetworkarea.c: New file.
Location:
c/src/lib/libbsp/powerpc
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/mpc8260ads/ChangeLog

    r8446486f r0f707111  
     12008-09-15      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add
     4        use of bsp_get_work_area() in its own file and rely on BSP Framework
     5        to perform more initialization.
     6        * startup/bspgetworkarea.c: New file.
     7
    182008-09-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • c/src/lib/libbsp/powerpc/mpc8260ads/Makefile.am

    r8446486f r0f707111  
    3939    ../../shared/bsppredriverhook.c ../../shared/bsppost.c \
    4040    startup/bspstart.c ../../shared/bootcard.c ../../shared/sbrk.c \
    41     ../../shared/gnatinstallhandler.c startup/cpuinit.c
     41    ../../shared/gnatinstallhandler.c startup/cpuinit.c \
     42    startup/bspgetworkarea.c ../../shared/bsppretaskinghook.c
    4243
    4344vectors_SOURCES = vectors/vectors_init.c vectors/vectors.h \
  • c/src/lib/libbsp/powerpc/mpc8260ads/configure.ac

    r8446486f r0f707111  
    6868AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
    6969
     70RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     71
    7072# Explicitly list a Makefile here
    7173AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/powerpc/mpc8260ads/startup/bspstart.c

    r8446486f r0f707111  
    4545
    4646#include <mpc8260.h>
    47 #include <rtems/libio.h>
    48 #include <rtems/libcsupport.h>
    4947#include <rtems/score/thread.h>
    5048#include <rtems/powerpc/powerpc.h>
     
    7472bool       bsp_timer_internal_clock;   /* TRUE, when timer runs with CPU clk */
    7573
    76 /*
    77  *  Use the shared implementations of the following routines.
    78  *  Look in rtems/c/src/lib/libbsp/shared/bsppost.c and
    79  *  rtems/c/src/lib/libbsp/shared/bsplibc.c.
    80  */
    81 void bsp_libc_init( void *, uint32_t, int );
    82 
    8374void  _BSP_GPLED1_on(void);
    8475void  _BSP_GPLED0_on(void);
     
    156147  csr->bcsr1 |=  UART2_E;               /* Disable Uart2 */
    157148
    158 }
    159 
    160 /*
    161  *  Function:   bsp_pretasking_hook
    162  *  Created:    95/03/10
    163  *
    164  *  Description:
    165  *      BSP pretasking hook.  Called just before drivers are initialized.
    166  *      Used to setup libc and install any BSP extensions.
    167  *
    168  *  NOTES:
    169  *      Must not use libc (to do io) from here, since drivers are
    170  *      not yet initialized.
    171  *
    172  */
    173 
    174 void
    175 bsp_pretasking_hook(void)
    176 {
    177   /*
    178    *  These are assigned addresses in the linkcmds file for the BSP. This
    179    *  approach is better than having these defined as manifest constants and
    180    *  compiled into the kernel, but it is still not ideal when dealing with
    181    *  multiprocessor configuration in which each board as a different memory
    182    *  map. A better place for defining these symbols might be the makefiles.
    183    *  Consideration should also be given to developing an approach in which
    184    *  the kernel and the application can be linked and burned into ROM
    185    *  independently of each other.
    186    */
    187   extern unsigned char _HeapStart;
    188   extern unsigned char _HeapEnd;
    189 
    190   bsp_libc_init( &_HeapStart, &_HeapEnd - &_HeapStart, 0 );
    191149}
    192150
     
    245203  rtems_cache_enable_data();
    246204#endif
    247 
    248   /*
    249    *  Allocate the memory for the RTEMS Work Space.  This can come from
    250    *  a variety of places: hard coded address, malloc'ed from outside
    251    *  RTEMS world (e.g. simulator or primitive memory manager), or (as
    252    *  typically done by stock BSPs) by subtracting the required amount
    253    *  of work space from the last physical address on the CPU board.
    254    */
    255 
    256   /*
    257    *  Need to "allocate" the memory for the RTEMS Workspace and
    258    *  tell the RTEMS configuration where it is.  This memory is
    259    *  not malloc'ed.  It is just "pulled from the air".
    260    */
    261 
    262   Configuration.work_space_start = (void *)&_WorkspaceBase;
    263205
    264206  /*
  • c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds

    r8446486f r0f707111  
    99              "elf32-powerpc")
    1010OUTPUT_ARCH(powerpc)
    11  
     11
    1212ENTRY(start)
    1313
     
    1818 *      the lines marked XXX below to use a constant value.
    1919 */
    20 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x400000; /* 4M Heap */
    21 StackSize = DEFINED(StackSize) ? StackSize : 0x8000;
    22 WorkSpaceSize = DEFINED(WorkSpaceSize) ? WorkSpaceSize : 0x80000; /* 512k */
     20StackSize   = DEFINED(StackSize) ? StackSize : 0x8000;
     21RamBase     = DEFINED(RamBase) ? RamBase : 0x0;
     22RamSize     = DEFINED(RamSize) ? RamDiskSize : 0x0800000; /* 8M program ram */
     23RamDiskBase = DEFINED(RamDiskBase) ? RamDiskBase : 0x0800000;
    2324RamDiskSize = DEFINED(RamDiskSize) ? RamDiskSize : 0x0800000; /* 8M ram disk */
    24  
     25
    2526MEMORY
    26         {
    27         ram : org = 0x0, l = 16M
    28         dpram : org = 0x04700000, l = 128K
    29         flash : org = 0xff800000, l = 8M
    30         }
     27{
     28  ram : org = 0x0, l = 8M
     29  ramdisk : org = 0x0800000, l = 8M
     30  dpram : org = 0x04700000, l = 128K
     31  flash : org = 0xff800000, l = 8M
     32}
    3133
    3234
    3335SECTIONS
    3436{
    35 
    36     /*
     37    /*
    3738     * The stack will live in this area - between the vectors and
    3839     * the text section.
    3940     */
    40        
     41
    4142    .text 0x10000:
    4243    {
     
    8182     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
    8283     *  wildcard also means that it doesn't matter which directory ecrti.o
    83      *  and ecrtn.o are in. 
     84     *  and ecrtn.o are in.
    8485     */
    8586    PROVIDE (_init = .);
     
    8788    *(.init)
    8889    *ecrtn.o(.init)
    89    
     90
    9091    PROVIDE (_fini = .);
    9192    *ecrti.o(.fini)
     
    9394    *ecrtn.o(.init)
    9495
    95     /* 
     96    /*
    9697     *  C++ constructors and destructors for static objects.
    9798     *  PowerPC EABI does not use crtstuff yet, so we build "old-style"
     
    99100     *  end terminate with a NULL entry.
    100101     */
    101      
    102     PROVIDE (__CTOR_LIST__ = .);             
     102
     103    PROVIDE (__CTOR_LIST__ = .);       
    103104    /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
    104105    *crtbegin.o(.ctors)
     
    107108    LONG(0)
    108109    PROVIDE (__CTOR_END__ = .);
    109        
     110
    110111    PROVIDE (__DTOR_LIST__ = .);
    111112    /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
     
    115116    LONG(0)
    116117    PROVIDE (__DTOR_END__ = .);
    117        
     118
    118119    /* Exception frame info */
    119120    *(.eh_frame)
     
    138139    PROVIDE (etext = .);
    139140    PROVIDE (__etext = .);
    140  
     141
    141142    } > ram
    142143
     
    194195    } > ram
    195196    __GOT_END__ = .;
    196        
     197
    197198    .got1                 : { *(.got1)          } >ram
    198199    PROVIDE (__GOT2_START__ = .);
     
    201202    PROVIDE (__GOT2_END__ = .);
    202203    PROVIDE (_GOT2_END_ = .);
    203        
     204
    204205    PROVIDE (__FIXUP_START__ = .);
    205206    PROVIDE (_FIXUP_START_ = .);
     
    207208    PROVIDE (_FIXUP_END_ = .);
    208209    PROVIDE (__FIXUP_END__ = .);
    209          
     210
    210211    PROVIDE (__SDATA2_START__ = .);
    211212    .sdata2       : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >ram
    212213    .sbss2        : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >ram
    213214    PROVIDE (__SBSS2_END__ = .);
    214        
     215
    215216    .sbss2        : { *(.sbss2)         } >ram
    216217    PROVIDE (__SBSS2_END__ = .);
    217        
     218
    218219    __SBSS_START__ = .;
    219220    .bss :
     
    257258        _startmalloc = .;
    258259     } >ram
    259                
     260
    260261
    261262    /*
     
    268269
    269270
    270     _HeapStart = .;
    271     __HeapStart = .;
    272     . += HeapSize;
    273     _HeapEnd = .;
    274     __HeapEnd = .;
    275 
    276271    clear_end = .;
    277272
    278 
    279     _WorkspaceBase = .;
    280     __WorkspaceBase = .;
    281     . += WorkSpaceSize;
    282 
    283 
    284     _RamDiskBase = .;
    285     __RamDiskBase = .;
    286     . += RamDiskSize;
    287     _RamDiskEnd  = .;
    288     __RamDiskEnd = .;
    289     PROVIDE( _RamDiskSize = _RamDiskEnd - _RamDiskBase );
     273    WorkspaceBase = .;
    290274
    291275    /* Sections for compressed .text and .data         */
  • c/src/lib/libbsp/powerpc/ss555/ChangeLog

    r8446486f r0f707111  
     12008-09-15      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Add
     4        use of bsp_get_work_area() in its own file and rely on BSP Framework
     5        to perform more initialization.
     6        * startup/bspgetworkarea.c: New file.
     7
    182008-09-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • c/src/lib/libbsp/powerpc/ss555/Makefile.am

    r8446486f r0f707111  
    3232    ../../shared/bsppost.c ../../shared/bsppredriverhook.c \
    3333    startup/bspstart.c ../../shared/bootcard.c startup/iss555.c \
    34     ../../shared/sbrk.c ../../shared/gnatinstallhandler.c startup/start.S
     34    ../../shared/sbrk.c ../../shared/gnatinstallhandler.c startup/start.S \
     35    ../../shared/bsppretaskinghook.c startup/bspgetworkarea.c
    3536tm27supp_SOURCES = startup/tm27supp.c
    3637
  • c/src/lib/libbsp/powerpc/ss555/configure.ac

    r8446486f r0f707111  
    4545 for the SCI ports.])
    4646
     47RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     48
    4749# Explicitly list a Makefile here
    4850AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/powerpc/ss555/startup/bspstart.c

    r8446486f r0f707111  
    2626#warning The interrupt disable mask is now stored in SPRG0, please verify that this is compatible to this BSP (see also bootcard.c).
    2727
    28 #include <string.h>
    29 
    30 #include <rtems/libio.h>
    31 #include <rtems/libcsupport.h>
    3228#include <rtems/bspIo.h>
    3329#include <rtems/powerpc/powerpc.h>
     
    5147uint32_t   bsp_timer_average_overhead;
    5248
    53 /*
    54  *  Use the shared implementations of the following routines.
    55  *  Look in rtems/c/src/lib/libbsp/shared/bsplibc.c.
    56  */
    57 void bsp_libc_init( void *, uint32_t, int );
    58 
    5949void BSP_panic(char *s)
    6050{
     
    6757  printk("%s PANIC ERROR %x\n",_RTEMS_version, v);
    6858  __asm__ __volatile ("sc");
    69 }
    70 
    71 /*
    72  *  bsp_pretasking_hook
    73  *
    74  *  Called when RTEMS initialization is complete but before interrupts and
    75  *  tasking are enabled. Used to setup libc and install any BSP extensions.
    76  *
    77  *  Must not use libc (to do io) from here, since drivers are not yet
    78  *  initialized.
    79  *
    80  *  Input parameters: NONE
    81  *
    82  *  Output parameters: NONE
    83  *
    84  *  Return values: NONE
    85  */
    86 void bsp_pretasking_hook(void)
    87 {
    88   /*
    89    *  These are assigned addresses in the linkcmds file for the BSP. This
    90    *  approach is better than having these defined as manifest constants and
    91    *  compiled into the kernel, but it is still not ideal when dealing with
    92    *  multiprocessor configuration in which each board as a different memory
    93    *  map. A better place for defining these symbols might be the makefiles.
    94    *  Consideration should also be given to developing an approach in which
    95    *  the kernel and the application can be linked and burned into ROM
    96    *  independently of each other.
    97    */
    98   uint8_t *_HeapStart =
    99       (uint8_t *)Configuration.work_space_start
    100            + rtems_configuration_get_work_space_size();
    101   extern uint8_t _HeapEnd[];
    102 
    103   bsp_libc_init( _HeapStart, _HeapEnd - _HeapStart, 0 );
    10459}
    10560
     
    12681void bsp_start(void)
    12782{
    128   extern char _WorkspaceBase[];
    129 
    13083  ppc_cpu_id_t myCpu;
    13184  ppc_cpu_revision_t myCpuRevision;
     
    152105
    153106  /*
    154    *  Allocate the memory for the RTEMS Work Space.  This can come from
    155    *  a variety of places: hard coded address, malloc'ed from outside
    156    *  RTEMS world (e.g. simulator or primitive memory manager), or (as
    157    *  typically done by stock BSPs) by subtracting the required amount
    158    *  of work space from the last physical address on the CPU board.
    159    *
    160    *  In this case, the memory is not malloc'ed.  It is just
    161    *  "pulled from the air".
    162    */
    163   Configuration.work_space_start = _WorkspaceBase;
    164 
    165   /*
    166107   *  initialize the device driver parameters
    167108   */
  • c/src/lib/libbsp/powerpc/ss555/startup/linkcmds

    r8446486f r0f707111  
    236236  PROVIDE(intrStackPtr = intrStack);
    237237
    238   _WorkspaceBase = .;
    239   __WorkspaceBase = .;
    240        
     238  WorkspaceBase = .;
     239
    241240  /*
    242241   * Heap
     
    247246   */
    248247  . = DEFINED(RTEMS_DEBUG) ? 0 + ext_ram_size : int_ram_top + ext_ram_size;
    249   _HeapEnd = .;
    250   __HeapEnd = .;
     248  RamEnd = .;
    251249 
    252        
    253250  /*
    254251   * Internal I/O devices
Note: See TracChangeset for help on using the changeset viewer.