Changeset 023f1dd9 in rtems for c/src/lib/libcpu/m68k/mcf5272
- Timestamp:
- 11/30/09 05:27:08 (14 years ago)
- Branches:
- 4.10, 4.11, 5, master
- Children:
- 6452809
- Parents:
- 359e537
- Location:
- c/src/lib/libcpu/m68k/mcf5272
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/m68k/mcf5272/clock/ckinit.c
r359e537 r023f1dd9 2 2 * Clock Driver for MCF5272 CPU 3 3 * 4 * This driver initailizes timer1 on the MCF5272 as the 5 * main system clock 4 * This driver initailizes timer1 on the MCF5272 as the 5 * main system clock 6 6 * 7 7 * Copyright 2004 Cogent Computer Systems … … 41 41 * These are set by clock driver during its init 42 42 */ 43 43 44 44 rtems_device_major_number rtems_clock_major = ~0; 45 45 rtems_device_minor_number rtems_clock_minor; … … 53 53 * PARAMETERS: 54 54 * vector - timer interrupt vector number 55 55 56 56 * RETURNS: 57 57 * none … … 92 92 icr |= (MCF5272_ICR1_TMR1_IPL(0) | MCF5272_ICR1_TMR1_PI); 93 93 g_intctrl_regs->icr1 = icr; 94 94 95 95 /* reset timer1 */ 96 96 g_timer_regs->tmr1 = MCF5272_TMR_CLK_STOP; 97 97 98 98 /* clear pending */ 99 99 g_timer_regs->ter1 = MCF5272_TER_REF | MCF5272_TER_CAP; … … 118 118 Clock_driver_ticks = 0; 119 119 if (rtems_configuration_get_ticks_per_timeslice()) { 120 120 121 121 /* Register the interrupt handler */ 122 122 set_vector(clock_isr, BSP_INTVEC_TMR1, 1); 123 123 124 124 /* Reset timer 1 */ 125 125 g_timer_regs->tmr1 = MCF5272_TMR_RST; … … 128 128 g_timer_regs->tcn1 = 0; /* reset counter */ 129 129 g_timer_regs->ter1 = MCF5272_TER_REF | MCF5272_TER_CAP; 130 130 131 131 /* Set Timer 1 prescaler so that it counts in microseconds */ 132 132 g_timer_regs->tmr1 = ( … … 138 138 MCF5272_TMR_RST)); 139 139 140 /* Set the timer timeout value from the BSP config */ 140 /* Set the timer timeout value from the BSP config */ 141 141 g_timer_regs->trr1 = rtems_configuration_get_microseconds_per_tick() - 1; 142 142 143 143 /* Feed system frequency to the timer */ 144 144 g_timer_regs->tmr1 |= MCF5272_TMR_CLK_MSTR; 145 145 146 146 /* Configure timer1 interrupts */ 147 147 icr = g_intctrl_regs->icr1; … … 175 175 { 176 176 Install_clock (Clock_isr); 177 177 178 178 /* Make major/minor avail to others such as shared memory driver */ 179 179 rtems_clock_major = major; 180 180 rtems_clock_minor = minor; 181 181 182 182 return RTEMS_SUCCESSFUL; 183 183 } -
c/src/lib/libcpu/m68k/mcf5272/include/mcf5272.h
r359e537 r023f1dd9 282 282 volatile uint16_t pbdat; 283 283 284 volatile uint16_t pcddr; 284 volatile uint16_t pcddr; 285 285 volatile uint16_t _res4; 286 286 … … 322 322 typedef struct { 323 323 volatile uint32_t dcmr; 324 324 325 325 volatile uint16_t _res0; 326 326 volatile uint16_t dcir; … … 587 587 volatile uint16_t _res3; 588 588 volatile uint16_t rfmmr; 589 volatile uint8_t _res4[3]; 589 volatile uint8_t _res4[3]; 590 590 volatile uint8_t far; 591 591 volatile uint32_t asr; 592 592 volatile uint32_t drr1; 593 593 volatile uint32_t drr2; 594 volatile uint16_t _res5; 594 volatile uint16_t _res5; 595 595 volatile uint16_t specr; 596 596 volatile uint16_t _res6; -
c/src/lib/libcpu/m68k/mcf5272/timer/timer.c
r359e537 r023f1dd9 19 19 * 20 20 * http://www.rtems.com/license/LICENSE. 21 * 21 * 22 22 * timer.c,v 1.1 2001/10/26 19:32:40 joel Exp 23 23 */ … … 27 27 #include <mcf5272/mcf5272.h> 28 28 29 #define TRR2_VAL 65530 29 #define TRR2_VAL 65530 30 30 31 31 uint32_t Timer_interrupts; … … 52 52 /* Catch timer2 interrupts */ 53 53 set_vector(timerisr, BSP_INTVEC_TMR2, 0); 54 54 55 55 /* Reset Timer */ 56 56 g_timer_regs->tmr2 = MCF5272_TMR_RST; … … 117 117 */ 118 118 clicks = g_timer_regs->tcn2; 119 119 120 120 /* Stop Timer... */ 121 121 g_timer_regs->tmr2 = MCF5272_TMR_CLK_STOP | MCF5272_TMR_RST; 122 122 123 123 /* 124 * Total is calculated by taking into account the number of timer 124 * Total is calculated by taking into account the number of timer 125 125 * overflow interrupts since the timer was initialized and clicks 126 126 * since the last interrupts. -
c/src/lib/libcpu/m68k/mcf5272/timer/timerisr.S
r359e537 r023f1dd9 28 28 * 29 29 * http://www.rtems.com/license/LICENSE. 30 * 30 * 31 31 * timerisr.S,v 1.1 2001/10/26 19:32:40 joel Exp 32 32 */
Note: See TracChangeset
for help on using the changeset viewer.