Siyuan Wang | affe85f | 2013-07-25 15:14:15 +0800 | [diff] [blame] | 1 | /* $NoKeywords:$ */ |
| 2 | /** |
| 3 | * @file |
| 4 | * |
| 5 | * GNB register access services. |
| 6 | * |
| 7 | * |
| 8 | * |
| 9 | * @xrefitem bom "File Content Label" "Release Content" |
| 10 | * @e project: AGESA |
| 11 | * @e sub-project: GNB |
| 12 | * @e \$Revision: 84150 $ @e \$Date: 2012-12-12 15:46:25 -0600 (Wed, 12 Dec 2012) $ |
| 13 | * |
| 14 | */ |
| 15 | /* |
| 16 | ***************************************************************************** |
| 17 | * |
| 18 | * Copyright (c) 2008 - 2013, Advanced Micro Devices, Inc. |
| 19 | * All rights reserved. |
| 20 | * |
| 21 | * Redistribution and use in source and binary forms, with or without |
| 22 | * modification, are permitted provided that the following conditions are met: |
| 23 | * * Redistributions of source code must retain the above copyright |
| 24 | * notice, this list of conditions and the following disclaimer. |
| 25 | * * Redistributions in binary form must reproduce the above copyright |
| 26 | * notice, this list of conditions and the following disclaimer in the |
| 27 | * documentation and/or other materials provided with the distribution. |
| 28 | * * Neither the name of Advanced Micro Devices, Inc. nor the names of |
| 29 | * its contributors may be used to endorse or promote products derived |
| 30 | * from this software without specific prior written permission. |
| 31 | * |
| 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 33 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 35 | * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY |
| 36 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 37 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 38 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 39 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 40 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 41 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 42 | * *************************************************************************** |
| 43 | * |
| 44 | */ |
| 45 | #ifndef _GNBLIB_H_ |
| 46 | #define _GNBLIB_H_ |
| 47 | |
| 48 | #define IOC_WRITE_ENABLE 0x80 |
| 49 | |
| 50 | VOID |
| 51 | GnbLibPciIndirectWrite ( |
| 52 | IN UINT32 Address, |
| 53 | IN UINT32 IndirectAddress, |
| 54 | IN ACCESS_WIDTH Width, |
| 55 | IN VOID *Value, |
| 56 | IN VOID *Config |
| 57 | ); |
| 58 | |
| 59 | VOID |
| 60 | GnbLibPciIndirectRead ( |
| 61 | IN UINT32 Address, |
| 62 | IN UINT32 IndirectAddress, |
| 63 | IN ACCESS_WIDTH Width, |
| 64 | OUT VOID *Value, |
| 65 | IN VOID *Config |
| 66 | ); |
| 67 | |
| 68 | VOID |
| 69 | GnbLibPciIndirectRMW ( |
| 70 | IN UINT32 Address, |
| 71 | IN UINT32 IndirectAddress, |
| 72 | IN ACCESS_WIDTH Width, |
| 73 | IN UINT32 Mask, |
| 74 | IN UINT32 Value, |
| 75 | IN VOID *Config |
| 76 | ); |
| 77 | |
| 78 | VOID |
| 79 | GnbLibPciIndirectWriteField ( |
| 80 | IN UINT32 Address, |
| 81 | IN UINT32 IndirectAddress, |
| 82 | IN UINT8 FieldOffset, |
| 83 | IN UINT8 FieldWidth, |
| 84 | IN UINT32 Value, |
| 85 | IN BOOLEAN S3Save, |
| 86 | IN VOID *Config |
| 87 | ); |
| 88 | |
| 89 | |
| 90 | VOID |
| 91 | GnbLibPciRMW ( |
| 92 | IN UINT32 Address, |
| 93 | IN ACCESS_WIDTH Width, |
| 94 | IN UINT32 Mask, |
| 95 | IN UINT32 Value, |
| 96 | IN VOID *Config |
| 97 | ); |
| 98 | |
| 99 | VOID |
| 100 | GnbLibIoRMW ( |
| 101 | IN UINT16 Address, |
| 102 | IN ACCESS_WIDTH Width, |
| 103 | IN UINT32 Mask, |
| 104 | IN UINT32 Value, |
| 105 | IN VOID *Config |
| 106 | ); |
| 107 | |
| 108 | |
| 109 | UINT32 |
| 110 | GnbLibPowerOf ( |
| 111 | IN UINT32 Value, |
| 112 | IN UINT32 Power |
| 113 | ); |
| 114 | |
| 115 | VOID* |
| 116 | GnbLibFind ( |
| 117 | IN UINT8 *Buf1, |
| 118 | IN UINTN Buf1Length, |
| 119 | IN UINT8 *Buf2, |
| 120 | IN UINTN Buf2Length |
| 121 | ); |
| 122 | |
| 123 | VOID |
| 124 | GnbLibIndirectIoBlockRead ( |
| 125 | IN UINT16 IndexPort, |
| 126 | IN UINT16 DataPort, |
| 127 | IN ACCESS_WIDTH Width, |
| 128 | IN UINT32 IndexAddress, |
| 129 | IN UINT32 Count, |
| 130 | IN VOID *Buffer, |
| 131 | IN VOID *Config |
| 132 | ); |
| 133 | |
| 134 | UINT8 |
| 135 | GnbLiGetIoapicId ( |
| 136 | IN UINT64 IoApicBaseAddress, |
| 137 | IN VOID *Config |
| 138 | ); |
| 139 | |
| 140 | VOID |
| 141 | GnbLibDebugDumpBuffer ( |
| 142 | IN VOID *Buffer, |
| 143 | IN UINT32 Count, |
| 144 | IN UINT8 DataWidth, |
| 145 | IN UINT8 LineWidth |
| 146 | ); |
| 147 | |
| 148 | AGESA_STATUS |
| 149 | GnbLibLocateService ( |
| 150 | IN GNB_SERVICE_ID ServiceId, |
| 151 | IN UINT8 SocketId, |
Arthur Heymans | b80de18 | 2022-05-16 15:29:53 +0200 | [diff] [blame^] | 152 | CONST IN VOID **ServiceProtocol, |
Siyuan Wang | affe85f | 2013-07-25 15:14:15 +0800 | [diff] [blame] | 153 | IN AMD_CONFIG_PARAMS *StdHeader |
| 154 | ); |
| 155 | |
| 156 | #endif |