schizovar.h revision 1.3.2.2 1 1.3.2.2 mjf /* $NetBSD: schizovar.h,v 1.3.2.2 2009/01/17 13:28:32 mjf Exp $ */
2 1.3.2.2 mjf /* $OpenBSD: schizovar.h,v 1.10 2007/01/14 16:19:49 kettenis Exp $ */
3 1.3.2.2 mjf
4 1.3.2.2 mjf /*
5 1.3.2.2 mjf * Copyright (c) 2002 Jason L. Wright (jason (at) thought.net)
6 1.3.2.2 mjf * All rights reserved.
7 1.3.2.2 mjf *
8 1.3.2.2 mjf * Redistribution and use in source and binary forms, with or without
9 1.3.2.2 mjf * modification, are permitted provided that the following conditions
10 1.3.2.2 mjf * are met:
11 1.3.2.2 mjf * 1. Redistributions of source code must retain the above copyright
12 1.3.2.2 mjf * notice, this list of conditions and the following disclaimer.
13 1.3.2.2 mjf * 2. Redistributions in binary form must reproduce the above copyright
14 1.3.2.2 mjf * notice, this list of conditions and the following disclaimer in the
15 1.3.2.2 mjf * documentation and/or other materials provided with the distribution.
16 1.3.2.2 mjf *
17 1.3.2.2 mjf * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 1.3.2.2 mjf * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 1.3.2.2 mjf * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 1.3.2.2 mjf * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21 1.3.2.2 mjf * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 1.3.2.2 mjf * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 1.3.2.2 mjf * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 1.3.2.2 mjf * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25 1.3.2.2 mjf * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 1.3.2.2 mjf * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.3.2.2 mjf * POSSIBILITY OF SUCH DAMAGE.
28 1.3.2.2 mjf */
29 1.3.2.2 mjf
30 1.3.2.2 mjf struct schizo_pbm {
31 1.3.2.2 mjf struct schizo_softc *sp_sc;
32 1.3.2.2 mjf
33 1.3.2.2 mjf struct schizo_range *sp_range;
34 1.3.2.2 mjf pci_chipset_tag_t sp_pc;
35 1.3.2.2 mjf int sp_nreg;
36 1.3.2.2 mjf int sp_nrange;
37 1.3.2.2 mjf int sp_nintmap;
38 1.3.2.2 mjf
39 1.3.2.2 mjf bus_space_tag_t sp_memt;
40 1.3.2.2 mjf bus_space_tag_t sp_iot;
41 1.3.2.2 mjf bus_space_tag_t sp_regt;
42 1.3.2.2 mjf bus_space_handle_t sp_regh;
43 1.3.2.2 mjf bus_space_tag_t sp_cfgt;
44 1.3.2.2 mjf bus_space_handle_t sp_cfgh;
45 1.3.2.2 mjf bus_dma_tag_t sp_dmat;
46 1.3.2.2 mjf int sp_bus;
47 1.3.2.2 mjf int sp_flags;
48 1.3.2.2 mjf int sp_bus_a;
49 1.3.2.2 mjf struct iommu_state sp_is;
50 1.3.2.2 mjf struct strbuf_ctl sp_sb;
51 1.3.2.2 mjf char sp_flush[0x80];
52 1.3.2.2 mjf };
53 1.3.2.2 mjf
54 1.3.2.2 mjf struct schizo_softc {
55 1.3.2.2 mjf struct device sc_dv;
56 1.3.2.2 mjf int sc_node;
57 1.3.2.2 mjf int sc_ign;
58 1.3.2.2 mjf bus_dma_tag_t sc_dmat;
59 1.3.2.2 mjf bus_space_tag_t sc_bustag;
60 1.3.2.2 mjf bus_addr_t sc_ctrl;
61 1.3.2.2 mjf bus_space_handle_t sc_ctrlh;
62 1.3.2.2 mjf bus_space_handle_t sc_confh;
63 1.3.2.2 mjf struct upa_reg sc_reg0;
64 1.3.2.2 mjf
65 1.3.2.2 mjf int sc_busa;
66 1.3.2.2 mjf int sc_tomatillo;
67 1.3.2.2 mjf };
68 1.3.2.2 mjf
69 1.3.2.2 mjf #define schizo_read(sc,r) \
70 1.3.2.2 mjf bus_space_read_8((sc)->sc_bustag, (sc)->sc_ctrlh, (r))
71 1.3.2.2 mjf #define schizo_write(sc,r,v) \
72 1.3.2.2 mjf bus_space_write_8((sc)->sc_bustag, (sc)->sc_ctrlh, (r), (v))
73 1.3.2.2 mjf #define schizo_pbm_read(pbm,r) \
74 1.3.2.2 mjf bus_space_read_8((pbm)->sp_regt, (pbm)->sp_regh, (r))
75 1.3.2.2 mjf #define schizo_pbm_write(pbm,r,v) \
76 1.3.2.2 mjf bus_space_write_8((pbm)->sp_regt, (pbm)->sp_regh, (r), (v))
77 1.3.2.2 mjf #define schizo_cfg_read(pbm,r) \
78 1.3.2.2 mjf bus_space_read_4((pbm)->sp_cfgt, (pbm)->sp_cfgh, (r))
79 1.3.2.2 mjf #define schizo_cfg_write(pbm,r,v) \
80 1.3.2.2 mjf bus_space_write_4((pbm)->sp_cfgt, (pbm)->sp_cfgh, (r), (v))
81