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

5
Last change on this file since cc1add7b was cc1add7b, checked in by Sebastian Huber <sebastian.huber@…>, on 03/03/16 at 08:49:15

bsps: Delete empty Clock_driver_support_at_tick()

  • 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.org/license/LICENSE.
16 */
17
18#include <rtems.h>
19#include <bsp/irq.h>
20#include <bsp.h>
21
22#define CLOCK_DRIVER_USE_FAST_IDLE 1
23
24#define CLOCK_VECTOR TX3904_IRQ_TMR0
25
26/*
27 *  5000 clicks per tick ISR is HIGHLY arbitrary
28 */
29
30#define CLICKS 5000
31
32#define Clock_driver_support_install_isr( _new, _old ) \
33  do { \
34    rtems_interrupt_handler_install( \
35      CLOCK_VECTOR, \
36      "clock", \
37      0, \
38      _new, \
39      NULL \
40    ); \
41 } while(0)
42
43#define Clock_driver_support_initialize_hardware() \
44  do { \
45    uint32_t   _clicks = CLICKS; \
46    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
47    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
48    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
49    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
50    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR,   0xC0 ); \
51    *((volatile uint32_t*) 0xFFFFC01C) = 0x00000700; \
52  } while(0)
53
54#define Clock_driver_support_shutdown_hardware()
55
56#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
57
58#include "../../../shared/clockdrv_shell.h"
Note: See TracBrowser for help on using the repository browser.