psychovar.h revision 115417
191094Sdes/*
292289Sdes * Copyright (c) 1999, 2000 Matthew R. Green
391094Sdes * All rights reserved.
491094Sdes *
591094Sdes * Redistribution and use in source and binary forms, with or without
691094Sdes * modification, are permitted provided that the following conditions
791094Sdes * are met:
891094Sdes * 1. Redistributions of source code must retain the above copyright
991094Sdes *    notice, this list of conditions and the following disclaimer.
1091094Sdes * 2. Redistributions in binary form must reproduce the above copyright
1191094Sdes *    notice, this list of conditions and the following disclaimer in the
1291094Sdes *    documentation and/or other materials provided with the distribution.
1391094Sdes * 3. The name of the author may not be used to endorse or promote products
1491094Sdes *    derived from this software without specific prior written permission.
1591094Sdes *
1691094Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1791094Sdes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1891094Sdes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1991094Sdes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2091094Sdes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
2191094Sdes * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2291094Sdes * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2391094Sdes * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2491094Sdes * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2591094Sdes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2691094Sdes * SUCH DAMAGE.
2791094Sdes *
2891094Sdes *	from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp
2991094Sdes *
3091094Sdes * $FreeBSD: head/sys/sparc64/pci/psychovar.h 115417 2003-05-30 20:48:05Z tmm $
3191094Sdes */
3291094Sdes
3391094Sdes#ifndef _SPARC64_PCI_PSYCHOVAR_H_
3494670Sdes#define _SPARC64_PCI_PSYCHOVAR_H_
3591094Sdes
3691094Sdes/*
3791094Sdes * per-PCI bus on mainbus softc structure; one for sabre, or two
3891094Sdes * per pair of psycho's.
3991094Sdes */
4091094Sdesstruct psycho_softc {
4191094Sdes	device_t			sc_dev;
4291094Sdes	/*
4391094Sdes	 * PSYCHO register.  we record the base physical address of these
4491094Sdes	 * also as it is the base of the entire PSYCHO
4591094Sdes	 */
4691094Sdes	vm_paddr_t			sc_basepaddr;
4791094Sdes
4891094Sdes	/* Interrupt Group Number for this device */
4991094Sdes	int				sc_ign;
5091094Sdes
5191094Sdes	/* our tags (from parent) */
5291094Sdes	bus_space_tag_t			sc_bustag;
5391094Sdes	bus_space_handle_t		sc_bushandle;
5491094Sdes	bus_dma_tag_t			sc_dmatag;
5591094Sdes
5691094Sdes	bus_addr_t			sc_pcictl;
5791100Sdes
5891100Sdes	int				sc_clockfreq;
5991100Sdes	phandle_t			sc_node;	/* prom node */
6091100Sdes	int				sc_mode;
6191100Sdes#define	PSYCHO_MODE_SABRE	1
6291100Sdes#define	PSYCHO_MODE_PSYCHO	2
6391100Sdes
6491100Sdes	/* Bus A or B of a psycho pair? */
6594670Sdes	int				sc_half;
6694670Sdes
6794670Sdes	struct iommu_state		*sc_is;
6894670Sdes	u_int32_t			sc_dvmabase;
6994670Sdes
7094670Sdes	struct resource			*sc_mem_res;
7194670Sdes	struct resource			*sc_irq_res[6];
7294670Sdes	void				*sc_ihand[6];
7394670Sdes
7494670Sdes	/*
7594670Sdes	 * note that the sabre really only has one ranges property,
7694670Sdes	 * used for both simba a and simba b (but the ranges for
7794670Sdes	 * real psychos are the same for PCI A and PCI B anyway).
7894670Sdes	 */
7994670Sdes	struct upa_ranges		*sc_range;
8094670Sdes	int				sc_nrange;
81
82	/* our tags */
83	bus_space_tag_t			sc_cfgt;
84	bus_space_tag_t			sc_memt;
85	bus_space_tag_t			sc_iot;
86	bus_dma_tag_t			sc_dmat;
87
88	bus_space_handle_t		sc_bh[4];
89
90	int				sc_busno;
91
92	struct rman			sc_mem_rman;
93	struct rman			sc_io_rman;
94
95	SLIST_ENTRY(psycho_softc)	sc_link;
96};
97
98#endif /* _SPARC64_PCI_PSYCHOVAR_H_ */
99