1*9455SKrishna.Elango@Sun.COM /* 2*9455SKrishna.Elango@Sun.COM * CDDL HEADER START 3*9455SKrishna.Elango@Sun.COM * 4*9455SKrishna.Elango@Sun.COM * The contents of this file are subject to the terms of the 5*9455SKrishna.Elango@Sun.COM * Common Development and Distribution License (the "License"). 6*9455SKrishna.Elango@Sun.COM * You may not use this file except in compliance with the License. 7*9455SKrishna.Elango@Sun.COM * 8*9455SKrishna.Elango@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*9455SKrishna.Elango@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*9455SKrishna.Elango@Sun.COM * See the License for the specific language governing permissions 11*9455SKrishna.Elango@Sun.COM * and limitations under the License. 12*9455SKrishna.Elango@Sun.COM * 13*9455SKrishna.Elango@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*9455SKrishna.Elango@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*9455SKrishna.Elango@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*9455SKrishna.Elango@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*9455SKrishna.Elango@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*9455SKrishna.Elango@Sun.COM * 19*9455SKrishna.Elango@Sun.COM * CDDL HEADER END 20*9455SKrishna.Elango@Sun.COM */ 21*9455SKrishna.Elango@Sun.COM /* 22*9455SKrishna.Elango@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23*9455SKrishna.Elango@Sun.COM * Use is subject to license terms. 24*9455SKrishna.Elango@Sun.COM */ 25*9455SKrishna.Elango@Sun.COM 26*9455SKrishna.Elango@Sun.COM #ifndef _SYS_PCIE_ACPI_H 27*9455SKrishna.Elango@Sun.COM #define _SYS_PCIE_ACPI_H 28*9455SKrishna.Elango@Sun.COM 29*9455SKrishna.Elango@Sun.COM #ifdef __cplusplus 30*9455SKrishna.Elango@Sun.COM extern "C" { 31*9455SKrishna.Elango@Sun.COM #endif 32*9455SKrishna.Elango@Sun.COM 33*9455SKrishna.Elango@Sun.COM /* revision id of _OSC for PCI/PCI-X/PCI-Exp hierarchy */ 34*9455SKrishna.Elango@Sun.COM #define PCIE_OSC_REVISION_ID 1 /* defined in PCI fw ver 3.0 */ 35*9455SKrishna.Elango@Sun.COM 36*9455SKrishna.Elango@Sun.COM /* 37*9455SKrishna.Elango@Sun.COM * _OSC method Capabilities buffer bit definitions (from PCI FW 3.0) 38*9455SKrishna.Elango@Sun.COM */ 39*9455SKrishna.Elango@Sun.COM /* first DWORD: status from _OSC invocation (except bit 0) */ 40*9455SKrishna.Elango@Sun.COM #define OSC_STATUS_QUERY_ENABLE 0x1 /* Query Support Flag */ 41*9455SKrishna.Elango@Sun.COM #define OSC_STATUS_FAILED 0x2 /* _OSC failure */ 42*9455SKrishna.Elango@Sun.COM #define OSC_STATUS_INV_UUID 0x4 /* invalid UUID */ 43*9455SKrishna.Elango@Sun.COM #define OSC_STATUS_INV_REVID 0x8 /* invalid revision ID */ 44*9455SKrishna.Elango@Sun.COM #define OSC_STATUS_CAPS_MASKED 0x10 /* capabilities masked */ 45*9455SKrishna.Elango@Sun.COM 46*9455SKrishna.Elango@Sun.COM #define OSC_STATUS_ERRORS \ 47*9455SKrishna.Elango@Sun.COM (OSC_STATUS_FAILED | OSC_STATUS_INV_UUID | OSC_STATUS_INV_REVID) 48*9455SKrishna.Elango@Sun.COM 49*9455SKrishna.Elango@Sun.COM /* second DWORD: Support Field (set by OS) */ 50*9455SKrishna.Elango@Sun.COM #define OSC_SUPPORT_EXT_PCI_CFG 0x1 /* Extended PCI Config Ops supported */ 51*9455SKrishna.Elango@Sun.COM #define OSC_SUPPORT_ACT_PM 0x2 /* Active State PM supported */ 52*9455SKrishna.Elango@Sun.COM #define OSC_SUPPORT_CLK_PM_CAP 0x4 /* Clock PM Capability supported */ 53*9455SKrishna.Elango@Sun.COM #define OSC_SUPPORT_PCI_SEGS 0x8 /* PCI Segment Groups supported */ 54*9455SKrishna.Elango@Sun.COM #define OSC_SUPPORT_MSI 0x10 /* MSI supported */ 55*9455SKrishna.Elango@Sun.COM 56*9455SKrishna.Elango@Sun.COM /* third DWORD: Control Field (set by OS/BIOS) */ 57*9455SKrishna.Elango@Sun.COM #define OSC_CONTROL_PCIE_NAT_HP 0x1 /* PCI Exp Native Hot Plug control */ 58*9455SKrishna.Elango@Sun.COM #define OSC_CONTROL_SHPC_NAT_HP 0x2 /* SHPC Native Hot Plug control */ 59*9455SKrishna.Elango@Sun.COM #define OSC_CONTROL_PCIE_NAT_PM 0x4 /* PCI Exp Native Power Mgmt. control */ 60*9455SKrishna.Elango@Sun.COM #define OSC_CONTROL_PCIE_ADV_ERR 0x8 /* PCIE Advanced Err. rep. control */ 61*9455SKrishna.Elango@Sun.COM #define OSC_CONTROL_PCIE_CAPS 0x10 /* PCIE Caps Structure control */ 62*9455SKrishna.Elango@Sun.COM 63*9455SKrishna.Elango@Sun.COM #define OSC_CONTROL_FIELD_INIT \ 64*9455SKrishna.Elango@Sun.COM (OSC_CONTROL_PCIE_CAPS | OSC_CONTROL_PCIE_ADV_ERR) 65*9455SKrishna.Elango@Sun.COM 66*9455SKrishna.Elango@Sun.COM #define OSC_SUPPORT_FIELD_INIT \ 67*9455SKrishna.Elango@Sun.COM (OSC_SUPPORT_EXT_PCI_CFG | \ 68*9455SKrishna.Elango@Sun.COM OSC_SUPPORT_ACT_PM | OSC_SUPPORT_CLK_PM_CAP | \ 69*9455SKrishna.Elango@Sun.COM OSC_SUPPORT_MSI | OSC_SUPPORT_PCI_SEGS) 70*9455SKrishna.Elango@Sun.COM 71*9455SKrishna.Elango@Sun.COM typedef struct pcie_x86_priv { 72*9455SKrishna.Elango@Sun.COM /* _OSC related */ 73*9455SKrishna.Elango@Sun.COM boolean_t bus_osc; /* Has _OSC method been called */ 74*9455SKrishna.Elango@Sun.COM boolean_t bus_osc_hp; /* Was native HP control granted */ 75*9455SKrishna.Elango@Sun.COM boolean_t bus_osc_aer; /* Was AER control granted */ 76*9455SKrishna.Elango@Sun.COM } pcie_x86_priv_t; 77*9455SKrishna.Elango@Sun.COM 78*9455SKrishna.Elango@Sun.COM extern int pcie_acpi_osc(dev_info_t *dip, uint32_t *osc_flags); 79*9455SKrishna.Elango@Sun.COM extern boolean_t pcie_is_osc(dev_info_t *dip); 80*9455SKrishna.Elango@Sun.COM 81*9455SKrishna.Elango@Sun.COM #ifdef __cplusplus 82*9455SKrishna.Elango@Sun.COM } 83*9455SKrishna.Elango@Sun.COM #endif 84*9455SKrishna.Elango@Sun.COM 85*9455SKrishna.Elango@Sun.COM #endif /* _SYS_PCIE_ACPI_H */ 86