achware.h revision 217365
1709Swollman/******************************************************************************
27460Sjkh *
3709Swollman * Name: achware.h -- hardware specific interfaces
437Srgrimes *
537Srgrimes *****************************************************************************/
637Srgrimes
737Srgrimes/*
837Srgrimes * Copyright (C) 2000 - 2011, Intel Corp.
937Srgrimes * All rights reserved.
1037Srgrimes *
1137Srgrimes * Redistribution and use in source and binary forms, with or without
1237Srgrimes * modification, are permitted provided that the following conditions
1337Srgrimes * are met:
1437Srgrimes * 1. Redistributions of source code must retain the above copyright
1537Srgrimes *    notice, this list of conditions, and the following disclaimer,
1637Srgrimes *    without modification.
1737Srgrimes * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1837Srgrimes *    substantially similar to the "NO WARRANTY" disclaimer below
1937Srgrimes *    ("Disclaimer") and any redistribution must be conditioned upon
2037Srgrimes *    including a substantially similar Disclaimer requirement for further
213843Sdg *    binary redistribution.
223843Sdg * 3. Neither the names of the above-listed copyright holders nor the names
232164Sdg *    of any contributors may be used to endorse or promote products derived
2437Srgrimes *    from this software without specific prior written permission.
2537Srgrimes *
2637Srgrimes * Alternatively, this software may be distributed under the terms of the
2737Srgrimes * GNU General Public License ("GPL") version 2 as published by the Free
2837Srgrimes * Software Foundation.
2937Srgrimes *
3037Srgrimes * NO WARRANTY
3137Srgrimes * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3237Srgrimes * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3337Srgrimes * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
3437Srgrimes * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3537Srgrimes * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3637Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3737Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3837Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3937Srgrimes * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
4037Srgrimes * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4137Srgrimes * POSSIBILITY OF SUCH DAMAGES.
4237Srgrimes */
4337Srgrimes
4437Srgrimes#ifndef __ACHWARE_H__
4537Srgrimes#define __ACHWARE_H__
4637Srgrimes
4737Srgrimes
4837Srgrimes/* Values for the _SST predefined method */
4937Srgrimes
5037Srgrimes#define ACPI_SST_INDICATOR_OFF  0
5137Srgrimes#define ACPI_SST_WORKING        1
5237Srgrimes#define ACPI_SST_WAKING         2
5337Srgrimes#define ACPI_SST_SLEEPING       3
5437Srgrimes#define ACPI_SST_SLEEP_CONTEXT  4
552164Sdg
562164Sdg
5737Srgrimes/*
5837Srgrimes * hwacpi - high level functions
5937Srgrimes */
6037SrgrimesACPI_STATUS
613036SdgAcpiHwSetMode (
623036Sdg    UINT32                  Mode);
633036Sdg
641692SphkUINT32
6537SrgrimesAcpiHwGetMode (
6637Srgrimes    void);
6737Srgrimes
68872Sache
69872Sache/*
70872Sache * hwregs - ACPI Register I/O
71872Sache */
724091SacheACPI_STATUS
73872SacheAcpiHwValidateRegister (
747219Sjkh    ACPI_GENERIC_ADDRESS    *Reg,
757219Sjkh    UINT8                   MaxBitWidth,
767219Sjkh    UINT64                  *Address);
777219Sjkh
787219SjkhACPI_STATUS
791675SacheAcpiHwRead (
807219Sjkh    UINT32                  *Value,
817293Sjkh    ACPI_GENERIC_ADDRESS    *Reg);
821675Sache
831675SacheACPI_STATUS
847259SjkhAcpiHwWrite (
857259Sjkh    UINT32                  Value,
867293Sjkh    ACPI_GENERIC_ADDRESS    *Reg);
8737Srgrimes
8837SrgrimesACPI_BIT_REGISTER_INFO *
897460SjkhAcpiHwGetBitRegisterInfo (
907460Sjkh    UINT32                  RegisterId);
917460Sjkh
927460SjkhACPI_STATUS
937460SjkhAcpiHwWritePm1Control (
947259Sjkh    UINT32                  Pm1aControl,
957259Sjkh    UINT32                  Pm1bControl);
9637Srgrimes
971001SguidoACPI_STATUS
987259SjkhAcpiHwRegisterRead (
997259Sjkh    UINT32                  RegisterId,
100857Sdg    UINT32                  *ReturnValue);
1017259Sjkh
10237SrgrimesACPI_STATUS
10337SrgrimesAcpiHwRegisterWrite (
104958Sache    UINT32                  RegisterId,
105958Sache    UINT32                  Value);
1061186Srgrimes
1071186SrgrimesACPI_STATUS
1081186SrgrimesAcpiHwClearAcpiStatus (
1091186Srgrimes    void);
1101308Srich
1111186Srgrimes
1121186Srgrimes/*
1131186Srgrimes * hwvalid - Port I/O with validation
1141186Srgrimes */
1151186SrgrimesACPI_STATUS
1161186SrgrimesAcpiHwReadPort (
1171186Srgrimes    ACPI_IO_ADDRESS         Address,
1187238Sache    UINT32                  *Value,
1197219Sjkh    UINT32                  Width);
1207238Sache
1217238SacheACPI_STATUS
1227238SacheAcpiHwWritePort (
1237238Sache    ACPI_IO_ADDRESS         Address,
1247238Sache    UINT32                  Value,
1257238Sache    UINT32                  Width);
1267238Sache
1277294Sjkh
1287238Sache/*
1297238Sache * hwgpe - GPE support
1307459Sjkh */
1317238SacheUINT32
1327238SacheAcpiHwGetGpeRegisterBit (
1337219Sjkh    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
1347459Sjkh    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo);
1357238Sache
1367219SjkhACPI_STATUS
1377219SjkhAcpiHwLowSetGpe (
1387238Sache    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
1397238Sache    UINT32                  Action);
1407459Sjkh
1417238SacheACPI_STATUS
1427238SacheAcpiHwDisableGpeBlock (
1437238Sache    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
1447294Sjkh    ACPI_GPE_BLOCK_INFO     *GpeBlock,
1457459Sjkh    void                    *Context);
1467238Sache
1477238SacheACPI_STATUS
1487238SacheAcpiHwClearGpe (
1497459Sjkh    ACPI_GPE_EVENT_INFO     *GpeEventInfo);
1507238Sache
1517238SacheACPI_STATUS
1527238SacheAcpiHwClearGpeBlock (
1537238Sache    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
1547238Sache    ACPI_GPE_BLOCK_INFO     *GpeBlock,
1557459Sjkh    void                    *Context);
1567238Sache
1577238SacheACPI_STATUS
1587238SacheAcpiHwGetGpeStatus (
1597238Sache    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
1607238Sache    ACPI_EVENT_STATUS       *EventStatus);
1617459Sjkh
1627238SacheACPI_STATUS
1637238SacheAcpiHwDisableAllGpes (
1647238Sache    void);
1657238Sache
1667238SacheACPI_STATUS
1677459SjkhAcpiHwEnableAllRuntimeGpes (
1687238Sache    void);
1697238Sache
1707238SacheACPI_STATUS
1717238SacheAcpiHwEnableAllWakeupGpes (
1727238Sache    void);
1737459Sjkh
1747238SacheACPI_STATUS
1757238SacheAcpiHwEnableRuntimeGpeBlock (
1767238Sache    ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
1777459Sjkh    ACPI_GPE_BLOCK_INFO     *GpeBlock,
1787238Sache    void                    *Context);
1797238Sache
1807238Sache
1817238Sache/*
1827238Sache * hwpci - PCI configuration support
1837238Sache */
1847238SacheACPI_STATUS
1857238SacheAcpiHwDerivePciId (
1867238Sache    ACPI_PCI_ID             *PciId,
1877238Sache    ACPI_HANDLE             RootPciDevice,
1887296Sjkh    ACPI_HANDLE             PciRegion);
1897296Sjkh
1907459Sjkh
1917296Sjkh/*
1927296Sjkh * hwtimer - ACPI Timer prototypes
1937296Sjkh */
1947259SjkhACPI_STATUS
1957259SjkhAcpiGetTimerResolution (
1967259Sjkh    UINT32                  *Resolution);
1977259Sjkh
19837SrgrimesACPI_STATUS
19937SrgrimesAcpiGetTimer (
20037Srgrimes    UINT32                  *Ticks);
201
202ACPI_STATUS
203AcpiGetTimerDuration (
204    UINT32                  StartTicks,
205    UINT32                  EndTicks,
206    UINT32                  *TimeElapsed);
207
208
209#endif /* __ACHWARE_H__ */
210