Index: c/src/lib/libchip/rtc/Makefile.in
===================================================================
--- c/src/lib/libchip/rtc/Makefile.in	(revision 009c235613d021b64bfb44005ebb263bd9c48e1b)
+++ c/src/lib/libchip/rtc/Makefile.in	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -13,9 +13,11 @@
 
 C_PIECES=\
+  rtcprobe m48t08
 
 C_FILES=$(C_PIECES:%=%.c)
 C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
 
-INSTALLED_H_FILES=$(srcdir)/rtc.h
+INSTALLED_H_FILES=$(srcdir)/rtc.h $(srcdir)/m48t08.h
+
 SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
 OBJS=$(C_O_FILES)
Index: c/src/lib/libchip/rtc/m48t08.c
===================================================================
--- c/src/lib/libchip/rtc/m48t08.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
+++ c/src/lib/libchip/rtc/m48t08.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -0,0 +1,152 @@
+/*
+ *  This file interfaces with the real-time clock found in 
+ *  a Mostek M48T08 or M48T18 or compatibles.
+ *
+ *  Year 2K Notes:
+ *
+ *  This chip only uses a two digit field to store the year.  This
+ *  code uses the RTEMS Epoch as a pivot year.  This lets us map the
+ *  two digit year field as follows:
+ *
+ *    + two digit years 0-87 are mapped to 2000-2087.
+ *    + two digit years 88-99 are mapped to 1988-1999.
+ *
+ *  This is less than the time span supported by RTEMS.
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  Copyright assigned to U.S. Government, 1994.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.OARcorp.com/rtems/license.html.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <libchip/rtc.h>
+#include <libchip/m48t08.h>
+
+/*
+ *  Control register bits
+ */
+
+#define MK48T08_CONTROL_WRITE  0x80
+#define MK48T08_CONTROL_READ   0x40
+#define MK48T08_CONTROL_SIGN   0x20
+
+/*
+ *  m48t08_initialize
+ */
+
+void m48t08_initialize(
+  int minor
+)
+{
+}
+
+/*
+ *  m48t08_get_time
+ */
+
+#define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F))
+#define To_BCD( _x )   ((((_x) / 10) << 4) + ((_x) % 10))
+
+int m48t08_get_time(
+  int                minor,
+  rtems_time_of_day *time
+)
+{
+  unsigned32     m48t08;
+  getRegister_f  getReg;
+  setRegister_f  setReg;
+  unsigned8      controlReg;
+  unsigned32     value1;
+  unsigned32     value2;
+
+  m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
+  getReg = RTC_Port_Tbl[ minor ].getRegister;
+  setReg = RTC_Port_Tbl[ minor ].setRegister;
+
+  /*
+   *  Put the RTC into read mode
+   */
+
+  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_READ );
+  
+  value1 = (*getReg)( m48t08, M48T08_YEAR );
+  value2 = From_BCD( value1 );
+  if ( value2 < 88 )
+    time->year = 2000 + value2;
+  else
+    time->year = 1900 + value2;
+
+  value1 = (*getReg)( m48t08, M48T08_MONTH );
+  time->month = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_DATE );
+  time->day = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_HOUR );
+  time->hour = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_MINUTE );
+  time->minute = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_SECOND );
+  time->second = From_BCD( value1 );
+  
+  /*
+   *  Put the RTC back into normal mode.
+   */
+
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg );
+
+  return 0;
+}
+
+/*
+ *  m48t08_set_time
+ */
+
+int m48t08_set_time(
+  int                minor,
+  rtems_time_of_day *time
+)
+{
+  unsigned32     m48t08;
+  getRegister_f  getReg;
+  setRegister_f  setReg;
+  unsigned8      controlReg;
+
+  m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
+  getReg = RTC_Port_Tbl[ minor ].getRegister;
+  setReg = RTC_Port_Tbl[ minor ].setRegister;
+
+  /*
+   *  Put the RTC into read mode
+   */
+
+  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_WRITE );
+  
+  if ( time->year >= 2088 )
+    rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
+
+  (*setReg)( m48t08, M48T08_YEAR,    To_BCD(time->year % 100) );
+  (*setReg)( m48t08, M48T08_MONTH,   To_BCD(time->month) );
+  (*setReg)( m48t08, M48T08_DATE,    To_BCD(time->day) );
+  (*setReg)( m48t08, M48T08_HOUR,    To_BCD(time->hour) );
+  (*setReg)( m48t08, M48T08_MINUTE,  To_BCD(time->minute) );
+  (*setReg)( m48t08, M48T08_SECOND,  To_BCD(time->second) );
+ 
+  /*
+   *  Put the RTC back into normal mode.
+   */
+
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg );
+
+  return 0;
+}
Index: c/src/lib/libchip/rtc/m48t08.h
===================================================================
--- c/src/lib/libchip/rtc/m48t08.h	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
+++ c/src/lib/libchip/rtc/m48t08.h	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -0,0 +1,36 @@
+/*
+ *  This file contains the definitions for the following real-time clocks:
+ *
+ *    + Mostek M48T08
+ *    + Mostek M48T18 
+ *    + Dallas Semiconductor DS1643
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  Copyright assigned to U.S. Government, 1994.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.OARcorp.com/rtems/license.html.
+ *
+ *  $Id$
+ */
+
+#ifndef __LIBCHIP_M48T08_h
+#define __LIBCHIP_M48T08_h
+
+/*
+ *  Register indices
+ */
+
+#define M48T08_CONTROL     0
+#define M48T08_SECOND      1
+#define M48T08_MINUTE      2
+#define M48T08_HOUR        3
+#define M48T08_DAY_OF_WEEK 4
+#define M48T08_DATE        5
+#define M48T08_MONTH       6
+#define M48T08_YEAR        7
+ 
+#endif
+/* end of include file */
Index: c/src/lib/libchip/rtc/rtc.h
===================================================================
--- c/src/lib/libchip/rtc/rtc.h	(revision 009c235613d021b64bfb44005ebb263bd9c48e1b)
+++ c/src/lib/libchip/rtc/rtc.h	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -21,9 +21,7 @@
  */
 
-typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
-typedef void      (*setRegister_f)(
-                            unsigned32 port, unsigned8 reg, unsigned8 value);
-typedef unsigned8 (*getData_f)(unsigned32 port);
-typedef void      (*setData_f)(unsigned32 port, unsigned8 value);
+typedef unsigned32 (*getRegister_f)(unsigned32 port, unsigned8 register);
+typedef void       (*setRegister_f)(
+                            unsigned32 port, unsigned8 reg, unsigned32 value);
 
 typedef struct _rtc_fns {
@@ -80,4 +78,7 @@
 extern unsigned long  RTC_Port_Count;
 
+
+boolean rtc_probe( int minor );
+
 #endif
 /* end of include file */
Index: c/src/lib/libchip/rtc/rtcprobe.c
===================================================================
--- c/src/lib/libchip/rtc/rtcprobe.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
+++ c/src/lib/libchip/rtc/rtcprobe.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -0,0 +1,24 @@
+/*
+ *  This file contains the default Real-Time Clock probe routine.
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  Copyright assigned to U.S. Government, 1994.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.OARcorp.com/rtems/license.html.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <libchip/rtc.h>
+
+
+boolean rtc_probe(
+  int minor
+)
+{
+  return TRUE;
+}
Index: c/src/libchip/rtc/Makefile.in
===================================================================
--- c/src/libchip/rtc/Makefile.in	(revision 009c235613d021b64bfb44005ebb263bd9c48e1b)
+++ c/src/libchip/rtc/Makefile.in	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -13,9 +13,11 @@
 
 C_PIECES=\
+  rtcprobe m48t08
 
 C_FILES=$(C_PIECES:%=%.c)
 C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
 
-INSTALLED_H_FILES=$(srcdir)/rtc.h
+INSTALLED_H_FILES=$(srcdir)/rtc.h $(srcdir)/m48t08.h
+
 SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES)
 OBJS=$(C_O_FILES)
Index: c/src/libchip/rtc/m48t08.c
===================================================================
--- c/src/libchip/rtc/m48t08.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
+++ c/src/libchip/rtc/m48t08.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -0,0 +1,152 @@
+/*
+ *  This file interfaces with the real-time clock found in 
+ *  a Mostek M48T08 or M48T18 or compatibles.
+ *
+ *  Year 2K Notes:
+ *
+ *  This chip only uses a two digit field to store the year.  This
+ *  code uses the RTEMS Epoch as a pivot year.  This lets us map the
+ *  two digit year field as follows:
+ *
+ *    + two digit years 0-87 are mapped to 2000-2087.
+ *    + two digit years 88-99 are mapped to 1988-1999.
+ *
+ *  This is less than the time span supported by RTEMS.
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  Copyright assigned to U.S. Government, 1994.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.OARcorp.com/rtems/license.html.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <libchip/rtc.h>
+#include <libchip/m48t08.h>
+
+/*
+ *  Control register bits
+ */
+
+#define MK48T08_CONTROL_WRITE  0x80
+#define MK48T08_CONTROL_READ   0x40
+#define MK48T08_CONTROL_SIGN   0x20
+
+/*
+ *  m48t08_initialize
+ */
+
+void m48t08_initialize(
+  int minor
+)
+{
+}
+
+/*
+ *  m48t08_get_time
+ */
+
+#define From_BCD( _x ) ((((_x) >> 4) * 10) + ((_x) & 0x0F))
+#define To_BCD( _x )   ((((_x) / 10) << 4) + ((_x) % 10))
+
+int m48t08_get_time(
+  int                minor,
+  rtems_time_of_day *time
+)
+{
+  unsigned32     m48t08;
+  getRegister_f  getReg;
+  setRegister_f  setReg;
+  unsigned8      controlReg;
+  unsigned32     value1;
+  unsigned32     value2;
+
+  m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
+  getReg = RTC_Port_Tbl[ minor ].getRegister;
+  setReg = RTC_Port_Tbl[ minor ].setRegister;
+
+  /*
+   *  Put the RTC into read mode
+   */
+
+  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_READ );
+  
+  value1 = (*getReg)( m48t08, M48T08_YEAR );
+  value2 = From_BCD( value1 );
+  if ( value2 < 88 )
+    time->year = 2000 + value2;
+  else
+    time->year = 1900 + value2;
+
+  value1 = (*getReg)( m48t08, M48T08_MONTH );
+  time->month = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_DATE );
+  time->day = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_HOUR );
+  time->hour = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_MINUTE );
+  time->minute = From_BCD( value1 );
+
+  value1 = (*getReg)( m48t08, M48T08_SECOND );
+  time->second = From_BCD( value1 );
+  
+  /*
+   *  Put the RTC back into normal mode.
+   */
+
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg );
+
+  return 0;
+}
+
+/*
+ *  m48t08_set_time
+ */
+
+int m48t08_set_time(
+  int                minor,
+  rtems_time_of_day *time
+)
+{
+  unsigned32     m48t08;
+  getRegister_f  getReg;
+  setRegister_f  setReg;
+  unsigned8      controlReg;
+
+  m48t08 = RTC_Port_Tbl[ minor ].ulCtrlPort1;
+  getReg = RTC_Port_Tbl[ minor ].getRegister;
+  setReg = RTC_Port_Tbl[ minor ].setRegister;
+
+  /*
+   *  Put the RTC into read mode
+   */
+
+  controlReg = (*getReg)( m48t08, M48T08_CONTROL );
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg | MK48T08_CONTROL_WRITE );
+  
+  if ( time->year >= 2088 )
+    rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
+
+  (*setReg)( m48t08, M48T08_YEAR,    To_BCD(time->year % 100) );
+  (*setReg)( m48t08, M48T08_MONTH,   To_BCD(time->month) );
+  (*setReg)( m48t08, M48T08_DATE,    To_BCD(time->day) );
+  (*setReg)( m48t08, M48T08_HOUR,    To_BCD(time->hour) );
+  (*setReg)( m48t08, M48T08_MINUTE,  To_BCD(time->minute) );
+  (*setReg)( m48t08, M48T08_SECOND,  To_BCD(time->second) );
+ 
+  /*
+   *  Put the RTC back into normal mode.
+   */
+
+  (*setReg)( m48t08, M48T08_CONTROL, controlReg );
+
+  return 0;
+}
Index: c/src/libchip/rtc/m48t08.h
===================================================================
--- c/src/libchip/rtc/m48t08.h	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
+++ c/src/libchip/rtc/m48t08.h	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -0,0 +1,36 @@
+/*
+ *  This file contains the definitions for the following real-time clocks:
+ *
+ *    + Mostek M48T08
+ *    + Mostek M48T18 
+ *    + Dallas Semiconductor DS1643
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  Copyright assigned to U.S. Government, 1994.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.OARcorp.com/rtems/license.html.
+ *
+ *  $Id$
+ */
+
+#ifndef __LIBCHIP_M48T08_h
+#define __LIBCHIP_M48T08_h
+
+/*
+ *  Register indices
+ */
+
+#define M48T08_CONTROL     0
+#define M48T08_SECOND      1
+#define M48T08_MINUTE      2
+#define M48T08_HOUR        3
+#define M48T08_DAY_OF_WEEK 4
+#define M48T08_DATE        5
+#define M48T08_MONTH       6
+#define M48T08_YEAR        7
+ 
+#endif
+/* end of include file */
Index: c/src/libchip/rtc/rtc.h
===================================================================
--- c/src/libchip/rtc/rtc.h	(revision 009c235613d021b64bfb44005ebb263bd9c48e1b)
+++ c/src/libchip/rtc/rtc.h	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -21,9 +21,7 @@
  */
 
-typedef unsigned8 (*getRegister_f)(unsigned32 port, unsigned8 register);
-typedef void      (*setRegister_f)(
-                            unsigned32 port, unsigned8 reg, unsigned8 value);
-typedef unsigned8 (*getData_f)(unsigned32 port);
-typedef void      (*setData_f)(unsigned32 port, unsigned8 value);
+typedef unsigned32 (*getRegister_f)(unsigned32 port, unsigned8 register);
+typedef void       (*setRegister_f)(
+                            unsigned32 port, unsigned8 reg, unsigned32 value);
 
 typedef struct _rtc_fns {
@@ -80,4 +78,7 @@
 extern unsigned long  RTC_Port_Count;
 
+
+boolean rtc_probe( int minor );
+
 #endif
 /* end of include file */
Index: c/src/libchip/rtc/rtcprobe.c
===================================================================
--- c/src/libchip/rtc/rtcprobe.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
+++ c/src/libchip/rtc/rtcprobe.c	(revision a1f514f197932b3e5fcb5e32a197ce1df836576a)
@@ -0,0 +1,24 @@
+/*
+ *  This file contains the default Real-Time Clock probe routine.
+ *
+ *  COPYRIGHT (c) 1989-1998.
+ *  On-Line Applications Research Corporation (OAR).
+ *  Copyright assigned to U.S. Government, 1994.
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.OARcorp.com/rtems/license.html.
+ *
+ *  $Id$
+ */
+
+#include <rtems.h>
+#include <libchip/rtc.h>
+
+
+boolean rtc_probe(
+  int minor
+)
+{
+  return TRUE;
+}
