psychovar.h revision 219567
1139825Simp/*- 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 * 1486231Stmm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1586231Stmm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1686231Stmm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1786231Stmm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1886231Stmm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 1986231Stmm * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 2086231Stmm * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2186231Stmm * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2286231Stmm * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2386231Stmm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2486231Stmm * SUCH DAMAGE. 2586231Stmm * 26219567Smarius * from: NetBSD: psychovar.h,v 1.15 2008/05/29 14:51:26 mrg Exp 2786231Stmm * 2886231Stmm * $FreeBSD: head/sys/sparc64/pci/psychovar.h 219567 2011-03-12 14:33:32Z marius $ 2986231Stmm */ 3086231Stmm 3186231Stmm#ifndef _SPARC64_PCI_PSYCHOVAR_H_ 3286231Stmm#define _SPARC64_PCI_PSYCHOVAR_H_ 3386231Stmm 3486231Stmm/* 35128625Stmm * Per-PCI bus on mainbus softc structure; one for sabre, or two 36128625Stmm * per pair of psychos. 3786231Stmm */ 3886231Stmmstruct psycho_softc { 3986231Stmm device_t sc_dev; 4086231Stmm 41170851Smarius struct mtx *sc_mtx; 42170851Smarius 4386231Stmm /* Interrupt Group Number for this device */ 44174117Smarius uint32_t sc_ign; 4586231Stmm 4690617Stmm bus_addr_t sc_pcictl; 4790617Stmm 48152696Smarius phandle_t sc_node; /* Firmware node */ 49174117Smarius u_int sc_mode; 50190109Smarius#define PSYCHO_MODE_SABRE 0 51190109Smarius#define PSYCHO_MODE_PSYCHO 1 5286231Stmm 53115417Stmm /* Bus A or B of a psycho pair? */ 54174117Smarius u_int sc_half; 55115417Stmm 5686231Stmm struct iommu_state *sc_is; 5786231Stmm 5888823Stmm struct resource *sc_mem_res; 59152696Smarius struct resource *sc_irq_res[PSYCHO_NINTR]; 60152696Smarius void *sc_ihand[PSYCHO_NINTR]; 6186231Stmm 62152696Smarius struct ofw_bus_iinfo sc_pci_iinfo; 63117119Stmm 64152696Smarius /* Tags for PCI access */ 65152696Smarius bus_space_tag_t sc_pci_cfgt; 66152696Smarius bus_space_tag_t sc_pci_memt; 67152696Smarius bus_space_tag_t sc_pci_iot; 68152696Smarius bus_dma_tag_t sc_pci_dmat; 6986231Stmm 70152696Smarius bus_space_handle_t sc_pci_bh[PSYCHO_NRANGE]; 7186231Stmm 72152696Smarius struct rman sc_pci_mem_rman; 73152696Smarius struct rman sc_pci_io_rman; 74105274Stmm 75178279Smarius uint8_t sc_pci_secbus; 76201395Smarius uint8_t sc_pci_subbus; 77178279Smarius 78174117Smarius uint8_t sc_pci_hpbcfg[16]; 79174117Smarius 80105274Stmm SLIST_ENTRY(psycho_softc) sc_link; 8186231Stmm}; 8286231Stmm 83152696Smarius#endif /* !_SPARC64_PCI_PSYCHOVAR_H_ */ 84