psychovar.h revision 219567
1/*-
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
21 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 *	from: NetBSD: psychovar.h,v 1.15 2008/05/29 14:51:26 mrg Exp
27 *
28 * $FreeBSD: head/sys/sparc64/pci/psychovar.h 219567 2011-03-12 14:33:32Z marius $
29 */
30
31#ifndef _SPARC64_PCI_PSYCHOVAR_H_
32#define _SPARC64_PCI_PSYCHOVAR_H_
33
34/*
35 * Per-PCI bus on mainbus softc structure; one for sabre, or two
36 * per pair of psychos.
37 */
38struct psycho_softc {
39	device_t			sc_dev;
40
41	struct mtx			*sc_mtx;
42
43	/* Interrupt Group Number for this device */
44	uint32_t			sc_ign;
45
46	bus_addr_t			sc_pcictl;
47
48	phandle_t			sc_node;	/* Firmware node */
49	u_int				sc_mode;
50#define	PSYCHO_MODE_SABRE		0
51#define	PSYCHO_MODE_PSYCHO		1
52
53	/* Bus A or B of a psycho pair? */
54	u_int				sc_half;
55
56	struct iommu_state		*sc_is;
57
58	struct resource			*sc_mem_res;
59	struct resource			*sc_irq_res[PSYCHO_NINTR];
60	void				*sc_ihand[PSYCHO_NINTR];
61
62	struct ofw_bus_iinfo		sc_pci_iinfo;
63
64	/* Tags for PCI access */
65	bus_space_tag_t			sc_pci_cfgt;
66	bus_space_tag_t			sc_pci_memt;
67	bus_space_tag_t			sc_pci_iot;
68	bus_dma_tag_t			sc_pci_dmat;
69
70	bus_space_handle_t		sc_pci_bh[PSYCHO_NRANGE];
71
72	struct rman			sc_pci_mem_rman;
73	struct rman			sc_pci_io_rman;
74
75	uint8_t				sc_pci_secbus;
76	uint8_t				sc_pci_subbus;
77
78	uint8_t				sc_pci_hpbcfg[16];
79
80	SLIST_ENTRY(psycho_softc)	sc_link;
81};
82
83#endif /* !_SPARC64_PCI_PSYCHOVAR_H_ */
84