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

Last change on this file since 63defa58 was 63defa58, checked in by Jennifer Averett <jennifer.averett@…>, on 04/04/12 at 13:39:46

PR 1993 - Convert MIPS to PIC IRQ model

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 *  @file
3 * 
4 *  Instantiate the clock driver shell.
5 *
6 *  The TX3904 simulator in gdb counts instructions.
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2012.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#include <rtems.h>
21#include <bsp/irq.h>
22#include <bsp.h>
23
24#define CLOCK_DRIVER_USE_FAST_IDLE
25
26#define CLOCK_VECTOR TX3904_IRQ_TMR0
27
28/*
29 *  5000 clicks per tick ISR is HIGHLY arbitrary
30 */
31
32#define CLICKS 5000
33
34#define Clock_driver_support_install_isr( _new, _old ) \
35  do { \
36    rtems_interrupt_handler_install( \
37      CLOCK_VECTOR, \
38      "clock", \
39      0, \
40      _new, \
41      NULL \
42    ); \
43 } while(0)
44
45#define Clock_driver_support_initialize_hardware() \
46  do { \
47    uint32_t   _clicks = CLICKS; \
48    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
49    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
50    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
51    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
52    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR,   0xC0 ); \
53    *((volatile uint32_t*) 0xFFFFC01C) = 0x00000700; \
54  } while(0)
55
56#define Clock_driver_support_at_tick()
57
58#define Clock_driver_support_shutdown_hardware()
59
60#include "../../../shared/clockdrv_shell.h"
Note: See TracBrowser for help on using the repository browser.