source: rtems/c/src/lib/libbsp/powerpc/dmv177/tod/todcfg.c @ 52a2cd91

4.104.114.84.95
Last change on this file since 52a2cd91 was 52a2cd91, checked in by Joel Sherrill <joel.sherrill@…>, on 11/01/02 at 21:53:55

2002-11-01 Joel Sherrill <joel@…>

  • startup/genpvec.c, tod/todcfg.c: Removed warnings.
  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  This file contains the RTC driver table for the DY-4 DMV177.
3 *
4 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994, 1997.
5 *  On-Line Applications Research Corporation (OAR).
6 *  All rights assigned to U.S. Government, 1994.
7 *
8 *  $Id$
9 */
10
11#include <bsp.h>
12
13#include <libchip/rtc.h>
14#include <libchip/icm7170.h>
15
16/*
17 * Configuration specific probe routines
18 *
19 * NOTE:  There are no DMV177 specific configuration routines.  These
20 *        routines could be written to dynamically determine what type
21 *        of real-time clock is on this board.  This would be useful for
22 *        a BSP supporting multiple board models.
23 */
24
25/* NONE CURRENTLY PROVIDED */
26
27/*
28 * The following table configures the RTC drivers used in this BSP.
29 *
30 * The first entry which, when probed, is available, will be named /dev/rtc,
31 * all others being given the name indicated.
32 */
33
34boolean dmv177_icm7170_probe(int minor);
35
36rtc_tbl RTC_Table[] = {
37        {
38                "/dev/rtc0",                    /* sDeviceName */
39                RTC_ICM7170,                    /* deviceType */
40                &icm7170_fns,                   /* pDeviceFns */
41                dmv177_icm7170_probe,           /* deviceProbe */
42                (void *) ICM7170_AT_1_MHZ,      /* pDeviceParams */
43                DMV170_RTC_ADDRESS,             /* ulCtrlPort1 */
44                0,                              /* ulDataPort */
45                icm7170_get_register_8,         /* getRegister */
46                icm7170_set_register_8,         /* setRegister */
47        }
48};
49
50/*
51 *  Declare some information used by the RTC driver
52 */
53
54#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl))
55
56unsigned long  RTC_Count = NUM_RTCS;
57
58rtems_device_minor_number  RTC_Minor;
59
60/*
61 *  Hopefully, by checking the card resource register, this BSP
62 *  will be able to operate on the DMV171, DMV176, or DMV177.
63 */
64
65boolean dmv177_icm7170_probe(int minor)
66{
67  volatile unsigned16 *card_resource_reg;
68  unsigned16 v;
69
70  card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG;
71
72  v = *card_resource_reg & DMV170_RTC_INST_MASK;
73
74  if ( v == DMV170_RTC_INSTALLED )
75    return TRUE;
76
77  return FALSE;
78}
79
Note: See TracBrowser for help on using the repository browser.