achware.h revision 69450
1170118Smjacob/******************************************************************************
2170118Smjacob *
3170485Smjacob * Name: achware.h -- hardware specific interfaces
4170485Smjacob *       $Revision: 48 $
5170485Smjacob *
6170485Smjacob *****************************************************************************/
7170485Smjacob
8170485Smjacob/******************************************************************************
9170485Smjacob *
10170485Smjacob * 1. Copyright Notice
11170485Smjacob *
12170485Smjacob * Some or all of this work - Copyright (c) 1999, Intel Corp.  All rights
13170485Smjacob * reserved.
14170485Smjacob *
15170485Smjacob * 2. License
16170485Smjacob *
17170485Smjacob * 2.1. This is your license from Intel Corp. under its intellectual property
18170485Smjacob * rights.  You may have additional license terms from the party that provided
19170485Smjacob * you this software, covering your right to use that party's intellectual
20170485Smjacob * property rights.
21170485Smjacob *
22170485Smjacob * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23170485Smjacob * copy of the source code appearing in this file ("Covered Code") an
24170485Smjacob * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25170485Smjacob * base code distributed originally by Intel ("Original Intel Code") to copy,
26170485Smjacob * make derivatives, distribute, use and display any portion of the Covered
27170485Smjacob * Code in any form, with the right to sublicense such rights; and
28170485Smjacob *
29170485Smjacob * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30170485Smjacob * license (with the right to sublicense), under only those claims of Intel
31170485Smjacob * patents that are infringed by the Original Intel Code, to make, use, sell,
32170485Smjacob * offer to sell, and import the Covered Code and derivative works thereof
33170485Smjacob * solely to the minimum extent necessary to exercise the above copyright
34170485Smjacob * license, and in no event shall the patent license extend to any additions
35170485Smjacob * to or modifications of the Original Intel Code.  No other license or right
36170485Smjacob * is granted directly or by implication, estoppel or otherwise;
37170485Smjacob *
38170485Smjacob * The above copyright and patent license is granted only if the following
39170485Smjacob * conditions are met:
40170485Smjacob *
41170485Smjacob * 3. Conditions
42170485Smjacob *
43170485Smjacob * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44170485Smjacob * Redistribution of source code of any substantial portion of the Covered
45170485Smjacob * Code or modification with rights to further distribute source must include
46170485Smjacob * the above Copyright Notice, the above License, this list of Conditions,
47170485Smjacob * and the following Disclaimer and Export Compliance provision.  In addition,
48170485Smjacob * Licensee must cause all Covered Code to which Licensee contributes to
49170485Smjacob * contain a file documenting the changes Licensee made to create that Covered
50170485Smjacob * Code and the date of any change.  Licensee must include in that file the
51170485Smjacob * documentation of any changes made by any predecessor Licensee.  Licensee
52170485Smjacob * must include a prominent statement that the modification is derived,
53170485Smjacob * directly or indirectly, from Original Intel Code.
54170485Smjacob *
55170485Smjacob * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56170485Smjacob * Redistribution of source code of any substantial portion of the Covered
57170485Smjacob * Code or modification without rights to further distribute source must
58170485Smjacob * include the following Disclaimer and Export Compliance provision in the
59170485Smjacob * documentation and/or other materials provided with distribution.  In
60170485Smjacob * addition, Licensee may not authorize further sublicense of source of any
61170485Smjacob * portion of the Covered Code, and must include terms to the effect that the
62170485Smjacob * license from Licensee to its licensee is limited to the intellectual
63170485Smjacob * property embodied in the software Licensee provides to its licensee, and
64170485Smjacob * not to intellectual property embodied in modifications its licensee may
65170485Smjacob * make.
66170485Smjacob *
67170485Smjacob * 3.3. Redistribution of Executable. Redistribution in executable form of any
68170485Smjacob * substantial portion of the Covered Code or modification must reproduce the
69170485Smjacob * above Copyright Notice, and the following Disclaimer and Export Compliance
70170485Smjacob * provision in the documentation and/or other materials provided with the
71170485Smjacob * distribution.
72170485Smjacob *
73170485Smjacob * 3.4. Intel retains all right, title, and interest in and to the Original
74170485Smjacob * Intel Code.
75170485Smjacob *
76170485Smjacob * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77170485Smjacob * Intel shall be used in advertising or otherwise to promote the sale, use or
78170485Smjacob * other dealings in products derived from or relating to the Covered Code
79170485Smjacob * without prior written authorization from Intel.
80170485Smjacob *
81170485Smjacob * 4. Disclaimer and Export Compliance
82170485Smjacob *
83170485Smjacob * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84170485Smjacob * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85170485Smjacob * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86170485Smjacob * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87170485Smjacob * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88170485Smjacob * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89170485Smjacob * PARTICULAR PURPOSE.
90170485Smjacob *
91170485Smjacob * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92170485Smjacob * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93170485Smjacob * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94170485Smjacob * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95170485Smjacob * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96170485Smjacob * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97170485Smjacob * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98170485Smjacob * LIMITED REMEDY.
99170485Smjacob *
100170485Smjacob * 4.3. Licensee shall not export, either directly or indirectly, any of this
101170485Smjacob * software or system incorporating such software without first obtaining any
102170485Smjacob * required license or other approval from the U. S. Department of Commerce or
103170485Smjacob * any other agency or department of the United States Government.  In the
104170485Smjacob * event Licensee exports any such software from the United States or
105170485Smjacob * re-exports any such software from a foreign destination, Licensee shall
106170485Smjacob * ensure that the distribution and export/re-export of the software is in
107170485Smjacob * compliance with all laws, regulations, orders, or other restrictions of the
108170485Smjacob * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109170485Smjacob * any of its subsidiaries will export/re-export any technical data, process,
110170485Smjacob * software, or service, directly or indirectly, to any country for which the
111170485Smjacob * United States government or any agency thereof requires an export license,
112170485Smjacob * other governmental approval, or letter of assurance, without first obtaining
113170485Smjacob * such license, approval or letter.
114170485Smjacob *
115170485Smjacob *****************************************************************************/
116170485Smjacob
117170485Smjacob#ifndef __ACHWARE_H__
118170485Smjacob#define __ACHWARE_H__
119170485Smjacob
120170485Smjacob
121170485Smjacob/* Prototypes */
122170485Smjacob
123170485Smjacob
124170485SmjacobACPI_STATUS
125170485SmjacobAcpiHwInitialize (
126170485Smjacob    void);
127170485Smjacob
128170485SmjacobACPI_STATUS
129170485SmjacobAcpiHwShutdown (
130170485Smjacob    void);
131170485Smjacob
132170485SmjacobACPI_STATUS
133170485SmjacobAcpiHwInitializeSystemInfo (
134170485Smjacob    void);
135170485Smjacob
136170485SmjacobACPI_STATUS
137170485SmjacobAcpiHwSetMode (
138170485Smjacob    UINT32                  Mode);
139170485Smjacob
140170485SmjacobUINT32
141170485SmjacobAcpiHwGetMode (
142170485Smjacob    void);
143170485Smjacob
144170485SmjacobUINT32
145170485SmjacobAcpiHwGetModeCapabilities (
146170485Smjacob    void);
147170485Smjacob
148170485Smjacob/* Register I/O Prototypes */
149170485Smjacob
150170485Smjacob
151170485SmjacobUINT32
152170485SmjacobAcpiHwRegisterBitAccess (
153170485Smjacob    NATIVE_UINT             ReadWrite,
154170485Smjacob    BOOLEAN                 UseLock,
155170485Smjacob    UINT32                  RegisterId,
156170485Smjacob    ... /* DWORD Write Value */);
157170485Smjacob
158170485SmjacobUINT32
159170485SmjacobAcpiHwRegisterRead (
160170485Smjacob    BOOLEAN                 UseLock,
161170485Smjacob    UINT32                  RegisterId);
162170485Smjacob
163170485Smjacobvoid
164170485SmjacobAcpiHwRegisterWrite (
165170485Smjacob    BOOLEAN                 UseLock,
166170485Smjacob    UINT32                  RegisterId,
167170485Smjacob    UINT32                  Value);
168170485Smjacob
169170485SmjacobUINT32
170170485SmjacobAcpiHwLowLevelRead (
171170485Smjacob    UINT32                  Width,
172170485Smjacob    ACPI_GAS                *Reg,
173170485Smjacob    UINT32                  Offset);
174170485Smjacob
175170485Smjacobvoid
176170485SmjacobAcpiHwLowLevelWrite (
177170485Smjacob    UINT32                  Width,
178170485Smjacob    UINT32                  Value,
179170485Smjacob    ACPI_GAS                *Reg,
180170485Smjacob    UINT32                  Offset);
181170485Smjacob
182170485Smjacobvoid
183170485SmjacobAcpiHwClearAcpiStatus (
184170485Smjacob   void);
185170485Smjacob
186170485Smjacob
187170485Smjacob/* GPE support */
188170485Smjacob
189170485Smjacobvoid
190170485SmjacobAcpiHwEnableGpe (
191170485Smjacob    UINT32                  GpeIndex);
192170485Smjacob
193170485Smjacobvoid
194170485SmjacobAcpiHwDisableGpe (
195170485Smjacob    UINT32                  GpeIndex);
196170485Smjacob
197170485Smjacobvoid
198170485SmjacobAcpiHwClearGpe (
199170485Smjacob    UINT32                  GpeIndex);
200170485Smjacob
201170485Smjacobvoid
202170485SmjacobAcpiHwGetGpeStatus (
203170485Smjacob    UINT32                  GpeNumber,
204170485Smjacob    ACPI_EVENT_STATUS       *EventStatus);
205170485Smjacob
206170485Smjacob/* Sleep Prototypes */
207170485Smjacob
208170485SmjacobACPI_STATUS
209170485SmjacobAcpiHwObtainSleepTypeRegisterData (
210170485Smjacob    UINT8                   SleepState,
211170485Smjacob    UINT8                   *Slp_TypA,
212170485Smjacob    UINT8                   *Slp_TypB);
213
214
215/* Cx State Prototypes */
216
217ACPI_STATUS
218AcpiHwEnterC1(
219    ACPI_IO_ADDRESS         PblkAddress,
220    UINT32                  *PmTimerTicks);
221
222ACPI_STATUS
223AcpiHwEnterC2(
224    ACPI_IO_ADDRESS         PblkAddress,
225    UINT32                  *PmTimerTicks);
226
227ACPI_STATUS
228AcpiHwEnterC3(
229    ACPI_IO_ADDRESS         PblkAddress,
230    UINT32                  *PmTimerTicks);
231
232ACPI_STATUS
233AcpiHwEnterCx (
234    ACPI_IO_ADDRESS         PblkAddress,
235    UINT32                  *PmTimerTicks);
236
237ACPI_STATUS
238AcpiHwSetCx (
239    UINT32                  CxState);
240
241ACPI_STATUS
242AcpiHwGetCxInfo (
243    UINT32                  CxStates[]);
244
245ACPI_STATUS
246AcpiHwGetCxHandler (
247    UINT32                  CxState,
248    ACPI_C_STATE_HANDLER    *Handler);
249
250ACPI_STATUS
251AcpiHwSetCxHandler (
252    UINT32                  CxState,
253    ACPI_C_STATE_HANDLER    Handler);
254
255
256/* Throttling Prototypes */
257
258void
259AcpiHwEnableThrottling (
260    ACPI_IO_ADDRESS         PblkAddress);
261
262void
263AcpiHwDisableThrottling (
264    ACPI_IO_ADDRESS         PblkAddress);
265
266UINT32
267AcpiHwGetDutyCycle (
268    UINT8                   DutyOffset,
269    ACPI_IO_ADDRESS         PblkAddress,
270    UINT32                  NumThrottleStates);
271
272void
273AcpiHwProgramDutyCycle (
274    UINT8                   DutyOffset,
275    UINT32                  DutyCycle,
276    ACPI_IO_ADDRESS         PblkAddress,
277    UINT32                  NumThrottleStates);
278
279NATIVE_UINT
280AcpiHwLocalPow (
281    NATIVE_UINT             x,
282    NATIVE_UINT             y);
283
284
285/* ACPI Timer prototypes */
286
287UINT32
288AcpiHwPmtTicks (
289    void);
290
291UINT32
292AcpiHwPmtResolution (
293    void);
294
295ACPI_STATUS
296AcpiGetTimer (
297    UINT32                  *OutTicks);
298
299
300#endif /* __ACHWARE_H__ */
301