blob: 143c2df00c0d74463fcc1e73e25485154de2262d [file] [log] [blame]
Martin Roth7687e772023-08-22 16:32:20 -06001/* SPDX-License-Identifier: BSD-3-Clause */
2
Marc Jones0b11bd02015-07-19 15:20:17 -06003/* $NoKeywords:$ */
4/**
5 * @file
6 *
7 * FCH ACPI lib
8 *
9 *
10 *
11 * @xrefitem bom "File Content Label" "Release Content"
12 * @e project: AGESA
13 * @e sub-project: FCH
14 * @e \$Revision: 281178 $ @e \$Date: 2013-12-18 02:14:15 -0600 (Wed, 18 Dec 2013) $
15 *
16 */
17/*****************************************************************************
18 *
19 * Copyright (c) 2008 - 2014, Advanced Micro Devices, Inc.
20 * All rights reserved.
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions are met:
24 * * Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * * Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in the
28 * documentation and/or other materials provided with the distribution.
29 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
30 * its contributors may be used to endorse or promote products derived
31 * from this software without specific prior written permission.
32 *
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
34 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
35 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
37 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
38 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
39 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
42 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 *
44 ***************************************************************************/
45
46#ifndef _FCH_ACPILIB_H_
47#define _FCH_ACPILIB_H_
48///
49/// RSDP - ACPI 2.0 table RSDP
50///
51typedef struct _RSDP_HEADER {
52 UINT64 Signature; ///< RSDP signature "RSD PTR"
53 UINT8 CheckSum; ///< checksum of the first 20 bytes
54 UINT8 OEMID[6]; ///< OEM ID
55 UINT8 Revision; ///< 0 for APCI 1.0, 2 for ACPI 2.0
56 UINT32 RsdtAddress; ///< physical address of RSDT
57 UINT32 Length; ///< total length of RSDP (including extended part)
58 UINT64 XsdtAddress; ///< physical address of XSDT
59 UINT8 ExtendedCheckSum; ///< chechsum of whole table
60 UINT8 Reserved[3]; ///< Reserved
61} RSDP_HEADER;
62
63///
64/// DESCRIPTION_HEADER - ACPI common table header
65///
66typedef struct _DESCRIPTION_HEADER {
67 UINT32 Signature; ///< ACPI signature (4 ASCII characters)
68 UINT32 Length; ///< Length of table, in bytes, including header
69 UINT8 Revision; ///< ACPI Specification minor version #
70 UINT8 CheckSum; ///< To make sum of entire table == 0
71 UINT8 OemId[6]; ///< OEM identification
72 UINT8 OemTableId[8]; ///< OEM table identification
73 UINT32 OemRevision; ///< OEM revision number
74 UINT32 CreatorId; ///< ASL compiler vendor ID
75 UINT32 CreatorRevision; ///< ASL compiler revision number
76} DESCRIPTION_HEADER;
77
78///
79/// _AcpiRegWrite - ACPI MMIO register R/W structure
80///
81typedef struct _ACPI_REG_WRITE {
82 UINT8 MmioBase; /// MmioBase: Index of Fch block (For instance GPIO_BASE:0x01 SMI_BASE:0x02)
83 UINT8 MmioReg; /// MmioReg : Register index
84 UINT8 DataAndMask; /// DataANDMask : AND Register Data
85 UINT8 DataOrMask; /// DataOrMask : Or Register Data
86} ACPI_REG_WRITE;
87
88VOID* AcpiLocateTable (IN UINT32 Signature);
89VOID AcpiSetTableCheckSum (IN VOID *TablePtr);
90UINT8 AcpiGetTableCheckSum (IN VOID *TablePtr);
91UINT8 GetByteSum (IN VOID *DataPtr, IN UINT32 Length);
92
93#endif