blob: 79310fd3d5f688aa5dcaedd58de63af54774b134 [file] [log] [blame]
Frank Vibrans2b4c8312011-02-14 18:30:54 +00001/*
2 *****************************************************************************
3 *
4 * Copyright (c) 2011, Advanced Micro Devices, Inc.
5 * All rights reserved.
Edward O'Callaghanb9a67002014-07-06 19:29:03 +10006 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +00007 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
Edward O'Callaghanb9a67002014-07-06 19:29:03 +100014 * * Neither the name of Advanced Micro Devices, Inc. nor the names of
15 * its contributors may be used to endorse or promote products derived
Frank Vibrans2b4c8312011-02-14 18:30:54 +000016 * from this software without specific prior written permission.
Edward O'Callaghanb9a67002014-07-06 19:29:03 +100017 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000018 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 * DISCLAIMED. IN NO EVENT SHALL ADVANCED MICRO DEVICES, INC. BE LIABLE FOR ANY
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Edward O'Callaghanb9a67002014-07-06 19:29:03 +100028 *
Frank Vibrans2b4c8312011-02-14 18:30:54 +000029 * ***************************************************************************
30 *
31 */
32
33
34//AMD Library Routines (AMDLIB.C)
35unsigned char getNumberOfCpuCores (OUT void);
36unsigned int readAlink (IN unsigned int Index);
37void writeAlink (IN unsigned int Index, IN unsigned int Data);
38void rwAlink (IN unsigned int Index, IN unsigned int AndMask, IN unsigned int OrMask);
39
40//AMD Library Routines (LEGACY.C)
41unsigned int GetFixUp (OUT void);
42
43//AMD Library Routines (IOLIB.C)
44void ReadIO (IN unsigned short Address, IN unsigned char OpFlag, IN void *Value);
45void WriteIO (IN unsigned short Address, IN unsigned char OpFlag, IN void *Value);
46void RWIO (IN unsigned short Address, IN unsigned char OpFlag, IN unsigned int Mask, IN unsigned int Data);
47
48
49
50//AMD Library Routines (MEMLIB.C)
51void ReadMEM (IN unsigned int Address, IN unsigned char OpFlag, IN void* Value);
52void WriteMEM (IN unsigned int Address, IN unsigned char OpFlag, IN void* Value);
53void RWMEM (IN unsigned int Address, IN unsigned char OpFlag, IN unsigned int Mask, IN unsigned int Data);
54
55//AMD Library Routines (PCILIB.C)
56void ReadPCI (IN unsigned int Address, IN unsigned char OpFlag, IN void *Value);
57void WritePCI (IN unsigned int Address, IN unsigned char OpFlag, IN void *Value);
58void RWPCI (IN unsigned int Address, IN unsigned char OpFlag, IN unsigned int Mask, IN unsigned int Data);
59
60//AMD Library Routines (SBPELIB.C)
61/**
62 * Read Southbridge Revision ID cie Base
63 *
64 *
65 * @retval 0xXXXXXXXX Revision ID
66 *
67 */
68unsigned char getRevisionID (OUT void);
69
70/**
71 * programPciByteTable - Program PCI register by table (8 bits data)
72 *
73 *
74 *
75 * @param[in] pPciByteTable - Table data pointer
76 * @param[in] dwTableSize - Table length
77 *
78 */
79void programPciByteTable (IN REG8MASK* pPciByteTable, IN unsigned short dwTableSize);
80
81/**
82 * programSbAcpiMmioTbl - Program SB ACPI MMIO register by table (8 bits data)
83 *
84 *
85 *
86 * @param[in] pAcpiTbl - Table data pointer
87 *
88 */
89void programSbAcpiMmioTbl (IN AcpiRegWrite *pAcpiTbl);
90
91/**
92 * getChipSysMode - Get Chip status
93 *
94 *
95 * @param[in] Value - Return Chip strap status
96 * StrapStatus [15.0] - SB800 chip Strap Status
97 * @li <b>0001</b> - Not USED FWH
98 * @li <b>0002</b> - Not USED LPC ROM
99 * @li <b>0004</b> - EC enabled
100 * @li <b>0008</b> - Reserved
101 * @li <b>0010</b> - Internal Clock mode
102 *
103 */
104void getChipSysMode (IN void* Value);
105
106/**
107 * Read Southbridge CIMx configuration structure pointer
108 *
109 *
110 *
111 * @retval 0xXXXXXXXX CIMx configuration structure pointer.
112 *
113 */
114AMDSBCFG* getConfigPointer (OUT void);
115
116//AMD Library Routines (PMIOLIB.C)
117/**
118 * Read PMIO
119 *
120 *
121 *
122 * @param[in] Address - PMIO Offset value
123 * @param[in] OpFlag - Access sizes
124 * @param[in] Value - Read Data Buffer
125 *
126 */
127void ReadPMIO (IN unsigned char Address, IN unsigned char OpFlag, IN void* Value);
128
129/**
130 * Write PMIO
131 *
132 *
133 *
134 * @param[in] Address - PMIO Offset value
135 * @param[in] OpFlag - Access sizes
136 * @param[in] Value - Write Data Buffer
137 *
138 */
139void WritePMIO (IN unsigned char Address, IN unsigned char OpFlag, IN void* Value);
140
141/**
142 * RWPMIO - Read/Write PMIO
143 *
144 *
145 *
146 * @param[in] Address - PMIO Offset value
147 * @param[in] OpFlag - Access sizes
148 * @param[in] AndMask - Data And Mask 32 bits
149 * @param[in] OrMask - Data OR Mask 32 bits
150 *
151 */
152void RWPMIO (IN unsigned char Address, IN unsigned char OpFlag, IN unsigned int AndMask, IN unsigned int OrMask);
153
154//AMD Library Routines (PMIO2LIB.C)
155
156/**
157 * Read PMIO2
158 *
159 *
160 *
161 * @param[in] Address - PMIO2 Offset value
162 * @param[in] OpFlag - Access sizes
163 * @param[in] Value - Read Data Buffer
164 *
165 */
166void ReadPMIO2 (IN unsigned char Address, IN unsigned char OpFlag, IN void* Value);
167
168/**
169 * Write PMIO 2
170 *
171 *
172 *
173 * @param[in] Address - PMIO2 Offset value
174 * @param[in] OpFlag - Access sizes
175 * @param[in] Value - Write Data Buffer
176 *
177 */
178void WritePMIO2 (IN unsigned char Address, IN unsigned char OpFlag, IN void* Value);
179
180/**
181 * RWPMIO2 - Read/Write PMIO2
182 *
183 *
184 *
185 * @param[in] Address - PMIO2 Offset value
186 * @param[in] OpFlag - Access sizes
187 * @param[in] AndMask - Data And Mask 32 bits
188 * @param[in] OrMask - Data OR Mask 32 bits
189 *
190 */
191void RWPMIO2 (IN unsigned char Address, IN unsigned char OpFlag, IN unsigned int AndMask, IN unsigned int OrMask);
192//AMD Library Routines (ECLIB.C)
193// ECLIB Routines
194
195// #ifndef NO_EC_SUPPORT
196
197/**
198 * EnterEcConfig - Force EC into Config mode
199 *
200 *
201 *
202 *
203 */
204void EnterEcConfig (void);
205
206/**
207 * ExitEcConfig - Force EC exit Config mode
208 *
209 *
210 *
211 *
212 */
213void ExitEcConfig (void);
214
215/**
216 * ReadEC8 - Read EC register data
217 *
218 *
219 *
220 * @param[in] Address - EC Register Offset Value
221 * @param[in] Value - Read Data Buffer
222 *
223 */
224void ReadEC8 (IN unsigned char Address, IN unsigned char* Value);
225
226/**
227 * WriteEC8 - Write date into EC register
228 *
229 *
230 *
231 * @param[in] Address - EC Register Offset Value
232 * @param[in] Value - Write Data Buffer
233 *
234 */
235void WriteEC8 (IN unsigned char Address, IN unsigned char* Value);
236
237/**
238 * RWEC8 - Read/Write EC register
239 *
240 *
241 *
242 * @param[in] Address - EC Register Offset Value
243 * @param[in] AndMask - Data And Mask 8 bits
244 * @param[in] OrMask - Data OR Mask 8 bits
245 *
246 */
247void RWEC8 (IN unsigned char Address, IN unsigned char AndMask, IN unsigned char OrMask);
248
249/**
250 * IsZoneFuncEnable - check every zone support function with BitMap from user define
251 *
252 */
253unsigned char IsZoneFuncEnable ( unsigned short Flag, unsigned char func, unsigned char Zone);
254
255void sbECfancontrolservice (IN AMDSBCFG* pConfig);
256void SBIMCFanInitializeS3 (void);
257void GetSbAcpiMmioBase (OUT unsigned int* AcpiMmioBase);
258void GetSbAcpiPmBase (OUT unsigned short* AcpiPmBase);
259
260// #endif
261