Deleted Added
full compact
ofw_pci.h (117119) ofw_pci.h (129051)
1/*
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001, 2003 by Thomas Moestl <tmm@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 14 unchanged lines hidden (view full) ---

23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: NetBSD: psychoreg.h,v 1.8 2001/09/10 16:17:06 eeh Exp
30 *
1/*
2 * Copyright (c) 1999, 2000 Matthew R. Green
3 * Copyright (c) 2001, 2003 by Thomas Moestl <tmm@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 14 unchanged lines hidden (view full) ---

23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * from: NetBSD: psychoreg.h,v 1.8 2001/09/10 16:17:06 eeh Exp
30 *
31 * $FreeBSD: head/sys/sparc64/pci/ofw_pci.h 117119 2003-07-01 14:52:47Z tmm $
31 * $FreeBSD: head/sys/sparc64/pci/ofw_pci.h 129051 2004-05-08 13:53:47Z marius $
32 */
33
34#ifndef _SPARC64_PCI_OFW_PCI_H_
35#define _SPARC64_PCI_OFW_PCI_H_
36
37#include <machine/ofw_bus.h>
38
39typedef u_int32_t ofw_pci_intr_t;
40
41#include "ofw_pci_if.h"
42
43/* PCI range child spaces. XXX: are these MI? */
44#define PCI_CS_CONFIG 0x00
45#define PCI_CS_IO 0x01
46#define PCI_CS_MEM32 0x02
47#define PCI_CS_MEM64 0x03
48
32 */
33
34#ifndef _SPARC64_PCI_OFW_PCI_H_
35#define _SPARC64_PCI_OFW_PCI_H_
36
37#include <machine/ofw_bus.h>
38
39typedef u_int32_t ofw_pci_intr_t;
40
41#include "ofw_pci_if.h"
42
43/* PCI range child spaces. XXX: are these MI? */
44#define PCI_CS_CONFIG 0x00
45#define PCI_CS_IO 0x01
46#define PCI_CS_MEM32 0x02
47#define PCI_CS_MEM64 0x03
48
49struct ofw_pci_imap {
50 u_int32_t phys_hi;
51 u_int32_t phys_mid;
52 u_int32_t phys_lo;
53 ofw_pci_intr_t intr;
54 phandle_t child_node;
55 phandle_t child_intr;
56};
57
58struct ofw_pci_imap_msk {
59 u_int32_t phys_hi;
60 u_int32_t phys_mid;
61 u_int32_t phys_lo;
62 ofw_pci_intr_t intr;
63};
64
65u_int8_t ofw_pci_alloc_busno(phandle_t);
66
49u_int8_t ofw_pci_alloc_busno(phandle_t);
50
67#ifdef OFW_NEWPCI
68
69static __inline phandle_t
70ofw_pci_get_node(device_t dev)
71{
72
73 return (OFW_PCI_GET_NODE(device_get_parent(dev), dev));
74}
75
51static __inline phandle_t
52ofw_pci_get_node(device_t dev)
53{
54
55 return (OFW_PCI_GET_NODE(device_get_parent(dev), dev));
56}
57
76#else
77
78struct ofw_pci_bdesc;
79typedef void ofw_pci_binit_t(device_t, struct ofw_pci_bdesc *);
80
81struct ofw_pci_bdesc {
82 u_int obd_bus;
83 u_int obd_slot;
84 u_int obd_func;
85 u_int obd_secbus;
86 u_int obd_subbus;
87 ofw_pci_binit_t *obd_init;
88 struct ofw_pci_bdesc *obd_super;
89};
90
91obr_callback_t ofw_pci_orb_callback;
92ofw_pci_binit_t ofw_pci_binit;
93void ofw_pci_init(device_t, phandle_t, ofw_pci_intr_t, struct ofw_pci_bdesc *);
94phandle_t ofw_pci_find_node(int, int, int);
95phandle_t ofw_pci_node(device_t);
96#endif
97
98#endif /* ! _SPARC64_PCI_OFW_PCI_H_ */
58#endif /* ! _SPARC64_PCI_OFW_PCI_H_ */