Changeset 479c86dd in rtems
- Timestamp:
- 09/23/98 13:22:43 (25 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 1cf2df40
- Parents:
- 8a496e46
- Location:
- c/src/lib/libbsp/i386/i386ex
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
r8a496e46 r479c86dd 34 34 35 35 rtems_unsigned32 Clock_isrs; /* ISRs until next tick */ 36 static rtems_unsigned32 Clock_initial_isr_value; 36 37 37 38 volatile rtems_unsigned32 Clock_driver_ticks; … … 56 57 if ( Clock_isrs == 1 ) { 57 58 rtems_clock_tick(); 58 Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000;59 Clock_isrs = Clock_initial_isr_value; /* BSP_Configuration.microseconds_per_tick / 1000;*/ 59 60 } 60 61 else … … 64 65 void ClockOff(const rtems_irq_connect_data* unused) 65 66 { 66 /* should do something here */; 67 outport_byte ( TMRCFG , 0x80 ); 67 outport_byte ( TMRCFG , 0x80 ); /* disable the counter timer */ 68 68 } 69 69 70 70 void ClockOn(const rtems_irq_connect_data* unused) 71 71 { 72 outport_byte ( TMRCFG , 0x80 ); 73 74 outport_byte ( TMRCON , 0x34 ); 75 outport_byte ( TMR0 , 0xA8 ); 76 outport_byte ( TMR0 , 0x04 ); 77 78 outport_byte ( TMRCFG , 0x00 ); 72 outport_byte ( TMRCFG , 0x00 ); /* enable the counter timer */ 79 73 } 80 74 … … 96 90 ) 97 91 { 92 unsigned timer_counter_init_value; 93 unsigned char clock_lsb, clock_msb; 94 98 95 Clock_driver_ticks = 0; 99 Clock_isrs = BSP_Configuration.microseconds_per_tick / 1000; 96 97 Clock_isrs = Clock_initial_isr_value = BSP_Configuration.microseconds_per_tick / 1000; /* ticks per clock_isr */ 98 99 /* 100 * configure the counter timer ( should be based on microsecs/tick ) 101 * NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h 102 * when setting the microseconds_per_tick value. 103 */ 104 ClockOff ( &clockIrqData ); 105 106 timer_counter_init_value = BSP_Configuration.microseconds_per_tick / Clock_isrs; 107 clock_lsb = (unsigned char)timer_counter_init_value; 108 clock_msb = timer_counter_init_value >> 8; 109 110 printk("timer_counter_init_value = 0x%x, lsb = 0x%x, msb = 0x%x, Clock_isrs = %d\n",timer_counter_init_value, 111 clock_lsb, clock_msb, Clock_isrs); 112 113 outport_byte ( TMRCON , 0x34 ); 114 outport_byte ( TMR0 , clock_lsb ); /* load LSB first */ 115 outport_byte ( TMR0 , clock_msb ); /* then MSB */ 116 100 117 if (!pc386_install_rtems_irq_handler (&clockIrqData)) { 101 118 printk("Unable to initialize system clock\n"); 102 119 rtems_fatal_error_occurred(1); 103 120 } 121 104 122 /* 105 123 * make major/minor avail to others such as shared memory driver -
c/src/lib/libbsp/i386/i386ex/start/start.s
r8a496e46 r479c86dd 45 45 */ 46 46 47 #define NEXT_GAS 48 47 49 EXTERN (boot_card) /* exits to bspstart */ 48 50 EXTERN (stack_start) /* defined in startup/linkcmds */ … … 150 152 * Initialize clock and power mgmt unit for: 151 153 * Clock Frequency = 50 Mhz 152 * Prescaled clock output = 1.19318 Mhz 153 * ( matches standard PC ) 154 * Prescaled clock output = 1 Mhz 154 155 * Normal halt instructions 155 156 */ … … 157 158 SYM(InitClk): 158 159 SetExRegByte( PWRCON, 0x0 ) 159 SetExRegWord( CLKPRS, 0x1 3)160 SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz. 160 161 161 162 /************************************************************** … … 275 276 276 277 SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB 277 SetExRegByte(TMR0 , 0xA8 ) # LSB = 0B count, followed by MSB 278 SetExRegByte(TMR0 , 0x04 ) # for INT every 50 msec. MSB = 0xE900 279 # for INT every 5 msec. 0x174c 280 # for INT every 1 msec. 0x04A8 281 # was 0xe900 282 278 SetExRegByte(TMR0 , 0x00 ) # sfa 279 SetExRegByte(TMR0 , 0x00 ) # sfa 280 281 283 282 SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc 284 283 SetExRegByte(TMR1 , 0x00 ) # sfa … … 287 286 SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc 288 287 SetExRegByte(TMR2 , 0x00 ) # 289 SetExRegByte(TMR2 , 0x00 ) # 290 SetExRegByte(TMRCFG , 0x80 ) # Enable timers = 0x00 291 288 SetExRegByte(TMR2 , 0x00 ) # 289 290 SetExRegByte(TMRCFG , 0x80 ) # Enable = 0x00 292 291 293 292 /*
Note: See TracChangeset
for help on using the changeset viewer.