summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386
diff options
context:
space:
mode:
authorEric Norum <WENorum@lbl.gov>2004-10-11 15:00:23 +0000
committerEric Norum <WENorum@lbl.gov>2004-10-11 15:00:23 +0000
commit29322a8d3df22392135993e7feeab1dd6f847e85 (patch)
tree8e1578e2d571ae4123d87384d03baf912d625ac9 /c/src/lib/libbsp/i386
parent2004-10-11 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-29322a8d3df22392135993e7feeab1dd6f847e85.tar.bz2
Add libchip driver for Motorola MC146818A time-of-day clock chip.
Modify i386/pc386 BSP to use this driver.
Diffstat (limited to 'c/src/lib/libbsp/i386')
-rw-r--r--c/src/lib/libbsp/i386/pc386/Makefile.am2
-rw-r--r--c/src/lib/libbsp/i386/pc386/clock/todcfg.c36
2 files changed, 37 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am b/c/src/lib/libbsp/i386/pc386/Makefile.am
index cac06eef15..f25452f4c8 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -50,7 +50,7 @@ dist_project_lib_DATA += startup/linkcmds
EXTRA_PROGRAMS += clock.rel
CLEANFILES += clock.rel
-clock_rel_SOURCES = clock/ckinit.c clock/rtc.c
+clock_rel_SOURCES = clock/ckinit.c clock/todcfg.c ../../shared/tod.c
clock_rel_CPPFLAGS = $(AM_CPPFLAGS) $(CFLAGS_OPTIMIZE_V)
clock_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
diff --git a/c/src/lib/libbsp/i386/pc386/clock/todcfg.c b/c/src/lib/libbsp/i386/pc386/clock/todcfg.c
new file mode 100644
index 0000000000..abff495f24
--- /dev/null
+++ b/c/src/lib/libbsp/i386/pc386/clock/todcfg.c
@@ -0,0 +1,36 @@
+/*
+ * This file contains the RTC driver table for Motorola shared BSPs.
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <libchip/rtc.h>
+#include <libchip/mc146818a.h>
+
+/* The following table configures the RTC drivers used in this BSP */
+rtc_tbl RTC_Table[] = {
+ {
+ "/dev/rtc", /* sDeviceName */
+ RTC_MC146818A, /* deviceType */
+ &mc146818a_fns, /* pDeviceFns */
+ rtc_probe, /* deviceProbe */
+ NULL, /* pDeviceParams */
+ 0x70, /* ulCtrlPort1 */
+ 0x00, /* ulDataPort */
+ mc146818a_get_register, /* getRegister */
+ mc146818a_set_register /* setRegister */
+ }
+};
+
+/* Some information used by the RTC driver */
+
+#define NUM_RTCS (sizeof(RTC_Table)/sizeof(rtc_tbl))
+
+unsigned long RTC_Count = NUM_RTCS;
+
+rtems_device_minor_number RTC_Minor;