gtpcivar.h revision 1.1 1 1.1 matt /* $NetBSD: gtpcivar.h,v 1.1 2003/03/05 22:08:22 matt Exp $ */
2 1.1 matt
3 1.1 matt /*
4 1.1 matt * Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
5 1.1 matt * All rights reserved.
6 1.1 matt *
7 1.1 matt * Redistribution and use in source and binary forms, with or without
8 1.1 matt * modification, are permitted provided that the following conditions
9 1.1 matt * are met:
10 1.1 matt * 1. Redistributions of source code must retain the above copyright
11 1.1 matt * notice, this list of conditions and the following disclaimer.
12 1.1 matt * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 matt * notice, this list of conditions and the following disclaimer in the
14 1.1 matt * documentation and/or other materials provided with the distribution.
15 1.1 matt * 3. All advertising materials mentioning features or use of this software
16 1.1 matt * must display the following acknowledgement:
17 1.1 matt * This product includes software developed for the NetBSD Project by
18 1.1 matt * Allegro Networks, Inc., and Wasabi Systems, Inc.
19 1.1 matt * 4. The name of Allegro Networks, Inc. may not be used to endorse
20 1.1 matt * or promote products derived from this software without specific prior
21 1.1 matt * written permission.
22 1.1 matt * 5. The name of Wasabi Systems, Inc. may not be used to endorse
23 1.1 matt * or promote products derived from this software without specific prior
24 1.1 matt * written permission.
25 1.1 matt *
26 1.1 matt * THIS SOFTWARE IS PROVIDED BY ALLEGRO NETWORKS, INC. AND
27 1.1 matt * WASABI SYSTEMS, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
28 1.1 matt * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
29 1.1 matt * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30 1.1 matt * IN NO EVENT SHALL EITHER ALLEGRO NETWORKS, INC. OR WASABI SYSTEMS, INC.
31 1.1 matt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 1.1 matt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 1.1 matt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 1.1 matt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 1.1 matt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 1.1 matt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 1.1 matt * POSSIBILITY OF SUCH DAMAGE.
38 1.1 matt */
39 1.1 matt
40 1.1 matt #ifndef _DEV_MARVELL_GTPCIVAR_H
41 1.1 matt #define _DEV_MARVELL_GTPCIVAR_H
42 1.1 matt
43 1.1 matt /*
44 1.1 matt */
45 1.1 matt
46 1.1 matt static uint32_t __inline
47 1.1 matt gtpci_read(pci_chipset_tag_t pc, bus_size_t reg)
48 1.1 matt {
49 1.1 matt uint32_t rv;
50 1.1 matt (void) gt_read(pc->pc_md.mdpc_gt, pc->pc_md.mdpc_syncreg);
51 1.1 matt rv = gt_read(pc->pc_md.mdpc_gt, reg);
52 1.1 matt (void) gt_read(pc->pc_md.mdpc_gt, pc->pc_md.mdpc_syncreg);
53 1.1 matt return rv;
54 1.1 matt }
55 1.1 matt
56 1.1 matt static void __inline
57 1.1 matt gtpci_write(pci_chipset_tag_t pc, bus_size_t reg, uint32_t val)
58 1.1 matt {
59 1.1 matt (void) gt_read(pc->pc_md.mdpc_gt, pc->pc_md.mdpc_syncreg);
60 1.1 matt gt_write(pc->pc_md.mdpc_gt, reg, val);
61 1.1 matt (void) gt_read(pc->pc_md.mdpc_gt, pc->pc_md.mdpc_syncreg);
62 1.1 matt }
63 1.1 matt
64 1.1 matt pcitag_t gtpci_make_tag(pci_chipset_tag_t, int, int, int);
65 1.1 matt void gtpci_decompose_tag(pci_chipset_tag_t, pcitag_t, int *, int *, int *);
66 1.1 matt pcireg_t gtpci_conf_read(pci_chipset_tag_t, pcitag_t, int);
67 1.1 matt void gtpci_conf_write(pci_chipset_tag_t, pcitag_t, int, pcireg_t);
68 1.1 matt
69 1.1 matt void gtpci_md_bus_devorder(pci_chipset_tag_t, int, char []);
70 1.1 matt int gtpci_md_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
71 1.1 matt int gtpci_md_conf_hook(pci_chipset_tag_t, int, int, int, pcireg_t);
72 1.1 matt void gtpci_md_conf_interrupt(pci_chipset_tag_t, int, int, int, int, int *);
73 1.1 matt
74 1.1 matt #endif /* _DEV_MARVELL_GTPCIVAR_H */
75