summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/m68k/mvme136/timer
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/m68k/mvme136/timer')
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/timer/timer.c85
-rw-r--r--c/src/lib/libbsp/m68k/mvme136/timer/timerisr.S36
2 files changed, 0 insertions, 121 deletions
diff --git a/c/src/lib/libbsp/m68k/mvme136/timer/timer.c b/c/src/lib/libbsp/m68k/mvme136/timer/timer.c
deleted file mode 100644
index a9bf322162..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/timer/timer.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#include <rtems/btimer.h>
-#include <bsp.h>
-#include <rtems/zilog/z8036.h>
-
-#define TIMER 0xfffb0000 /* address of Z8036 on MVME136 */
-
-int Ttimer_val;
-bool benchmark_timer_find_average_overhead;
-
-rtems_isr timerisr(rtems_vector_number);
-
-void benchmark_timer_initialize(void)
-{
- (void) set_vector( timerisr, 66, 0 ); /* install ISR */
-
- Ttimer_val = 0; /* clear timer ISR count */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x01 ); /* reset */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0x00 ); /* clear reset */
- Z8x36_WRITE( TIMER, MASTER_INTR, 0xe2 ); /* disable lower chain, no vec */
- /* set right justified addr */
- /* and master int enable */
- Z8x36_WRITE( TIMER, CT1_MODE_SPEC, 0x80 ); /* T1 continuous, and */
- /* cycle/pulse output */
-
- *((uint16_t*)0xfffb0016) = 0x0000; /* write countdown value */
-/*
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_MSB, 0x00 );
- Z8x36_WRITE( TIMER, CT1_TIME_CONST_LSB, 0x00 );
-*/
- Z8x36_WRITE( TIMER, MASTER_CFG, 0xc4 ); /* enable timer1 */
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xc6 ); /* set INTR enable (IE), */
- /* trigger command */
- /* (TCB) and gate */
- /* command (GCB) bits */
- *((uint8_t*)0xfffb0038) &= 0xfd; /* enable timer INTR on */
- /* VME controller */
-}
-
-#define AVG_OVERHEAD 6 /* It typically takes 3.0 microseconds */
- /* (6 countdowns) to start/stop the timer. */
-#define LEAST_VALID 10 /* Don't trust a value lower than this */
-
-benchmark_timer_t benchmark_timer_read(void)
-{
-/*
- uint8_t msb, lsb;
-*/
- uint32_t remaining, total;
-
- Z8x36_WRITE( TIMER, CT1_CMD_STATUS, 0xce ); /* read the counter value */
-remaining = 0xffff - *((uint16_t*) 0xfffb0010);
-/*
- Z8x36_READ( TIMER, CT1_CUR_CNT_MSB, msb );
- Z8x36_READ( TIMER, CT1_CUR_CNT_LSB, lsb );
-
- remaining = 0xffff - ((msb << 8) + lsb);
-*/
- total = (Ttimer_val * 0x10000) + remaining;
-
- if ( benchmark_timer_find_average_overhead == true )
- return total; /* in one-half microsecond units */
-
- else {
- if ( total < LEAST_VALID )
- return 0; /* below timer resolution */
- return (total-AVG_OVERHEAD) >> 1;
- }
-}
-
-void benchmark_timer_disable_subtracting_average_overhead(
- bool find_flag
-)
-{
- benchmark_timer_find_average_overhead = find_flag;
-}
diff --git a/c/src/lib/libbsp/m68k/mvme136/timer/timerisr.S b/c/src/lib/libbsp/m68k/mvme136/timer/timerisr.S
deleted file mode 100644
index dda8770c36..0000000000
--- a/c/src/lib/libbsp/m68k/mvme136/timer/timerisr.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* timer_isr()
- *
- * This routine provides the ISR for the Z8036 timer on the MVME136
- * board. The timer is set up to generate an interrupt at maximum
- * intervals.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- *
- * COPYRIGHT (c) 1989-1999.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#include <rtems/asm.h>
-
-BEGIN_CODE
-
-.set CT1_CMD_STATUS, 0xfffb000a | port A
-.set RELOAD, 0x24 | clr IP & IUS,allow countdown
-
- PUBLIC (timerisr)
-SYM (timerisr):
- movl a0,a7@- | save a0
- movl #CT1_CMD_STATUS,a0 | a0 = addr of cmd status reg
- movb #RELOAD,a0@ | reload countdown
- addql #1, SYM (Ttimer_val) | increment timer value
- movl a7@+,a0 | save a0
- rte
-
-END_CODE
-END