psychovar.h revision 86231
1112918Sjeff/*
2144518Sdavidxu * Copyright (c) 1999, 2000 Matthew R. Green
3112918Sjeff * All rights reserved.
4112918Sjeff *
5112918Sjeff * Redistribution and use in source and binary forms, with or without
6112918Sjeff * modification, are permitted provided that the following conditions
7112918Sjeff * are met:
8112918Sjeff * 1. Redistributions of source code must retain the above copyright
9112918Sjeff *    notice, this list of conditions and the following disclaimer.
10112918Sjeff * 2. Redistributions in binary form must reproduce the above copyright
11112918Sjeff *    notice, this list of conditions and the following disclaimer in the
12112918Sjeff *    documentation and/or other materials provided with the distribution.
13112918Sjeff * 3. The name of the author may not be used to endorse or promote products
14112918Sjeff *    derived from this software without specific prior written permission.
15112918Sjeff *
16112918Sjeff * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17112918Sjeff * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18112918Sjeff * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19112918Sjeff * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20112918Sjeff * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21112918Sjeff * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22112918Sjeff * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23112918Sjeff * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24112918Sjeff * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25112918Sjeff * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26112918Sjeff * SUCH DAMAGE.
27112918Sjeff *
28112918Sjeff *	from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp
29112918Sjeff *
30112918Sjeff * $FreeBSD: head/sys/sparc64/pci/psychovar.h 86231 2001-11-09 20:19:58Z tmm $
31112918Sjeff */
32112918Sjeff
33144518Sdavidxu#ifndef _SPARC64_PCI_PSYCHOVAR_H_
34149691Sstefanf#define _SPARC64_PCI_PSYCHOVAR_H_
35144518Sdavidxu
36112918Sjeff/*
37144518Sdavidxu * per-PCI bus on mainbus softc structure; one for sabre, or two
38144518Sdavidxu * per pair of psycho's.
39144518Sdavidxu */
40144518Sdavidxustruct psycho_softc {
41144518Sdavidxu	device_t			sc_dev;
42144518Sdavidxu	/*
43144518Sdavidxu	 * PSYCHO register.  we record the base physical address of these
44112918Sjeff	 * also as it is the base of the entire PSYCHO
45112918Sjeff	 */
46201546Sdavidxu	struct psychoreg		*sc_regs;
47201546Sdavidxu	vm_offset_t			sc_basepaddr;
48201546Sdavidxu
49201546Sdavidxu	/* Interrupt Group Number for this device */
50201546Sdavidxu	int				sc_ign;
51201546Sdavidxu
52201546Sdavidxu	/* our tags (from parent) */
53112918Sjeff	bus_space_tag_t			sc_bustag;
54201546Sdavidxu	bus_dma_tag_t			sc_dmatag;
55112918Sjeff
56201546Sdavidxu	int				sc_clockfreq;
57201546Sdavidxu	phandle_t			sc_node;	/* prom node */
58201546Sdavidxu	int				sc_mode;
59201546Sdavidxu#define	PSYCHO_MODE_SABRE	1
60201546Sdavidxu#define	PSYCHO_MODE_PSYCHO	2
61201546Sdavidxu
62201546Sdavidxu	struct iommu_state		*sc_is;
63201546Sdavidxu
64112918Sjeff	struct resource			*sc_irq[6];
65201546Sdavidxu	void				*sc_ihand[6];
66201546Sdavidxu
67201546Sdavidxu	/*
68201546Sdavidxu	 * note that the sabre really only has one ranges property,
69201546Sdavidxu	 * used for both simba a and simba b (but the ranges for
70201546Sdavidxu	 * real psychos are the same for PCI A and PCI B anyway).
71201546Sdavidxu	 */
72201546Sdavidxu	struct upa_ranges		*sc_range;
73112918Sjeff	int				sc_nrange;
74144518Sdavidxu	struct ofw_pci_imap	 	*sc_intrmap;
75201546Sdavidxu	int				sc_nintrmap;
76144518Sdavidxu	struct ofw_pci_imap_msk		sc_intrmapmsk;
77201546Sdavidxu
78112918Sjeff	/* our tags */
79112918Sjeff	bus_space_tag_t			sc_cfgt;
80112918Sjeff	bus_space_tag_t			sc_memt;
81201546Sdavidxu	bus_space_tag_t			sc_iot;
82112918Sjeff	bus_dma_tag_t			sc_dmat;
83201546Sdavidxu
84112918Sjeff	bus_space_handle_t		sc_bh[4];
85112918Sjeff
86112918Sjeff	int				sc_busno;
87201546Sdavidxu
88112918Sjeff	struct rman			sc_mem_rman;
89201546Sdavidxu	struct rman			sc_io_rman;
90112918Sjeff};
91112918Sjeff
92112918Sjeff#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */
93201546Sdavidxu