bshwvar.h revision 73149
1272343Sngie/* $FreeBSD: head/sys/dev/ct/bshwvar.h 73149 2001-02-27 12:34:01Z nyan $ */ 2/* $NecBSD: bshwvar.h,v 1.3 1999/04/15 01:36:10 kmatsuda Exp $ */ 3/* $NetBSD$ */ 4 5/* 6 * [NetBSD for NEC PC-98 series] 7 * Copyright (c) 1994, 1995, 1996, 1997, 1998 8 * NetBSD/pc98 porting staff. All rights reserved. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 3. The name of the author may not be used to endorse or promote products 19 * derived from this software without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 * POSSIBILITY OF SUCH DAMAGE. 32 */ 33#ifndef _BSHWVAR_H_ 34#define _BSHWVAR_H_ 35 36/* 37 * bshwvar.h 38 * NEC 55 compatible board specific definitions 39 */ 40 41#define BSHW_DEFAULT_CHIPCLK 20 /* 20MHz */ 42#define BSHW_DEFAULT_HOSTID 7 43 44struct bshw { 45#define BSHW_SYNC_RELOAD 0x01 46#define BSHW_SMFIFO 0x02 47#define BSHW_DOUBLE_DMACHAN 0x04 48 u_int hw_flags; 49 50 u_int sregaddr; 51 52 int ((*dma_init) __P((struct ct_softc *))); 53 void ((*dma_start) __P((struct ct_softc *))); 54 void ((*dma_stop) __P((struct ct_softc *))); 55}; 56 57struct bshw_softc { 58 int sc_hostid; 59 int sc_irq; /* irq */ 60 int sc_drq; /* drq */ 61 62 /* dma transfer */ 63 u_int8_t *sc_segaddr; 64 u_int8_t *sc_bufp; 65 int sc_seglen; 66 int sc_tdatalen; /* temp datalen */ 67 68 /* private bounce */ 69 u_int8_t *sc_bounce_phys; 70 u_int8_t *sc_bounce_addr; 71 u_int sc_bounce_size; 72 bus_addr_t sc_minphys; 73 74 /* hardware */ 75 struct bshw *sc_hw; 76}; 77 78void bshw_synch_setup __P((struct ct_softc *, struct lun_info *)); 79void bshw_bus_reset __P((struct ct_softc *)); 80int bshw_read_settings __P((bus_space_tag_t, bus_space_handle_t, struct bshw_softc *)); 81void bshw_smit_xfer_start __P((struct ct_softc *)); 82void bshw_smit_xfer_stop __P((struct ct_softc *)); 83void bshw_dma_xfer_start __P((struct ct_softc *)); 84void bshw_dma_xfer_stop __P((struct ct_softc *)); 85extern struct dvcfg_hwsel bshw_hwsel; 86#endif /* !_BSHWVAR_H_ */ 87