pcibus.h revision 202173
1/*-
2 * Copyright (c) 1998 Doug Rabson
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 AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, 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 * $FreeBSD: head/sys/mips/rmi/pcibus.h 202173 2010-01-12 21:17:36Z imp $
27 */
28#define DEFAULT_PCI_CONFIG_BASE         0x18000000
29
30#define MSI_MIPS_ADDR_BASE             0xfee00000
31
32
33#define PCIE_LINK0_MSI_STATUS        0x90
34#define PCIE_LINK1_MSI_STATUS        0x94
35#define PCIE_LINK2_MSI_STATUS        0x190
36#define PCIE_LINK3_MSI_STATUS        0x194
37
38void pci_init_resources(void);
39struct resource *
40xlr_pci_alloc_resource(device_t bus, device_t child,
41    int type, int *rid,
42    u_long start, u_long end, u_long count,
43    u_int flags);
44int
45pci_activate_resource(device_t bus, device_t child, int type, int rid,
46    struct resource *r);
47int
48pci_deactivate_resource(device_t bus, device_t child, int type, int rid,
49    struct resource *r);
50int
51pci_release_resource(device_t bus, device_t child, int type, int rid,
52    struct resource *r);
53struct rman *pci_get_rman(device_t dev, int type);
54
55int
56mips_platform_pci_setup_intr(device_t dev, device_t child,
57    struct resource *irq, int flags,
58    driver_filter_t * filt,
59    driver_intr_t * intr, void *arg,
60    void **cookiep);
61int
62    mips_pci_route_interrupt(device_t bus, device_t dev, int pin);
63