xref: /titanic_51/usr/src/uts/intel/sys/acpica.h (revision 8e56767d5805b843712c67bce2d732cc722f154b)
17c478bd9Sstevel@tonic-gate /*
2*8e56767dSsmall  * CDDL HEADER START
3*8e56767dSsmall  *
4*8e56767dSsmall  * The contents of this file are subject to the terms of the
5*8e56767dSsmall  * Common Development and Distribution License, Version 1.0 only
6*8e56767dSsmall  * (the "License").  You may not use this file except in compliance
7*8e56767dSsmall  * with the License.
8*8e56767dSsmall  *
9*8e56767dSsmall  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*8e56767dSsmall  * or http://www.opensolaris.org/os/licensing.
11*8e56767dSsmall  * See the License for the specific language governing permissions
12*8e56767dSsmall  * and limitations under the License.
13*8e56767dSsmall  *
14*8e56767dSsmall  * When distributing Covered Code, include this CDDL HEADER in each
15*8e56767dSsmall  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*8e56767dSsmall  * If applicable, add the following below this CDDL HEADER, with the
17*8e56767dSsmall  * fields enclosed by brackets "[]" replaced with your own identifying
18*8e56767dSsmall  * information: Portions Copyright [yyyy] [name of copyright owner]
19*8e56767dSsmall  *
20*8e56767dSsmall  * CDDL HEADER END
21*8e56767dSsmall  */
22*8e56767dSsmall /*
237c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef _SYS_ACPICA_H
287c478bd9Sstevel@tonic-gate #define	_SYS_ACPICA_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef __cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate typedef struct {
377c478bd9Sstevel@tonic-gate 	dev_info_t		*dip;
387c478bd9Sstevel@tonic-gate 	kmutex_t		mutex;
397c478bd9Sstevel@tonic-gate 	ddi_iblock_cookie_t	iblock_cookie;
407c478bd9Sstevel@tonic-gate } AcpiCA;
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /* acpi-user-options options property */
437c478bd9Sstevel@tonic-gate extern unsigned int acpi_options_prop;
447c478bd9Sstevel@tonic-gate #define	ACPI_OUSER_MASK		0x0003
457c478bd9Sstevel@tonic-gate #define	ACPI_OUSER_DFLT		0x0000
467c478bd9Sstevel@tonic-gate #define	ACPI_OUSER_ON		0x0001
477c478bd9Sstevel@tonic-gate #define	ACPI_OUSER_OFF		0x0002
487c478bd9Sstevel@tonic-gate #define	ACPI_OUSER_MADT		0x0004
497c478bd9Sstevel@tonic-gate #define	ACPI_OUSER_LEGACY	0x0008
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate  * Initialization state of the ACPI CA subsystem
547c478bd9Sstevel@tonic-gate  */
557c478bd9Sstevel@tonic-gate #define	ACPICA_NOT_INITIALIZED	(0)
567c478bd9Sstevel@tonic-gate #define	ACPICA_INITIALIZED	(1)
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate extern int acpica_init(void);
597c478bd9Sstevel@tonic-gate extern void acpica_ec_init(void);
607c478bd9Sstevel@tonic-gate extern int acpica_eval_int(ACPI_HANDLE, char *, int *);
617c478bd9Sstevel@tonic-gate extern int acpica_find_pciobj(dev_info_t *, ACPI_HANDLE *);
627c478bd9Sstevel@tonic-gate extern int acpica_find_pcidip(ACPI_HANDLE, dev_info_t **);
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate #define	SCI_IPL	(LOCK_LEVEL-1)
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate /*
677c478bd9Sstevel@tonic-gate  * Mapping table from dip to ACPI object for PCI nodes that might have
687c478bd9Sstevel@tonic-gate  * _PRT. Note: we keep bus/dev/func, but they're not really used;
697c478bd9Sstevel@tonic-gate  * lookups on this table are from dip to acpiobj. b/d/f are there
707c478bd9Sstevel@tonic-gate  * primarily for debugging ease. For peer/root PCI buses, dev and func
717c478bd9Sstevel@tonic-gate  * are irrelevant, and so are set to bogus illegal values; bus is set to
727c478bd9Sstevel@tonic-gate  * the PCI bus *under* that peer-bus node.
737c478bd9Sstevel@tonic-gate  */
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate typedef struct dip_to_acpiobj_t {
767c478bd9Sstevel@tonic-gate 	dev_info_t *dip;
777c478bd9Sstevel@tonic-gate 	ACPI_HANDLE acpiobj;
787c478bd9Sstevel@tonic-gate 	unsigned char bus;
797c478bd9Sstevel@tonic-gate 	unsigned char dev;
807c478bd9Sstevel@tonic-gate 	unsigned char func;
817c478bd9Sstevel@tonic-gate } d2a;
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate /*
847c478bd9Sstevel@tonic-gate  * definitions of Bus Type
857c478bd9Sstevel@tonic-gate  */
867c478bd9Sstevel@tonic-gate #define	BUS_CBUS	1
877c478bd9Sstevel@tonic-gate #define	BUS_CBUSII	2
887c478bd9Sstevel@tonic-gate #define	BUS_EISA	3
897c478bd9Sstevel@tonic-gate #define	BUS_FUTURE	4
907c478bd9Sstevel@tonic-gate #define	BUS_INTERN	5
917c478bd9Sstevel@tonic-gate #define	BUS_ISA		6
927c478bd9Sstevel@tonic-gate #define	BUS_MBI		7
937c478bd9Sstevel@tonic-gate #define	BUS_MBII	8
947c478bd9Sstevel@tonic-gate #define	BUS_MPI		10
957c478bd9Sstevel@tonic-gate #define	BUS_MPSA	11
967c478bd9Sstevel@tonic-gate #define	BUS_NUBUS	12
977c478bd9Sstevel@tonic-gate #define	BUS_PCI		13
987c478bd9Sstevel@tonic-gate #define	BUS_PCMCIA	14
997c478bd9Sstevel@tonic-gate #define	BUS_TC		15
1007c478bd9Sstevel@tonic-gate #define	BUS_VL		16
1017c478bd9Sstevel@tonic-gate #define	BUS_VME		17
1027c478bd9Sstevel@tonic-gate #define	BUS_XPRESS	18
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate /*
1067c478bd9Sstevel@tonic-gate  * intr_po - polarity definitions
1077c478bd9Sstevel@tonic-gate  */
1087c478bd9Sstevel@tonic-gate #define	INTR_PO_CONFORM		0x00
1097c478bd9Sstevel@tonic-gate #define	INTR_PO_ACTIVE_HIGH	0x01
1107c478bd9Sstevel@tonic-gate #define	INTR_PO_RESERVED	0x02
1117c478bd9Sstevel@tonic-gate #define	INTR_PO_ACTIVE_LOW	0x03
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate /*
1147c478bd9Sstevel@tonic-gate  * intr_el edge or level definitions
1157c478bd9Sstevel@tonic-gate  */
1167c478bd9Sstevel@tonic-gate #define	INTR_EL_CONFORM		0x00
1177c478bd9Sstevel@tonic-gate #define	INTR_EL_EDGE		0x01
1187c478bd9Sstevel@tonic-gate #define	INTR_EL_RESERVED	0x02
1197c478bd9Sstevel@tonic-gate #define	INTR_EL_LEVEL		0x03
1207c478bd9Sstevel@tonic-gate 
1217c478bd9Sstevel@tonic-gate /*
1227c478bd9Sstevel@tonic-gate  * interrupt flags structure
1237c478bd9Sstevel@tonic-gate  */
1247c478bd9Sstevel@tonic-gate typedef struct iflag {
1257c478bd9Sstevel@tonic-gate 	uchar_t	intr_po: 2,
1267c478bd9Sstevel@tonic-gate 		intr_el: 2,
1277c478bd9Sstevel@tonic-gate 		bustype: 4;
1287c478bd9Sstevel@tonic-gate } iflag_t;
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate /* _HID for PCI bus object */
1327c478bd9Sstevel@tonic-gate #define	HID_PCI_BUS		0x30AD041
1337c478bd9Sstevel@tonic-gate #define	HID_PCI_EXPRESS_BUS	0x080AD041
1347c478bd9Sstevel@tonic-gate 
1357c478bd9Sstevel@tonic-gate /*
1367c478bd9Sstevel@tonic-gate  * Internal functions
1377c478bd9Sstevel@tonic-gate  */
1387c478bd9Sstevel@tonic-gate extern ACPI_STATUS acpica_get_sci(int *sci_irq, iflag_t *sci_flags);
1397c478bd9Sstevel@tonic-gate extern int acpica_get_bdf(dev_info_t *dip, int *bus, int *device, int *func);
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate #ifdef __cplusplus
1427c478bd9Sstevel@tonic-gate }
1437c478bd9Sstevel@tonic-gate #endif
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate #endif /* _SYS_ACPICA_H */
146