Changeset 018e3821 in rtems


Ignore:
Timestamp:
Sep 10, 2008, 8:32:27 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
e993f5b1
Parents:
03a85d32
Message:

2008-09-10 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.
Location:
c/src/lib/libbsp/bfin
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/bfin/bf537Stamp/ChangeLog

    r03a85d32 r018e3821  
     12008-09-10      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
    172008-08-15      Allan Hessenflow <allanh@kallisti.com>
    28
  • c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am

    r03a85d32 r018e3821  
    3131        ../../shared/bsppredriverhook.c startup/bspstart.c \
    3232        ../../shared/bspclean.c ../../shared/sbrk.c ../../shared/setvec.c \
    33         ../../shared/bootcard.c ../../shared/gnatinstallhandler.c
     33        ../../shared/bootcard.c ../../shared/gnatinstallhandler.c \
     34        ../shared/bspgetworkarea.c
    3435startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
    3536startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
  • c/src/lib/libbsp/bfin/bf537Stamp/configure.ac

    r03a85d32 r018e3821  
    2525[The console driver can operate in either polled or interrupt mode.])
    2626
     27RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     28
    2729# Explicitly list all Makefiles here
    2830AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/bfin/bf537Stamp/startup/bspstart.c

    r03a85d32 r018e3821  
    3434#endif
    3535
    36 /*
    37  *  Use the shared implementations of the following routines
    38  */
    39 
    40 void bsp_postdriver_hook(void);
    4136void bsp_libc_init(void *, uint32_t, int);
    4237
     
    4843
    4944/*
    50  *  Function:   bsp_pretasking_hook
    51  *  Created:    95/03/10
    52  *
    53  *  Description:
    54  *      BSP pretasking hook.  Called just before drivers are initialized.
    55  *      Used to setup libc and install any BSP extensions.
    56  *
    57  *  NOTES:
    58  *      Must not use libc (to do io) from here, since drivers are
    59  *      not yet initialized.
    60  *
     45 *  BSP pretasking hook.
    6146 */
    62 
    63 void bsp_pretasking_hook(void) {
    64   extern int HeapBase;
    65   extern int RamBase;
    66   extern int RamSize;
    67   unsigned long heapSize;
    68   void *heapStart;
    69 
     47void bsp_pretasking_hook(void)
     48{
    7049  bfin_interrupt_init();
    71 
    72   heapStart = &HeapBase;
    73   heapSize  = (unsigned long) &RamBase;
    74   heapSize += (unsigned long) &RamSize;
    75   heapSize -= (unsigned long) &HeapBase;
    76 
    77   bsp_libc_init(heapStart, heapSize, 0);
    78 
    7950}
    8051
     
    8253 *  bsp_start
    8354 *
    84  *  This routine does the bulk of the system initialization.
     55 *  This routine does the bulk of the BSP initialization.
    8556 */
    86 void bsp_start(void) {
    87    
    88   extern void *_WorkspaceBase;
    89 
     57void bsp_start(void)
     58{
    9059  /* BSP Hardware Initialization*/
    9160
     
    9766  initEBIU();  /* EBIU initialization */
    9867  initGPIO();  /* GPIO initialization */
    99 
    100   /*
    101    *  Allocate the memory for the RTEMS Work Space.  This can come from
    102    *  a variety of places: hard coded address, malloc'ed from outside
    103    *  RTEMS world (e.g. simulator or primitive memory manager), or (as
    104    *  typically done by stock BSPs) by subtracting the required amount
    105    *  of work space from the last physical address on the CPU board.
    106    */
    107 
    108   /*
    109    *  Need to "allocate" the memory for the RTEMS Workspace and
    110    *  tell the RTEMS configuration where it is.  This memory is
    111    *  not malloc'ed.  It is just "pulled from the air".
    112    */
    113 
    114   Configuration.work_space_start = (void *) &_WorkspaceBase;
    115 
    11668}
    11769
  • c/src/lib/libbsp/bfin/bf537Stamp/startup/linkcmds

    r03a85d32 r018e3821  
    1414_RamBase = DEFINED(_RamBase) ? _RamBase : 0x0;
    1515_RamSize = DEFINED(_RamSize) ? _RamSize : 0x04000000;
    16 /*_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0200000;*/
    1716_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
    1817
     
    113112        . += _StackSize;
    114113        _clear_end = .;
    115         _WorkspaceBase = .;
    116         . += 512K;      /* reserve some memory for workspace */
    117         _HeapBase = .;
    118 /*
    119         . += _HeapSize;
    120 */
     114        _WorkArea = .;
    121115         _end = .;
    122116         __end = .;
     
    165159__RamSize = _RamSize;
    166160__HeapBase = _HeapBase;
    167 /*__HeapSize = _HeapSize;*/
    168 __WorkspaceBase = _WorkspaceBase;
    169161__edata = _edata;
    170162__etext = _etext;
  • c/src/lib/libbsp/bfin/eZKit533/ChangeLog

    r03a85d32 r018e3821  
     12008-09-10      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
    172008-08-18      Allan Hessenflow <allanh@kallisti.com>
    28
  • c/src/lib/libbsp/bfin/eZKit533/Makefile.am

    r03a85d32 r018e3821  
    3232        ../../shared/bsppredriverhook.c startup/bspstart.c \
    3333        ../../shared/bspclean.c ../../shared/sbrk.c ../../shared/setvec.c \
    34         ../../shared/bootcard.c ../../shared/gnatinstallhandler.c
     34        ../../shared/bootcard.c ../../shared/gnatinstallhandler.c \
     35        ../shared/bspgetworkarea.c
    3536startup_rel_CPPFLAGS = $(AM_CPPFLAGS)
    3637startup_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
  • c/src/lib/libbsp/bfin/eZKit533/configure.ac

    r03a85d32 r018e3821  
    2121[The console driver can operate in either polled or interrupt mode.])
    2222
     23RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     24
    2325# Explicitly list all Makefiles here
    2426AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/bfin/eZKit533/startup/bspstart.c

    r03a85d32 r018e3821  
    2727
    2828const unsigned int dcplbs_table[16][2] = { 
    29         { 0xFFA00000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) },
    30         { 0xFF900000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data B */
    31         { 0xFF800000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data A */
    32         { 0xFFB00000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },
    33 
    34         { 0x20300000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 3 */
    35         { 0x20200000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 2 (Secnd)  */
    36         { 0x20100000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 1 (Prim B) */
    37         { 0x20000000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 0 (Prim A) */
    38 
    39         { 0x02400000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
    40         { 0x02000000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
    41         { 0x00C00000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
    42         { 0x00800000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
    43         { 0x00400000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
    44         { 0x00000000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
    45 
    46         { 0xffffffff, 0xffffffff }                                                      /* end of section - termination */
    47 
    48        }
    49 ;
     29  { 0xFFA00000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) },
     30  { 0xFF900000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data B */
     31  { 0xFF800000,   (PAGE_SIZE_1MB | CPLB_D_PAGE_MGMT | CPLB_WT) }, /* L1 Data A */
     32  { 0xFFB00000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },
     33  { 0x20300000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 3 */
     34  { 0x20200000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 2 (Secnd)  */
     35  { 0x20100000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 1 (Prim B) */
     36  { 0x20000000,   (PAGE_SIZE_1MB | CPLB_DNOCACHE) },      /* Async Memory Bank 0 (Prim A) */
     37
     38  { 0x02400000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
     39  { 0x02000000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
     40  { 0x00C00000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
     41  { 0x00800000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
     42  { 0x00400000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
     43  { 0x00000000,   (PAGE_SIZE_4MB | CPLB_DNOCACHE) },
     44  { 0xffffffff, 0xffffffff }                 /* end of section - termination */
     45
     46};
    5047
    5148
    5249const unsigned int _icplbs_table[16][2] = {
    53         { 0xFFA00000,   (PAGE_SIZE_1MB | CPLB_I_PAGE_MGMT | CPLB_I_PAGE_MGMT | 0x4) },  /* L1 Code */
    54         { 0xEF000000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* AREA DE BOOT */
    55         { 0xFFB00000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },     
    56 
    57         { 0x20300000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 3 */
    58         { 0x20200000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 2 (Secnd) */
    59         { 0x20100000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 1 (Prim B) */
    60         { 0x20000000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 0 (Prim A) */
    61 
    62         { 0x02400000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
    63         { 0x02000000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
    64         { 0x00C00000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
    65         { 0x00800000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
    66         { 0x00400000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
    67         { 0x00000000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
    68 
    69         { 0xffffffff, 0xffffffff }                                                      /* end of section - termination */
    70 
    71        }
    72 ;
     50  { 0xFFA00000,   (PAGE_SIZE_1MB | CPLB_I_PAGE_MGMT | CPLB_I_PAGE_MGMT | 0x4) },  /* L1 Code */
     51  { 0xEF000000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* AREA DE BOOT */
     52  { 0xFFB00000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },     
     53  { 0x20300000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 3 */
     54  { 0x20200000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 2 (Secnd) */
     55  { 0x20100000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 1 (Prim B) */
     56  { 0x20000000,   (PAGE_SIZE_1MB | CPLB_INOCACHE) },      /* Async Memory Bank 0 (Prim A) */
     57
     58  { 0x02400000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
     59  { 0x02000000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
     60  { 0x00C00000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
     61  { 0x00800000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
     62  { 0x00400000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
     63  { 0x00000000,   (PAGE_SIZE_4MB | CPLB_INOCACHE) },
     64  { 0xffffffff, 0xffffffff }               /* end of section - termination */
     65
     66};
    7367
    7468/*
     
    7670 */
    7771
    78 void bsp_libc_init( void *, uint32_t, int );
    7972void Init_PLL (void);
    8073void Init_EBIU (void);
     
    8578
    8679/*
    87  *  Function:   bsp_pretasking_hook
    88  *  Created:    95/03/10
    89  *
    90  *  Description:
    9180 *      BSP pretasking hook.  Called just before drivers are initialized.
    9281 *      Used to setup libc and install any BSP extensions.
    93  *
    94  *  NOTES:
    95  *      Must not use libc (to do io) from here, since drivers are
    96  *      not yet initialized.
    97  *
    9882 */
    9983
    10084void bsp_pretasking_hook(void)
    10185{
    102     extern int HeapBase;
    103     extern int HeapSize;
    104     void         *heapStart = &HeapBase;
    105     unsigned long heapSize = (unsigned long)&HeapSize;
    106 
    107     bfin_interrupt_init();
    108 
    109     bsp_libc_init(heapStart, heapSize, 0);
     86  bfin_interrupt_init();
    11087}
    11188
     
    11895void bsp_start( void )
    11996{
    120    
    121   extern void          * _WorkspaceBase;
    122 
    12397  /* BSP Hardware Initialization*/
    12498  Init_RTC();   /* Blackfin Real Time Clock initialization */ 
     
    127101  Init_Flags(); /* GPIO initialization */
    128102
    129   /*
    130    *  Allocate the memory for the RTEMS Work Space.  This can come from
    131    *  a variety of places: hard coded address, malloc'ed from outside
    132    *  RTEMS world (e.g. simulator or primitive memory manager), or (as
    133    *  typically done by stock BSPs) by subtracting the required amount
    134    *  of work space from the last physical address on the CPU board.
    135    */
    136 
    137   /*
    138    *  Need to "allocate" the memory for the RTEMS Workspace and
    139    *  tell the RTEMS configuration where it is.  This memory is
    140    *  not malloc'ed.  It is just "pulled from the air".
    141    */
    142 
    143   Configuration.work_space_start = (void *) &_WorkspaceBase;
    144 
    145103  int i=0;
    146104  for (i=5;i<16;i++) {
    147105    set_vector((rtems_isr_entry)null_isr, i, 1);
    148106  }
    149  
    150 }
    151 
    152  /*
    153   * Init_PLL
    154   *
    155   * Routine to initialize the PLL. The Ezkit uses a 27 Mhz XTAL.
    156   * See "../eZKit533/include/bsp.h" for more information.
    157   */
    158 
     107}
     108
     109/*
     110 * Init_PLL
     111 *
     112 * Routine to initialize the PLL. The Ezkit uses a 27 Mhz XTAL.
     113 * See "../eZKit533/include/bsp.h" for more information.
     114 */
    159115void Init_PLL (void)
    160116{
    161  
    162117  unsigned int n;
    163118 
     
    174129  /* Delay for PLL stabilization */
    175130  for (n=0; n<200; n++) {}
    176  
    177131}
    178132
     
    197151}
    198152
    199  /*
    200   * Init_Flags
    201   *
    202   * Enable LEDs port
    203   */
     153/*
     154 * Init_Flags
     155 *
     156 * Enable LEDs port
     157 */
    204158void Init_Flags(void)
    205159{
     
    230184}
    231185
    232 void initCPLB() {
    233 
    234        int i = 0;
    235        unsigned int *addr;
    236        unsigned int *data;
     186void initCPLB()
     187{
     188  int i = 0;
     189  unsigned int *addr;
     190  unsigned int *data;
    237191       
    238        addr = (unsigned int *)0xffe00100;
    239        data = (unsigned int *)0xffe00200;
    240 
    241        while ( dcplbs_table[i][0] != 0xffffffff ) {
    242                *addr = dcplbs_table[i][0];
    243                *data = dcplbs_table[i][1];
    244 
    245                addr++;
    246                data++;
    247        }
    248 }
     192  addr = (unsigned int *)0xffe00100;
     193  data = (unsigned int *)0xffe00200;
     194
     195  while ( dcplbs_table[i][0] != 0xffffffff ) {
     196    *addr = dcplbs_table[i][0];
     197    *data = dcplbs_table[i][1];
     198    addr++;
     199    data++;
     200  }
     201}
  • c/src/lib/libbsp/bfin/eZKit533/startup/linkcmds

    r03a85d32 r018e3821  
    102102        . += _StackSize;
    103103        _clear_end = .;
    104         _WorkspaceBase = .;
    105         . += 512K;      /* reserve some memory for workspace */
    106         _HeapBase = .;
    107         . += _HeapSize; /* reserve some memory for heap */
     104        _WorkArea = .;
    108105         _end = .;
    109106         __end = .;
     
    149146}
    150147
    151 __HeapBase = _HeapBase;
    152148__HeapSize = _HeapSize;
    153 __WorkspaceBase = _WorkspaceBase;
    154149__edata = _edata;
    155150__etext = _etext;
Note: See TracChangeset for help on using the changeset viewer.