psychovar.h revision 178279
1139825Simp/*-
286231Stmm * Copyright (c) 1999, 2000 Matthew R. Green
386231Stmm * All rights reserved.
486231Stmm *
586231Stmm * Redistribution and use in source and binary forms, with or without
686231Stmm * modification, are permitted provided that the following conditions
786231Stmm * are met:
886231Stmm * 1. Redistributions of source code must retain the above copyright
986231Stmm *    notice, this list of conditions and the following disclaimer.
1086231Stmm * 2. Redistributions in binary form must reproduce the above copyright
1186231Stmm *    notice, this list of conditions and the following disclaimer in the
1286231Stmm *    documentation and/or other materials provided with the distribution.
1386231Stmm * 3. The name of the author may not be used to endorse or promote products
1486231Stmm *    derived from this software without specific prior written permission.
1586231Stmm *
1686231Stmm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1786231Stmm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1886231Stmm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1986231Stmm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2086231Stmm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
2186231Stmm * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2286231Stmm * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2386231Stmm * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2486231Stmm * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2586231Stmm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2686231Stmm * SUCH DAMAGE.
2786231Stmm *
2886231Stmm *	from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp
2986231Stmm *
3086231Stmm * $FreeBSD: head/sys/sparc64/pci/psychovar.h 178279 2008-04-17 12:38:00Z marius $
3186231Stmm */
3286231Stmm
3386231Stmm#ifndef _SPARC64_PCI_PSYCHOVAR_H_
3486231Stmm#define _SPARC64_PCI_PSYCHOVAR_H_
3586231Stmm
3686231Stmm/*
37128625Stmm * Per-PCI bus on mainbus softc structure; one for sabre, or two
38128625Stmm * per pair of psychos.
3986231Stmm */
4086231Stmmstruct psycho_softc {
4186231Stmm	device_t			sc_dev;
4286231Stmm
43170851Smarius	struct mtx			*sc_mtx;
44170851Smarius
4586231Stmm	/* Interrupt Group Number for this device */
46174117Smarius	uint32_t			sc_ign;
4786231Stmm
4890617Stmm	bus_addr_t			sc_pcictl;
4990617Stmm
50152696Smarius	phandle_t			sc_node;	/* Firmware node */
51174117Smarius	u_int				sc_mode;
5286231Stmm#define	PSYCHO_MODE_SABRE	1
5386231Stmm#define	PSYCHO_MODE_PSYCHO	2
5486231Stmm
55115417Stmm	/* Bus A or B of a psycho pair? */
56174117Smarius	u_int				sc_half;
57115417Stmm
5886231Stmm	struct iommu_state		*sc_is;
5986231Stmm
6088823Stmm	struct resource			*sc_mem_res;
61152696Smarius	struct resource			*sc_irq_res[PSYCHO_NINTR];
62152696Smarius	void				*sc_ihand[PSYCHO_NINTR];
6386231Stmm
64152696Smarius	struct ofw_bus_iinfo		sc_pci_iinfo;
65117119Stmm
66152696Smarius	/* Tags for PCI access */
67152696Smarius	bus_space_tag_t			sc_pci_cfgt;
68152696Smarius	bus_space_tag_t			sc_pci_memt;
69152696Smarius	bus_space_tag_t			sc_pci_iot;
70152696Smarius	bus_dma_tag_t			sc_pci_dmat;
7186231Stmm
72152696Smarius	bus_space_handle_t		sc_pci_bh[PSYCHO_NRANGE];
7386231Stmm
74152696Smarius	struct rman			sc_pci_mem_rman;
75152696Smarius	struct rman			sc_pci_io_rman;
76105274Stmm
77178279Smarius	uint8_t				sc_pci_secbus;
78178279Smarius
79174117Smarius	uint8_t				sc_pci_hpbcfg[16];
80174117Smarius
81105274Stmm	SLIST_ENTRY(psycho_softc)	sc_link;
8286231Stmm};
8386231Stmm
84152696Smarius#endif /* !_SPARC64_PCI_PSYCHOVAR_H_ */
85