psychovar.h revision 152696
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 152696 2005-11-22 21:34:26Z 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;
42113238Sjake	vm_paddr_t			sc_basepaddr;
4386231Stmm
4486231Stmm	/* Interrupt Group Number for this device */
4586231Stmm	int				sc_ign;
4686231Stmm
47152696Smarius	/* Our tags (from parent) */
4886231Stmm	bus_space_tag_t			sc_bustag;
4988823Stmm	bus_space_handle_t		sc_bushandle;
5088823Stmm	bus_dma_tag_t			sc_dmatag;
5186231Stmm
5290617Stmm	bus_addr_t			sc_pcictl;
5390617Stmm
54152696Smarius	phandle_t			sc_node;	/* Firmware node */
5586231Stmm	int				sc_mode;
5686231Stmm#define	PSYCHO_MODE_SABRE	1
5786231Stmm#define	PSYCHO_MODE_PSYCHO	2
5886231Stmm
59115417Stmm	/* Bus A or B of a psycho pair? */
60115417Stmm	int				sc_half;
61115417Stmm
6286231Stmm	struct iommu_state		*sc_is;
63152696Smarius	uint32_t			sc_dvmabase;
6486231Stmm
6588823Stmm	struct resource			*sc_mem_res;
66152696Smarius	struct resource			*sc_irq_res[PSYCHO_NINTR];
67152696Smarius	void				*sc_ihand[PSYCHO_NINTR];
6886231Stmm
69152696Smarius	struct ofw_bus_iinfo		sc_pci_iinfo;
70117119Stmm
7186231Stmm	struct upa_ranges		*sc_range;
7286231Stmm	int				sc_nrange;
7386231Stmm
74152696Smarius	/* Tags for PCI access */
75152696Smarius	bus_space_tag_t			sc_pci_cfgt;
76152696Smarius	bus_space_tag_t			sc_pci_memt;
77152696Smarius	bus_space_tag_t			sc_pci_iot;
78152696Smarius	bus_dma_tag_t			sc_pci_dmat;
7986231Stmm
80152696Smarius	bus_space_handle_t		sc_pci_bh[PSYCHO_NRANGE];
8186231Stmm
82152696Smarius	u_int				sc_pci_secbus;
83152696Smarius	u_int				sc_pci_subbus;
8486231Stmm
85152696Smarius	struct rman			sc_pci_mem_rman;
86152696Smarius	struct rman			sc_pci_io_rman;
87105274Stmm
88105274Stmm	SLIST_ENTRY(psycho_softc)	sc_link;
8986231Stmm};
9086231Stmm
91152696Smarius#endif /* !_SPARC64_PCI_PSYCHOVAR_H_ */
92