diff options
Diffstat (limited to 'c/src/lib/libcpu/m68k/mcf5206/clock/ckinit.c')
-rw-r--r-- | c/src/lib/libcpu/m68k/mcf5206/clock/ckinit.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/c/src/lib/libcpu/m68k/mcf5206/clock/ckinit.c b/c/src/lib/libcpu/m68k/mcf5206/clock/ckinit.c index 462fac6fbb..d0739d66a9 100644 --- a/c/src/lib/libcpu/m68k/mcf5206/clock/ckinit.c +++ b/c/src/lib/libcpu/m68k/mcf5206/clock/ckinit.c @@ -1,8 +1,8 @@ /* * Clock Driver for MCF5206eLITE board * - * This driver initailizes timer1 on the MCF5206E as the - * main system clock + * This driver initailizes timer1 on the MCF5206E as the + * main system clock * * Author: Victor V. Vengerov <vvv@oktet.ru> * @@ -36,7 +36,7 @@ volatile uint32_t Clock_driver_ticks; /* * These are set by clock driver during its init */ - + rtems_device_major_number rtems_clock_major = ~0; rtems_device_minor_number rtems_clock_minor; @@ -114,33 +114,33 @@ Install_clock(rtems_isr_entry clock_isr) MCF5206E_ICR_AVEC | ((BSP_INTLVL_TIMER1 << MCF5206E_ICR_IL_S) & MCF5206E_ICR_IL) | ((BSP_INTPRIO_TIMER1 << MCF5206E_ICR_IP_S) & MCF5206E_ICR_IP); - + /* Register the interrupt handler */ set_vector(clock_isr, BSP_INTVEC_TIMER1, 1); - + /* Reset timer 1 */ *MCF5206E_TMR(MBAR, 1) = MCF5206E_TMR_RST; *MCF5206E_TMR(MBAR, 1) = MCF5206E_TMR_ICLK_STOP; *MCF5206E_TMR(MBAR, 1) = MCF5206E_TMR_RST; *MCF5206E_TCN(MBAR, 1) = 0; /* Reset counter */ *MCF5206E_TER(MBAR, 1) = MCF5206E_TER_REF | MCF5206E_TER_CAP; - + /* Set Timer 1 prescaler so that it counts in microseconds */ *MCF5206E_TMR(MBAR, 1) = - (((BSP_SYSTEM_FREQUENCY/1000000 - 1) << MCF5206E_TMR_PS_S) & + (((BSP_SYSTEM_FREQUENCY/1000000 - 1) << MCF5206E_TMR_PS_S) & MCF5206E_TMR_PS) | MCF5206E_TMR_CE_NONE | MCF5206E_TMR_ORI | MCF5206E_TMR_FRR | MCF5206E_TMR_RST; - - /* Set the timer timeout value from the BSP config */ + + /* Set the timer timeout value from the BSP config */ *MCF5206E_TRR(MBAR, 1) = rtems_configuration_get_microseconds_per_tick() - 1; /* Feed system frequency to the timer */ *MCF5206E_TMR(MBAR, 1) |= MCF5206E_TMR_ICLK_MSCLK; - + /* Enable timer 1 interrupts */ *MCF5206E_IMR(MBAR) &= ~MCF5206E_INTR_BIT(MCF5206E_INTR_TIMER_1); - + /* Register the driver exit procedure so we can shutdown */ atexit(Clock_exit); } @@ -166,10 +166,10 @@ Clock_initialize(rtems_device_major_number major, void *pargp) { Install_clock (Clock_isr); - + /* Make major/minor avail to others such as shared memory driver */ rtems_clock_major = major; rtems_clock_minor = minor; - + return RTEMS_SUCCESSFUL; } |