psychovar.h revision 115417
1184610Salfred/* 2184610Salfred * Copyright (c) 1999, 2000 Matthew R. Green 3184610Salfred * All rights reserved. 4184610Salfred * 5184610Salfred * Redistribution and use in source and binary forms, with or without 6184610Salfred * modification, are permitted provided that the following conditions 7184610Salfred * are met: 8184610Salfred * 1. Redistributions of source code must retain the above copyright 9184610Salfred * notice, this list of conditions and the following disclaimer. 10184610Salfred * 2. Redistributions in binary form must reproduce the above copyright 11184610Salfred * notice, this list of conditions and the following disclaimer in the 12184610Salfred * documentation and/or other materials provided with the distribution. 13184610Salfred * 3. The name of the author may not be used to endorse or promote products 14184610Salfred * derived from this software without specific prior written permission. 15184610Salfred * 16184610Salfred * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17184610Salfred * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18184610Salfred * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19184610Salfred * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20184610Salfred * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21184610Salfred * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22184610Salfred * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23184610Salfred * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24184610Salfred * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25184610Salfred * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26184610Salfred * SUCH DAMAGE. 27184610Salfred * 28184610Salfred * from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp 29184610Salfred * 30184610Salfred * $FreeBSD: head/sys/sparc64/pci/psychovar.h 115417 2003-05-30 20:48:05Z tmm $ 31184610Salfred */ 32184610Salfred 33184610Salfred#ifndef _SPARC64_PCI_PSYCHOVAR_H_ 34184610Salfred#define _SPARC64_PCI_PSYCHOVAR_H_ 35184610Salfred 36184610Salfred/* 37184610Salfred * per-PCI bus on mainbus softc structure; one for sabre, or two 38184610Salfred * per pair of psycho's. 39184610Salfred */ 40184610Salfredstruct psycho_softc { 41184610Salfred device_t sc_dev; 42184610Salfred /* 43184610Salfred * PSYCHO register. we record the base physical address of these 44184610Salfred * also as it is the base of the entire PSYCHO 45184610Salfred */ 46184610Salfred vm_paddr_t sc_basepaddr; 47184610Salfred 48184610Salfred /* Interrupt Group Number for this device */ 49184610Salfred int sc_ign; 50184610Salfred 51184610Salfred /* our tags (from parent) */ 52184610Salfred bus_space_tag_t sc_bustag; 53184610Salfred bus_space_handle_t sc_bushandle; 54184610Salfred bus_dma_tag_t sc_dmatag; 55184610Salfred 56184610Salfred bus_addr_t sc_pcictl; 57184610Salfred 58184610Salfred int sc_clockfreq; 59184610Salfred phandle_t sc_node; /* prom node */ 60184610Salfred int sc_mode; 61184610Salfred#define PSYCHO_MODE_SABRE 1 62184610Salfred#define PSYCHO_MODE_PSYCHO 2 63184610Salfred 64184610Salfred /* Bus A or B of a psycho pair? */ 65184610Salfred int sc_half; 66184610Salfred 67184610Salfred struct iommu_state *sc_is; 68194677Sthompsa u_int32_t sc_dvmabase; 69194677Sthompsa 70194677Sthompsa struct resource *sc_mem_res; 71194677Sthompsa struct resource *sc_irq_res[6]; 72194677Sthompsa void *sc_ihand[6]; 73194677Sthompsa 74194677Sthompsa /* 75194677Sthompsa * note that the sabre really only has one ranges property, 76194677Sthompsa * used for both simba a and simba b (but the ranges for 77194677Sthompsa * real psychos are the same for PCI A and PCI B anyway). 78194677Sthompsa */ 79194677Sthompsa struct upa_ranges *sc_range; 80194677Sthompsa int sc_nrange; 81194677Sthompsa 82194677Sthompsa /* our tags */ 83194677Sthompsa bus_space_tag_t sc_cfgt; 84194677Sthompsa bus_space_tag_t sc_memt; 85194677Sthompsa bus_space_tag_t sc_iot; 86194677Sthompsa bus_dma_tag_t sc_dmat; 87194677Sthompsa 88194677Sthompsa bus_space_handle_t sc_bh[4]; 89194677Sthompsa 90194677Sthompsa int sc_busno; 91188746Sthompsa 92184610Salfred struct rman sc_mem_rman; 93184610Salfred struct rman sc_io_rman; 94194677Sthompsa 95188942Sthompsa SLIST_ENTRY(psycho_softc) sc_link; 96184610Salfred}; 97188942Sthompsa 98188942Sthompsa#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */ 99184610Salfred