1*707b9604Smatt /* $NetBSD: qv_ic.h,v 1.1 2015/07/05 03:07:21 matt Exp $ */ 2*707b9604Smatt 3*707b9604Smatt /*- 4*707b9604Smatt * Copyright (c) 2015 The NetBSD Foundation, Inc. 5*707b9604Smatt * All rights reserved. 6*707b9604Smatt * 7*707b9604Smatt * This code is derived from software contributed to The NetBSD Foundation 8*707b9604Smatt * by Charles H. Dickman 9*707b9604Smatt * 10*707b9604Smatt * Redistribution and use in source and binary forms, with or without 11*707b9604Smatt * modification, are permitted provided that the following conditions 12*707b9604Smatt * are met: 13*707b9604Smatt * 1. Redistributions of source code must retain the above copyright 14*707b9604Smatt * notice, this list of conditions and the following disclaimer. 15*707b9604Smatt * 2. Redistributions in binary form must reproduce the above copyright 16*707b9604Smatt * notice, this list of conditions and the following disclaimer in the 17*707b9604Smatt * documentation and/or other materials provided with the distribution. 18*707b9604Smatt * 19*707b9604Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20*707b9604Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21*707b9604Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22*707b9604Smatt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23*707b9604Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24*707b9604Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25*707b9604Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26*707b9604Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27*707b9604Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28*707b9604Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29*707b9604Smatt * POSSIBILITY OF SUCH DAMAGE. 30*707b9604Smatt */ 31*707b9604Smatt 32*707b9604Smatt /* registers */ 33*707b9604Smatt #define QV_IC_DR 0 /* data register */ 34*707b9604Smatt #define QV_IC_SR 2 /* status register */ 35*707b9604Smatt 36*707b9604Smatt /* commands */ 37*707b9604Smatt #define QV_IC_RESET 0x00 38*707b9604Smatt #define QV_IC_CIMR 0x28 39*707b9604Smatt #define QV_IC_SIMR 0x38 40*707b9604Smatt #define QV_IC_CLRIRR 0x40 41*707b9604Smatt #define QV_IC_SIRR 0x58 42*707b9604Smatt #define QV_IC_MODE 0x80 43*707b9604Smatt #define QV_IC_ARM 0xa1 44*707b9604Smatt #define QV_IC_DISARM 0xa2 45*707b9604Smatt #define QV_IC_ACREG 0xc0 46*707b9604Smatt #define QV_IC_RMEM 0xe0 47*707b9604Smatt #define RMEM_BC_1 0x00 48*707b9604Smatt #define RMEM_BC_2 0x08 49*707b9604Smatt #define RMEM_BC_3 0x10 50*707b9604Smatt #define RMEM_BC_4 0x18 51*707b9604Smatt 52*707b9604Smatt 53*707b9604Smatt /* vectors */ 54*707b9604Smatt #define QV_DUART_VEC 0 55*707b9604Smatt #define QV_SYNC_VEC 1 56*707b9604Smatt #define QV_MOUSE_VEC 2 57*707b9604Smatt #define QV_CURS_VEC 3 58*707b9604Smatt #define QV_MBA_VEC 4 59*707b9604Smatt #define QV_MBB_VEC 5 60*707b9604Smatt #define QV_MBC_VEC 6 61*707b9604Smatt 62*707b9604Smatt #define QV_IC_ENA 1 63*707b9604Smatt #define QV_IC_DIS 0 64*707b9604Smatt 65*707b9604Smatt void qv_ic_init(struct uba_attach_args *, bus_size_t); 66*707b9604Smatt void qv_ic_setvec(struct uba_attach_args *, bus_size_t, int, int); 67*707b9604Smatt void qv_ic_enable(struct uba_attach_args *, bus_size_t, int, int); 68*707b9604Smatt void qv_ic_arm(struct uba_attach_args *, bus_size_t, int); 69*707b9604Smatt void qv_ic_force(struct uba_attach_args *, bus_size_t, int); 70*707b9604Smatt 71