achware.h revision 193249
1116742Ssam/****************************************************************************** 2116904Ssam * 3139530Ssam * Name: achware.h -- hardware specific interfaces 4116742Ssam * $Revision: 1.83 $ 5116742Ssam * 6116742Ssam *****************************************************************************/ 7116742Ssam 8116742Ssam/****************************************************************************** 9116742Ssam * 10116904Ssam * 1. Copyright Notice 11116904Ssam * 12116904Ssam * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. 13116904Ssam * All rights reserved. 14116904Ssam * 15116904Ssam * 2. License 16116742Ssam * 17116742Ssam * 2.1. This is your license from Intel Corp. under its intellectual property 18116742Ssam * rights. You may have additional license terms from the party that provided 19116742Ssam * you this software, covering your right to use that party's intellectual 20116742Ssam * property rights. 21116904Ssam * 22116904Ssam * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23116904Ssam * copy of the source code appearing in this file ("Covered Code") an 24116904Ssam * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25116904Ssam * base code distributed originally by Intel ("Original Intel Code") to copy, 26116904Ssam * make derivatives, distribute, use and display any portion of the Covered 27116904Ssam * Code in any form, with the right to sublicense such rights; and 28116904Ssam * 29116904Ssam * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30116904Ssam * license (with the right to sublicense), under only those claims of Intel 31116742Ssam * patents that are infringed by the Original Intel Code, to make, use, sell, 32116742Ssam * offer to sell, and import the Covered Code and derivative works thereof 33116742Ssam * solely to the minimum extent necessary to exercise the above copyright 34116742Ssam * license, and in no event shall the patent license extend to any additions 35116742Ssam * to or modifications of the Original Intel Code. No other license or right 36116742Ssam * is granted directly or by implication, estoppel or otherwise; 37116742Ssam * 38116742Ssam * The above copyright and patent license is granted only if the following 39116742Ssam * conditions are met: 40127646Ssam * 41127646Ssam * 3. Conditions 42127646Ssam * 43116742Ssam * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44116742Ssam * Redistribution of source code of any substantial portion of the Covered 45116742Ssam * Code or modification with rights to further distribute source must include 46116742Ssam * the above Copyright Notice, the above License, this list of Conditions, 47116742Ssam * and the following Disclaimer and Export Compliance provision. In addition, 48116742Ssam * Licensee must cause all Covered Code to which Licensee contributes to 49116742Ssam * contain a file documenting the changes Licensee made to create that Covered 50116742Ssam * Code and the date of any change. Licensee must include in that file the 51116742Ssam * documentation of any changes made by any predecessor Licensee. Licensee 52116742Ssam * must include a prominent statement that the modification is derived, 53116742Ssam * directly or indirectly, from Original Intel Code. 54116742Ssam * 55127646Ssam * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56127646Ssam * Redistribution of source code of any substantial portion of the Covered 57127646Ssam * Code or modification without rights to further distribute source must 58127646Ssam * include the following Disclaimer and Export Compliance provision in the 59127646Ssam * documentation and/or other materials provided with distribution. In 60127646Ssam * addition, Licensee may not authorize further sublicense of source of any 61127646Ssam * portion of the Covered Code, and must include terms to the effect that the 62127646Ssam * license from Licensee to its licensee is limited to the intellectual 63127646Ssam * property embodied in the software Licensee provides to its licensee, and 64127646Ssam * not to intellectual property embodied in modifications its licensee may 65116742Ssam * make. 66116742Ssam * 67116742Ssam * 3.3. Redistribution of Executable. Redistribution in executable form of any 68116742Ssam * substantial portion of the Covered Code or modification must reproduce the 69116742Ssam * above Copyright Notice, and the following Disclaimer and Export Compliance 70138568Ssam * provision in the documentation and/or other materials provided with the 71138568Ssam * distribution. 72138568Ssam * 73138568Ssam * 3.4. Intel retains all right, title, and interest in and to the Original 74138568Ssam * Intel Code. 75116742Ssam * 76116742Ssam * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77116742Ssam * Intel shall be used in advertising or otherwise to promote the sale, use or 78116742Ssam * other dealings in products derived from or relating to the Covered Code 79116742Ssam * without prior written authorization from Intel. 80116742Ssam * 81138568Ssam * 4. Disclaimer and Export Compliance 82138568Ssam * 83138568Ssam * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84138568Ssam * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85138568Ssam * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86138568Ssam * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87138568Ssam * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88138568Ssam * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89138568Ssam * PARTICULAR PURPOSE. 90138568Ssam * 91138568Ssam * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92138568Ssam * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93138568Ssam * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94138568Ssam * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95138568Ssam * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96138568Ssam * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97138568Ssam * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98138568Ssam * LIMITED REMEDY. 99138568Ssam * 100138568Ssam * 4.3. Licensee shall not export, either directly or indirectly, any of this 101138568Ssam * software or system incorporating such software without first obtaining any 102138568Ssam * required license or other approval from the U. S. Department of Commerce or 103138568Ssam * any other agency or department of the United States Government. In the 104138568Ssam * event Licensee exports any such software from the United States or 105138568Ssam * re-exports any such software from a foreign destination, Licensee shall 106138568Ssam * ensure that the distribution and export/re-export of the software is in 107138568Ssam * compliance with all laws, regulations, orders, or other restrictions of the 108138568Ssam * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109138568Ssam * any of its subsidiaries will export/re-export any technical data, process, 110138568Ssam * software, or service, directly or indirectly, to any country for which the 111138568Ssam * United States government or any agency thereof requires an export license, 112138568Ssam * other governmental approval, or letter of assurance, without first obtaining 113138568Ssam * such license, approval or letter. 114138568Ssam * 115138568Ssam *****************************************************************************/ 116138568Ssam 117138568Ssam#ifndef __ACHWARE_H__ 118138568Ssam#define __ACHWARE_H__ 119138568Ssam 120138568Ssam 121138568Ssam/* PM Timer ticks per second (HZ) */ 122138568Ssam 123138568Ssam#define PM_TIMER_FREQUENCY 3579545 124138568Ssam 125138568Ssam/* Values for the _SST reserved method */ 126138568Ssam 127138568Ssam#define ACPI_SST_INDICATOR_OFF 0 128138568Ssam#define ACPI_SST_WORKING 1 129138568Ssam#define ACPI_SST_WAKING 2 130138568Ssam#define ACPI_SST_SLEEPING 3 131138568Ssam#define ACPI_SST_SLEEP_CONTEXT 4 132138568Ssam 133138568Ssam 134138568Ssam/* Prototypes */ 135138568Ssam 136138568Ssam 137138568Ssam/* 138138568Ssam * hwacpi - high level functions 139138568Ssam */ 140138568SsamACPI_STATUS 141138568SsamAcpiHwSetMode ( 142138568Ssam UINT32 Mode); 143138568Ssam 144138568SsamUINT32 145138568SsamAcpiHwGetMode ( 146138568Ssam void); 147138568Ssam 148138568Ssam 149138568Ssam/* 150138568Ssam * hwregs - ACPI Register I/O 151138568Ssam */ 152138568SsamACPI_BIT_REGISTER_INFO * 153138568SsamAcpiHwGetBitRegisterInfo ( 154138568Ssam UINT32 RegisterId); 155138568Ssam 156138568SsamACPI_STATUS 157138568SsamAcpiHwRegisterRead ( 158138568Ssam BOOLEAN UseLock, 159138568Ssam UINT32 RegisterId, 160138568Ssam UINT32 *ReturnValue); 161138568Ssam 162138568SsamACPI_STATUS 163138568SsamAcpiHwRegisterWrite ( 164138568Ssam BOOLEAN UseLock, 165138568Ssam UINT32 RegisterId, 166138568Ssam UINT32 Value); 167138568Ssam 168138568SsamACPI_STATUS 169138568SsamAcpiHwLowLevelRead ( 170138568Ssam UINT32 Width, 171138568Ssam UINT32 *Value, 172138568Ssam ACPI_GENERIC_ADDRESS *Reg); 173138568Ssam 174138568SsamACPI_STATUS 175138568SsamAcpiHwLowLevelWrite ( 176138568Ssam UINT32 Width, 177138568Ssam UINT32 Value, 178138568Ssam ACPI_GENERIC_ADDRESS *Reg); 179138568Ssam 180138568SsamACPI_STATUS 181138568SsamAcpiHwClearAcpiStatus ( 182138568Ssam void); 183138568Ssam 184138568Ssam 185116742Ssam/* 186138568Ssam * hwgpe - GPE support 187116742Ssam */ 188138568SsamACPI_STATUS 189116742SsamAcpiHwWriteGpeEnableReg ( 190116742Ssam ACPI_GPE_EVENT_INFO *GpeEventInfo); 191116742Ssam 192116742SsamACPI_STATUS 193116742SsamAcpiHwDisableGpeBlock ( 194116742Ssam ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 195116742Ssam ACPI_GPE_BLOCK_INFO *GpeBlock); 196116742Ssam 197116742SsamACPI_STATUS 198116742SsamAcpiHwClearGpe ( 199116742Ssam ACPI_GPE_EVENT_INFO *GpeEventInfo); 200116742Ssam 201116742SsamACPI_STATUS 202116742SsamAcpiHwClearGpeBlock ( 203116742Ssam ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 204116742Ssam ACPI_GPE_BLOCK_INFO *GpeBlock); 205116742Ssam 206116742SsamACPI_STATUS 207116742SsamAcpiHwGetGpeStatus ( 208116742Ssam ACPI_GPE_EVENT_INFO *GpeEventInfo, 209116742Ssam ACPI_EVENT_STATUS *EventStatus); 210116742Ssam 211116742SsamACPI_STATUS 212116742SsamAcpiHwDisableAllGpes ( 213116742Ssam void); 214116742Ssam 215116742SsamACPI_STATUS 216116742SsamAcpiHwEnableAllRuntimeGpes ( 217116742Ssam void); 218116742Ssam 219116742SsamACPI_STATUS 220116742SsamAcpiHwEnableAllWakeupGpes ( 221116742Ssam void); 222116742Ssam 223116742SsamACPI_STATUS 224116742SsamAcpiHwEnableRuntimeGpeBlock ( 225116742Ssam ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 226116742Ssam ACPI_GPE_BLOCK_INFO *GpeBlock); 227116742Ssam 228116742Ssam 229116742Ssam/* 230116742Ssam * hwtimer - ACPI Timer prototypes 231116742Ssam */ 232116742SsamACPI_STATUS 233116742SsamAcpiGetTimerResolution ( 234116742Ssam UINT32 *Resolution); 235116742Ssam 236116742SsamACPI_STATUS 237116742SsamAcpiGetTimer ( 238116742Ssam UINT32 *Ticks); 239116742Ssam 240116742SsamACPI_STATUS 241116742SsamAcpiGetTimerDuration ( 242116742Ssam UINT32 StartTicks, 243116742Ssam UINT32 EndTicks, 244116742Ssam UINT32 *TimeElapsed); 245116742Ssam 246116742Ssam 247116742Ssam#endif /* __ACHWARE_H__ */ 248116742Ssam