source: rtems/c/src/lib/libbsp/mips/jmr3904/clock/clockdrv.c @ 7a677fd7

4.104.114.84.95
Last change on this file since 7a677fd7 was 7a677fd7, checked in by Joel Sherrill <joel.sherrill@…>, on 12/13/00 at 22:16:28

2000-12-13 Joel Sherrill <joel@…>

  • README: Updated. We are now vectoring a clock tick ISR handler. But RTEMS is not returning from the ISR properly.
  • clock/clockdrv.c: Now causes interrupts but has not been calibrated.
  • include/bsp.h: Use <libcpu/tx3904.h>
  • startup/Makefile.am: Add setvec.c from shared.
  • startup/bspstart.c: Initialize the status register (SR) so no interrupts are masked but global interrupts (SR_IEC) are off. Added call to install the ISR prologue code.
  • wrapup/Makefile.am: Pick up more pieces from libcpu.
  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*
2 *  Instantiate the clock driver shell.
3 *
4 *  Since there is no clock source on the simulator, all we do is
5 *  make sure it will build.
6 *
7 *  $Id$
8 */
9
10#include <rtems.h>
11#include <libcpu/tx3904.h>
12
13#define CLOCK_VECTOR TX3904_IRQ_TMR0
14
15#define Clock_driver_support_at_tick()
16
17/* XXX */
18#define CLICKS 10000
19#define Clock_driver_support_install_isr( _new, _old ) \
20  do { \
21    unsigned32 _clicks = CLICKS; \
22    _old = (rtems_isr_entry) set_vector( _new, CLOCK_VECTOR, 1 ); \
23    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
24    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
25    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
26    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
27    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR,   0xC0 ); \
28    *((volatile unsigned32 *) 0xFFFFC01C) = 0x00000700; \
29  } while(0)
30
31
32#define Clock_driver_support_initialize_hardware()
33
34#define Clock_driver_support_shutdown_hardware()
35
36#include "../../../shared/clockdrv_shell.c"
Note: See TracBrowser for help on using the repository browser.