achware.h revision 193335
175584Sru/****************************************************************************** 275584Sru * 375584Sru * Name: achware.h -- hardware specific interfaces 4104862Sru * 575584Sru *****************************************************************************/ 675584Sru 775584Sru/****************************************************************************** 875584Sru * 975584Sru * 1. Copyright Notice 1075584Sru * 1175584Sru * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. 1275584Sru * All rights reserved. 1375584Sru * 1475584Sru * 2. License 15104862Sru * 1675584Sru * 2.1. This is your license from Intel Corp. under its intellectual property 1775584Sru * rights. You may have additional license terms from the party that provided 1875584Sru * you this software, covering your right to use that party's intellectual 1975584Sru * property rights. 2075584Sru * 2175584Sru * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 22104862Sru * copy of the source code appearing in this file ("Covered Code") an 2375584Sru * irrevocable, perpetual, worldwide license under Intel's copyrights in the 2475584Sru * base code distributed originally by Intel ("Original Intel Code") to copy, 2575584Sru * make derivatives, distribute, use and display any portion of the Covered 2675584Sru * Code in any form, with the right to sublicense such rights; and 2775584Sru * 2875584Sru * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 2975584Sru * license (with the right to sublicense), under only those claims of Intel 3075584Sru * patents that are infringed by the Original Intel Code, to make, use, sell, 3175584Sru * offer to sell, and import the Covered Code and derivative works thereof 3275584Sru * solely to the minimum extent necessary to exercise the above copyright 3375584Sru * license, and in no event shall the patent license extend to any additions 3475584Sru * to or modifications of the Original Intel Code. No other license or right 3575584Sru * is granted directly or by implication, estoppel or otherwise; 3675584Sru * 3775584Sru * The above copyright and patent license is granted only if the following 3875584Sru * conditions are met: 3975584Sru * 4075584Sru * 3. Conditions 4175584Sru * 4275584Sru * 3.1. Redistribution of Source with Rights to Further Distribute Source. 4375584Sru * Redistribution of source code of any substantial portion of the Covered 4475584Sru * Code or modification with rights to further distribute source must include 4575584Sru * the above Copyright Notice, the above License, this list of Conditions, 4675584Sru * and the following Disclaimer and Export Compliance provision. In addition, 4775584Sru * Licensee must cause all Covered Code to which Licensee contributes to 4875584Sru * contain a file documenting the changes Licensee made to create that Covered 4975584Sru * Code and the date of any change. Licensee must include in that file the 5075584Sru * documentation of any changes made by any predecessor Licensee. Licensee 5175584Sru * must include a prominent statement that the modification is derived, 5275584Sru * directly or indirectly, from Original Intel Code. 5375584Sru * 5475584Sru * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 5575584Sru * Redistribution of source code of any substantial portion of the Covered 5675584Sru * Code or modification without rights to further distribute source must 5775584Sru * include the following Disclaimer and Export Compliance provision in the 5875584Sru * documentation and/or other materials provided with distribution. In 5975584Sru * addition, Licensee may not authorize further sublicense of source of any 6075584Sru * portion of the Covered Code, and must include terms to the effect that the 6175584Sru * license from Licensee to its licensee is limited to the intellectual 6275584Sru * property embodied in the software Licensee provides to its licensee, and 6375584Sru * not to intellectual property embodied in modifications its licensee may 6475584Sru * make. 6575584Sru * 6675584Sru * 3.3. Redistribution of Executable. Redistribution in executable form of any 6775584Sru * substantial portion of the Covered Code or modification must reproduce the 6875584Sru * above Copyright Notice, and the following Disclaimer and Export Compliance 6975584Sru * provision in the documentation and/or other materials provided with the 7075584Sru * distribution. 7175584Sru * 7275584Sru * 3.4. Intel retains all right, title, and interest in and to the Original 7375584Sru * Intel Code. 7475584Sru * 7575584Sru * 3.5. Neither the name Intel nor any other trademark owned or controlled by 7675584Sru * Intel shall be used in advertising or otherwise to promote the sale, use or 7775584Sru * other dealings in products derived from or relating to the Covered Code 7875584Sru * without prior written authorization from Intel. 7975584Sru * 8075584Sru * 4. Disclaimer and Export Compliance 8175584Sru * 8275584Sru * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 8375584Sru * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 8475584Sru * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 8575584Sru * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 8675584Sru * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 8775584Sru * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 8875584Sru * PARTICULAR PURPOSE. 8975584Sru * 9075584Sru * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 9175584Sru * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 9275584Sru * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 9375584Sru * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 9475584Sru * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 9575584Sru * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 9675584Sru * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 9775584Sru * LIMITED REMEDY. 9875584Sru * 9975584Sru * 4.3. Licensee shall not export, either directly or indirectly, any of this 10075584Sru * software or system incorporating such software without first obtaining any 10175584Sru * required license or other approval from the U. S. Department of Commerce or 10275584Sru * any other agency or department of the United States Government. In the 10375584Sru * event Licensee exports any such software from the United States or 10475584Sru * re-exports any such software from a foreign destination, Licensee shall 10575584Sru * ensure that the distribution and export/re-export of the software is in 10675584Sru * compliance with all laws, regulations, orders, or other restrictions of the 10775584Sru * U.S. Export Administration Regulations. Licensee agrees that neither it nor 10875584Sru * any of its subsidiaries will export/re-export any technical data, process, 10975584Sru * software, or service, directly or indirectly, to any country for which the 11075584Sru * United States government or any agency thereof requires an export license, 11175584Sru * other governmental approval, or letter of assurance, without first obtaining 11275584Sru * such license, approval or letter. 11375584Sru * 11475584Sru *****************************************************************************/ 11575584Sru 11675584Sru#ifndef __ACHWARE_H__ 117104862Sru#define __ACHWARE_H__ 11875584Sru 11975584Sru 12075584Sru/* Values for the _SST predefined method */ 12175584Sru 12275584Sru#define ACPI_SST_INDICATOR_OFF 0 12375584Sru#define ACPI_SST_WORKING 1 12475584Sru#define ACPI_SST_WAKING 2 12575584Sru#define ACPI_SST_SLEEPING 3 12675584Sru#define ACPI_SST_SLEEP_CONTEXT 4 12775584Sru 12875584Sru 129114402Sru/* 13075584Sru * hwacpi - high level functions 13175584Sru */ 13275584SruACPI_STATUS 13375584SruAcpiHwSetMode ( 13475584Sru UINT32 Mode); 135104862Sru 13675584SruUINT32 13775584SruAcpiHwGetMode ( 13875584Sru void); 139104862Sru 14075584Sru 14175584Sru/* 14275584Sru * hwregs - ACPI Register I/O 14375584Sru */ 14475584SruACPI_BIT_REGISTER_INFO * 14575584SruAcpiHwGetBitRegisterInfo ( 14675584Sru UINT32 RegisterId); 14775584Sru 14875584SruACPI_STATUS 14975584SruAcpiHwWritePm1Control ( 15075584Sru UINT32 Pm1aControl, 15175584Sru UINT32 Pm1bControl); 15275584Sru 15375584SruACPI_STATUS 15475584SruAcpiHwRegisterRead ( 15575584Sru UINT32 RegisterId, 15675584Sru UINT32 *ReturnValue); 15775584Sru 15875584SruACPI_STATUS 15975584SruAcpiHwRegisterWrite ( 16075584Sru UINT32 RegisterId, 16175584Sru UINT32 Value); 16275584Sru 16375584SruACPI_STATUS 16475584SruAcpiHwClearAcpiStatus ( 16575584Sru void); 16675584Sru 16775584Sru 16875584Sru/* 16975584Sru * hwvalid - Port I/O with validation 17075584Sru */ 17175584SruACPI_STATUS 17275584SruAcpiHwReadPort ( 173104862Sru ACPI_IO_ADDRESS Address, 17475584Sru UINT32 *Value, 17575584Sru UINT32 Width); 17675584Sru 17775584SruACPI_STATUS 17875584SruAcpiHwWritePort ( 17975584Sru ACPI_IO_ADDRESS Address, 18075584Sru UINT32 Value, 18175584Sru UINT32 Width); 18275584Sru 18375584Sru 18475584Sru/* 18575584Sru * hwgpe - GPE support 18675584Sru */ 18775584SruACPI_STATUS 18875584SruAcpiHwLowDisableGpe ( 18975584Sru ACPI_GPE_EVENT_INFO *GpeEventInfo); 19075584Sru 19175584SruACPI_STATUS 19275584SruAcpiHwWriteGpeEnableReg ( 19375584Sru ACPI_GPE_EVENT_INFO *GpeEventInfo); 19475584Sru 19575584SruACPI_STATUS 19675584SruAcpiHwDisableGpeBlock ( 19775584Sru ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 19875584Sru ACPI_GPE_BLOCK_INFO *GpeBlock, 19975584Sru void *Context); 20075584Sru 20175584SruACPI_STATUS 20275584SruAcpiHwClearGpe ( 20375584Sru ACPI_GPE_EVENT_INFO *GpeEventInfo); 20475584Sru 205104862SruACPI_STATUS 20675584SruAcpiHwClearGpeBlock ( 20775584Sru ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 20875584Sru ACPI_GPE_BLOCK_INFO *GpeBlock, 20975584Sru void *Context); 21075584Sru 21175584SruACPI_STATUS 21275584SruAcpiHwGetGpeStatus ( 21375584Sru ACPI_GPE_EVENT_INFO *GpeEventInfo, 214 ACPI_EVENT_STATUS *EventStatus); 215 216ACPI_STATUS 217AcpiHwDisableAllGpes ( 218 void); 219 220ACPI_STATUS 221AcpiHwEnableAllRuntimeGpes ( 222 void); 223 224ACPI_STATUS 225AcpiHwEnableAllWakeupGpes ( 226 void); 227 228ACPI_STATUS 229AcpiHwEnableRuntimeGpeBlock ( 230 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 231 ACPI_GPE_BLOCK_INFO *GpeBlock, 232 void *Context); 233 234 235/* 236 * hwtimer - ACPI Timer prototypes 237 */ 238ACPI_STATUS 239AcpiGetTimerResolution ( 240 UINT32 *Resolution); 241 242ACPI_STATUS 243AcpiGetTimer ( 244 UINT32 *Ticks); 245 246ACPI_STATUS 247AcpiGetTimerDuration ( 248 UINT32 StartTicks, 249 UINT32 EndTicks, 250 UINT32 *TimeElapsed); 251 252 253#endif /* __ACHWARE_H__ */ 254