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/11.0/sys/sparc64/pci/psychovar.h 287726 2015-09-12 22:49:32Z 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 {
39287726Smarius	/*
40287726Smarius	 * This is here so that we can hook up the common bus interface
41287726Smarius	 * methods in ofw_pci.c directly.
42287726Smarius	 */
43287726Smarius	struct ofw_pci_softc		sc_ops;
44287726Smarius
45287726Smarius	struct iommu_state		*sc_is;
46220147Smarius	struct bus_dma_methods		*sc_dma_methods;
47220039Smarius
48170851Smarius	struct mtx			*sc_mtx;
49170851Smarius
50287726Smarius	struct resource			*sc_mem_res;
51287726Smarius	struct resource			*sc_irq_res[PSYCHO_NINTR];
52287726Smarius	void				*sc_ihand[PSYCHO_NINTR];
5386231Stmm
54287726Smarius	uint8_t				sc_pci_hpbcfg[16];
55287726Smarius
56287726Smarius	SLIST_ENTRY(psycho_softc)	sc_link;
57287726Smarius
58287726Smarius	device_t			sc_dev;
59287726Smarius
6090617Stmm	bus_addr_t			sc_pcictl;
6190617Stmm
62174117Smarius	u_int				sc_mode;
63190109Smarius#define	PSYCHO_MODE_SABRE		0
64190109Smarius#define	PSYCHO_MODE_PSYCHO		1
6586231Stmm
66115417Stmm	/* Bus A or B of a psycho pair? */
67174117Smarius	u_int				sc_half;
68115417Stmm
69287726Smarius	/* Interrupt Group Number for this device */
70287726Smarius	uint32_t			sc_ign;
7186231Stmm};
7286231Stmm
73152696Smarius#endif /* !_SPARC64_PCI_PSYCHOVAR_H_ */
74