Changeset 58eee41 in rtems


Ignore:
Timestamp:
Sep 14, 2008, 9:26:23 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
63c08c0
Parents:
25e4d24
Message:

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

  • Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds: Split out bsp_get_work_area() into its own file and user BSP Framework to perform more initialization.
  • startup/bspgetworkarea.c: New file.
Location:
c/src/lib/libbsp/mips/genmongoosev
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/mips/genmongoosev/ChangeLog

    r25e4d24 r58eee41  
     12008-09-14      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, startup/bspstart.c, startup/linkcmds:
     4        Split out bsp_get_work_area() into its own file and user BSP
     5        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/mips/genmongoosev/Makefile.am

    r25e4d24 r58eee41  
    2727dist_project_lib_DATA += startup/linkcmds
    2828
    29 startup_SOURCES = ../../shared/bspclean.c \
     29startup_SOURCES = ../../shared/bspclean.c ../../shared/bsppretaskinghook.c \
    3030    ../../shared/bsppredriverhook.c ../../shared/bsplibc.c \
    3131    ../../shared/bsppost.c startup/bspstart.c ../../shared/bootcard.c \
    3232    ../../shared/sbrk.c ../../shared/gnatinstallhandler.c \
    33     ../../shared/setvec.c
     33    ../../shared/setvec.c startup/bspgetworkarea.c
    3434clock_SOURCES = clock/clockdrv.c
    3535console_SOURCES = console/conscfg.c ../../shared/console.c
  • c/src/lib/libbsp/mips/genmongoosev/configure.ac

    r25e4d24 r58eee41  
    1717RTEMS_PROG_CCAS
    1818
     19RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     20
    1921# Explicitly list all Makefiles here
    2022AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/mips/genmongoosev/startup/bspstart.c

    r25e4d24 r58eee41  
    2626#include <libcpu/mongoose-v.h>
    2727
    28 /*
    29  *  Use the shared implementations of the following routines
    30  */
    31 
    32 void bsp_libc_init( void *, uint32_t, int );
    33 
    34 /*
    35  *  Function:   bsp_pretasking_hook
    36  *  Created:    95/03/10
    37  *
    38  *  Description:
    39  *      BSP pretasking hook.  Called just before drivers are initialized.
    40  *      Used to setup libc and install any BSP extensions.
    41  *
    42  *  NOTES:
    43  *      Must not use libc (to do io) from here, since drivers are
    44  *      not yet initialized.
    45  *
    46  */
    47 
    48 void bsp_pretasking_hook(void)
    49 {
    50     extern int HeapBase;
    51     extern int HeapSize;
    52     void         *heapStart = &HeapBase;
    53     unsigned long heapSize = (unsigned long)&HeapSize;
    54 
    55     bsp_libc_init(heapStart, (uint32_t) heapSize, 0);
    56 }
     28extern void _sys_exit(int);
     29extern void mips_install_isr_entries(void);
     30extern void mips_gdb_stub_install(void);
    5731
    5832/*
     
    6135 *  This routine does the bulk of the system initialization.
    6236 */
    63 
    6437void bsp_start( void )
    6538{
    66    extern void _sys_exit(int);
    67    extern int WorkspaceBase;
    68    extern void mips_install_isr_entries(void);
    69    extern void mips_gdb_stub_install(void);
     39 /* mask off any interrupts */
     40 MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_MASK_REGISTER, 0 );
    7041
    71    /* HACK -- tied to value linkcmds */
    72    if ( rtems_configuration_get_work_space_size() > (4096*1024) )
    73       _sys_exit( 1 );
     42 /* reset the config register & clear any pending peripheral interrupts */
     43 MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, 0 );
     44 MONGOOSEV_WRITE(
     45   MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, MONGOOSEV_UART_CMD_RESET_BOTH_PORTS );
     46 MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, 0 );
    7447
    75    Configuration.work_space_start = (void *) &WorkspaceBase;
     48 /* reset both timers */
     49 MONGOOSEV_WRITE_REGISTER(
     50   MONGOOSEV_TIMER1_BASE, MONGOOSEV_TIMER_INITIAL_COUNTER_REGISTER, 0xffffffff);
     51 MONGOOSEV_WRITE_REGISTER(
     52   MONGOOSEV_TIMER1_BASE, MONGOOSEV_TIMER_CONTROL_REGISTER, 0);
    7653
    77    /* mask off any interrupts */
    78    MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_FUNCTION_INTERRUPT_MASK_REGISTER, 0 );
     54 MONGOOSEV_WRITE_REGISTER(
     55   MONGOOSEV_TIMER2_BASE, MONGOOSEV_TIMER_INITIAL_COUNTER_REGISTER, 0xffffffff);
     56 MONGOOSEV_WRITE_REGISTER(
     57   MONGOOSEV_TIMER2_BASE, MONGOOSEV_TIMER_CONTROL_REGISTER, 0);
    7958
    80    /* reset the config register & clear any pending peripheral interrupts */
    81    MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, 0 );
    82    MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, MONGOOSEV_UART_CMD_RESET_BOTH_PORTS );
    83    MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_COMMAND_REGISTER, 0 );
     59 /* clear any pending interrupts */
     60 MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_STATUS_REGISTER, 0xffffffff );
    8461
    85    /* reset both timers */
    86    MONGOOSEV_WRITE_REGISTER( MONGOOSEV_TIMER1_BASE, MONGOOSEV_TIMER_INITIAL_COUNTER_REGISTER, 0xffffffff );
    87    MONGOOSEV_WRITE_REGISTER( MONGOOSEV_TIMER1_BASE, MONGOOSEV_TIMER_CONTROL_REGISTER, 0);
     62 /* clear any writable bits in the cause register */
     63 mips_set_cause( 0 );
    8864
    89    MONGOOSEV_WRITE_REGISTER( MONGOOSEV_TIMER2_BASE, MONGOOSEV_TIMER_INITIAL_COUNTER_REGISTER, 0xffffffff );
    90    MONGOOSEV_WRITE_REGISTER( MONGOOSEV_TIMER2_BASE, MONGOOSEV_TIMER_CONTROL_REGISTER, 0);
     65 /* set interrupt mask, but globally off. */
    9166
    92    /* clear any pending interrupts */
    93    MONGOOSEV_WRITE( MONGOOSEV_PERIPHERAL_STATUS_REGISTER, 0xffffffff );
     67 /*
     68  *  Bit 15 | Bit 14 | Bit 13 | Bit 12 | Bit 11 | Bit 10 | Bit  9 | Bit  8 |
     69  *  periph | unused |  FPU   | unused | timer2 | timer1 | swint1 | swint2 |
     70  *  extern |        |        |        |        |        |        |        |
     71  *
     72  *    1        0        1        0        0        1        0        0
     73  *
     74  *    0x8C00   Enable only internal Mongoose V timers.
     75  *    0xA400   Enable Peripherial ints, FPU and timer1
     76  *    0x0400   Timer1 only
     77  */
    9478
    95    /* clear any writable bits in the cause register */
    96    mips_set_cause( 0 );
     79  /* mips_set_sr( (SR_CU0 | SR_CU1 | 0xA400) ); */
    9780
    98    /* set interrupt mask, but globally off. */
     81  /* to start up, only enable coprocessor 0 & timer int. per-task
     82   * processor settings will be applied as they are created, this
     83   * is just to configure the processor for startup
     84   */
     85  mips_set_sr( (SR_CU0 | 0x400) );
    9986
    100    /*
    101    **  Bit 15 | Bit 14 | Bit 13 | Bit 12 | Bit 11 | Bit 10 | Bit  9 | Bit  8 |
    102    **  periph | unused |  FPU   | unused | timer2 | timer1 | swint1 | swint2 |
    103    **  extern |        |        |        |        |        |        |        |
    104    **
    105    **    1        0        1        0        0        1        0        0
    106    **
    107    **    0x8C00   Enable only internal Mongoose V timers.
    108    **    0xA400   Enable Peripherial ints, FPU and timer1
    109    **    0x0400   Timer1 only
    110    */
    111 
    112    /* mips_set_sr( (SR_CU0 | SR_CU1 | 0xA400) ); */
    113 
    114    /* to start up, only enable coprocessor 0 & timer int. per-task
    115    ** processor settings will be applied as they are created, this
    116    ** is just to configure the processor for startup
    117    */
    118    mips_set_sr( (SR_CU0 | 0x400) );
    119 
    120    mips_install_isr_entries();
     87  mips_install_isr_entries();
    12188}
    12289
     
    12996   promCopyDcacheFlush();
    13097}
    131 
    132 #if 0
    133 
    134 /* Structure filled in by get_mem_info. */
    135 
    136 struct s_mem
    137 {
    138   unsigned int size;
    139   unsigned int icsize;
    140   unsigned int dcsize;
    141 };
    142 
    143 extern uint32_t   _RamSize;
    144 
    145 void get_mem_info ( struct s_mem *mem )
    146 {
    147    mem->size = (uint32_t)&_RamSize;
    148    mem->icsize = MONGOOSEV_IC_SIZE;
    149    mem->dcsize = MONGOOSEV_DC_SIZE;
    150 }
    151 
    152 #endif
  • c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds

    r25e4d24 r58eee41  
    1414_RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000000;
    1515_RamSize = DEFINED(_RamSize) ? _RamSize : 32M;
    16 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x40000;
    1716_StackSize = DEFINED(_StackSize) ? _StackSize : 0x4000;
    1817ClockRate = DEFINED(ClockRate) ? ClockRate : 12000000;
     
    171170    _stack_init = .;
    172171    _clear_end = .;
    173     HeapBase = .;
    174     . += HeapSize;    /* reserve some memory for heap */
    175172    WorkspaceBase = .;
    176173    end = .;
Note: See TracChangeset for help on using the changeset viewer.