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: releng/10.2/sys/powerpc/powermac/maciovar.h 264375 2014-04-12 19:57:15Z andreast $
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
51264375Sandreast#define FCR1_I2S0_CLK_ENABLE	0x00001000
52264375Sandreast#define FCR1_I2S0_ENABLE	0x00002000
53264375Sandreast
54253825Sjhibbits/* Used only by macio_enable_wireless() for now. */
55253825Sjhibbits#define KEYLARGO_GPIO_BASE	0x6a
56253825Sjhibbits#define KEYLARGO_EXTINT_GPIO_REG_BASE	0x58
57253825Sjhibbits
58221519Snwhitehorn/*
59110080Sbenno * Format of a macio reg property entry.
60110080Sbenno */
61110080Sbennostruct macio_reg {
62110080Sbenno	u_int32_t	mr_base;
63110080Sbenno	u_int32_t	mr_size;
64110080Sbenno};
65110080Sbenno
66110080Sbenno/*
67103619Sgrehan * Per macio device structure.
68103619Sgrehan */
69103619Sgrehanstruct macio_devinfo {
70178599Smarcel	int        mdi_interrupts[6];
71108991Sbenno	int	   mdi_ninterrupts;
72103619Sgrehan	int        mdi_base;
73153050Smarius	struct ofw_bus_devinfo mdi_obdinfo;
74103619Sgrehan	struct resource_list mdi_resources;
75103619Sgrehan};
76103619Sgrehan
77253825Sjhibbitsextern int macio_enable_wireless(device_t dev, bool enable);
78253825Sjhibbits
79103619Sgrehan#endif /* _MACIO_MACIOVAR_H_ */
80