1*02222606SBen Gras /* $NetBSD: rtc.h,v 1.2 2009/03/14 14:45:55 dsl Exp $ */ 2*02222606SBen Gras 3*02222606SBen Gras /* 4*02222606SBen Gras * Copyright (c) 1994 Mark Brinicombe. 5*02222606SBen Gras * Copyright (c) 1994 Brini. 6*02222606SBen Gras * All rights reserved. 7*02222606SBen Gras * 8*02222606SBen Gras * This code is derived from software written for Brini by Mark Brinicombe 9*02222606SBen Gras * 10*02222606SBen Gras * Redistribution and use in source and binary forms, with or without 11*02222606SBen Gras * modification, are permitted provided that the following conditions 12*02222606SBen Gras * are met: 13*02222606SBen Gras * 1. Redistributions of source code must retain the above copyright 14*02222606SBen Gras * notice, this list of conditions and the following disclaimer. 15*02222606SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 16*02222606SBen Gras * notice, this list of conditions and the following disclaimer in the 17*02222606SBen Gras * documentation and/or other materials provided with the distribution. 18*02222606SBen Gras * 3. All advertising materials mentioning features or use of this software 19*02222606SBen Gras * must display the following acknowledgement: 20*02222606SBen Gras * This product includes software developed by Brini. 21*02222606SBen Gras * 4. The name of the company nor the name of the author may be used to 22*02222606SBen Gras * endorse or promote products derived from this software without specific 23*02222606SBen Gras * prior written permission. 24*02222606SBen Gras * 25*02222606SBen Gras * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED 26*02222606SBen Gras * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 27*02222606SBen Gras * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 28*02222606SBen Gras * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 29*02222606SBen Gras * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30*02222606SBen Gras * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31*02222606SBen Gras * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32*02222606SBen Gras * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33*02222606SBen Gras * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34*02222606SBen Gras * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35*02222606SBen Gras * SUCH DAMAGE. 36*02222606SBen Gras * 37*02222606SBen Gras * RiscBSD kernel project 38*02222606SBen Gras * 39*02222606SBen Gras * rtc.h 40*02222606SBen Gras * 41*02222606SBen Gras * Header file for RTC / CMOS stuff 42*02222606SBen Gras * 43*02222606SBen Gras * Created : 13/10/94 44*02222606SBen Gras * Updated : 15/07/2000 45*02222606SBen Gras * 46*02222606SBen Gras * Based of kate/display/iiccontrol.c 47*02222606SBen Gras */ 48*02222606SBen Gras 49*02222606SBen Gras /* 50*02222606SBen Gras * IIC addresses for RTC chip 51*02222606SBen Gras * Two PCF8583 chips are supported on the IIC bus 52*02222606SBen Gras */ 53*02222606SBen Gras 54*02222606SBen Gras #define IIC_PCF8583_MASK 0xfc 55*02222606SBen Gras #define IIC_PCF8583_ADDR 0xa0 56*02222606SBen Gras 57*02222606SBen Gras #define RTC_Write (IIC_PCF8583_ADDR | IIC_WRITE) 58*02222606SBen Gras #define RTC_Read (IIC_PCF8583_ADDR | IIC_READ) 59*02222606SBen Gras 60*02222606SBen Gras typedef struct { 61*02222606SBen Gras u_char rtc_micro; 62*02222606SBen Gras u_char rtc_centi; 63*02222606SBen Gras u_char rtc_sec; 64*02222606SBen Gras u_char rtc_min; 65*02222606SBen Gras u_char rtc_hour; 66*02222606SBen Gras u_char rtc_day; 67*02222606SBen Gras u_char rtc_mon; 68*02222606SBen Gras u_char rtc_year; 69*02222606SBen Gras u_char rtc_cen; 70*02222606SBen Gras } rtc_t; 71*02222606SBen Gras 72*02222606SBen Gras #define RTC_ADDR_CHECKSUM 0x3f 73*02222606SBen Gras #define RTC_ADDR_BOOTOPTS 0x90 74*02222606SBen Gras #define RTC_ADDR_REBOOTCNT 0x91 75*02222606SBen Gras #define RTC_ADDR_YEAR 0xc0 76*02222606SBen Gras #define RTC_ADDR_CENT 0xc1 77*02222606SBen Gras 78*02222606SBen Gras #ifdef _KERNEL 79*02222606SBen Gras int cmos_read(int); 80*02222606SBen Gras int cmos_write(int, int); 81*02222606SBen Gras #endif /* _KERNEL */ 82*02222606SBen Gras 83*02222606SBen Gras /* End of rtc.h */ 84