xref: /openbsd-src/sys/arch/sparc64/dev/pyrovar.h (revision 1d9e937e45405d8fccbf06a258cd97fbc51591ce)
1*1d9e937eSjmatthew /*	$OpenBSD: pyrovar.h,v 1.5 2020/06/23 01:21:29 jmatthew Exp $	*/
2c36e1b75Skettenis 
3c36e1b75Skettenis /*
4c36e1b75Skettenis  * Copyright (c) 2007 Mark Kettenis
5c36e1b75Skettenis  * All rights reserved.
6c36e1b75Skettenis  *
7c36e1b75Skettenis  * Redistribution and use in source and binary forms, with or without
8c36e1b75Skettenis  * modification, are permitted provided that the following conditions
9c36e1b75Skettenis  * are met:
10c36e1b75Skettenis  * 1. Redistributions of source code must retain the above copyright
11c36e1b75Skettenis  *    notice, this list of conditions and the following disclaimer.
12c36e1b75Skettenis  * 2. Redistributions in binary form must reproduce the above copyright
13c36e1b75Skettenis  *    notice, this list of conditions and the following disclaimer in the
14c36e1b75Skettenis  *    documentation and/or other materials provided with the distribution.
15c36e1b75Skettenis  *
16c36e1b75Skettenis  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17c36e1b75Skettenis  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18c36e1b75Skettenis  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19c36e1b75Skettenis  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
20c36e1b75Skettenis  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21c36e1b75Skettenis  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22c36e1b75Skettenis  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23c36e1b75Skettenis  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24c36e1b75Skettenis  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
25c36e1b75Skettenis  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26c36e1b75Skettenis  * POSSIBILITY OF SUCH DAMAGE.
27c36e1b75Skettenis  */
28c36e1b75Skettenis 
293eacbc82Skettenis struct pyro_msi_msg {
303eacbc82Skettenis 	uint8_t		mm_type;
313eacbc82Skettenis 	uint8_t		mm_reserved[3];
323eacbc82Skettenis 	uint16_t	mm_reqid;
333eacbc82Skettenis 	uint16_t	mm_data;
343eacbc82Skettenis 	uint64_t	mm_reserved2[7];
353eacbc82Skettenis };
363eacbc82Skettenis 
37c36e1b75Skettenis struct pyro_range {
38c36e1b75Skettenis 	u_int32_t	cspace;
39c36e1b75Skettenis 	u_int32_t	child_hi;
40c36e1b75Skettenis 	u_int32_t	child_lo;
41c36e1b75Skettenis 	u_int32_t	phys_hi;
42c36e1b75Skettenis 	u_int32_t	phys_lo;
43c36e1b75Skettenis 	u_int32_t	size_hi;
44c36e1b75Skettenis 	u_int32_t	size_lo;
45c36e1b75Skettenis };
46c36e1b75Skettenis 
47*1d9e937eSjmatthew struct pyro_eq {
48*1d9e937eSjmatthew 	char			eq_name[16];
49*1d9e937eSjmatthew 	struct pyro_pbm		*eq_pbm;
50*1d9e937eSjmatthew 	void			*eq_ih;
51*1d9e937eSjmatthew 	bus_size_t		eq_head;
52*1d9e937eSjmatthew 	bus_size_t		eq_tail;
53*1d9e937eSjmatthew 	struct pyro_msi_msg	*eq_ring;
54*1d9e937eSjmatthew 	uint64_t		eq_mask;
55*1d9e937eSjmatthew 
56*1d9e937eSjmatthew 	unsigned int		eq_id;
57*1d9e937eSjmatthew 	unsigned int		eq_intr;
58*1d9e937eSjmatthew };
59*1d9e937eSjmatthew 
60c36e1b75Skettenis struct pyro_pbm {
61c36e1b75Skettenis 	struct pyro_softc *pp_sc;
62c36e1b75Skettenis 
63c36e1b75Skettenis 	struct pyro_range *pp_range;
64c36e1b75Skettenis 	pci_chipset_tag_t pp_pc;
65c36e1b75Skettenis 	int pp_nrange;
66c36e1b75Skettenis 
67c36e1b75Skettenis 	bus_space_tag_t		pp_memt;
68c36e1b75Skettenis 	bus_space_tag_t		pp_iot;
69c36e1b75Skettenis 	bus_space_tag_t		pp_cfgt;
70c36e1b75Skettenis 	bus_space_handle_t	pp_cfgh;
71c36e1b75Skettenis 	bus_dma_tag_t		pp_dmat;
72c36e1b75Skettenis 	int			pp_bus_a;
7370c5f0d9Skettenis 	struct iommu_state	pp_is;
7470c5f0d9Skettenis 	struct strbuf_ctl	pp_sb;
753eacbc82Skettenis 
763eacbc82Skettenis 	struct msi_eq *pp_meq;
773eacbc82Skettenis 	bus_addr_t pp_msiaddr;
783eacbc82Skettenis 	int pp_msinum;
793eacbc82Skettenis 	struct intrhand **pp_msi;
803eacbc82Skettenis 
81*1d9e937eSjmatthew 	unsigned int		pp_neq;
82*1d9e937eSjmatthew 	struct pyro_eq		*pp_eq;
83*1d9e937eSjmatthew 
843eacbc82Skettenis 	int pp_flags;
85c36e1b75Skettenis };
86c36e1b75Skettenis 
87c36e1b75Skettenis struct pyro_softc {
88c36e1b75Skettenis 	struct device sc_dv;
89c36e1b75Skettenis 	int sc_node;
90c36e1b75Skettenis 	int sc_ign;
91c36e1b75Skettenis 	bus_dma_tag_t sc_dmat;
92c36e1b75Skettenis 	bus_space_tag_t sc_bust;
9306399e9dSkettenis 	bus_addr_t sc_csr, sc_xbc;
9406399e9dSkettenis 	bus_space_handle_t sc_csrh, sc_xbch;
95c36e1b75Skettenis 
96*1d9e937eSjmatthew #if 0
97*1d9e937eSjmatthew 	struct pyro_pbm *sc_pbm;
98*1d9e937eSjmatthew #endif
99*1d9e937eSjmatthew 
100c36e1b75Skettenis 	int sc_oberon;
101c36e1b75Skettenis };
102