psychovar.h revision 86231
133965Sjdp/*
278828Sobrien * Copyright (c) 1999, 2000 Matthew R. Green
378828Sobrien * All rights reserved.
433965Sjdp *
533965Sjdp * Redistribution and use in source and binary forms, with or without
633965Sjdp * modification, are permitted provided that the following conditions
733965Sjdp * are met:
833965Sjdp * 1. Redistributions of source code must retain the above copyright
933965Sjdp *    notice, this list of conditions and the following disclaimer.
1033965Sjdp * 2. Redistributions in binary form must reproduce the above copyright
1133965Sjdp *    notice, this list of conditions and the following disclaimer in the
1233965Sjdp *    documentation and/or other materials provided with the distribution.
1333965Sjdp * 3. The name of the author may not be used to endorse or promote products
1433965Sjdp *    derived from this software without specific prior written permission.
1533965Sjdp *
1633965Sjdp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1733965Sjdp * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1833965Sjdp * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1933965Sjdp * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2033965Sjdp * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
2133965Sjdp * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2233965Sjdp * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2333965Sjdp * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2433965Sjdp * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2533965Sjdp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2633965Sjdp * SUCH DAMAGE.
2733965Sjdp *
2833965Sjdp *	from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp
2933965Sjdp *
3033965Sjdp * $FreeBSD: head/sys/sparc64/pci/psychovar.h 86231 2001-11-09 20:19:58Z tmm $
3133965Sjdp */
3233965Sjdp
3333965Sjdp#ifndef _SPARC64_PCI_PSYCHOVAR_H_
3433965Sjdp#define _SPARC64_PCI_PSYCHOVAR_H_
3533965Sjdp
3633965Sjdp/*
3733965Sjdp * per-PCI bus on mainbus softc structure; one for sabre, or two
3833965Sjdp * per pair of psycho's.
3933965Sjdp */
4060484Sobrienstruct psycho_softc {
4160484Sobrien	device_t			sc_dev;
4260484Sobrien	/*
4360484Sobrien	 * PSYCHO register.  we record the base physical address of these
4433965Sjdp	 * also as it is the base of the entire PSYCHO
4560484Sobrien	 */
4633965Sjdp	struct psychoreg		*sc_regs;
4760484Sobrien	vm_offset_t			sc_basepaddr;
4860484Sobrien
4933965Sjdp	/* Interrupt Group Number for this device */
5033965Sjdp	int				sc_ign;
5133965Sjdp
5233965Sjdp	/* our tags (from parent) */
5333965Sjdp	bus_space_tag_t			sc_bustag;
5433965Sjdp	bus_dma_tag_t			sc_dmatag;
5533965Sjdp
5633965Sjdp	int				sc_clockfreq;
5733965Sjdp	phandle_t			sc_node;	/* prom node */
5833965Sjdp	int				sc_mode;
5933965Sjdp#define	PSYCHO_MODE_SABRE	1
6033965Sjdp#define	PSYCHO_MODE_PSYCHO	2
6133965Sjdp
6233965Sjdp	struct iommu_state		*sc_is;
6333965Sjdp
6433965Sjdp	struct resource			*sc_irq[6];
6533965Sjdp	void				*sc_ihand[6];
6633965Sjdp
6733965Sjdp	/*
6833965Sjdp	 * note that the sabre really only has one ranges property,
6933965Sjdp	 * used for both simba a and simba b (but the ranges for
7033965Sjdp	 * real psychos are the same for PCI A and PCI B anyway).
7133965Sjdp	 */
7260484Sobrien	struct upa_ranges		*sc_range;
73	int				sc_nrange;
74	struct ofw_pci_imap	 	*sc_intrmap;
75	int				sc_nintrmap;
76	struct ofw_pci_imap_msk		sc_intrmapmsk;
77
78	/* our tags */
79	bus_space_tag_t			sc_cfgt;
80	bus_space_tag_t			sc_memt;
81	bus_space_tag_t			sc_iot;
82	bus_dma_tag_t			sc_dmat;
83
84	bus_space_handle_t		sc_bh[4];
85
86	int				sc_busno;
87
88	struct rman			sc_mem_rman;
89	struct rman			sc_io_rman;
90};
91
92#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */
93