psychovar.h revision 108800
1/*
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 *    derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 *	from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp
29 *
30 * $FreeBSD: head/sys/sparc64/pci/psychovar.h 108800 2003-01-06 16:51:06Z tmm $
31 */
32
33#ifndef _SPARC64_PCI_PSYCHOVAR_H_
34#define _SPARC64_PCI_PSYCHOVAR_H_
35
36/*
37 * per-PCI bus on mainbus softc structure; one for sabre, or two
38 * per pair of psycho's.
39 */
40struct psycho_softc {
41	device_t			sc_dev;
42	/*
43	 * PSYCHO register.  we record the base physical address of these
44	 * also as it is the base of the entire PSYCHO
45	 */
46	vm_offset_t			sc_basepaddr;
47
48	/* Interrupt Group Number for this device */
49	int				sc_ign;
50
51	/* our tags (from parent) */
52	bus_space_tag_t			sc_bustag;
53	bus_space_handle_t		sc_bushandle;
54	bus_dma_tag_t			sc_dmatag;
55
56	bus_addr_t			sc_pcictl;
57
58	int				sc_clockfreq;
59	phandle_t			sc_node;	/* prom node */
60	int				sc_mode;
61#define	PSYCHO_MODE_SABRE	1
62#define	PSYCHO_MODE_PSYCHO	2
63
64	struct iommu_state		*sc_is;
65	u_int32_t			sc_dvmabase;
66
67	struct resource			*sc_mem_res;
68	struct resource			*sc_irq_res[6];
69	void				*sc_ihand[6];
70
71	/*
72	 * note that the sabre really only has one ranges property,
73	 * used for both simba a and simba b (but the ranges for
74	 * real psychos are the same for PCI A and PCI B anyway).
75	 */
76	struct upa_ranges		*sc_range;
77	int				sc_nrange;
78
79	/* our tags */
80	bus_space_tag_t			sc_cfgt;
81	bus_space_tag_t			sc_memt;
82	bus_space_tag_t			sc_iot;
83	bus_dma_tag_t			sc_dmat;
84
85	bus_space_handle_t		sc_bh[4];
86
87	int				sc_busno;
88
89	struct rman			sc_mem_rman;
90	struct rman			sc_io_rman;
91
92	SLIST_ENTRY(psycho_softc)	sc_link;
93};
94
95#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */
96