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$
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 {
42292789Smarius	/*
43292789Smarius	 * This is here so that we can hook up the common bus interface
44292789Smarius	 * methods in ofw_pci.c directly.
45292789Smarius	 */
46292789Smarius	struct ofw_pci_softc		sc_ops;
47292789Smarius
48292789Smarius	struct schizo_iommu_state	sc_is;
49220038Smarius	struct bus_dma_methods          sc_dma_methods;
50220038Smarius
51220038Smarius	struct mtx			sc_sync_mtx;
52220038Smarius	uint64_t			sc_sync_val;
53220038Smarius
54183423Smarius	struct mtx			*sc_mtx;
55183423Smarius
56292789Smarius	struct resource			*sc_mem_res[TOM_NREG];
57292789Smarius	struct resource			*sc_irq_res[STX_NINTR];
58292789Smarius	void				*sc_ihand[STX_NINTR];
59183423Smarius
60292789Smarius	SLIST_ENTRY(schizo_softc)	sc_link;
61292789Smarius
62292789Smarius	device_t			sc_dev;
63292789Smarius
64183423Smarius	u_int				sc_mode;
65185133Smarius#define	SCHIZO_MODE_SCZ			0
66185133Smarius#define	SCHIZO_MODE_TOM			1
67185133Smarius#define	SCHIZO_MODE_XMS			2
68183423Smarius
69185133Smarius	u_int				sc_flags;
70208097Smarius#define	SCHIZO_FLAGS_BSWAR		(1 << 0)
71220038Smarius#define	SCHIZO_FLAGS_XMODE		(1 << 1)
72185133Smarius
73230664Smarius	bus_addr_t			sc_cdma_map;
74185133Smarius	bus_addr_t			sc_cdma_clr;
75230664Smarius	uint32_t			sc_cdma_vec;
76185133Smarius	uint32_t			sc_cdma_state;
77220038Smarius#define	SCHIZO_CDMA_STATE_IDLE		(1 << 0)
78185133Smarius#define	SCHIZO_CDMA_STATE_PENDING	(1 << 1)
79220038Smarius#define	SCHIZO_CDMA_STATE_RECEIVED	(1 << 2)
80185133Smarius
81183423Smarius	u_int				sc_half;
82183423Smarius	uint32_t			sc_ign;
83183423Smarius	uint32_t			sc_ver;
84220038Smarius	uint32_t			sc_mrev;
85183423Smarius
86208097Smarius	uint32_t			sc_stats_dma_ce;
87208097Smarius	uint32_t			sc_stats_pci_non_fatal;
88183423Smarius};
89183423Smarius
90183423Smarius#endif /* !_SPARC64_PCI_SCHIZOVAR_H_ */
91