psychovar.h revision 86231
164562Sgshapiro/* 264562Sgshapiro * Copyright (c) 1999, 2000 Matthew R. Green 364562Sgshapiro * All rights reserved. 490792Sgshapiro * 590792Sgshapiro * Redistribution and use in source and binary forms, with or without 690792Sgshapiro * modification, are permitted provided that the following conditions 790792Sgshapiro * are met: 864562Sgshapiro * 1. Redistributions of source code must retain the above copyright 964562Sgshapiro * notice, this list of conditions and the following disclaimer. 1064562Sgshapiro * 2. Redistributions in binary form must reproduce the above copyright 1164562Sgshapiro * notice, this list of conditions and the following disclaimer in the 1264562Sgshapiro * documentation and/or other materials provided with the distribution. 1364562Sgshapiro * 3. The name of the author may not be used to endorse or promote products 1464562Sgshapiro * derived from this software without specific prior written permission. 15173340Sgshapiro * 1664562Sgshapiro * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1764562Sgshapiro * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1864562Sgshapiro * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1990792Sgshapiro * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2090792Sgshapiro * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21173340Sgshapiro * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 2264562Sgshapiro * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2364562Sgshapiro * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2464562Sgshapiro * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2564562Sgshapiro * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2664562Sgshapiro * SUCH DAMAGE. 2790792Sgshapiro * 2890792Sgshapiro * from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp 29173340Sgshapiro * 3064562Sgshapiro * $FreeBSD: head/sys/sparc64/pci/psychovar.h 86231 2001-11-09 20:19:58Z tmm $ 31285303Sgshapiro */ 32285303Sgshapiro 33285303Sgshapiro#ifndef _SPARC64_PCI_PSYCHOVAR_H_ 3490792Sgshapiro#define _SPARC64_PCI_PSYCHOVAR_H_ 35173340Sgshapiro 3690792Sgshapiro/* 3798121Sgshapiro * per-PCI bus on mainbus softc structure; one for sabre, or two 3898121Sgshapiro * per pair of psycho's. 39173340Sgshapiro */ 40173340Sgshapirostruct psycho_softc { 4164562Sgshapiro device_t sc_dev; 4271345Sgshapiro /* 4371345Sgshapiro * PSYCHO register. we record the base physical address of these 4471345Sgshapiro * also as it is the base of the entire PSYCHO 4571345Sgshapiro */ 4671345Sgshapiro struct psychoreg *sc_regs; 47266692Sgshapiro vm_offset_t sc_basepaddr; 48 49 /* Interrupt Group Number for this device */ 50 int sc_ign; 51 52 /* our tags (from parent) */ 53 bus_space_tag_t sc_bustag; 54 bus_dma_tag_t sc_dmatag; 55 56 int sc_clockfreq; 57 phandle_t sc_node; /* prom node */ 58 int sc_mode; 59#define PSYCHO_MODE_SABRE 1 60#define PSYCHO_MODE_PSYCHO 2 61 62 struct iommu_state *sc_is; 63 64 struct resource *sc_irq[6]; 65 void *sc_ihand[6]; 66 67 /* 68 * note that the sabre really only has one ranges property, 69 * used for both simba a and simba b (but the ranges for 70 * real psychos are the same for PCI A and PCI B anyway). 71 */ 72 struct upa_ranges *sc_range; 73 int sc_nrange; 74 struct ofw_pci_imap *sc_intrmap; 75 int sc_nintrmap; 76 struct ofw_pci_imap_msk sc_intrmapmsk; 77 78 /* our tags */ 79 bus_space_tag_t sc_cfgt; 80 bus_space_tag_t sc_memt; 81 bus_space_tag_t sc_iot; 82 bus_dma_tag_t sc_dmat; 83 84 bus_space_handle_t sc_bh[4]; 85 86 int sc_busno; 87 88 struct rman sc_mem_rman; 89 struct rman sc_io_rman; 90}; 91 92#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */ 93