source: rtems/c/src/lib/libbsp/mips/genmongoosev/clock/clockdrv.c @ f849f3e

4.104.114.84.95
Last change on this file since f849f3e was f849f3e, checked in by Joel Sherrill <joel.sherrill@…>, on 03/14/01 at 17:19:53

2001-02-22 Joel Sherrill <joel@…>

  • The Generic Mongoose-V BSP uses only the peripherals found on the Synova Mongoose-V CPU. This is a radiation hardened CPU based on the LSI Logic 33K.
  • .cvsignore, ChangeLog?, Makefile.am, README, bsp_specs, configure.in, clock/.cvsignore, clock/Makefile.am, clock/clockdrv.c, console/.cvsignore, console/Makefile.am, console/conscfg.c, include/.cvsignore, include/Makefile.am, include/bsp.h, start/.cvsignore, start/Makefile.am, start/regs.S, start/start.S, startup/.cvsignore, startup/Makefile.am, startup/bspstart.c, startup/linkcmds, timer/.cvsignore, timer/Makefile.am, timer/timer.c, wrapup/.cvsignore, wrapup/Makefile.am: New files.
  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  Instantiate the clock driver shell.
3 *
4 *  The tx3904 simulator in gdb counts instructions.
5 *
6 *  $Id$
7 */
8
9#include <rtems.h>
10#include <libcpu/mongoose-v.h>
11#include <bsp.h>
12
13#if defined(USE_TIMER2_FOR_CLOCK)
14#define CLOCK_BASE   MONGOOSEV_TIMER2_BASE
15#define CLOCK_VECTOR MONGOOSEV_IRQ_TIMER2
16#else
17#define CLOCK_BASE   MONGOOSEV_TIMER1_BASE
18#define CLOCK_VECTOR MONGOOSEV_IRQ_TIMER1
19#endif
20
21/* reset Timeout (TO) bit */
22#define Clock_driver_support_at_tick() \
23  MONGOOSEV_WRITE_REGISTER( \
24    CLOCK_BASE, \
25    MONGOOSEV_TIMER_CONTROL_REGISTER, \
26    (MONGOOSEV_TIMER_CONTROL_COUNTER_ENABLE | \
27     MONGOOSEV_TIMER_CONTROL_INTERRUPT_ENABLE) \
28  );
29
30#define Clock_driver_support_install_isr( _new, _old ) \
31  do { \
32    _old = set_vector( _new, CLOCK_VECTOR, 1 ); \
33  } while(0)
34
35
36extern int ClockRate;
37
38#define CLICKS (unsigned32) &ClockRate
39#define Clock_driver_support_initialize_hardware() \
40  do { \
41    unsigned32 _clicks; \
42    _clicks = CLICKS * rtems_configuration_get_microseconds_per_tick(); \
43    MONGOOSEV_WRITE_REGISTER( \
44      CLOCK_BASE, \
45      MONGOOSEV_TIMER_INITIAL_COUNTER_REGISTER, \
46      _clicks \
47    ); \
48    Clock_driver_support_at_tick(); \
49  } while(0)
50
51#define Clock_driver_support_shutdown_hardware() \
52  MONGOOSEV_WRITE_REGISTER( CLOCK_BASE, MONGOOSEV_TIMER_CONTROL_REGISTER, 0 )
53
54#include <clockdrv_shell.c>
Note: See TracBrowser for help on using the repository browser.