OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [powerpc/] [dmv177/] [tod/] [todcfg.c] - Blame information for rev 389

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*
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: todcfg.c,v 1.2 2001-09-27 12:00:35 chris Exp $
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
 
34
boolean dmv177_icm7170_probe(int minor);
35
 
36
rtc_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
                NULL,                           /* 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
 
56
unsigned long  RTC_Count = NUM_RTCS;
57
 
58
rtems_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
 
65
boolean 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.