--- /dev/null Wed Jul 2 13:19:50 2003 +++ arch/evbppc/conf/OPENBLOCKS266 Tue Jul 1 16:26:03 2003 @@ -0,0 +1,215 @@ +# $NetBSD$ +# +# GENERIC -- everything that's currently supported +# + +include "arch/evbppc/conf/std.obs266" + +#options INCLUDE_CONFIG_FILE # embed config file in kernel binary + +#ident "OPENBLOCKS266" + +maxusers 32 + +#options UVMHIST +#options UVMHIST_PRINT + +# Options for necessary to use MD +#options MEMORY_DISK_HOOKS +#options MEMORY_DISK_IS_ROOT # force root on memory disk +#options MEMORY_DISK_SERVER=0 # no userspace memory disk support +#options MEMORY_DISK_ROOT_SIZE=16384 # size of memory disk, in blocks + + +#options INSECURE # disable kernel security levels +#options NTP # NTP phase/frequency locked loop +#options KTRACE # system call tracing via ktrace(1) + +options SYSVMSG # System V message queues +options SYSVSEM # System V semaphores +options SYSVSHM # System V shared memory +#options SHMMAXPGS=1024 # 1024 pages is the default + +#options LKM # loadable kernel modules + +#options USERCONF # userconf(4) support +#options PIPE_SOCKETPAIR # smaller, but slower pipe(2) + +# Diagnostic/debugging support options +#options DIAGNOSTIC # cheap kernel consistency checks +options DEBUG # expensive debugging checks/support +options DDB # in-kernel debugger +options DDB_HISTORY_SIZE=512 # enable history editing in DDB +options TRAP_PANICWAIT +options SYMTAB_SPACE=300000 # size for embedded symbol table + +makeoptions DEBUG="-g" # compile full symbol table + +# Compatibility options +#options COMPAT_09 # NetBSD 0.9, +#options COMPAT_10 # NetBSD 1.0, +#options COMPAT_11 # NetBSD 1.1, +#options COMPAT_12 # NetBSD 1.2, +options COMPAT_13 # NetBSD 1.3, +options COMPAT_14 # NetBSD 1.4, +options COMPAT_43 # and 4.3BSD +#options COMPAT_386BSD_MBRPART # recognize old partition ID +#options TCP_COMPAT_42 # 4.2BSD TCP/IP bug compat. Not recommended. + +# File systems +file-system FFS # UFS +file-system EXT2FS # second extended file system (linux) +file-system LFS # log-structured file system +file-system MFS # memory file system +file-system NFS # Network File System client +file-system CD9660 # ISO 9660 + Rock Ridge file system +file-system MSDOSFS # MS-DOS file system +file-system FDESC # /dev/fd +file-system KERNFS # /kern +file-system NULLFS # loopback file system +file-system OVERLAY # overlay file system +file-system PORTAL # portal filesystem (still experimental) +file-system PROCFS # /proc +file-system UMAPFS # NULLFS + uid and gid remapping +file-system UNION # union file system + +# File system options +options QUOTA # UFS quotas +#options FFS_EI # FFS Endian Independant support +options SOFTDEP # FFS soft updates support. +options NFSSERVER # Network File System server +options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and + # immutable) behave as system flags. + +options NFS_BOOT_DHCP # Support DHCP NFS root + +# Networking options +options GATEWAY # packet forwarding +options INET # IP + ICMP + TCP + UDP +options INET6 # IPV6 +#options IPSEC # IP security +#options IPSEC_ESP # IP security (encryption part; define w/IPSEC) +#options IPSEC_DEBUG # debug for IP security +#options MROUTING # IP multicast routing +#options DIRECTED_BROADCAST # allow broadcasts through routers +#options NS # XNS +#options NSIP # XNS tunneling over IP +options ISO,TPIP # OSI +#options EON # OSI tunneling over IP +#options CCITT,LLC,HDLC # X.25 +#options NETATALK # AppleTalk networking protocols +options PPP_BSDCOMP # BSD-Compress compression support for PPP +options PPP_DEFLATE # Deflate compression support for PPP +options PPP_FILTER # Active filter support for PPP (requires bpf) +options PFIL_HOOKS # pfil(9) packet filter hooks +options IPFILTER_LOG # ipmon(8) log support +#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG +options NMBCLUSTERS=1024 + +# These options enable verbose messages for several subsystems. +# Warning, these may compile large string tables into the kernel! +options PCIVERBOSE # verbose PCI device autoconfig messages +options MIIVERBOSE # verbose PHY autoconfig messages +#options PCI_CONFIG_DUMP # verbosely dump PCI config space +options SCSIVERBOSE # human readable SCSI error messages +options PCI_NETBSD_CONFIGURE # Do not rely on BIOS/whatever to configure PCI devices +#options PCI_CONFIGURE_VERBOSE # Show PCI config information + +# wscons options +#options WSEMUL_SUN # sun terminal emulation +#options WSEMUL_VT100 # VT100 / VT220 emulation + +# Kernel root file system and dump configuration. +config netbsd root on ? type ? + +# +# Device configuration +# + +plb0 at root # Processor Local Bus + +cpu0 at plb? + +ecc0 at plb? irq 16 # On-chip ECC controller + +opb* at plb? # On-chip Peripheral Bus + +wdog* at opb? # Watchdog timer + +com* at opb? addr ? irq ? # UARTs + +emac0 at opb? addr ? irq ? # Ethernet Media Access Controller +options EMAC_EVENT_COUNTERS + +iic0 at opb? addr ? irq ? # IIC +rtc0 at iic? addr ? # RTC +todclock0 at rtc? # time-of-day device via rtc device + +pchb0 at plb? # PCI-Host bridges + +pci* at pchb? +ppb* at pci? dev ? function ? # PCI-PCI bridges +pciide* at pci? dev ? function ? + +tlp* at pci? dev ? function ? # DECchip 21x4x and clones + +lxtphy* at mii? phy ? # Level One LXT-970 PHYs +ukphy* at mii? phy ? # generic unknown PHYs + +#cardslot* at cbb? +#cardbus* at cardslot? +#pcmcia* at cardslot? + +#com* at pcmcia? function ? # Modems and serial cards +#wdc* at pcmcia? function ? # PCMCIA IDE controllers +#ep* at pcmcia? function ? # 3Com 3c589 and 3c562 Ethernet +#mbe* at pcmcia? function ? # MB8696x based Ethernet +#ne* at pcmcia? function ? # NE2000-compatible Ethernet +#ex* at cardbus? dev ? function ? # 3Com 3C575TX +#tlp* at cardbus? dev ? function ? # DECchip 21143 +#rtk* at cardbus? dev ? function ? # Realtek 8129/8139 + +wd* at pciide? channel ? drive ? + +atapibus* at pciide? channel ? + +cd* at atapibus? drive ? flags 0x0000 # ATAPI CD-ROM drives +sd* at atapibus? drive ? flags 0x0000 # ATAPI disk drives +uk* at atapibus? drive ? flags 0x0000 # ATAPI unknown + +pbus* at plb? # off-chip Peripheral BUS + +#dsrtc0 at pbus? addr ? # RTC +#todclock0 at dsrtc? # time-of-day device via rtc device + +#pckbc0 at pbus? +#pckbd* at pckbc? +#wskbd* at pckbd? console ? +#pms* at pckbc? +#wsmouse* at pms? mux 0 + +#vga* at pci? dev ? function ? +#wsdisplay* at vga? console ? + +pseudo-device vnd 4 # disk-like interface to files +pseudo-device ccd 4 # concatenated/striped disk devices +#pseudo-device cgd 4 # cryptographic disk devices +#pseudo-device raid 4 # RAIDframe disk driver +#options RAID_AUTOCONFIG # auto-configuration of RAID components +pseudo-device md 1 # memory disk device +pseudo-device loop # network loopback +pseudo-device bpfilter 8 # packet filter +pseudo-device ipfilter # IP filter (firewall) and NAT +pseudo-device ppp 2 # Point-to-Point Protocol +pseudo-device sl 2 # Serial Line IP +pseudo-device tun 4 # network tunneling over tty +#pseudo-device gre 2 # generic L3 over IP tunnel +pseudo-device gif 4 # IPv[46] over IPv[46] tunnel (RFC1933) +#pseudo-device faith 1 # IPv[46] tcp relay translation i/f +#pseudo-device stf 1 # 6to4 IPv6 over IPv4 encapsulation +pseudo-device vlan # IEEE 802.1q encapsulation +pseudo-device pty # pseudo-terminals +pseudo-device rnd # /dev/random and in-kernel generator +#pseudo-device wsmux # ick +pseudo-device clockctl # user control of clock subsystem +pseudo-device kttcp # kernel ttcp --- /dev/null Wed Jul 2 13:19:50 2003 +++ arch/evbppc/conf/Makefile.obs266.inc Tue Jul 1 09:19:26 2003 @@ -0,0 +1,20 @@ +# $NetBSD$ + +MKIMG?= ${THISPPC}/compile/walnut-mkimg.sh +CFLAGS+=-mcpu=403 +AFLAGS+=-mcpu=403 +TEXTADDR?= 25000 + +SYSTEM_FIRST_OBJ= walnut_start.o +SYSTEM_FIRST_SFILE= ${THISPPC}/walnut/walnut_start.S + +.ifdef DBSYM +SYSTEM_LD_TAIL_EXTRA+=; \ + echo "${DBSYM} $@ || true"; \ + ${DBSYM} $@ || true +.endif + +SYSTEM_LD_TAIL_EXTRA+=; \ + echo ${MKIMG} netbsd netbsd.img ; \ + OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; export OBJDUMP OBJCOPY; \ + ${MKIMG} $@ $@.img --- /dev/null Wed Jul 2 13:19:50 2003 +++ arch/evbppc/conf/files.obs266 Tue Jul 1 11:17:53 2003 @@ -0,0 +1,77 @@ +# $NetBSD$ +# +# walnut-specific configuration info + +file arch/evbppc/walnut/autoconf.c +file arch/evbppc/walnut/consinit.c +file arch/evbppc/walnut/machdep.c + +#file arch/evbppc/evbppc/bus_dma.c + +# Memory Disk for install kernel +file dev/md_root.c memory_disk_hooks + +# Machine-independent I2O drivers. +include "dev/i2o/files.i2o" + +# Machine-independent SCSI drivers +include "dev/scsipi/files.scsipi" + +# Machine-independent ATA drivers +include "dev/ata/files.ata" + +# Workstation Console +include "dev/wscons/files.wscons" + +# Raster operations +include "dev/rasops/files.rasops" +include "dev/wsfont/files.wsfont" + +# PCI bus support +include "dev/pci/files.pci" + +# On-chip PCI bridge +# +# XXX: Move these to a 405gp-specific file and re-think the +# layout of the powerpc/ibm4xx hierarchy to accomodate SoCs. +# +device pchb : pcibus +attach pchb at plb +file arch/evbppc/walnut/pci/pchb.c pchb +file arch/evbppc/walnut/pci/pci_machdep.c pci +file arch/powerpc/ibm4xx/dev/ibm405gp.c + +# Off-chip peripheral bus +device pbus {[addr=-1], [irq=-1]} +attach pbus at plb +file arch/evbppc/walnut/dev/pbus.c pbus + +define todservice {} + +device todclock +attach todclock at todservice +file arch/evbppc/walnut/dev/todclock.c todclock needs-count + +device rtc: todservice +attach rtc at iic +file arch/evbppc/walnut/dev/x1226.c rtc + +#device dsrtc: todservice +#attach dsrtc at pbus +#file arch/evbppc/walnut/dev/ds1743.c dsrtc + +include "dev/pckbc/files.pckbc" +attach pckbc at pbus with pckbc_pbus +file arch/evbppc/walnut/dev/pckbc_pbus.c pckbc_pbus + +# +# Machine-independent CardBus drivers +# + +# XXX dev/pcmcia needs fdc +device fdc {drive = -1} + +include "dev/cardbus/files.cardbus" +include "dev/pcmcia/files.pcmcia" + +file arch/macppc/macppc/rbus_machdep.c cardbus --- /dev/null Wed Jul 2 13:19:50 2003 +++ arch/evbppc/conf/std.obs266 Tue Jul 1 10:56:36 2003 @@ -0,0 +1,28 @@ +# $NetBSD$ +# +# Standard/required options for NetBSD/obs266. + +machine evbppc powerpc + +# standard ("mandatory") kernel options. +options PPC_IBM4XX # IBM 40x family + +# Executable support: +options EXEC_ELF32 # (native) ELF32 binary support +options EXEC_AOUT # (native) a.out binary support (deprecated) +options EXEC_SCRIPT # shell script support + +makeoptions TEXTADDR=0x25000 +makeoptions BOARDTYPE="obs266" +makeoptions PPCDIR="ibm4xx" + +options OPENBLOCKS266 +options PPC_INTR_IMPL="" +options PPC_PCI_MACHDEP_IMPL="" +options KERNBASE=0x25000 + +options INTSTK=16384 +options SPILLSTK=1024 + +include "arch/powerpc/conf/files.ibm4xx" +include "arch/evbppc/conf/files.obs266" --- /dev/null Wed Jul 2 13:19:50 2003 +++ arch/evbppc/walnut/dev/x1226.c Wed Jul 2 13:19:43 2003 @@ -0,0 +1,265 @@ +/* $NetBSD$ */ + +/* + * Copyright (c) 2001-2002 Wasabi Sysetms, Inc. + * Copyright (c) 1998 Mark Brinicombe. + * Copyright (c) 1998 Causality Limited. + * All rights reserved. + * + * Written by Mark Brinicombe, Causality Limited + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Mark Brinicombe + * for the NetBSD Project. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY CAUASLITY LIMITED ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CAUSALITY LIMITED OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include + +struct xrtc_softc { + struct device sc_dev; + bus_space_tag_t sc_iot; + bus_space_handle_t sc_ioh; + struct iic_softc *adap; +}; + +static void xrtc_attach(struct device *, struct device *, void *); +static int xrtc_match(struct device *, struct cfdata *, void *); + +static int xrtc_read(void *, rtc_t *); +static int xrtc_write(void *, rtc_t *); + +static inline u_char x1226_read(struct xrtc_softc *, u_int16_t); +static inline u_char x1226_write(struct xrtc_softc *, u_int16_t, u_char); +static int x1226_lock(struct xrtc_softc *); +static int x1226_unlock(struct xrtc_softc *); + +/* device and attach structures */ +CFATTACH_DECL(rtc, sizeof(struct xrtc_softc), + xrtc_match, xrtc_attach, NULL, NULL); + +/* + * xrtc_match() + */ + +static int +xrtc_match(struct device *parent, struct cfdata *cf, void *aux) +{ + struct iicbus_attach_args *iaa = aux; + + /* match only RTC devices */ + if (strcmp(iaa->iicb_name, cf->cf_name) == 0) + return (1); + + return (0); +} + +/* + * xrtc_attach() + */ + +static void +xrtc_attach(struct device *parent, struct device *self, void *aux) +{ + struct xrtc_softc *sc = (struct xrtc_softc *)self; + struct iicbus_attach_args *iaa = aux; + struct todclock_attach_args ta; + + sc->sc_iot = 0; + sc->sc_ioh = iaa->iicb_addr; + sc->adap = iaa->adap; + + /* Make sure the clock is running */ + /* x1226_unlock(sc); */ + if (x1226_read(sc, X1226_SR) & X1226_SR_RTCF) + printf(": power failure, RTC unreliable"); + printf("\n"); + +#ifdef DEBUG + { + rtc_t rtc; + xrtc_read(sc, &rtc); + printf("RTC: %02d%02d/%02d/%02d %02d:%02d:%02d\n", + rtc.rtc_cen, rtc.rtc_year, + rtc.rtc_mon, rtc.rtc_day, + rtc.rtc_hour, rtc.rtc_min, rtc.rtc_sec); + } +#endif + + ta.ta_name = "todclock"; + ta.ta_rtc_arg = sc; + ta.ta_rtc_write = xrtc_write; + ta.ta_rtc_read = xrtc_read; + ta.ta_flags = 0; + config_found(self, &ta, NULL); +} + +static inline u_char +x1226_read(struct xrtc_softc *sc, u_int16_t addr) +{ + u_char ret, baddr[2]; + int addrmsk = (X1226_SIZE - 1); + + baddr[0] = (((addr & addrmsk) >> 8) & 0xff); + baddr[1] = ((addr & addrmsk) & 0xff); + + iic_read(sc->adap, X1226_DEVID_CCR, baddr, 2, &ret, 1); + + return ret; +} + +static inline u_char +x1226_write(struct xrtc_softc *sc, u_int16_t addr, u_char d) +{ + u_char ret, data[1], baddr[2]; + int addrmsk = (X1226_SIZE - 1); + + data[0] = d; + baddr[0] = (((addr & addrmsk) >> 8) & 0xff); + baddr[1] = ((addr & addrmsk) & 0xff); + + ret = iic_write(sc->adap, X1226_DEVID_CCR, baddr, 2, data, 1); + + return ret; +} + +#define BIN2BCD(x) ((((x) / 10) << 4) | (x % 10)) +#define BCD2BIN(x) (((((x) >> 4) & 0xf) * 10) + ((x) & 0xf)) + +static int +x1226_unlock(struct xrtc_softc *sc) +{ + u_char sr; + + sr = X1226_SR_WEL; + x1226_write(sc, X1226_SR, sr); + sr |= X1226_SR_RWEL; + x1226_write(sc, X1226_SR, sr); + + sr = 0; + sr = x1226_read(sc, X1226_SR); + sr &= (X1226_SR_RWEL | X1226_SR_WEL); + if (sr != (X1226_SR_RWEL | X1226_SR_WEL)) { + return 1; + } + return 0; +} + +static int +x1226_lock(struct xrtc_softc *sc) +{ + u_char sr; + + sr = 0; + x1226_write(sc, X1226_SR, sr); + + sr = 0; + sr = x1226_read(sc, X1226_SR); + sr &= (X1226_SR_RWEL | X1226_SR_WEL); + if (sr != 0) { + return 1; + } + return 0; +} + +static int +xrtc_write(void * arg, rtc_t * rtc) +{ + struct xrtc_softc *sc = arg; + + if (x1226_unlock(sc) != 0) { + return (1); + } + + x1226_write(sc, X1226_RTC_SC, + BIN2BCD(rtc->rtc_sec) & 0x7f); + x1226_write(sc, X1226_RTC_MN, + BIN2BCD(rtc->rtc_min) & 0x7f); + x1226_write(sc, X1226_RTC_HR, /* 24 hour format */ + (BIN2BCD(rtc->rtc_hour) & 0x1f) | X1226_RTC_HR_MIL); + x1226_write(sc, X1226_RTC_DT, + BIN2BCD(rtc->rtc_day) & 0x3f); + x1226_write(sc, X1226_RTC_MO, + BIN2BCD(rtc->rtc_mon) & 0x1f); + x1226_write(sc, X1226_RTC_YR, + BIN2BCD(rtc->rtc_year) & 0xff); + x1226_write(sc, X1226_RTC_Y2K, + BIN2BCD(rtc->rtc_cen) & 0x3f); + + x1226_lock(sc); + + xrtc_read(arg, rtc); + + return (0); +} + +static int +xrtc_read(void *arg, rtc_t *rtc) +{ + struct xrtc_softc *sc = arg; + u_char hreg; + + rtc->rtc_micro = 0; + rtc->rtc_centi = 0; + + /* YYYY */ + rtc->rtc_cen = BCD2BIN(x1226_read(sc, X1226_RTC_Y2K) & 0x3f); + rtc->rtc_year = BCD2BIN(x1226_read(sc, X1226_RTC_YR)); + + /* MM */ + rtc->rtc_mon = BCD2BIN(x1226_read(sc, X1226_RTC_MO) & 0x1f); + + /* DD */ + rtc->rtc_day = BCD2BIN(x1226_read(sc, X1226_RTC_DT) & 0x3f); + + /* HH */ + hreg = x1226_read(sc, X1226_RTC_HR); + rtc->rtc_hour = BCD2BIN(hreg & 0x1f); + if (!(hreg & X1226_RTC_HR_MIL)) { + if (hreg & X1226_RTC_HR_H21) { + rtc->rtc_hour += 12; + if (rtc->rtc_hour >= 24) + rtc->rtc_hour = 0; + } + } + + /* MM */ + rtc->rtc_min = BCD2BIN(x1226_read(sc, X1226_RTC_MN) & 0x7f); + + /* SS */ + rtc->rtc_sec = BCD2BIN(x1226_read(sc, X1226_RTC_SC) & 0x7f); + + return (1); +} --- /dev/null Wed Jul 2 13:19:50 2003 +++ arch/evbppc/walnut/dev/x1226reg.h Tue Jul 1 09:19:58 2003 @@ -0,0 +1,78 @@ +/* $NetBSD$ */ + +/* + * Copyright 2001-2002 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Simon Burge and Eduardo Horvath for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __X1226REG_H__ +#define __X1226REG_H__ + +/* XICOR X1226 Device Identifier */ +#define X1226_DEVID_CCR 0x6f +#define X1226_DEVID_EEPROM 0x57 + +/* XICOR X1226 Watchdog RTC registers */ +#define X1226_SR 0x3f +#define X1226_RTC_Y2K 0x37 /* century (19/20) */ +#define X1226_RTC_DW 0x36 /* day of week (0-6) */ +#define X1226_RTC_YR 0x35 /* year (0-99) */ +#define X1226_RTC_MO 0x34 /* month (1-12) */ +#define X1226_RTC_DT 0x33 /* day (1-31) */ +#define X1226_RTC_HR 0x32 /* hour (0-23) */ +#define X1226_RTC_MN 0x31 /* minute (0-59) */ +#define X1226_RTC_SC 0x30 /* second (0-59) */ +#define X1226_RTC_BASE 0x30 +#define X1226_CTRL_DTR 0x13 +#define X1226_CTRL_ATR 0x12 +#define X1226_CTRL_INT 0x11 +#define X1226_CTRL_BL 0x10 + +/* XICOR X1226 RTC flags */ +#define X1226_SR_RTCF 0x01 +#define X1226_SR_WEL 0x02 +#define X1226_SR_RWEL 0x04 +#define X1226_SR_AL0 0x20 +#define X1226_SR_AL1 0x40 +#define X1226_SR_BAT 0x80 +#define X1226_RTC_HR_H21 0x20 +#define X1226_RTC_HR_MIL 0x80 + +/* XICOR X1226 size */ +#define X1226_SIZE 0x0100 /* 4kbit (512 x 8bit) */ + +/* Y2K definitions */ +#define EPOCH 2000 +#define SYS_EPOCH 1900 + +#endif /* __X1226REG_H__ */