xref: /netbsd-src/sys/arch/pmax/include/z8530var.h (revision 02cb47cab231ebd863359e08e47b4a2356127b4c)
1*02cb47caStsutsui /* $NetBSD: z8530var.h,v 1.5 2008/03/29 19:15:35 tsutsui Exp $ */
29aa9b8ebSad 
39aa9b8ebSad /*
49aa9b8ebSad  * Copyright (c) 1994 Gordon W. Ross
59aa9b8ebSad  * Copyright (c) 1992, 1993
69aa9b8ebSad  *	The Regents of the University of California.  All rights reserved.
79aa9b8ebSad  *
89aa9b8ebSad  * This software was developed by the Computer Systems Engineering group
99aa9b8ebSad  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
109aa9b8ebSad  * contributed to Berkeley.
119aa9b8ebSad  *
129aa9b8ebSad  * All advertising materials mentioning features or use of this software
139aa9b8ebSad  * must display the following acknowledgement:
149aa9b8ebSad  *	This product includes software developed by the University of
159aa9b8ebSad  *	California, Lawrence Berkeley Laboratory.
169aa9b8ebSad  *
179aa9b8ebSad  * Redistribution and use in source and binary forms, with or without
189aa9b8ebSad  * modification, are permitted provided that the following conditions
199aa9b8ebSad  * are met:
209aa9b8ebSad  * 1. Redistributions of source code must retain the above copyright
219aa9b8ebSad  *    notice, this list of conditions and the following disclaimer.
229aa9b8ebSad  * 2. Redistributions in binary form must reproduce the above copyright
239aa9b8ebSad  *    notice, this list of conditions and the following disclaimer in the
249aa9b8ebSad  *    documentation and/or other materials provided with the distribution.
259aa9b8ebSad  * 3. All advertising materials mentioning features or use of this software
269aa9b8ebSad  *    must display the following acknowledgement:
279aa9b8ebSad  *	This product includes software developed by the University of
289aa9b8ebSad  *	California, Berkeley and its contributors.
299aa9b8ebSad  * 4. Neither the name of the University nor the names of its contributors
309aa9b8ebSad  *    may be used to endorse or promote products derived from this software
319aa9b8ebSad  *    without specific prior written permission.
329aa9b8ebSad  *
339aa9b8ebSad  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
349aa9b8ebSad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
359aa9b8ebSad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
369aa9b8ebSad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
379aa9b8ebSad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
389aa9b8ebSad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
399aa9b8ebSad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
409aa9b8ebSad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
419aa9b8ebSad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
429aa9b8ebSad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
439aa9b8ebSad  * SUCH DAMAGE.
449aa9b8ebSad  *
459aa9b8ebSad  *	@(#)zsvar.h	8.1 (Berkeley) 6/11/93
469aa9b8ebSad  */
479aa9b8ebSad 
489aa9b8ebSad /*
499aa9b8ebSad  * XXX XXX XXX THIS DOES NOT WORK WITH MULTIPLE ATTACHMENTS!!! XXX XXX XXX
509aa9b8ebSad  */
519aa9b8ebSad 
529aa9b8ebSad #include <dev/ic/z8530sc.h>
539aa9b8ebSad 
549aa9b8ebSad struct zsc_softc {
55*02cb47caStsutsui 	device_t zsc_dev;		/* required first: base device */
569aa9b8ebSad 	struct	zs_chanstate *zsc_cs[2];	/* channel A and B soft state */
579aa9b8ebSad 	/* Machine-dependent part follows... */
589aa9b8ebSad 	int zsc_addroffset;	/* used as "cookie" to identify scc */
599aa9b8ebSad 	void *zsc_sih;
609aa9b8ebSad };
619aa9b8ebSad 
629aa9b8ebSad /*
639aa9b8ebSad  * Functions to read and write individual registers in a channel.
649aa9b8ebSad  * The ZS chip requires a 1.6 uSec. recovery time between accesses,
659aa9b8ebSad  * and the Alpha TC hardware does NOT take care of this for you.
669aa9b8ebSad  * The delay is now handled inside the chip access functions.
679aa9b8ebSad  * These could be inlines, but with the delay, speed is moot.
689aa9b8ebSad  */
699aa9b8ebSad 
709aa9b8ebSad u_int zs_read_reg(struct zs_chanstate *cs, u_int reg);
719aa9b8ebSad u_int zs_read_csr(struct zs_chanstate *cs);
729aa9b8ebSad u_int zs_read_data(struct zs_chanstate *cs);
739aa9b8ebSad 
749aa9b8ebSad void  zs_write_reg(struct zs_chanstate *cs, u_int reg, u_int val);
759aa9b8ebSad void  zs_write_csr(struct zs_chanstate *cs, u_int val);
769aa9b8ebSad void  zs_write_data(struct zs_chanstate *cs, u_int val);
779aa9b8ebSad 
789aa9b8ebSad /* Interrupt priority for the SCC chip; needs to match ZSHARD_PRI. */
799aa9b8ebSad #define splzs()		spltty()
80d3793569Sad #define	IPL_ZS		IPL_TTY
81