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

Last change on this file since f3b29236 was f3b29236, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 18, 2017 at 6:22:38 AM

bsps: Clock_driver_support_install_isr()

Remove old ISR parameter since is not used by the clock driver shell.
Make an implementation optional.

Update #3139.

  • 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 ) \
33  rtems_interrupt_handler_install( CLOCK_VECTOR, "clock", 0, _new, NULL )
34
35#define Clock_driver_support_initialize_hardware() \
36  do { \
37    uint32_t   _clicks = CLICKS; \
38    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CCDR, 0x3 ); \
39    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_CPRA, _clicks ); \
40    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TISR, 0x00 ); \
41    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_ITMR, 0x8001 ); \
42    TX3904_TIMER_WRITE( TX3904_TIMER0_BASE, TX3904_TIMER_TCR,   0xC0 ); \
43    *((volatile uint32_t*) 0xFFFFC01C) = 0x00000700; \
44  } while(0)
45
46#define Clock_driver_support_shutdown_hardware()
47
48#define CLOCK_DRIVER_USE_DUMMY_TIMECOUNTER
49
50#include "../../../shared/clockdrv_shell.h"
Note: See TracBrowser for help on using the repository browser.