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

4.104.115
Last change on this file since 11978407 was 11978407, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/30/08 at 06:49:04

2008-09-30 Ralf Corsépius <ralf.corsepius@…>

  • clock/clockdrv.c: include "../../../shared/clockdrv_shell.h".
  • Makefile.am: Reflect changes above.
  • 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 *  COPYRIGHT (c) 1989-2006.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#include <rtems.h>
17#include <libcpu/tx3904.h>
18#include <bsp.h>
19
20#define CLOCK_DRIVER_USE_FAST_IDLE
21
22#define CLOCK_VECTOR TX3904_IRQ_TMR0
23
24#define Clock_driver_support_at_tick()
25
26/*
27 *  5000 clicks per tick ISR is HIGHLY arbitrary
28 */
29
30#define CLICKS 5000
31#define Clock_driver_support_install_isr( _new, _old ) \
32  do { \
33    uint32_t   _clicks = CLICKS; \
34    _old = set_vector( _new, CLOCK_VECTOR, 1 ); \
35    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
36    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
37    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
38    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
39    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR,   0xC0 ); \
40    *((volatile uint32_t*) 0xFFFFC01C) = 0x00000700; \
41  } while(0)
42
43#define Clock_driver_support_initialize_hardware()
44
45#define Clock_driver_support_shutdown_hardware()
46
47#include "../../../shared/clockdrv_shell.h"
Note: See TracBrowser for help on using the repository browser.