]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - rtems-patches/rtems-csb336-20051008-asyncmclk.patch
Series updated to latest 4.6.99 RTEMS version.
[rtems-devel.git] / rtems-patches / rtems-csb336-20051008-asyncmclk.patch
1 Index: rtems/c/src/lib/libbsp/arm/csb336/startup/bspstart.c
2 ===================================================================
3 --- rtems/c/src/lib/libbsp/arm/csb336/startup/bspstart.c        (revision 42)
4 +++ rtems/c/src/lib/libbsp/arm/csb336/startup/bspstart.c        (working copy)
5 @@ -86,9 +86,25 @@
6  /*   Since RTEMS is not configured, no RTEMS functions can be called.     */
7  /*                                                                        */
8  /**************************************************************************/
9 +void mmu_set_cpu_async_mode(void);
10  void bsp_start_default( void )
11  {
12 +    int i;
13  
14 +    /* Set the MCU prescaler to divide by 1 */
15 +    MC9328MXL_PLL_CSCR &= ~MC9328MXL_PLL_CSCR_PRESC;
16 +
17 +    /* Enable the MCU PLL */
18 +    MC9328MXL_PLL_CSCR |= MC9328MXL_PLL_CSCR_MPEN;
19 +
20 +    /* Delay to allow time for PLL to get going */
21 +    for (i = 0; i < 100; i++) {
22 +        asm volatile ("nop\n");
23 +    }
24 +
25 +    /* Set the CPU to asynchrous clock mode, so it uses its fastest clock */
26 +    mmu_set_cpu_async_mode();
27 +
28      /* disable interrupts */
29      MC9328MXL_AITC_INTENABLEL = 0;
30      MC9328MXL_AITC_INTENABLEH = 0;
31 --