1139825Simp/*-
2103619Sgrehan * Copyright 2002 by Peter Grehan. All rights reserved.
3103619Sgrehan *
4103619Sgrehan * Redistribution and use in source and binary forms, with or without
5103619Sgrehan * modification, are permitted provided that the following conditions
6103619Sgrehan * are met:
7103619Sgrehan * 1. Redistributions of source code must retain the above copyright
8103619Sgrehan *    notice, this list of conditions and the following disclaimer.
9103619Sgrehan * 2. Redistributions in binary form must reproduce the above copyright
10103619Sgrehan *    notice, this list of conditions and the following disclaimer in the
11103619Sgrehan *    documentation and/or other materials provided with the distribution.
12103619Sgrehan * 3. The name of the author may not be used to endorse or promote products
13103619Sgrehan *    derived from this software without specific prior written permission.
14103619Sgrehan *
15103619Sgrehan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16103619Sgrehan * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17103619Sgrehan * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18103619Sgrehan * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19103619Sgrehan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20103619Sgrehan * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21103619Sgrehan * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22103619Sgrehan * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23103619Sgrehan * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24103619Sgrehan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25103619Sgrehan * SUCH DAMAGE.
26103619Sgrehan *
27103619Sgrehan * $FreeBSD$
28103619Sgrehan */
29103619Sgrehan
30103619Sgrehan#ifndef _MACIO_MACIOVAR_H_
31103619Sgrehan#define _MACIO_MACIOVAR_H_
32103619Sgrehan
33131399Sgrehan/*
34103619Sgrehan * The addr space size
35103619Sgrehan * XXX it would be better if this could be determined by querying the
36103619Sgrehan *     PCI device, but there isn't an access method for this
37103619Sgrehan */
38103619Sgrehan#define MACIO_REG_SIZE  0x7ffff
39103619Sgrehan
40103619Sgrehan/*
41221519Snwhitehorn * Feature Control Registers (FCR)
42221519Snwhitehorn */
43221519Snwhitehorn#define HEATHROW_FCR	0x38
44221519Snwhitehorn#define KEYLARGO_FCR0	0x38
45221519Snwhitehorn#define KEYLARGO_FCR1	0x3c
46253825Sjhibbits#define KEYLARGO_FCR2	0x40
47221519Snwhitehorn
48221519Snwhitehorn#define FCR_ENET_ENABLE	0x60000000
49221519Snwhitehorn#define FCR_ENET_RESET	0x80000000
50221519Snwhitehorn
51253825Sjhibbits/* Used only by macio_enable_wireless() for now. */
52253825Sjhibbits#define KEYLARGO_GPIO_BASE	0x6a
53253825Sjhibbits#define KEYLARGO_EXTINT_GPIO_REG_BASE	0x58
54253825Sjhibbits
55221519Snwhitehorn/*
56110080Sbenno * Format of a macio reg property entry.
57110080Sbenno */
58110080Sbennostruct macio_reg {
59110080Sbenno	u_int32_t	mr_base;
60110080Sbenno	u_int32_t	mr_size;
61110080Sbenno};
62110080Sbenno
63110080Sbenno/*
64103619Sgrehan * Per macio device structure.
65103619Sgrehan */
66103619Sgrehanstruct macio_devinfo {
67178599Smarcel	int        mdi_interrupts[6];
68108991Sbenno	int	   mdi_ninterrupts;
69103619Sgrehan	int        mdi_base;
70153050Smarius	struct ofw_bus_devinfo mdi_obdinfo;
71103619Sgrehan	struct resource_list mdi_resources;
72103619Sgrehan};
73103619Sgrehan
74253825Sjhibbitsextern int macio_enable_wireless(device_t dev, bool enable);
75253825Sjhibbits
76103619Sgrehan#endif /* _MACIO_MACIOVAR_H_ */
77