source: rtems/c/src/lib/libbsp/arm/smdk2410/startup/bspstart.c @ 3f5e0961

5
Last change on this file since 3f5e0961 was 3f5e0961, checked in by Joel Sherrill <joel@…>, on 03/01/16 at 18:46:18

smdk2410: Resurrect missing gp32 files

When the gp32 BSP was obsoleted and removed, files were deleted that
were actually used by the gp32.

This was actually a violation of the expected directory structure
and why it wasn't caught. Another example of why continuous integration
testing -- even just building is important.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 * This file contains the ARM BSP startup package. It includes application,
3 * board, and monitor specific initialization and configuration. The generic CPU
4 * dependent initialization has been performed before this routine is invoked.
5 */
6
7/*
8 *  Copyright (c) 2000 Canon Research Centre France SA.
9 *  Emmanuel Raguet, mailto:raguet@crf.canon.fr
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 */
15
16#include <bsp.h>
17#include <bsp/irq-generic.h>
18#include <rtems/bspIo.h>
19#include <s3c24xx.h>
20
21/*
22 *  BSP Specific Initialization in C
23 */
24static void bsp_start_default( void )
25{
26  uint32_t cr;
27  uint32_t pend,last;
28  uint32_t REFCNT;
29  int i;
30
31  /* stop RTC */
32  #ifdef CPU_S3C2400
33    rTICINT = 0x0;
34  #else
35    rTICNT = 0x0;
36  #endif
37  /* stop watchdog,ADC and timers */
38  rWTCON = 0x0;
39  rTCON = 0x0;
40  rADCCON = 0x0;
41
42  /* disable interrupts */
43  rINTMOD = 0x0;
44  rINTMSK = BIT_ALLMSK; /* unmasked by drivers */
45
46  last = 0;
47  for(i=0; i<4; i++) {
48    pend = rSRCPND;
49    if(pend == 0 || pend == last)
50      break;
51    rSRCPND = pend;
52    rINTPND = pend;
53    last    = pend;
54  }
55
56  /* setup clocks */
57  rCLKDIVN = M_CLKDIVN;
58  rMPLLCON = ((M_MDIV<<12)+(M_PDIV<<4)+M_SDIV);
59  /* setup rREFRESH
60   * period = 15.6 us, HCLK=66Mhz, (2048+1-15.6*66)
61   */
62  REFCNT   = 2048+1-(15.6*get_HCLK()/1000000);
63  rREFRESH = ((REFEN<<23)+(TREFMD<<22)+(Trp<<20)+(Trc<<18)+(Tchr<<16)+REFCNT);
64
65  /* set prescaler for timers 2,3,4 to 16(15+1) */
66  cr = rTCFG0 & 0xFFFF00FF;
67  rTCFG0 = (cr | (15<<8));
68
69  /* set prescaler for timers 0,1 to 1(0+1) */
70  cr = rTCFG0 & 0xFFFFFF00;
71  rTCFG0 = (cr | (0<<0));
72
73  /*
74   * Init rtems exceptions management
75   */
76  /* FIXME: Use shared start.S */
77  rtems_exception_init_mngt();
78
79  /*
80   * Init rtems interrupt management
81   */
82  bsp_interrupt_initialize();
83}
84
85/*
86 *  By making this a weak alias for bsp_start_default, a brave soul
87 *  can override the actual bsp_start routine used.
88 */
89void bsp_start (void) __attribute__ ((weak, alias("bsp_start_default")));
Note: See TracBrowser for help on using the repository browser.