schizovar.h revision 292789
1235537Sgber/*-
2330449Seadler * Copyright (c) 2005 by Marius Strobl <marius@FreeBSD.org>.
3330449Seadler * All rights reserved.
4235537Sgber *
5235537Sgber * Redistribution and use in source and binary forms, with or without
6235537Sgber * modification, are permitted provided that the following conditions
7235537Sgber * are met:
8235537Sgber * 1. Redistributions of source code must retain the above copyright
9235537Sgber *    notice, this list of conditions, and the following disclaimer,
10235537Sgber *    without modification, immediately at the beginning of the file.
11235537Sgber * 2. Redistributions in binary form must reproduce the above copyright
12235537Sgber *    notice, this list of conditions and the following disclaimer in
13235537Sgber *    the documentation and/or other materials provided with the
14235537Sgber *    distribution.
15235537Sgber *
16235537Sgber * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17235537Sgber * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18235537Sgber * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19235537Sgber * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20235537Sgber * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21235537Sgber * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22235537Sgber * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23235537Sgber * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24235537Sgber * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25235537Sgber * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26235537Sgber * SUCH DAMAGE.
27235537Sgber *
28235537Sgber * $FreeBSD: stable/10/sys/sparc64/pci/schizovar.h 292789 2015-12-27 19:37:47Z marius $
29235537Sgber */
30235537Sgber
31235537Sgber#ifndef _SPARC64_PCI_SCHIZOVAR_H_
32235537Sgber#define	_SPARC64_PCI_SCHIZOVAR_H_
33235537Sgber
34235537Sgberstruct schizo_softc;
35235537Sgber
36235537Sgberstruct schizo_iommu_state {
37235537Sgber	struct iommu_state	sis_is;
38235537Sgber	struct schizo_softc	*sis_sc;
39235537Sgber};
40235537Sgber
41235537Sgberstruct schizo_softc {
42235537Sgber	/*
43235537Sgber	 * This is here so that we can hook up the common bus interface
44235537Sgber	 * methods in ofw_pci.c directly.
45235537Sgber	 */
46235537Sgber	struct ofw_pci_softc		sc_ops;
47235537Sgber
48235537Sgber	struct schizo_iommu_state	sc_is;
49235537Sgber	struct bus_dma_methods          sc_dma_methods;
50235537Sgber
51235537Sgber	struct mtx			sc_sync_mtx;
52235537Sgber	uint64_t			sc_sync_val;
53235537Sgber
54235537Sgber	struct mtx			*sc_mtx;
55235537Sgber
56235537Sgber	struct resource			*sc_mem_res[TOM_NREG];
57235537Sgber	struct resource			*sc_irq_res[STX_NINTR];
58235537Sgber	void				*sc_ihand[STX_NINTR];
59235537Sgber
60235537Sgber	SLIST_ENTRY(schizo_softc)	sc_link;
61235537Sgber
62235537Sgber	device_t			sc_dev;
63235537Sgber
64235537Sgber	u_int				sc_mode;
65235537Sgber#define	SCHIZO_MODE_SCZ			0
66235537Sgber#define	SCHIZO_MODE_TOM			1
67235537Sgber#define	SCHIZO_MODE_XMS			2
68235537Sgber
69235537Sgber	u_int				sc_flags;
70235537Sgber#define	SCHIZO_FLAGS_BSWAR		(1 << 0)
71235537Sgber#define	SCHIZO_FLAGS_XMODE		(1 << 1)
72235537Sgber
73235537Sgber	bus_addr_t			sc_cdma_map;
74235537Sgber	bus_addr_t			sc_cdma_clr;
75235537Sgber	uint32_t			sc_cdma_vec;
76235537Sgber	uint32_t			sc_cdma_state;
77235537Sgber#define	SCHIZO_CDMA_STATE_IDLE		(1 << 0)
78235537Sgber#define	SCHIZO_CDMA_STATE_PENDING	(1 << 1)
79235537Sgber#define	SCHIZO_CDMA_STATE_RECEIVED	(1 << 2)
80235537Sgber
81235537Sgber	u_int				sc_half;
82235537Sgber	uint32_t			sc_ign;
83	uint32_t			sc_ver;
84	uint32_t			sc_mrev;
85
86	uint32_t			sc_stats_dma_ce;
87	uint32_t			sc_stats_pci_non_fatal;
88};
89
90#endif /* !_SPARC64_PCI_SCHIZOVAR_H_ */
91