Changeset d1347a37 in rtems
- Timestamp:
- 10/12/14 15:06:05 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 7bddaa3c
- Parents:
- 8a442b5
- git-author:
- Joel Sherrill <joel.sherrill@…> (10/12/14 15:06:05)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (10/13/14 15:33:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/m68k/idp/clock/ckinit.c
r8a442b5 rd1347a37 1 /* Clock_init() 2 * 3 * 1 /* 4 2 * This is modified by Doug McBride to get it to work for the MC68EC040 5 3 * IDP board. The below comments are kept to show that some prior work … … 9 7 * This routine initializes the mc68230 on the MC68EC040 board. 10 8 * The tick frequency is 40 milliseconds. 11 * 12 * Input parameters: NONE 13 * 14 * Output parameters: NONE 15 * 9 */ 10 11 /* 16 12 * COPYRIGHT (c) 1989-1999. 17 13 * On-Line Applications Research Corporation (OAR). … … 39 35 40 36 /* 41 * These are set by clock driver during its init42 */43 44 rtems_device_major_number rtems_clock_major = ~0;45 rtems_device_minor_number rtems_clock_minor;46 47 /*48 37 * ISR Handler 49 38 * … … 52 41 * MC68230, 2^5 is the prescaler factor, and 1ms is the common interrupt 53 42 * interval for the Clock_isr routine. 43 * 54 44 * Therefore, 203 (decimal) is the number to program into the CPRH-L registers 55 45 * of the MC68230 for countdown. However, I have found that 193 instead of … … 57 47 * than that 58 48 */ 59 60 rtems_isr Clock_isr( 49 static rtems_isr Clock_isr( 61 50 rtems_vector_number vector 62 51 ) … … 64 53 Clock_driver_ticks += 1; 65 54 /* acknowledge interrupt 66 55 MC68230_TSR = 1; */ 67 56 MC68230_WRITE (MC68230_TSR, 1); 68 57 69 58 if ( Clock_isrs == 1 ) { 70 59 rtems_clock_tick(); 71 72 73 74 60 /* Cast to an integer so that 68EC040 IDP which doesn't have an FPU doesn't 61 have a heart attack -- if you use newlib1.6 or greater and get 62 libgcc.a for gcc with software floating point support, this is not 63 a problem */ 75 64 Clock_isrs = 76 65 (int)(rtems_configuration_get_microseconds_per_tick() / 1000); … … 82 71 void Disable_clock(void) 83 72 { 84 85 73 /* Disable timer */ 74 MC68230_WRITE (MC68230_TCR, 0x00); 86 75 } 87 76 88 void Install_clock(77 static void Install_clock( 89 78 rtems_isr_entry clock_isr ) 90 79 { … … 105 94 106 95 /* Set CPRH through CPRL to 193 (not 203) decimal for countdown--see ckisr.c 107 108 109 96 CPRH = 0x00; 97 CPRM = 0x00; 98 CPRL = 0xC1; */ 110 99 MC68230_WRITE (MC68230_CPRH, 0x00); 111 100 MC68230_WRITE (MC68230_CPRM, 0x00); … … 113 102 114 103 /* Enable timer and use it as an external periodic interrupt generator 115 104 MC68230_TCR = 0xA1; */ 116 105 /* led_putnum('a'); * for debugging purposes */ 117 106 MC68230_WRITE (MC68230_TCR, 0xA1); … … 129 118 130 119 /* disable timer 131 132 120 data = TCR; 121 TCR = (data & 0xFE); */ 133 122 MC68230_READ (MC68230_TCR, data); 134 123 MC68230_WRITE (MC68230_TCR, (data & 0xFE)); … … 145 134 Install_clock( Clock_isr ); 146 135 147 /*148 * make major/minor avail to others such as shared memory driver149 */150 151 rtems_clock_major = major;152 rtems_clock_minor = minor;153 154 136 return RTEMS_SUCCESSFUL; 155 137 }
Note: See TracChangeset
for help on using the changeset viewer.