1 /*-
2  * Copyright (c) 2007 The NetBSD Foundation, Inc.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to The NetBSD Foundation
6  * by Tim Rightnour
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef _RS6000_IOPLANAR_H_
31 #define _RS6000_IOPLANAR_H_
32 
33 #include <sys/bus.h>
34 #include <machine/mca_machdep.h>
35 
36 /*
37  * Driver attach args
38  */
39 struct ioplanar_dev_attach_args {
40           bus_space_tag_t idaa_iot;     /* I/O space tag */
41           bus_space_tag_t idaa_memt;    /* MEM space tag */
42           mca_chipset_tag_t idaa_mc;
43           bus_dma_tag_t idaa_dmat;      /* DMA tag */
44 
45           uint16_t idaa_devid;                    /* devid of the ioplanar */
46           int idaa_device;              /* devnum from below defines */
47 };
48 
49 /* Master bus */
50 struct ioplanar_softc {
51           device_t sc_dev;
52           mca_chipset_tag_t sc_ic;
53           bus_space_tag_t sc_iot;
54           bus_space_tag_t sc_memt;
55           bus_dma_tag_t sc_dmat;
56           uint16_t sc_devid;            /* devid of the ioplanar */
57 };
58 
59 /*
60  * These are the defines for the various devices we might find on an
61  * ioplanar.  Because this is not a real bus, we have to basically tell
62  * autoconf what we are looking for specifically, so it can find it.  Each
63  * ioplanar has a specific set of devices that live on it, and those will
64  * appear in a table.
65  */
66 
67 #define IOP_COM0    1
68 #define IOP_COM1    2
69 #define IOP_COM0_2  3
70 #define IOP_COM1_2  4
71 #define IOP_COM0_3  5
72 #define IOP_COM1_3  6
73 #define IOP_COM2_3  7
74 #define IOP_MOUSE   10
75 #define IOP_KBD               11
76 #define IOP_TABLET  12
77 #define IOP_KBD_2   13
78 #define IOP_TABLET_2          14
79 #define IOP_LPD               20
80 #define IOP_LPD_2   21
81 #define IOP_FDC               30
82 #define IOP_FDC_2   31
83 #define IOP_FDC_3   32
84 
85 /*
86  * The RS6000 defines a set of minimum IO configuration ports.  These are
87  * basic services like serial, parallel, scsi, etc.  Per the definition, all
88  * machines must respond on these ports for these services.
89  */
90 
91 #define RSI_COM0    0x30
92 #define RSI_COM0_LEN          8
93 #define RSI_COM1    0x38
94 #define RSI_COM1_LEN          8
95 #define RSI_COM_DMA 0x40
96 #define RSI_COM_DMA_LEN       1
97 #define RSI_MOUSE   0x48
98 #define RSI_MOUSE_LEN         8
99 #define RSI_KBD               0x50
100 #define RSI_KBD_LEN 10
101 #define RSI_FLOPPY  0x60
102 #define RSI_FLOPPY_LEN        9
103 #define RSI_TABLET  0x70
104 #define RSI_TABLEN_LEN        8
105 #define RSI_PARALLEL          0x78
106 #define RSI_PARALLEL_LEN      7
107 #define RSI_SCSI    0x7f
108 #define RSI_SCSI_LEN          96
109 #define RSI_LAN               0xf0
110 #define RSI_LAN_LEN 11
111 
112 #endif /* _RS6000_IOPLANAR_H_ */
113