achware.h revision 114237
1214501Srpaulo/******************************************************************************
2214501Srpaulo *
3214501Srpaulo * Name: achware.h -- hardware specific interfaces
4214501Srpaulo *       $Revision: 62 $
5214501Srpaulo *
6214501Srpaulo *****************************************************************************/
7214501Srpaulo
8214501Srpaulo/******************************************************************************
9214501Srpaulo *
10214501Srpaulo * 1. Copyright Notice
11214501Srpaulo *
12214501Srpaulo * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13214501Srpaulo * All rights reserved.
14214501Srpaulo *
15214501Srpaulo * 2. License
16214501Srpaulo *
17214501Srpaulo * 2.1. This is your license from Intel Corp. under its intellectual property
18214501Srpaulo * rights.  You may have additional license terms from the party that provided
19214501Srpaulo * you this software, covering your right to use that party's intellectual
20214501Srpaulo * property rights.
21214501Srpaulo *
22214501Srpaulo * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23214501Srpaulo * copy of the source code appearing in this file ("Covered Code") an
24214501Srpaulo * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25214501Srpaulo * base code distributed originally by Intel ("Original Intel Code") to copy,
26214501Srpaulo * make derivatives, distribute, use and display any portion of the Covered
27214501Srpaulo * Code in any form, with the right to sublicense such rights; and
28214501Srpaulo *
29214501Srpaulo * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30214501Srpaulo * license (with the right to sublicense), under only those claims of Intel
31214501Srpaulo * patents that are infringed by the Original Intel Code, to make, use, sell,
32214501Srpaulo * offer to sell, and import the Covered Code and derivative works thereof
33214501Srpaulo * solely to the minimum extent necessary to exercise the above copyright
34214501Srpaulo * license, and in no event shall the patent license extend to any additions
35214501Srpaulo * to or modifications of the Original Intel Code.  No other license or right
36214501Srpaulo * is granted directly or by implication, estoppel or otherwise;
37214501Srpaulo *
38214501Srpaulo * The above copyright and patent license is granted only if the following
39214501Srpaulo * conditions are met:
40214501Srpaulo *
41214501Srpaulo * 3. Conditions
42214501Srpaulo *
43214501Srpaulo * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44214501Srpaulo * Redistribution of source code of any substantial portion of the Covered
45214501Srpaulo * Code or modification with rights to further distribute source must include
46214501Srpaulo * the above Copyright Notice, the above License, this list of Conditions,
47214501Srpaulo * and the following Disclaimer and Export Compliance provision.  In addition,
48214501Srpaulo * Licensee must cause all Covered Code to which Licensee contributes to
49214501Srpaulo * contain a file documenting the changes Licensee made to create that Covered
50214501Srpaulo * Code and the date of any change.  Licensee must include in that file the
51214501Srpaulo * documentation of any changes made by any predecessor Licensee.  Licensee
52214501Srpaulo * must include a prominent statement that the modification is derived,
53214501Srpaulo * directly or indirectly, from Original Intel Code.
54214501Srpaulo *
55214501Srpaulo * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56214501Srpaulo * Redistribution of source code of any substantial portion of the Covered
57214501Srpaulo * Code or modification without rights to further distribute source must
58214501Srpaulo * include the following Disclaimer and Export Compliance provision in the
59214501Srpaulo * documentation and/or other materials provided with distribution.  In
60214501Srpaulo * addition, Licensee may not authorize further sublicense of source of any
61214501Srpaulo * portion of the Covered Code, and must include terms to the effect that the
62214501Srpaulo * license from Licensee to its licensee is limited to the intellectual
63214501Srpaulo * property embodied in the software Licensee provides to its licensee, and
64214501Srpaulo * not to intellectual property embodied in modifications its licensee may
65214501Srpaulo * make.
66214501Srpaulo *
67214501Srpaulo * 3.3. Redistribution of Executable. Redistribution in executable form of any
68214501Srpaulo * substantial portion of the Covered Code or modification must reproduce the
69214501Srpaulo * above Copyright Notice, and the following Disclaimer and Export Compliance
70214501Srpaulo * provision in the documentation and/or other materials provided with the
71214501Srpaulo * distribution.
72214501Srpaulo *
73214501Srpaulo * 3.4. Intel retains all right, title, and interest in and to the Original
74214501Srpaulo * Intel Code.
75214501Srpaulo *
76214501Srpaulo * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77214501Srpaulo * Intel shall be used in advertising or otherwise to promote the sale, use or
78214501Srpaulo * other dealings in products derived from or relating to the Covered Code
79214501Srpaulo * without prior written authorization from Intel.
80214501Srpaulo *
81214501Srpaulo * 4. Disclaimer and Export Compliance
82214501Srpaulo *
83214501Srpaulo * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84214501Srpaulo * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85214501Srpaulo * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86214501Srpaulo * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87214501Srpaulo * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88214501Srpaulo * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89214501Srpaulo * PARTICULAR PURPOSE.
90214501Srpaulo *
91214501Srpaulo * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92214501Srpaulo * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93214501Srpaulo * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94214501Srpaulo * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95214501Srpaulo * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96214501Srpaulo * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97214501Srpaulo * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98214501Srpaulo * LIMITED REMEDY.
99214501Srpaulo *
100214501Srpaulo * 4.3. Licensee shall not export, either directly or indirectly, any of this
101214501Srpaulo * software or system incorporating such software without first obtaining any
102214501Srpaulo * required license or other approval from the U. S. Department of Commerce or
103214501Srpaulo * any other agency or department of the United States Government.  In the
104214501Srpaulo * event Licensee exports any such software from the United States or
105214501Srpaulo * re-exports any such software from a foreign destination, Licensee shall
106214501Srpaulo * ensure that the distribution and export/re-export of the software is in
107214501Srpaulo * compliance with all laws, regulations, orders, or other restrictions of the
108214501Srpaulo * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109214501Srpaulo * any of its subsidiaries will export/re-export any technical data, process,
110214501Srpaulo * software, or service, directly or indirectly, to any country for which the
111214501Srpaulo * United States government or any agency thereof requires an export license,
112214501Srpaulo * other governmental approval, or letter of assurance, without first obtaining
113214501Srpaulo * such license, approval or letter.
114214501Srpaulo *
115214501Srpaulo *****************************************************************************/
116214501Srpaulo
117214501Srpaulo#ifndef __ACHWARE_H__
118214501Srpaulo#define __ACHWARE_H__
119214501Srpaulo
120214501Srpaulo
121214501Srpaulo/* PM Timer ticks per second (HZ) */
122214501Srpaulo#define PM_TIMER_FREQUENCY  3579545
123214501Srpaulo
124214501Srpaulo
125214501Srpaulo/* Prototypes */
126214501Srpaulo
127214501Srpaulo
128214501SrpauloACPI_STATUS
129214501SrpauloAcpiHwInitialize (
130214501Srpaulo    void);
131214501Srpaulo
132214501SrpauloACPI_STATUS
133214501SrpauloAcpiHwShutdown (
134214501Srpaulo    void);
135214501Srpaulo
136214501SrpauloACPI_STATUS
137214501SrpauloAcpiHwInitializeSystemInfo (
138214501Srpaulo    void);
139214501Srpaulo
140214501SrpauloACPI_STATUS
141214501SrpauloAcpiHwSetMode (
142214501Srpaulo    UINT32                  Mode);
143214501Srpaulo
144214501SrpauloUINT32
145214501SrpauloAcpiHwGetMode (
146214501Srpaulo    void);
147214501Srpaulo
148214501SrpauloUINT32
149214501SrpauloAcpiHwGetModeCapabilities (
150214501Srpaulo    void);
151214501Srpaulo
152214501Srpaulo/* Register I/O Prototypes */
153214501Srpaulo
154214501SrpauloACPI_BIT_REGISTER_INFO *
155214501SrpauloAcpiHwGetBitRegisterInfo (
156214501Srpaulo    UINT32                  RegisterId);
157214501Srpaulo
158214501SrpauloACPI_STATUS
159214501SrpauloAcpiHwRegisterRead (
160214501Srpaulo    BOOLEAN                 UseLock,
161214501Srpaulo    UINT32                  RegisterId,
162214501Srpaulo    UINT32                  *ReturnValue);
163214501Srpaulo
164214501SrpauloACPI_STATUS
165214501SrpauloAcpiHwRegisterWrite (
166214501Srpaulo    BOOLEAN                 UseLock,
167214501Srpaulo    UINT32                  RegisterId,
168214501Srpaulo    UINT32                  Value);
169214501Srpaulo
170214501SrpauloACPI_STATUS
171214501SrpauloAcpiHwLowLevelRead (
172214501Srpaulo    UINT32                  Width,
173214501Srpaulo    UINT32                  *Value,
174214501Srpaulo    ACPI_GENERIC_ADDRESS    *Reg,
175214501Srpaulo    UINT32                  Offset);
176214501Srpaulo
177214501SrpauloACPI_STATUS
178214501SrpauloAcpiHwLowLevelWrite (
179214501Srpaulo    UINT32                  Width,
180214501Srpaulo    UINT32                  Value,
181214501Srpaulo    ACPI_GENERIC_ADDRESS    *Reg,
182214501Srpaulo    UINT32                  Offset);
183214501Srpaulo
184214501SrpauloACPI_STATUS
185214501SrpauloAcpiHwClearAcpiStatus (
186214501Srpaulo   void);
187214501Srpaulo
188214501Srpaulo
189214501Srpaulo/* GPE support */
190214501Srpaulo
191214501SrpauloACPI_STATUS
192214501SrpauloAcpiHwEnableGpe (
193214501Srpaulo    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
194214501Srpaulo
195214501Srpaulovoid
196214501SrpauloAcpiHwEnableGpeForWakeup (
197214501Srpaulo    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
198214501Srpaulo
199214501SrpauloACPI_STATUS
200214501SrpauloAcpiHwDisableGpe (
201214501Srpaulo    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
202214501Srpaulo
203214501Srpaulovoid
204214501SrpauloAcpiHwDisableGpeForWakeup (
205214501Srpaulo    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
206214501Srpaulo
207214501SrpauloACPI_STATUS
208214501SrpauloAcpiHwClearGpe (
209214501Srpaulo    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
210214501Srpaulo
211214501SrpauloACPI_STATUS
212214501SrpauloAcpiHwGetGpeStatus (
213214501Srpaulo    UINT32                  GpeNumber,
214214501Srpaulo    ACPI_EVENT_STATUS       *EventStatus);
215214501Srpaulo
216214501SrpauloACPI_STATUS
217214501SrpauloAcpiHwDisableNonWakeupGpes (
218214501Srpaulo    void);
219214501Srpaulo
220214501SrpauloACPI_STATUS
221214501SrpauloAcpiHwEnableNonWakeupGpes (
222214501Srpaulo    void);
223214501Srpaulo
224214501Srpaulo
225214501Srpaulo/* ACPI Timer prototypes */
226214501Srpaulo
227214501SrpauloACPI_STATUS
228214501SrpauloAcpiGetTimerResolution (
229214501Srpaulo    UINT32                  *Resolution);
230214501Srpaulo
231214501SrpauloACPI_STATUS
232214501SrpauloAcpiGetTimer (
233214501Srpaulo    UINT32                  *Ticks);
234214501Srpaulo
235214501SrpauloACPI_STATUS
236214501SrpauloAcpiGetTimerDuration (
237214501Srpaulo    UINT32                  StartTicks,
238214501Srpaulo    UINT32                  EndTicks,
239214501Srpaulo    UINT32                  *TimeElapsed);
240214501Srpaulo
241214501Srpaulo
242214501Srpaulo#endif /* __ACHWARE_H__ */
243214501Srpaulo