xref: /freebsd/sys/dev/cardbus/cardbus_cis.h (revision 0d5500e4aa5f4aa3fddf5e647f5f1085a0561924)
1 /*
2  * Copyright (c) 2000,2001 Jonathan Chen.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions, and the following disclaimer,
10  *    without modification, immediately at the beginning of the file.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in
13  *    the documentation and/or other materials provided with the
14  *    distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
20  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  *
28  * $FreeBSD$
29  */
30 
31 /*
32  * Cardbus CIS definitions
33  */
34 
35 struct cis_tupleinfo;
36 
37 int	cardbus_do_cis(device_t, device_t);
38 
39 #define	MAXTUPLESIZE		0x400
40 
41 /* CIS TUPLES */
42 
43 #define	CISTPL_NULL		0x00
44 #define	CISTPL_DEVICE		0x01
45 #define	CISTPL_LONG_LINK_CB	0x02
46 #define	CISTPL_INDIRECT		0x03
47 #define	CISTPL_CONFIG_CB	0x04
48 #define	CISTPL_CFTABLE_ENTRY_CB	0x05
49 #define	CISTPL_LONGLINK_MFC	0x06
50 #define	CISTPL_BAR		0x07
51 #define	CISTPL_PWR_MGMNT	0x08
52 #define	CISTPL_EXTDEVICE	0x09
53 #define	CISTPL_CHECKSUM		0x10
54 #define	CISTPL_LONGLINK_A	0x11
55 #define	CISTPL_LONGLINK_C	0x12
56 #define	CISTPL_LINKTARGET	0x13
57 #define	CISTPL_NO_LINK		0x14
58 #define	CISTPL_VERS_1		0x15
59 #define	CISTPL_ALTSTR		0x16
60 #define	CISTPL_DEVICE_A		0x17
61 #define	CISTPL_JEDEC_C		0x18
62 #define	CISTPL_JEDEC_A		0x19
63 #define	CISTPL_CONFIG		0x1A
64 #define	CISTPL_CFTABLE_ENTRY	0x1B
65 #define	CISTPL_DEVICE_OC	0x1C
66 #define	CISTPL_DEVICE_OA	0x1D
67 #define	CISTPL_DEVICE_GEO	0x1E
68 #define	CISTPL_DEVICE_GEO_A	0x1F
69 #define	CISTPL_MANFID		0x20
70 #define	CISTPL_FUNCID		0x21
71 #define	CISTPL_FUNCE		0x22
72 #define	CISTPL_SWIL		0x23
73 #define	CISTPL_VERS_2		0x40
74 #define	CISTPL_FORMAT		0x41
75 #define	CISTPL_GEOMETRY		0x42
76 #define	CISTPL_BYTEORDER	0x43
77 #define	CISTPL_DATE		0x44
78 #define	CISTPL_BATTERY		0x45
79 #define	CISTPL_ORG		0x46
80 #define	CISTPL_CUSTOMSTART	0x80
81 #define	CISTPL_END		0xFF
82 
83 #define	CISTPL_GENERIC		-1	/* catchall */
84 
85 /* BAR */
86 #define	TPL_BAR_REG_ASI_MASK			0x07
87 #define	TPL_BAR_REG_AS				0x10
88 #define	TPL_BAR_REG_PREFETCHABLE_ONLY		0x20
89 #define	TPL_BAR_REG_PREFETCHABLE_CACHEABLE	0x40
90 #define	TPL_BAR_REG_PREFETCHABLE		0x60
91 #define	TPL_BAR_REG_BELOW1MB			0x80
92 
93 /* CISTPL_FUNC */
94 #define	TPL_FUNC_MF		0	/* multi function tuple */
95 #define	TPL_FUNC_MEM		1	/* memory */
96 #define	TPL_FUNC_SERIAL		2	/* serial, including modem and fax */
97 #define	TPL_FUNC_PARALLEL	3	/* parallel, including printer and SCSI */
98 #define	TPL_FUNC_DISK		4	/* Disk */
99 #define	TPL_FUNC_VIDEO		5	/* Video Adaptor */
100 #define	TPL_FUNC_LAN		6	/* LAN Adaptor */
101 #define	TPL_FUNC_AIMS		7	/* Auto Inclement Mass Strages */
102 
103 /* TPL_FUNC_LAN */
104 #define	TPL_FUNCE_LAN_TECH	1	/* technology */
105 #define	TPL_FUNCE_LAN_SPEED	2	/* speed */
106 #define	TPL_FUNCE_LAN_MEDIA	3	/* which media do you use? */
107 #define	TPL_FUNCE_LAN_NID	4	/* node id (address) */
108 #define	TPL_FUNCE_LAN_CONN	5	/* connector type (shape) */
109 
110 /* TPL_FUNC_SERIAL */
111 #define	TPL_FUNCE_SER_UART	0	/* UART type */
112