11.12Smatt/* $NetBSD: z8530var.h,v 1.12 2012/07/28 23:08:57 matt Exp $ */ 21.1Stsubai 31.1Stsubai/* 41.1Stsubai * Copyright (c) 1992, 1993 51.1Stsubai * The Regents of the University of California. All rights reserved. 61.6Sagc * 71.6Sagc * This software was developed by the Computer Systems Engineering group 81.6Sagc * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 91.6Sagc * contributed to Berkeley. 101.6Sagc * 111.6Sagc * All advertising materials mentioning features or use of this software 121.6Sagc * must display the following acknowledgement: 131.6Sagc * This product includes software developed by the University of 141.6Sagc * California, Lawrence Berkeley Laboratory. 151.6Sagc * 161.6Sagc * Redistribution and use in source and binary forms, with or without 171.6Sagc * modification, are permitted provided that the following conditions 181.6Sagc * are met: 191.6Sagc * 1. Redistributions of source code must retain the above copyright 201.6Sagc * notice, this list of conditions and the following disclaimer. 211.6Sagc * 2. Redistributions in binary form must reproduce the above copyright 221.6Sagc * notice, this list of conditions and the following disclaimer in the 231.6Sagc * documentation and/or other materials provided with the distribution. 241.6Sagc * 3. Neither the name of the University nor the names of its contributors 251.6Sagc * may be used to endorse or promote products derived from this software 261.6Sagc * without specific prior written permission. 271.6Sagc * 281.6Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291.6Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301.6Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311.6Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321.6Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331.6Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341.6Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351.6Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361.6Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371.6Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381.6Sagc * SUCH DAMAGE. 391.6Sagc * 401.6Sagc * @(#)zsvar.h 8.1 (Berkeley) 6/11/93 411.6Sagc */ 421.6Sagc 431.6Sagc/* 441.6Sagc * Copyright (c) 1994 Gordon W. Ross 451.1Stsubai * 461.1Stsubai * This software was developed by the Computer Systems Engineering group 471.1Stsubai * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 481.1Stsubai * contributed to Berkeley. 491.1Stsubai * 501.1Stsubai * All advertising materials mentioning features or use of this software 511.1Stsubai * must display the following acknowledgement: 521.1Stsubai * This product includes software developed by the University of 531.1Stsubai * California, Lawrence Berkeley Laboratory. 541.1Stsubai * 551.1Stsubai * Redistribution and use in source and binary forms, with or without 561.1Stsubai * modification, are permitted provided that the following conditions 571.1Stsubai * are met: 581.1Stsubai * 1. Redistributions of source code must retain the above copyright 591.1Stsubai * notice, this list of conditions and the following disclaimer. 601.1Stsubai * 2. Redistributions in binary form must reproduce the above copyright 611.1Stsubai * notice, this list of conditions and the following disclaimer in the 621.1Stsubai * documentation and/or other materials provided with the distribution. 631.1Stsubai * 3. All advertising materials mentioning features or use of this software 641.1Stsubai * must display the following acknowledgement: 651.1Stsubai * This product includes software developed by the University of 661.1Stsubai * California, Berkeley and its contributors. 671.1Stsubai * 4. Neither the name of the University nor the names of its contributors 681.1Stsubai * may be used to endorse or promote products derived from this software 691.1Stsubai * without specific prior written permission. 701.1Stsubai * 711.1Stsubai * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 721.1Stsubai * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 731.1Stsubai * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 741.1Stsubai * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 751.1Stsubai * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 761.1Stsubai * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 771.1Stsubai * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 781.1Stsubai * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 791.1Stsubai * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 801.1Stsubai * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 811.1Stsubai * SUCH DAMAGE. 821.1Stsubai * 831.1Stsubai * @(#)zsvar.h 8.1 (Berkeley) 6/11/93 841.1Stsubai */ 851.1Stsubai 861.1Stsubai#include <dev/ic/z8530sc.h> 871.1Stsubai 881.1Stsubaistruct zsc_softc { 891.10Stsutsui device_t zsc_dev; /* required first: base device */ 901.1Stsubai struct zs_chanstate *zsc_cs[2]; /* channel A and B soft state */ 911.1Stsubai /* Machine-dependent part follows... */ 921.1Stsubai struct zs_chanstate zsc_cs_store[2]; 931.5Stsutsui void *zsc_si; /* softinterrupt handle */ 941.1Stsubai}; 951.1Stsubai 961.1Stsubai/* 971.1Stsubai * Functions to read and write individual registers in a channel. 981.1Stsubai * The ZS chip requires a 1.6 uSec. recovery time between accesses, 991.1Stsubai * and the NEWS3400 hardware does NOT take care of this for you. 1001.1Stsubai * The delay is now handled inside the chip access functions. 1011.1Stsubai * These could be inlines, but with the delay, speed is moot. 1021.1Stsubai */ 1031.1Stsubai 1041.10Stsutsuiuint8_t zs_read_reg(struct zs_chanstate *cs, uint8_t reg); 1051.10Stsutsuiuint8_t zs_read_csr(struct zs_chanstate *cs); 1061.10Stsutsuiuint8_t zs_read_data(struct zs_chanstate *cs); 1071.10Stsutsui 1081.10Stsutsuivoid zs_write_reg(struct zs_chanstate *cs, uint8_t reg, uint8_t val); 1091.10Stsutsuivoid zs_write_csr(struct zs_chanstate *cs, uint8_t val); 1101.10Stsutsuivoid zs_write_data(struct zs_chanstate *cs, uint8_t val); 1111.7Stsutsui 1121.7Stsutsuiint zs_print(void *, const char *); 1131.7Stsutsuiint zshard(void *); 1141.7Stsutsuiint zs_get_speed(struct zs_chanstate *); 1151.12Smattextern void (*zs_delay)(void); 1161.1Stsubai 1171.5Stsutsui#define splzs() splserial() 1181.9Sad#define IPL_ZS IPL_SERIAL 119