From 03f655ca4d47283a1d48d83ceb0be3d1d776ee76 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 28 Apr 2005 17:25:59 +0000 Subject: 2005-04-28 Joel Sherrill * bsp_howto/rtc.t: Rewritten to account for removal of dmv177. --- doc/bsp_howto/rtc.t | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'doc/bsp_howto/rtc.t') diff --git a/doc/bsp_howto/rtc.t b/doc/bsp_howto/rtc.t index 942c57748c..210e3de053 100644 --- a/doc/bsp_howto/rtc.t +++ b/doc/bsp_howto/rtc.t @@ -33,9 +33,49 @@ RTC chip. Each of these README explains how to configure the shared libchip implementation of the RTC driver for that particular RTC chip. -The DY-4 DMV177 BSP uses the shared libchip implementation of the RTC -driver. Its @code{RTC_Table} configuration table can be found in -@code{c/src/lib/libbsp/powerpc/dmv177/tod/config.c}. +The DY-4 DMV177 BSP used the shared libchip implementation of the RTC +driver. There were no DMV177 specific configuration routines. A BSP +could use configuration routines to dynamically determine what type +of real-time clock is on a particular board. This would be useful for +a BSP supporting multiple board models. The relevant ports of +the DMV177's @code{RTC_Table} configuration table is below: + +@example + +#include +#include +#include + +boolean dmv177_icm7170_probe(int minor); + +rtc_tbl RTC_Table[] = { + { "/dev/rtc0", /* sDeviceName */ + RTC_ICM7170, /* deviceType */ + &icm7170_fns, /* pDeviceFns */ + dmv177_icm7170_probe, /* deviceProbe */ + (void *) ICM7170_AT_1_MHZ, /* pDeviceParams */ + DMV170_RTC_ADDRESS, /* ulCtrlPort1 */ + 0, /* ulDataPort */ + icm7170_get_register_8, /* getRegister */ + icm7170_set_register_8, /* setRegister */ + } +}; + +unsigned long RTC_Count = (sizeof(RTC_Table)/sizeof(rtc_tbl)); +rtems_device_minor_number RTC_Minor; + +boolean dmv177_icm7170_probe(int minor) +{ + volatile unsigned16 *card_resource_reg; + + card_resource_reg = (volatile unsigned16 *) DMV170_CARD_RESORCE_REG; + + if ( (*card_resource_reg & DMV170_RTC_INST_MASK) == DMV170_RTC_INSTALLED ) + return TRUE; + return FALSE; +} + +@end example @section Initialization -- cgit v1.2.3