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 *
1486231Stmm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1586231Stmm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1686231Stmm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1786231Stmm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1886231Stmm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
1986231Stmm * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
2086231Stmm * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
2186231Stmm * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2286231Stmm * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2386231Stmm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2486231Stmm * SUCH DAMAGE.
2586231Stmm *
26219567Smarius *	from: NetBSD: psychovar.h,v 1.15 2008/05/29 14:51:26 mrg Exp
2786231Stmm *
2886231Stmm * $FreeBSD: releng/10.2/sys/sparc64/pci/psychovar.h 225931 2011-10-02 23:22:38Z marius $
2986231Stmm */
3086231Stmm
3186231Stmm#ifndef _SPARC64_PCI_PSYCHOVAR_H_
3286231Stmm#define _SPARC64_PCI_PSYCHOVAR_H_
3386231Stmm
3486231Stmm/*
35128625Stmm * Per-PCI bus on mainbus softc structure; one for sabre, or two
36128625Stmm * per pair of psychos.
3786231Stmm */
3886231Stmmstruct psycho_softc {
39220147Smarius	struct bus_dma_methods		*sc_dma_methods;
40220039Smarius
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;
52190109Smarius#define	PSYCHO_MODE_SABRE		0
53190109Smarius#define	PSYCHO_MODE_PSYCHO		1
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_iot;
69152696Smarius	bus_dma_tag_t			sc_pci_dmat;
7086231Stmm
71152696Smarius	bus_space_handle_t		sc_pci_bh[PSYCHO_NRANGE];
7286231Stmm
73152696Smarius	struct rman			sc_pci_mem_rman;
74152696Smarius	struct rman			sc_pci_io_rman;
75105274Stmm
76178279Smarius	uint8_t				sc_pci_secbus;
77201395Smarius	uint8_t				sc_pci_subbus;
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