achware.h revision 128212
1178172Simp/******************************************************************************
2178172Simp *
3178172Simp * Name: achware.h -- hardware specific interfaces
4178172Simp *       $Revision: 69 $
5178172Simp *
6178172Simp *****************************************************************************/
7178172Simp
8178172Simp/******************************************************************************
9178172Simp *
10178172Simp * 1. Copyright Notice
11178172Simp *
12178172Simp * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
13178172Simp * All rights reserved.
14178172Simp *
15202031Simp * 2. License
16202031Simp *
17178172Simp * 2.1. This is your license from Intel Corp. under its intellectual property
18178172Simp * rights.  You may have additional license terms from the party that provided
19178172Simp * you this software, covering your right to use that party's intellectual
20178172Simp * property rights.
21178172Simp *
22178172Simp * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23178172Simp * copy of the source code appearing in this file ("Covered Code") an
24178172Simp * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25178172Simp * base code distributed originally by Intel ("Original Intel Code") to copy,
26178172Simp * make derivatives, distribute, use and display any portion of the Covered
27202031Simp * Code in any form, with the right to sublicense such rights; and
28202031Simp *
29202031Simp * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30202031Simp * license (with the right to sublicense), under only those claims of Intel
31202031Simp * patents that are infringed by the Original Intel Code, to make, use, sell,
32202031Simp * offer to sell, and import the Covered Code and derivative works thereof
33202031Simp * solely to the minimum extent necessary to exercise the above copyright
34202031Simp * license, and in no event shall the patent license extend to any additions
35202031Simp * to or modifications of the Original Intel Code.  No other license or right
36202031Simp * is granted directly or by implication, estoppel or otherwise;
37178172Simp *
38178172Simp * The above copyright and patent license is granted only if the following
39178172Simp * conditions are met:
40178172Simp *
41178172Simp * 3. Conditions
42178172Simp *
43178172Simp * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44178172Simp * Redistribution of source code of any substantial portion of the Covered
45202031Simp * Code or modification with rights to further distribute source must include
46178172Simp * the above Copyright Notice, the above License, this list of Conditions,
47178172Simp * and the following Disclaimer and Export Compliance provision.  In addition,
48178172Simp * Licensee must cause all Covered Code to which Licensee contributes to
49178172Simp * contain a file documenting the changes Licensee made to create that Covered
50178172Simp * Code and the date of any change.  Licensee must include in that file the
51178172Simp * documentation of any changes made by any predecessor Licensee.  Licensee
52178172Simp * must include a prominent statement that the modification is derived,
53178172Simp * directly or indirectly, from Original Intel Code.
54178172Simp *
55178172Simp * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56178172Simp * Redistribution of source code of any substantial portion of the Covered
57178172Simp * Code or modification without rights to further distribute source must
58178172Simp * include the following Disclaimer and Export Compliance provision in the
59178172Simp * documentation and/or other materials provided with distribution.  In
60178172Simp * addition, Licensee may not authorize further sublicense of source of any
61178172Simp * portion of the Covered Code, and must include terms to the effect that the
62178172Simp * license from Licensee to its licensee is limited to the intellectual
63178172Simp * property embodied in the software Licensee provides to its licensee, and
64202031Simp * not to intellectual property embodied in modifications its licensee may
65202031Simp * make.
66202031Simp *
67202031Simp * 3.3. Redistribution of Executable. Redistribution in executable form of any
68202031Simp * substantial portion of the Covered Code or modification must reproduce the
69202031Simp * above Copyright Notice, and the following Disclaimer and Export Compliance
70202031Simp * provision in the documentation and/or other materials provided with the
71202031Simp * distribution.
72202031Simp *
73202031Simp * 3.4. Intel retains all right, title, and interest in and to the Original
74202031Simp * Intel Code.
75202031Simp *
76202031Simp * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77202031Simp * Intel shall be used in advertising or otherwise to promote the sale, use or
78202031Simp * other dealings in products derived from or relating to the Covered Code
79202031Simp * without prior written authorization from Intel.
80202031Simp *
81202031Simp * 4. Disclaimer and Export Compliance
82202031Simp *
83202031Simp * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84178172Simp * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85178172Simp * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86178172Simp * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government.  In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117#ifndef __ACHWARE_H__
118#define __ACHWARE_H__
119
120
121/* PM Timer ticks per second (HZ) */
122#define PM_TIMER_FREQUENCY  3579545
123
124
125/* Prototypes */
126
127
128ACPI_STATUS
129AcpiHwInitialize (
130    void);
131
132ACPI_STATUS
133AcpiHwShutdown (
134    void);
135
136ACPI_STATUS
137AcpiHwInitializeSystemInfo (
138    void);
139
140ACPI_STATUS
141AcpiHwSetMode (
142    UINT32                  Mode);
143
144UINT32
145AcpiHwGetMode (
146    void);
147
148UINT32
149AcpiHwGetModeCapabilities (
150    void);
151
152/* Register I/O Prototypes */
153
154ACPI_BIT_REGISTER_INFO *
155AcpiHwGetBitRegisterInfo (
156    UINT32                  RegisterId);
157
158ACPI_STATUS
159AcpiHwRegisterRead (
160    BOOLEAN                 UseLock,
161    UINT32                  RegisterId,
162    UINT32                  *ReturnValue);
163
164ACPI_STATUS
165AcpiHwRegisterWrite (
166    BOOLEAN                 UseLock,
167    UINT32                  RegisterId,
168    UINT32                  Value);
169
170ACPI_STATUS
171AcpiHwLowLevelRead (
172    UINT32                  Width,
173    UINT32                  *Value,
174    ACPI_GENERIC_ADDRESS    *Reg);
175
176ACPI_STATUS
177AcpiHwLowLevelWrite (
178    UINT32                  Width,
179    UINT32                  Value,
180    ACPI_GENERIC_ADDRESS    *Reg);
181
182ACPI_STATUS
183AcpiHwClearAcpiStatus (
184    UINT32                  Flags);
185
186
187/* GPE support */
188
189ACPI_STATUS
190AcpiHwEnableGpe (
191    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
192
193void
194AcpiHwEnableGpeForWakeup (
195    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
196
197ACPI_STATUS
198AcpiHwDisableGpe (
199    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
200
201ACPI_STATUS
202AcpiHwDisableGpeBlock (
203    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
204    ACPI_GPE_BLOCK_INFO     *GpeBlock);
205
206void
207AcpiHwDisableGpeForWakeup (
208    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
209
210ACPI_STATUS
211AcpiHwClearGpe (
212    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
213
214ACPI_STATUS
215AcpiHwClearGpeBlock (
216    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
217    ACPI_GPE_BLOCK_INFO     *GpeBlock);
218
219ACPI_STATUS
220AcpiHwGetGpeStatus (
221    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
222    ACPI_EVENT_STATUS       *EventStatus);
223
224ACPI_STATUS
225AcpiHwPrepareGpesForSleep (
226    void);
227
228ACPI_STATUS
229AcpiHwRestoreGpesOnWake (
230    void);
231
232
233/* ACPI Timer prototypes */
234
235ACPI_STATUS
236AcpiGetTimerResolution (
237    UINT32                  *Resolution);
238
239ACPI_STATUS
240AcpiGetTimer (
241    UINT32                  *Ticks);
242
243ACPI_STATUS
244AcpiGetTimerDuration (
245    UINT32                  StartTicks,
246    UINT32                  EndTicks,
247    UINT32                  *TimeElapsed);
248
249
250#endif /* __ACHWARE_H__ */
251