Changeset 3ddb428 in rtems


Ignore:
Timestamp:
Sep 14, 2008, 11:07:47 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
5c8d42b
Parents:
eb3923b
Message:

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

  • Makefile.am, configure.ac, console/rsPMCQ1.h, include/bsp.h, startup/bspstart.c: Create bsp_get_work_area() into its own file and use BSP Framework to perform more initialization.
  • startup/bspgetworkarea.c: New file.
Location:
c/src/lib/libbsp/powerpc/ep1a
Files:
1 added
6 edited

Legend:

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

    reb3923b r3ddb428  
     12008-09-14      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, console/rsPMCQ1.h, include/bsp.h,
     4        startup/bspstart.c: Create bsp_get_work_area() into its own file and
     5        use BSP Framework 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/ep1a/Makefile.am

    reb3923b r3ddb428  
    2626startup_SOURCES = startup/bspstart.c ../../shared/bootcard.c \
    2727    ../../shared/bsppost.c ../../shared/bsppredriverhook.c \
    28     ../../shared/bsplibc.c ../../powerpc/shared/startup/sbrk.c \
     28    startup/bspgetworkarea.c ../../shared/bsplibc.c \
     29    ../../powerpc/shared/startup/sbrk.c \
    2930    ../../shared/bspclean.c ../../shared/gnatinstallhandler.c \
    3031    ../../powerpc/shared/startup/pgtbl_setup.c \
  • c/src/lib/libbsp/powerpc/ep1a/configure.ac

    reb3923b r3ddb428  
    3737AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
    3838
     39RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     40
    3941# Explicitly list all Makefiles here
    4042AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/powerpc/ep1a/console/rsPMCQ1.h

    reb3923b r3ddb428  
    150150  int                   arg
    151151);
    152 unsigned int rsPMCQ1Init();
     152unsigned int rsPMCQ1Init(void);
    153153unsigned int rsPMCQ1MaIntConnect (
    154154    unsigned long       busNo,  /* Pci Bus number of PMCQ1 */
  • c/src/lib/libbsp/powerpc/ep1a/include/bsp.h

    reb3923b r3ddb428  
    203203#define BSP_FLASH_SET_PAGE(_page)       BSP_FLASH_set_page( _page )
    204204
     205/*
     206 * system init stack
     207 */
     208#define BSP_INIT_STACK_SIZE 0x1000
    205209
    206210/* clear hostbridge errors
  • c/src/lib/libbsp/powerpc/ep1a/startup/bspstart.c

    reb3923b r3ddb428  
    2020
    2121#include <rtems/libio.h>
    22 #include <rtems/libcsupport.h>
    2322#include <bsp/consoleIo.h>
    2423#include <libcpu/spr.h>
     
    8584
    8685/*
    87  * Total memory.
    88  * Note: RAM_END is defined in linkcmds.  We want to verify that the application
    89  *       is only using 10M of memory, and we do this by only accounting for this
    90  *       much memory.
    91  */
    92 extern int   RAM_END; 
    93 unsigned int BSP_mem_size = (unsigned int)&RAM_END;
    94 
    95 /*
    9686 * PCI Bus Frequency
    9787 */
     
    10797 */
    10898unsigned int BSP_time_base_divisor = 1000;  /* XXX - Just a guess */
    109 
    110 /*
    111  * system init stack
    112  */
    113 #define INIT_STACK_SIZE 0x1000
    11499
    115100void BSP_panic(char *s)
     
    165150
    166151/*
    167  *  Use the shared implementations of the following routines
    168  */
    169  
    170 void bsp_libc_init( void *, uint32_t, int );
    171 
    172 /*
    173  *  Function:   bsp_pretasking_hook
    174  *  Created:    95/03/10
     152 *  bsp_pretasking_hook
    175153 *
    176  *  Description:
    177  *      BSP pretasking hook.  Called just before drivers are initialized.
    178  *      Used to setup libc and install any BSP extensions.
    179  *
    180  *  NOTES:
    181  *      Must not use libc (to do io) from here, since drivers are
    182  *      not yet initialized.
    183  *
    184  */
    185  
     154 *  BSP pretasking hook.  Called just before drivers are initialized.
     155 */
    186156void bsp_pretasking_hook(void)
    187157{
    188   uint32_t        heap_start;   
    189   uint32_t        heap_size;
    190   uint32_t        heap_sbrk_spared;
    191 
    192   extern uint32_t _bsp_sbrk_init(uint32_t, uint32_t*);
    193  
    194   heap_start = ((uint32_t) __rtems_end) +
    195     INIT_STACK_SIZE + rtems_configuration_get_interrupt_stack_size();
    196   if (heap_start & (CPU_ALIGNMENT-1))
    197     heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
    198 
    199   heap_size = (BSP_mem_size - heap_start) - rtems_configuration_get_work_space_size();
    200 
    201   heap_sbrk_spared=_bsp_sbrk_init(heap_start, &heap_size);
    202 
    203 #ifdef SHOW_MORE_INIT_SETTINGS
    204   printk(" HEAP start %x  size %x (%x bytes spared for sbrk)\n",
    205     heap_start, heap_size, heap_sbrk_spared);
    206 #endif   
    207 
    208   bsp_libc_init((void *) 0, heap_size, heap_sbrk_spared);
    209158  rsPMCQ1Init();
    210159}
     
    330279  uint32_t intrStackStart;
    331280  uint32_t intrStackSize;
    332   unsigned char *work_space_start;
    333281  ppc_cpu_id_t myCpu;
    334282  ppc_cpu_revision_t myCpuRevision;
     
    336284
    337285  /*
    338    * Get CPU identification dynamically. Note that the get_ppc_cpu_type() function
    339    * store the result in global variables so that it can be used latter...
     286   * Get CPU identification dynamically. Note that the get_ppc_cpu_type()
     287   * function store the result in global variables so that it can be used
     288   * latter...
    340289   */
    341290  BSP_Increment_Light();
     
    368317   * so that It can be printed without accessing R1.
    369318   */
    370   stack = ((unsigned char*) __rtems_end) + INIT_STACK_SIZE - PPC_MINIMUM_STACK_FRAME_SIZE;
     319  stack = ((unsigned char*) __rtems_end) + BSP_INIT_STACK_SIZE
     320          - PPC_MINIMUM_STACK_FRAME_SIZE;
    371321
    372322 /* tag the bottom (T. Straumann 6/36/2001 <strauman@slac.stanford.edu>) */
     
    376326   * Initialize the interrupt related settings.
    377327   */
    378   intrStackStart = (uint32_t) __rtems_end + INIT_STACK_SIZE;
     328  intrStackStart = (uint32_t) __rtems_end + BSP_INIT_STACK_SIZE;
    379329  intrStackSize = rtems_configuration_get_interrupt_stack_size();
    380330
     
    418368  __asm__ __volatile ("sc");
    419369#endif 
    420 
    421 #ifdef SHOW_MORE_INIT_SETTINGS
    422   printk("rtems_configuration_get_work_space_size() = %x\n",
    423      rtems_configuration_get_work_space_size());
    424 #endif 
    425   work_space_start =
    426     (unsigned char *)BSP_mem_size - rtems_configuration_get_work_space_size();
    427 
    428   if ( work_space_start <= ((unsigned char *)__rtems_end) +
    429         INIT_STACK_SIZE + rtems_configuration_get_interrupt_stack_size()) {
    430     printk( "bspstart: Not enough RAM!!!\n" );
    431     bsp_cleanup();
    432   }
    433 
    434   Configuration.work_space_start = work_space_start;
    435370
    436371  /*
Note: See TracChangeset for help on using the changeset viewer.