summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/acpireg.h
blob: e5534bccce0ebf3633681075ce61d137d115052a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
/*	$NetBSD: acpireg.h,v 1.3 2002/06/15 18:03:42 thorpej Exp $	*/

/*
 * Copyright 2001 Wasabi Systems, Inc.
 * All rights reserved.
 *
 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed for the NetBSD Project by
 *	Wasabi Systems, Inc.
 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
 *    or promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * This file defines various ACPI event messages, etc.
 */

/*
 * 5.6.3: Device Object Notifications
 */

/* Device Object Notification Types */
#define	ACPI_NOTIFY_BusCheck		0x00
#define	ACPI_NOTIFY_DeviceCheck		0x01
#define	ACPI_NOTIFY_DeviceWake		0x02
#define	ACPI_NOTIFY_EjectRequest	0x03
#define	ACPI_NOTIFY_DeviceCheckLight	0x04
#define	ACPI_NOTIFY_FrquencyMismatch	0x05
#define	ACPI_NOTIFY_BusModeMismatch	0x06
#define	ACPI_NOTIFY_PowerFault		0x07
				/*	0x08 - 0x7f	reserved */

/* Control Method Battery Device Notification Types */
#define	ACPI_NOTIFY_BatteryStatusChanged	0x80
#define	ACPI_NOTIFY_BatteryInformationChanged	0x81

/* Power Source Object Notification Types */
#define	ACPI_NOTIFY_PowerSourceStatusChanged	0x80

/* Thermal Zone Object Notication Types */
#define	ACPI_NOTIFY_ThermalZoneStatusChanged	0x80
#define	ACPI_NOTIFY_ThermalZoneTripPointsChanged 0x81
#define	ACPI_NOTIFY_DeviceListsChanged		0x82

/* Control Method Power Button Notification Types */
#define	ACPI_NOTIFY_S0PowerButtonPressed	0x80

/* Control Method Sleep Button Notification Types */
#define	ACPI_NOTIFY_S0SleepButtonPressed	0x80

/* Control Method Lid Notification Types */
#define	ACPI_NOTIFY_LidStatusChanged		0x80

/* Processor Device Notification Values */
#define	ACPI_NOTIFY_PerformancePresentCapabiltitesChanged 0x80
#define	ACPI_NOTIFY_CStatesChanged		0x81

/*
 * 6: Configuration
 *
 * 6.1: Device Identification Objects
 *
 *	_ADR	Object that evaluates to a device's address on
 *		its parent bus.
 *
 *	_CID	Object that evaluates to a device's Plug and Play
 *		compatible ID list.
 *
 *	_DDN	Object that associates a logical software name
 *		(for example, COM1) with a device.
 *
 *	_HID	Object that evaluates to a device's Plug and Play
 *		hardware ID.
 *
 *	_SUN	Objcet that evaluates to the slot-unique ID number
 *		for a slot.
 *
 *	_STR	Object that contains a Unicode identifier for a device.
 *
 *	_UID	Object that specifies a device's unique persistent ID,
 *		or a control method that generates it.
 */

/*
 * 6.1.1: _ADR (Address)
 *
 *	EISA		EISA slot numnber 0-f
 *
 *	Floppy Bus	Drive select values used for programming
 *			the floppy controller to access the
 *			specified INT13 unit number.  The _ADR
 *			objects should be sorted based on drive
 *			select encoding from 0-3.
 *
 *	IDE controller	0 - primary channel, 1 - secondary channel
 *
 *	IDE channel	0 - master drive, 1 - slave drive
 *
 *	PCI		High word - Device #, Low word - Function #
 *			0xffff == all functions on a device
 *
 *	PCMCIA		Socket #; 0 == first socket
 *
 *	PC Card		Socket #; 0 == first socket
 *
 *	SMBus		Lowest slave address
 *
 *	USB Root Hub	Only one child of the host controller, must
 *			have an _ADR of 0.
 *
 *	USB ports	port number
 */
#define	ACPI_ADR_PCI_DEV(x)	(((x) >> 16) & 0xffff)
#define	ACPI_ADR_PCI_FUNC(x)	((x) & 0xffff)
#define	ACPI_ADR_PCI_ALLFUNCS	0xffff

/*
 * 6.1.2: _CID (Compatible ID)
 */

/*
 * 6.1.3: _DDN (Device Name)
 */

/*
 * 6.1.4: _HID (Hardware ID)
 */

/*
 * 6.1.5: _STR (String)
 */

/*
 * 6.1.6: _SUN (Slot User Number)
 */

/*
 * 6.1.7: _UID (Unique ID)
 */

/*
 * 6.2: Device Configuration Objects
 *
 *	_CRS	Object that specifies a device's *current* resource
 *		settings, or a control method that generates such
 *		an object.
 *
 *	_DIS	Control method that disables a device.
 *
 *	_DMA	Object that specifies a device's *current* resources
 *		for DMA transactions.
 *
 *	_FIX	Object used to provide correlation between the
 *		fixed-hardware register blocks defined in the FADT
 *		and the devices that implement these fixed-hardware
 *		registers.
 *
 *	_HPP	Object that specifies the cache-line size, latency
 *		timer, SERR enable, and PERR enable values to be
 *		used when configuring a PCI device inserted into
 *		a hot-plug slot or initial configuration of a PCI
 *		device at system boot.
 *
 *	_MAT	Object that evaluates to a buffer of MADT APIC
 *		structure entries.
 *
 *	_PRS	An object that specifies a device's *possible*
 *		resource settings, or a control method that
 *		generates such an object.
 *
 *	_PRT	Object that specifies the PCI interrupt routing
 *		table.
 *
 *	_PXM	Object that specifies a proximity domain for a device.
 *
 *	_SRS	Control method that sets a device's settings.
 */

/*
 * 6.2.1: _CRS (Current Resource Settings)
 */

/*
 * 6.2.2: _DIS (Disable)
 */

/*
 * 6.2.3: _DMA (Direct Memory AccesS)
 */

/*
 * 6.2.4: _FIX (Fixed Register Resource Provider)
 */

/*
 * 6.2.5: _HPP (Hot Plug Parameters)
 */

/*
 * 6.2.6: _MAT (Multiple APIC Table Entry)
 */

/*
 * 6.2.7: _PRS (Possible Resource Settings)
 */

/*
 * 6.2.8: _PRT (PCI Routing Table)
 */

/*
 * 6.2.9: _PXM (Proximity)
 */

/*
 * 6.2.10: _SRS (Set Resource Settings)
 */

/*
 * 6.3: Device Insertion and Removal Objects
 *
 *	_EDL	Object that evaluates to a package of namespace
 *		references of device objects that depend on
 *		the device containing _EDL.  Whenever the named
 *		devices is ejected, OSPM ejects all dependent
 *		devices.
 *
 *	_EJD	Object that evaluates to the name of a device object
 *		on which a device depends.  Whenever the named
 *		device is ejected, the dependent device must receive
 *		an ejection notification.
 *
 *	_EJx	Control method that ejects a device.
 *
 *	_LCK	Control method that locks or unlocks a device.
 *
 *	_RMV	Object that indicates that the given device is
 *		removable.
 *
 *	_STA	Control method that returns a device's status.
 */

/*
 * 6.3.1: _EDL (Eject Device List)
 */

/*
 * 6.3.2: _EJD (Ejection Dependent Device)
 */

/*
 * 6.3.3: _EJx (Eject)
 *
 *	x	Indicates sleeping state at which device
 *		can be ejected.
 */

/*
 * 6.3.4: _LCK (Lock)
 */

/*
 * 6.3.5: _RMV (Remove)
 */

/*
 * 6.3.6: _STA (Status) for device insertion/removal
 */
#define	ACPI_STA_DEV_PRESENT	0x00000001	/* device present */
#define	ACPI_STA_DEV_ENABLED	0x00000002	/* enabled (decoding res.) */
#define	ACPI_STA_DEV_SHOW	0x00000004	/* show device in UI */
#define	ACPI_STA_DEV_OK		0x00000008	/* functioning properly */
#define	ACPI_STA_DEV_BATT	0x00000010	/* battery present */

/*
 * 6.4: Resource Data Types for ACPI
 *
 *	Used by the _CRS, _PRS, and _SRS methods.
 */

/*
 * 7.1.4: _STA (Status) for power resource current state
 */
#define	ACPI_STA_POW_OFF	0		/* power resource off */
#define	ACPI_STA_POW_ON		1		/* power resource on */

/*
 * ACPI driver components
 */

#define	ACPI_BUS_COMPONENT	0x00010000
#define	ACPI_ACAD_COMPONENT	0x00020000
#define	ACPI_BAT_COMPONENT	0x00040000
#define	ACPI_BUTTON_COMPONENT	0x00080000
#define	ACPI_EC_COMPONENT	0x00100000
#define	ACPI_LID_COMPONENT	0x00200000
#define	ACPI_RESOURCE_COMPONENT	0x00400000