psychovar.h revision 117119
186231Stmm/* 286231Stmm * Copyright (c) 1999, 2000 Matthew R. Green 386231Stmm * All rights reserved. 486231Stmm * 586231Stmm * Redistribution and use in source and binary forms, with or without 686231Stmm * modification, are permitted provided that the following conditions 786231Stmm * are met: 886231Stmm * 1. Redistributions of source code must retain the above copyright 986231Stmm * notice, this list of conditions and the following disclaimer. 1086231Stmm * 2. Redistributions in binary form must reproduce the above copyright 1186231Stmm * notice, this list of conditions and the following disclaimer in the 1286231Stmm * documentation and/or other materials provided with the distribution. 1386231Stmm * 3. The name of the author may not be used to endorse or promote products 1486231Stmm * derived from this software without specific prior written permission. 1586231Stmm * 1686231Stmm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1786231Stmm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1886231Stmm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1986231Stmm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2086231Stmm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 2186231Stmm * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 2286231Stmm * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2386231Stmm * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2486231Stmm * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2586231Stmm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2686231Stmm * SUCH DAMAGE. 2786231Stmm * 2886231Stmm * from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp 2986231Stmm * 3086231Stmm * $FreeBSD: head/sys/sparc64/pci/psychovar.h 117119 2003-07-01 14:52:47Z tmm $ 3186231Stmm */ 3286231Stmm 3386231Stmm#ifndef _SPARC64_PCI_PSYCHOVAR_H_ 3486231Stmm#define _SPARC64_PCI_PSYCHOVAR_H_ 3586231Stmm 3686231Stmm/* 3786231Stmm * per-PCI bus on mainbus softc structure; one for sabre, or two 3886231Stmm * per pair of psycho's. 3986231Stmm */ 4086231Stmmstruct psycho_softc { 4186231Stmm device_t sc_dev; 4286231Stmm /* 4388823Stmm * PSYCHO register. we record the base physical address of these 4486231Stmm * also as it is the base of the entire PSYCHO 4586231Stmm */ 46113238Sjake vm_paddr_t sc_basepaddr; 4786231Stmm 4886231Stmm /* Interrupt Group Number for this device */ 4986231Stmm int sc_ign; 5086231Stmm 5186231Stmm /* our tags (from parent) */ 5286231Stmm bus_space_tag_t sc_bustag; 5388823Stmm bus_space_handle_t sc_bushandle; 5488823Stmm bus_dma_tag_t sc_dmatag; 5586231Stmm 5690617Stmm bus_addr_t sc_pcictl; 5790617Stmm 5886231Stmm int sc_clockfreq; 5986231Stmm phandle_t sc_node; /* prom node */ 6086231Stmm int sc_mode; 6186231Stmm#define PSYCHO_MODE_SABRE 1 6286231Stmm#define PSYCHO_MODE_PSYCHO 2 6386231Stmm 64115417Stmm /* Bus A or B of a psycho pair? */ 65115417Stmm int sc_half; 66115417Stmm 6786231Stmm struct iommu_state *sc_is; 68108800Stmm u_int32_t sc_dvmabase; 6986231Stmm 7088823Stmm struct resource *sc_mem_res; 7188823Stmm struct resource *sc_irq_res[6]; 7286231Stmm void *sc_ihand[6]; 7386231Stmm 74117119Stmm#ifdef OFW_NEWPCI 75117119Stmm struct ofw_bus_iinfo sc_iinfo; 76117119Stmm#endif 77117119Stmm 7886231Stmm /* 7986231Stmm * note that the sabre really only has one ranges property, 8086231Stmm * used for both simba a and simba b (but the ranges for 8186231Stmm * real psychos are the same for PCI A and PCI B anyway). 8286231Stmm */ 8386231Stmm struct upa_ranges *sc_range; 8486231Stmm int sc_nrange; 8586231Stmm 8686231Stmm /* our tags */ 8786231Stmm bus_space_tag_t sc_cfgt; 8886231Stmm bus_space_tag_t sc_memt; 8986231Stmm bus_space_tag_t sc_iot; 9086231Stmm bus_dma_tag_t sc_dmat; 9186231Stmm 9286231Stmm bus_space_handle_t sc_bh[4]; 9386231Stmm 94117119Stmm u_int sc_secbus; 95117119Stmm u_int sc_subbus; 9686231Stmm 9786231Stmm struct rman sc_mem_rman; 9886231Stmm struct rman sc_io_rman; 99105274Stmm 100105274Stmm SLIST_ENTRY(psycho_softc) sc_link; 10186231Stmm}; 10286231Stmm 10386231Stmm#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */ 104