achware.h revision 99679
11558Srgrimes/****************************************************************************** 21558Srgrimes * 31558Srgrimes * Name: achware.h -- hardware specific interfaces 41558Srgrimes * $Revision: 60 $ 51558Srgrimes * 61558Srgrimes *****************************************************************************/ 71558Srgrimes 81558Srgrimes/****************************************************************************** 91558Srgrimes * 101558Srgrimes * 1. Copyright Notice 111558Srgrimes * 121558Srgrimes * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. 131558Srgrimes * All rights reserved. 141558Srgrimes * 151558Srgrimes * 2. License 161558Srgrimes * 171558Srgrimes * 2.1. This is your license from Intel Corp. under its intellectual property 181558Srgrimes * rights. You may have additional license terms from the party that provided 191558Srgrimes * you this software, covering your right to use that party's intellectual 201558Srgrimes * property rights. 211558Srgrimes * 221558Srgrimes * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 231558Srgrimes * copy of the source code appearing in this file ("Covered Code") an 241558Srgrimes * irrevocable, perpetual, worldwide license under Intel's copyrights in the 251558Srgrimes * base code distributed originally by Intel ("Original Intel Code") to copy, 261558Srgrimes * make derivatives, distribute, use and display any portion of the Covered 271558Srgrimes * Code in any form, with the right to sublicense such rights; and 281558Srgrimes * 291558Srgrimes * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30114589Sobrien * license (with the right to sublicense), under only those claims of Intel 311558Srgrimes * patents that are infringed by the Original Intel Code, to make, use, sell, 3238039Scharnier * offer to sell, and import the Covered Code and derivative works thereof 331558Srgrimes * solely to the minimum extent necessary to exercise the above copyright 341558Srgrimes * license, and in no event shall the patent license extend to any additions 351558Srgrimes * to or modifications of the Original Intel Code. No other license or right 361558Srgrimes * is granted directly or by implication, estoppel or otherwise; 371558Srgrimes * 381558Srgrimes * The above copyright and patent license is granted only if the following 39114589Sobrien * conditions are met: 4038039Scharnier * 41114589Sobrien * 3. Conditions 42114589Sobrien * 431558Srgrimes * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44108375Sdillon * Redistribution of source code of any substantial portion of the Covered 45108375Sdillon * Code or modification with rights to further distribute source must include 46108375Sdillon * the above Copyright Notice, the above License, this list of Conditions, 47138129Sdas * and the following Disclaimer and Export Compliance provision. In addition, 48108375Sdillon * Licensee must cause all Covered Code to which Licensee contributes to 4938039Scharnier * contain a file documenting the changes Licensee made to create that Covered 5038039Scharnier * Code and the date of any change. Licensee must include in that file the 511558Srgrimes * documentation of any changes made by any predecessor Licensee. Licensee 521558Srgrimes * must include a prominent statement that the modification is derived, 5378732Sdd * directly or indirectly, from Original Intel Code. 5438039Scharnier * 556661Sphk * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56108375Sdillon * Redistribution of source code of any substantial portion of the Covered 57179154Spjd * Code or modification without rights to further distribute source must 581558Srgrimes * include the following Disclaimer and Export Compliance provision in the 59108375Sdillon * documentation and/or other materials provided with distribution. In 60108375Sdillon * addition, Licensee may not authorize further sublicense of source of any 61108375Sdillon * portion of the Covered Code, and must include terms to the effect that the 626661Sphk * license from Licensee to its licensee is limited to the intellectual 63108375Sdillon * property embodied in the software Licensee provides to its licensee, and 64108375Sdillon * not to intellectual property embodied in modifications its licensee may 656661Sphk * make. 666661Sphk * 671558Srgrimes * 3.3. Redistribution of Executable. Redistribution in executable form of any 6892806Sobrien * substantial portion of the Covered Code or modification must reproduce the 69108375Sdillon * above Copyright Notice, and the following Disclaimer and Export Compliance 7092806Sobrien * provision in the documentation and/or other materials provided with the 711558Srgrimes * distribution. 72179966Smtm * 731558Srgrimes * 3.4. Intel retains all right, title, and interest in and to the Original 74108375Sdillon * Intel Code. 75108375Sdillon * 76108375Sdillon * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77108375Sdillon * Intel shall be used in advertising or otherwise to promote the sale, use or 78108375Sdillon * other dealings in products derived from or relating to the Covered Code 79108375Sdillon * without prior written authorization from Intel. 80108375Sdillon * 81108375Sdillon * 4. Disclaimer and Export Compliance 821558Srgrimes * 83179966Smtm * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84108375Sdillon * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85108375Sdillon * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86108375Sdillon * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87108375Sdillon * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88108375Sdillon * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89108375Sdillon * PARTICULAR PURPOSE. 90108375Sdillon * 91108375Sdillon * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92108375Sdillon * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 931558Srgrimes * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94108375Sdillon * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95108375Sdillon * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96108375Sdillon * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97108375Sdillon * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 981558Srgrimes * LIMITED REMEDY. 99108375Sdillon * 100108375Sdillon * 4.3. Licensee shall not export, either directly or indirectly, any of this 101108375Sdillon * software or system incorporating such software without first obtaining any 102108375Sdillon * required license or other approval from the U. S. Department of Commerce or 103108375Sdillon * any other agency or department of the United States Government. In the 104108375Sdillon * event Licensee exports any such software from the United States or 105179154Spjd * re-exports any such software from a foreign destination, Licensee shall 106179154Spjd * ensure that the distribution and export/re-export of the software is in 107108375Sdillon * compliance with all laws, regulations, orders, or other restrictions of the 108179154Spjd * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109179154Spjd * any of its subsidiaries will export/re-export any technical data, process, 110179154Spjd * software, or service, directly or indirectly, to any country for which the 111179154Spjd * United States government or any agency thereof requires an export license, 112179154Spjd * other governmental approval, or letter of assurance, without first obtaining 113179154Spjd * such license, approval or letter. 114108375Sdillon * 115108375Sdillon *****************************************************************************/ 116108375Sdillon 117179154Spjd#ifndef __ACHWARE_H__ 118108375Sdillon#define __ACHWARE_H__ 119108375Sdillon 120179966Smtm 121179966Smtm/* PM Timer ticks per second (HZ) */ 122179966Smtm#define PM_TIMER_FREQUENCY 3579545 123179966Smtm 124179154Spjd 125179154Spjd/* Prototypes */ 126108375Sdillon 127108375Sdillon 128108375SdillonACPI_STATUS 129108375SdillonAcpiHwInitialize ( 130108375Sdillon void); 131108375Sdillon 132108375SdillonACPI_STATUS 133108375SdillonAcpiHwShutdown ( 134108375Sdillon void); 1351558Srgrimes 1361558SrgrimesACPI_STATUS 137108375SdillonAcpiHwInitializeSystemInfo ( 1381558Srgrimes void); 139108375Sdillon 1401558SrgrimesACPI_STATUS 1411558SrgrimesAcpiHwSetMode ( 1421558Srgrimes UINT32 Mode); 143108375Sdillon 144108375SdillonUINT32 145108375SdillonAcpiHwGetMode ( 146108375Sdillon void); 147108375Sdillon 148108375SdillonUINT32 149108375SdillonAcpiHwGetModeCapabilities ( 150111424Sdas void); 151108375Sdillon 152108375Sdillon/* Register I/O Prototypes */ 153179966Smtm 154179966SmtmACPI_BIT_REGISTER_INFO * 155179966SmtmAcpiHwGetBitRegisterInfo ( 156179966Smtm UINT32 RegisterId); 157179966Smtm 158179966SmtmACPI_STATUS 159108375SdillonAcpiHwRegisterRead ( 160108375Sdillon BOOLEAN UseLock, 161108375Sdillon UINT32 RegisterId, 162108375Sdillon UINT32 *ReturnValue); 163108375Sdillon 164108375SdillonACPI_STATUS 165108375SdillonAcpiHwRegisterWrite ( 1661558Srgrimes BOOLEAN UseLock, 167108375Sdillon UINT32 RegisterId, 168107913Sdillon UINT32 Value); 169108375Sdillon 170108375SdillonACPI_STATUS 171108375SdillonAcpiHwLowLevelRead ( 1721558Srgrimes UINT32 Width, 173108375Sdillon UINT32 *Value, 174108375Sdillon ACPI_GENERIC_ADDRESS *Reg, 175108375Sdillon UINT32 Offset); 176108375Sdillon 177108375SdillonACPI_STATUS 178108375SdillonAcpiHwLowLevelWrite ( 1791558Srgrimes UINT32 Width, 1801558Srgrimes UINT32 Value, 1811558Srgrimes ACPI_GENERIC_ADDRESS *Reg, 182108375Sdillon UINT32 Offset); 183111424Sdas 1841558SrgrimesACPI_STATUS 185108375SdillonAcpiHwClearAcpiStatus ( 1861558Srgrimes void); 1871558Srgrimes 188111424Sdas 18926740Scharnier/* GPE support */ 1901558Srgrimes 191111424SdasUINT8 192111424SdasAcpiHwGetGpeBitMask ( 193111424Sdas UINT32 GpeNumber); 194111424Sdas 195111424SdasACPI_STATUS 196111424SdasAcpiHwEnableGpe ( 1971558Srgrimes UINT32 GpeNumber); 19826740Scharnier 1991558Srgrimesvoid 2001558SrgrimesAcpiHwEnableGpeForWakeup ( 2011558Srgrimes UINT32 GpeNumber); 2021558Srgrimes 2031558SrgrimesACPI_STATUS 2041558SrgrimesAcpiHwDisableGpe ( 2051558Srgrimes UINT32 GpeNumber); 20626740Scharnier 207108375Sdillonvoid 2081558SrgrimesAcpiHwDisableGpeForWakeup ( 209108375Sdillon UINT32 GpeNumber); 210108375Sdillon 211141611SruACPI_STATUS 212108375SdillonAcpiHwClearGpe ( 213179966Smtm UINT32 GpeNumber); 214108375Sdillon 215108375SdillonACPI_STATUS 216179154SpjdAcpiHwGetGpeStatus ( 217108375Sdillon UINT32 GpeNumber, 218108375Sdillon ACPI_EVENT_STATUS *EventStatus); 2191558Srgrimes 2201558SrgrimesACPI_STATUS 221107913SdillonAcpiHwDisableNonWakeupGpes ( 222108375Sdillon void); 223179154Spjd 224179154SpjdACPI_STATUS 225179154SpjdAcpiHwEnableNonWakeupGpes ( 226179154Spjd void); 227179154Spjd 228179154Spjd 229179154Spjd/* ACPI Timer prototypes */ 230179154Spjd 231179154SpjdACPI_STATUS 232179154SpjdAcpiGetTimerResolution ( 233179154Spjd UINT32 *Resolution); 234179154Spjd 235179154SpjdACPI_STATUS 236179154SpjdAcpiGetTimer ( 237179154Spjd UINT32 *Ticks); 238179154Spjd 239108375SdillonACPI_STATUS 240107913SdillonAcpiGetTimerDuration ( 241108375Sdillon UINT32 StartTicks, 242108375Sdillon UINT32 EndTicks, 243108425Smike UINT32 *TimeElapsed); 244108375Sdillon 245108375Sdillon 246108375Sdillon#endif /* __ACHWARE_H__ */ 247108375Sdillon