z8530var.h revision 1.4
11.4Stsutsui/* $NetBSD: z8530var.h,v 1.4 2003/04/26 18:43:20 tsutsui Exp $ */ 21.1Stsubai 31.1Stsubai/* 41.1Stsubai * Copyright (c) 1994 Gordon W. Ross 51.1Stsubai * Copyright (c) 1992, 1993 61.1Stsubai * The Regents of the University of California. All rights reserved. 71.1Stsubai * 81.1Stsubai * This software was developed by the Computer Systems Engineering group 91.1Stsubai * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 101.1Stsubai * contributed to Berkeley. 111.1Stsubai * 121.1Stsubai * All advertising materials mentioning features or use of this software 131.1Stsubai * must display the following acknowledgement: 141.1Stsubai * This product includes software developed by the University of 151.1Stsubai * California, Lawrence Berkeley Laboratory. 161.1Stsubai * 171.1Stsubai * Redistribution and use in source and binary forms, with or without 181.1Stsubai * modification, are permitted provided that the following conditions 191.1Stsubai * are met: 201.1Stsubai * 1. Redistributions of source code must retain the above copyright 211.1Stsubai * notice, this list of conditions and the following disclaimer. 221.1Stsubai * 2. Redistributions in binary form must reproduce the above copyright 231.1Stsubai * notice, this list of conditions and the following disclaimer in the 241.1Stsubai * documentation and/or other materials provided with the distribution. 251.1Stsubai * 3. All advertising materials mentioning features or use of this software 261.1Stsubai * must display the following acknowledgement: 271.1Stsubai * This product includes software developed by the University of 281.1Stsubai * California, Berkeley and its contributors. 291.1Stsubai * 4. Neither the name of the University nor the names of its contributors 301.1Stsubai * may be used to endorse or promote products derived from this software 311.1Stsubai * without specific prior written permission. 321.1Stsubai * 331.1Stsubai * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 341.1Stsubai * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 351.1Stsubai * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 361.1Stsubai * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 371.1Stsubai * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 381.1Stsubai * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 391.1Stsubai * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 401.1Stsubai * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 411.1Stsubai * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 421.1Stsubai * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 431.1Stsubai * SUCH DAMAGE. 441.1Stsubai * 451.1Stsubai * @(#)zsvar.h 8.1 (Berkeley) 6/11/93 461.1Stsubai */ 471.1Stsubai 481.1Stsubai#include <dev/ic/z8530sc.h> 491.1Stsubai 501.1Stsubaistruct zsc_softc { 511.1Stsubai struct device zsc_dev; /* required first: base device */ 521.1Stsubai struct zs_chanstate *zsc_cs[2]; /* channel A and B soft state */ 531.1Stsubai /* Machine-dependent part follows... */ 541.1Stsubai struct zs_chanstate zsc_cs_store[2]; 551.1Stsubai}; 561.1Stsubai 571.1Stsubai/* 581.1Stsubai * Functions to read and write individual registers in a channel. 591.1Stsubai * The ZS chip requires a 1.6 uSec. recovery time between accesses, 601.1Stsubai * and the NEWS3400 hardware does NOT take care of this for you. 611.1Stsubai * The delay is now handled inside the chip access functions. 621.1Stsubai * These could be inlines, but with the delay, speed is moot. 631.1Stsubai */ 641.1Stsubai 651.1Stsubaiu_char zs_read_reg __P((struct zs_chanstate *cs, u_char reg)); 661.1Stsubaiu_char zs_read_csr __P((struct zs_chanstate *cs)); 671.1Stsubaiu_char zs_read_data __P((struct zs_chanstate *cs)); 681.1Stsubai 691.1Stsubaivoid zs_write_reg __P((struct zs_chanstate *cs, u_char reg, u_char val)); 701.1Stsubaivoid zs_write_csr __P((struct zs_chanstate *cs, u_char val)); 711.1Stsubaivoid zs_write_data __P((struct zs_chanstate *cs, u_char val)); 721.4Stsutsui 731.4Stsutsuiint zs_print __P((void *, const char *)); 741.4Stsutsuiint zshard __P((void *)); 751.4Stsutsuivoid zssoft __P((void*)); 761.4Stsutsuiint zs_get_speed __P((struct zs_chanstate *)); 771.4Stsutsuivoid (*zs_delay) __P((void)); 781.1Stsubai 791.1Stsubai/* Zilog Serial hardware interrupts (level 1) */ 801.3Smatt#define splzs cpu_spl1 811.3Smattextern int splzs(void); 82