17c478bd9Sstevel@tonic-gate /****************************************************************************** 27c478bd9Sstevel@tonic-gate * 37c478bd9Sstevel@tonic-gate * Name: achware.h -- hardware specific interfaces 47c478bd9Sstevel@tonic-gate * 57c478bd9Sstevel@tonic-gate *****************************************************************************/ 67c478bd9Sstevel@tonic-gate 726f3cdf0SGordon Ross /* 8*385cc6b4SJerry Jelinek * Copyright (C) 2000 - 2016, Intel Corp. 97c478bd9Sstevel@tonic-gate * All rights reserved. 107c478bd9Sstevel@tonic-gate * 1126f3cdf0SGordon Ross * Redistribution and use in source and binary forms, with or without 1226f3cdf0SGordon Ross * modification, are permitted provided that the following conditions 1326f3cdf0SGordon Ross * are met: 1426f3cdf0SGordon Ross * 1. Redistributions of source code must retain the above copyright 1526f3cdf0SGordon Ross * notice, this list of conditions, and the following disclaimer, 1626f3cdf0SGordon Ross * without modification. 1726f3cdf0SGordon Ross * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1826f3cdf0SGordon Ross * substantially similar to the "NO WARRANTY" disclaimer below 1926f3cdf0SGordon Ross * ("Disclaimer") and any redistribution must be conditioned upon 2026f3cdf0SGordon Ross * including a substantially similar Disclaimer requirement for further 2126f3cdf0SGordon Ross * binary redistribution. 2226f3cdf0SGordon Ross * 3. Neither the names of the above-listed copyright holders nor the names 2326f3cdf0SGordon Ross * of any contributors may be used to endorse or promote products derived 2426f3cdf0SGordon Ross * from this software without specific prior written permission. 257c478bd9Sstevel@tonic-gate * 2626f3cdf0SGordon Ross * Alternatively, this software may be distributed under the terms of the 2726f3cdf0SGordon Ross * GNU General Public License ("GPL") version 2 as published by the Free 2826f3cdf0SGordon Ross * Software Foundation. 297c478bd9Sstevel@tonic-gate * 3026f3cdf0SGordon Ross * NO WARRANTY 3126f3cdf0SGordon Ross * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3226f3cdf0SGordon Ross * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3326f3cdf0SGordon Ross * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 3426f3cdf0SGordon Ross * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3526f3cdf0SGordon Ross * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3626f3cdf0SGordon Ross * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3726f3cdf0SGordon Ross * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3826f3cdf0SGordon Ross * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3926f3cdf0SGordon Ross * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 4026f3cdf0SGordon Ross * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4126f3cdf0SGordon Ross * POSSIBILITY OF SUCH DAMAGES. 4226f3cdf0SGordon Ross */ 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #ifndef __ACHWARE_H__ 457c478bd9Sstevel@tonic-gate #define __ACHWARE_H__ 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate 48aa2aa9a6SDana Myers /* Values for the _SST predefined method */ 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate #define ACPI_SST_INDICATOR_OFF 0 517c478bd9Sstevel@tonic-gate #define ACPI_SST_WORKING 1 527c478bd9Sstevel@tonic-gate #define ACPI_SST_WAKING 2 537c478bd9Sstevel@tonic-gate #define ACPI_SST_SLEEPING 3 547c478bd9Sstevel@tonic-gate #define ACPI_SST_SLEEP_CONTEXT 4 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate /* 587c478bd9Sstevel@tonic-gate * hwacpi - high level functions 597c478bd9Sstevel@tonic-gate */ 607c478bd9Sstevel@tonic-gate ACPI_STATUS 617c478bd9Sstevel@tonic-gate AcpiHwSetMode ( 627c478bd9Sstevel@tonic-gate UINT32 Mode); 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate UINT32 657c478bd9Sstevel@tonic-gate AcpiHwGetMode ( 667c478bd9Sstevel@tonic-gate void); 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate /* 707c478bd9Sstevel@tonic-gate * hwregs - ACPI Register I/O 717c478bd9Sstevel@tonic-gate */ 724cf02d40SSaurabh Misra ACPI_STATUS 734cf02d40SSaurabh Misra AcpiHwValidateRegister ( 744cf02d40SSaurabh Misra ACPI_GENERIC_ADDRESS *Reg, 754cf02d40SSaurabh Misra UINT8 MaxBitWidth, 764cf02d40SSaurabh Misra UINT64 *Address); 774cf02d40SSaurabh Misra 7857190917SDana Myers ACPI_STATUS 7957190917SDana Myers AcpiHwRead ( 8057190917SDana Myers UINT32 *Value, 8157190917SDana Myers ACPI_GENERIC_ADDRESS *Reg); 8257190917SDana Myers 8357190917SDana Myers ACPI_STATUS 8457190917SDana Myers AcpiHwWrite ( 8557190917SDana Myers UINT32 Value, 8657190917SDana Myers ACPI_GENERIC_ADDRESS *Reg); 8757190917SDana Myers 887c478bd9Sstevel@tonic-gate ACPI_BIT_REGISTER_INFO * 897c478bd9Sstevel@tonic-gate AcpiHwGetBitRegisterInfo ( 907c478bd9Sstevel@tonic-gate UINT32 RegisterId); 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate ACPI_STATUS 93aa2aa9a6SDana Myers AcpiHwWritePm1Control ( 94aa2aa9a6SDana Myers UINT32 Pm1aControl, 95aa2aa9a6SDana Myers UINT32 Pm1bControl); 96aa2aa9a6SDana Myers 97aa2aa9a6SDana Myers ACPI_STATUS 987c478bd9Sstevel@tonic-gate AcpiHwRegisterRead ( 997c478bd9Sstevel@tonic-gate UINT32 RegisterId, 1007c478bd9Sstevel@tonic-gate UINT32 *ReturnValue); 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate ACPI_STATUS 1037c478bd9Sstevel@tonic-gate AcpiHwRegisterWrite ( 1047c478bd9Sstevel@tonic-gate UINT32 RegisterId, 1057c478bd9Sstevel@tonic-gate UINT32 Value); 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate ACPI_STATUS 1087c478bd9Sstevel@tonic-gate AcpiHwClearAcpiStatus ( 109db2bae30SDana Myers void); 1107c478bd9Sstevel@tonic-gate 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate /* 113*385cc6b4SJerry Jelinek * hwsleep - sleep/wake support (Legacy sleep registers) 114*385cc6b4SJerry Jelinek */ 115*385cc6b4SJerry Jelinek ACPI_STATUS 116*385cc6b4SJerry Jelinek AcpiHwLegacySleep ( 117*385cc6b4SJerry Jelinek UINT8 SleepState); 118*385cc6b4SJerry Jelinek 119*385cc6b4SJerry Jelinek ACPI_STATUS 120*385cc6b4SJerry Jelinek AcpiHwLegacyWakePrep ( 121*385cc6b4SJerry Jelinek UINT8 SleepState); 122*385cc6b4SJerry Jelinek 123*385cc6b4SJerry Jelinek ACPI_STATUS 124*385cc6b4SJerry Jelinek AcpiHwLegacyWake ( 125*385cc6b4SJerry Jelinek UINT8 SleepState); 126*385cc6b4SJerry Jelinek 127*385cc6b4SJerry Jelinek 128*385cc6b4SJerry Jelinek /* 129*385cc6b4SJerry Jelinek * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) 130*385cc6b4SJerry Jelinek */ 131*385cc6b4SJerry Jelinek void 132*385cc6b4SJerry Jelinek AcpiHwExecuteSleepMethod ( 133*385cc6b4SJerry Jelinek char *MethodName, 134*385cc6b4SJerry Jelinek UINT32 IntegerArgument); 135*385cc6b4SJerry Jelinek 136*385cc6b4SJerry Jelinek ACPI_STATUS 137*385cc6b4SJerry Jelinek AcpiHwExtendedSleep ( 138*385cc6b4SJerry Jelinek UINT8 SleepState); 139*385cc6b4SJerry Jelinek 140*385cc6b4SJerry Jelinek ACPI_STATUS 141*385cc6b4SJerry Jelinek AcpiHwExtendedWakePrep ( 142*385cc6b4SJerry Jelinek UINT8 SleepState); 143*385cc6b4SJerry Jelinek 144*385cc6b4SJerry Jelinek ACPI_STATUS 145*385cc6b4SJerry Jelinek AcpiHwExtendedWake ( 146*385cc6b4SJerry Jelinek UINT8 SleepState); 147*385cc6b4SJerry Jelinek 148*385cc6b4SJerry Jelinek 149*385cc6b4SJerry Jelinek /* 150aa2aa9a6SDana Myers * hwvalid - Port I/O with validation 151aa2aa9a6SDana Myers */ 152aa2aa9a6SDana Myers ACPI_STATUS 153aa2aa9a6SDana Myers AcpiHwReadPort ( 154aa2aa9a6SDana Myers ACPI_IO_ADDRESS Address, 155aa2aa9a6SDana Myers UINT32 *Value, 156aa2aa9a6SDana Myers UINT32 Width); 157aa2aa9a6SDana Myers 158aa2aa9a6SDana Myers ACPI_STATUS 159aa2aa9a6SDana Myers AcpiHwWritePort ( 160aa2aa9a6SDana Myers ACPI_IO_ADDRESS Address, 161aa2aa9a6SDana Myers UINT32 Value, 162aa2aa9a6SDana Myers UINT32 Width); 163aa2aa9a6SDana Myers 164aa2aa9a6SDana Myers 165aa2aa9a6SDana Myers /* 1667c478bd9Sstevel@tonic-gate * hwgpe - GPE support 1677c478bd9Sstevel@tonic-gate */ 16826f3cdf0SGordon Ross UINT32 16926f3cdf0SGordon Ross AcpiHwGetGpeRegisterBit ( 170*385cc6b4SJerry Jelinek ACPI_GPE_EVENT_INFO *GpeEventInfo); 171db2bae30SDana Myers 172db2bae30SDana Myers ACPI_STATUS 17326f3cdf0SGordon Ross AcpiHwLowSetGpe ( 17426f3cdf0SGordon Ross ACPI_GPE_EVENT_INFO *GpeEventInfo, 17526f3cdf0SGordon Ross UINT32 Action); 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate ACPI_STATUS 1787c478bd9Sstevel@tonic-gate AcpiHwDisableGpeBlock ( 1797c478bd9Sstevel@tonic-gate ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 180aa2aa9a6SDana Myers ACPI_GPE_BLOCK_INFO *GpeBlock, 181aa2aa9a6SDana Myers void *Context); 1827c478bd9Sstevel@tonic-gate 1837c478bd9Sstevel@tonic-gate ACPI_STATUS 1847c478bd9Sstevel@tonic-gate AcpiHwClearGpe ( 1857c478bd9Sstevel@tonic-gate ACPI_GPE_EVENT_INFO *GpeEventInfo); 1867c478bd9Sstevel@tonic-gate 1877c478bd9Sstevel@tonic-gate ACPI_STATUS 1887c478bd9Sstevel@tonic-gate AcpiHwClearGpeBlock ( 1897c478bd9Sstevel@tonic-gate ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 190aa2aa9a6SDana Myers ACPI_GPE_BLOCK_INFO *GpeBlock, 191aa2aa9a6SDana Myers void *Context); 1927c478bd9Sstevel@tonic-gate 1937c478bd9Sstevel@tonic-gate ACPI_STATUS 1947c478bd9Sstevel@tonic-gate AcpiHwGetGpeStatus ( 1957c478bd9Sstevel@tonic-gate ACPI_GPE_EVENT_INFO *GpeEventInfo, 1967c478bd9Sstevel@tonic-gate ACPI_EVENT_STATUS *EventStatus); 1977c478bd9Sstevel@tonic-gate 1987c478bd9Sstevel@tonic-gate ACPI_STATUS 1997c478bd9Sstevel@tonic-gate AcpiHwDisableAllGpes ( 200450d6964Smyers void); 2017c478bd9Sstevel@tonic-gate 2027c478bd9Sstevel@tonic-gate ACPI_STATUS 2037c478bd9Sstevel@tonic-gate AcpiHwEnableAllRuntimeGpes ( 204450d6964Smyers void); 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate ACPI_STATUS 2077c478bd9Sstevel@tonic-gate AcpiHwEnableAllWakeupGpes ( 208450d6964Smyers void); 2097c478bd9Sstevel@tonic-gate 2107c478bd9Sstevel@tonic-gate ACPI_STATUS 2117c478bd9Sstevel@tonic-gate AcpiHwEnableRuntimeGpeBlock ( 2127c478bd9Sstevel@tonic-gate ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 213aa2aa9a6SDana Myers ACPI_GPE_BLOCK_INFO *GpeBlock, 214aa2aa9a6SDana Myers void *Context); 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate /* 21826f3cdf0SGordon Ross * hwpci - PCI configuration support 21926f3cdf0SGordon Ross */ 22026f3cdf0SGordon Ross ACPI_STATUS 22126f3cdf0SGordon Ross AcpiHwDerivePciId ( 22226f3cdf0SGordon Ross ACPI_PCI_ID *PciId, 22326f3cdf0SGordon Ross ACPI_HANDLE RootPciDevice, 22426f3cdf0SGordon Ross ACPI_HANDLE PciRegion); 22526f3cdf0SGordon Ross 22626f3cdf0SGordon Ross 2277c478bd9Sstevel@tonic-gate #endif /* __ACHWARE_H__ */ 228