xref: /netbsd-src/sys/arch/prep/include/pcipnp.h (revision 0df165c04d0a9ca1adde9ed2b890344c937954a6)
1 /* $NetBSD: pcipnp.h,v 1.1 2006/05/30 23:56:38 garbled Exp $ */
2 /*-
3  * Copyright (c) 2006 The NetBSD Foundation, Inc.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to The NetBSD Foundation
7  * by Tim Rightnour
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *        This product includes software developed by the NetBSD
20  *        Foundation, Inc. and its contributors.
21  * 4. Neither the name of The NetBSD Foundation nor the names of its
22  *    contributors may be used to endorse or promote products derived
23  *    from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  */
37 /*
38  * Based on:
39  * IBM Power Personal Systems Architecture: Residual Data
40  * Document Number: PPS-AR-FW0001 Rev 0.5  April 3, 1996
41  */
42 
43 #ifndef _PCIPNP_H_
44 #define _PCIPNP_H_
45 
46 #define MAX_PCI_INTRS	4
47 
48 typedef enum _IntrTypes {
49 	IntrInvalid = 0,
50 	Intr8259 = 1,
51 	IntrMPIC = 2,
52 	IntrRS6K = 3
53 } _IntrTypes;
54 
55 /* PCI to system conversion map */
56 typedef struct _IntrMap {
57 	uint8_t slotnum;		/* First = 1, integrated = 0 */
58 	uint8_t devfunc;
59 	uint8_t intrctrltype;		/* interrupt type */
60 	uint8_t intrctrlnum;		/* 8259 = 0
61 					 * MPIC = 1
62 					 * RS6K = buid ???? */
63 	uint16_t intr[MAX_PCI_INTRS];	/* Index 0-3 == A-D
64 					 * 0xFFFF == not usable
65 					 * 0x8nnn == edge sensitive
66 					 */
67 } IntrMap;
68 
69 typedef struct _PCIInfoPack {
70 	uint8_t tag;			/* large tag = 0x84 */
71 	uint8_t count0;
72 	uint8_t count1;
73 	  /* count = number of PCI slots * sizeof(IntrMap) + 21 */
74 	uint8_t type;			/* == 3 PCI Bridge */
75 	uint8_t configbaseaddr[8];	/* Base addr of PCI configuration
76 					 *   system real address */
77 	uint8_t configbasedata[8];	/* base addr of PCI config data
78 					 *   system real address */
79 	uint8_t busnum;			/* PCI Bus Number */
80 	uint8_t reserved[3];		/* reserved, padded with 0 */
81 	IntrMap map[1];			/* Interrupt map array for each PCI
82 					 * slots that are pluggable.
83 					 * number = (count-21)/sizeof(IntrMap)*/
84 } PCIInfoPack;
85 
86 #endif /* _PCIPNP_H_ */
87