schizovar.h revision 230664
1183423Smarius/*- 2183423Smarius * Copyright (c) 2005 by Marius Strobl <marius@FreeBSD.org>. 3183423Smarius * All rights reserved. 4183423Smarius * 5183423Smarius * Redistribution and use in source and binary forms, with or without 6183423Smarius * modification, are permitted provided that the following conditions 7183423Smarius * are met: 8183423Smarius * 1. Redistributions of source code must retain the above copyright 9183423Smarius * notice, this list of conditions, and the following disclaimer, 10183423Smarius * without modification, immediately at the beginning of the file. 11183423Smarius * 2. Redistributions in binary form must reproduce the above copyright 12183423Smarius * notice, this list of conditions and the following disclaimer in 13183423Smarius * the documentation and/or other materials provided with the 14183423Smarius * distribution. 15183423Smarius * 16183423Smarius * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17183423Smarius * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18183423Smarius * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19183423Smarius * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 20183423Smarius * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21183423Smarius * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22183423Smarius * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23183423Smarius * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24183423Smarius * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25183423Smarius * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26183423Smarius * SUCH DAMAGE. 27183423Smarius * 28183423Smarius * $FreeBSD: head/sys/sparc64/pci/schizovar.h 230664 2012-01-28 22:42:33Z marius $ 29183423Smarius */ 30183423Smarius 31183423Smarius#ifndef _SPARC64_PCI_SCHIZOVAR_H_ 32183423Smarius#define _SPARC64_PCI_SCHIZOVAR_H_ 33183423Smarius 34220038Smariusstruct schizo_softc; 35220038Smarius 36220038Smariusstruct schizo_iommu_state { 37220038Smarius struct iommu_state sis_is; 38220038Smarius struct schizo_softc *sis_sc; 39220038Smarius}; 40220038Smarius 41183423Smariusstruct schizo_softc { 42220038Smarius struct bus_dma_methods sc_dma_methods; 43220038Smarius 44183423Smarius device_t sc_dev; 45183423Smarius 46220038Smarius struct mtx sc_sync_mtx; 47220038Smarius uint64_t sc_sync_val; 48220038Smarius 49183423Smarius struct mtx *sc_mtx; 50183423Smarius 51183423Smarius phandle_t sc_node; 52183423Smarius 53183423Smarius u_int sc_mode; 54185133Smarius#define SCHIZO_MODE_SCZ 0 55185133Smarius#define SCHIZO_MODE_TOM 1 56185133Smarius#define SCHIZO_MODE_XMS 2 57183423Smarius 58185133Smarius u_int sc_flags; 59208097Smarius#define SCHIZO_FLAGS_BSWAR (1 << 0) 60220038Smarius#define SCHIZO_FLAGS_XMODE (1 << 1) 61185133Smarius 62230664Smarius bus_addr_t sc_cdma_map; 63185133Smarius bus_addr_t sc_cdma_clr; 64230664Smarius uint32_t sc_cdma_vec; 65185133Smarius uint32_t sc_cdma_state; 66220038Smarius#define SCHIZO_CDMA_STATE_IDLE (1 << 0) 67185133Smarius#define SCHIZO_CDMA_STATE_PENDING (1 << 1) 68220038Smarius#define SCHIZO_CDMA_STATE_RECEIVED (1 << 2) 69185133Smarius 70183423Smarius u_int sc_half; 71183423Smarius uint32_t sc_ign; 72183423Smarius uint32_t sc_ver; 73220038Smarius uint32_t sc_mrev; 74183423Smarius 75183423Smarius struct resource *sc_mem_res[TOM_NREG]; 76183423Smarius struct resource *sc_irq_res[STX_NINTR]; 77183423Smarius void *sc_ihand[STX_NINTR]; 78183423Smarius 79220038Smarius struct schizo_iommu_state sc_is; 80183423Smarius 81183423Smarius struct rman sc_pci_mem_rman; 82183423Smarius struct rman sc_pci_io_rman; 83183423Smarius bus_space_handle_t sc_pci_bh[STX_NRANGE]; 84183423Smarius bus_space_tag_t sc_pci_cfgt; 85183423Smarius bus_space_tag_t sc_pci_iot; 86183423Smarius bus_dma_tag_t sc_pci_dmat; 87183423Smarius 88208097Smarius uint32_t sc_stats_dma_ce; 89208097Smarius uint32_t sc_stats_pci_non_fatal; 90208097Smarius 91183423Smarius uint8_t sc_pci_secbus; 92201395Smarius uint8_t sc_pci_subbus; 93183423Smarius 94183423Smarius struct ofw_bus_iinfo sc_pci_iinfo; 95183423Smarius 96183423Smarius SLIST_ENTRY(schizo_softc) sc_link; 97183423Smarius}; 98183423Smarius 99183423Smarius#endif /* !_SPARC64_PCI_SCHIZOVAR_H_ */ 100