remove trailing whitespace
[coreboot.git] / src / mainboard / amd / torpedo / agesawrapper.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2011 Advanced Micro Devices, Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 /*----------------------------------------------------------------------------------------
21  *                             M O D U L E S    U S E D
22  *----------------------------------------------------------------------------------------
23  */
24
25 #include <stdint.h>
26 #include <string.h>
27 #include "agesawrapper.h"
28 #include "BiosCallOuts.h"
29 #include "cpuRegisters.h"
30 #include "cpuCacheInit.h"
31 #include "cpuApicUtilities.h"
32 #include "cpuEarlyInit.h"
33 #include "cpuLateInit.h"
34 #include "Dispatcher.h"
35 #include "cpuCacheInit.h"
36 #include "amdlib.h"
37 #include "PlatformGnbPcieComplex.h"
38 #include "Filecode.h"
39 #include <arch/io.h>
40
41 #define FILECODE UNASSIGNED_FILE_FILECODE
42
43 /*----------------------------------------------------------------------------------------
44  *                   D E F I N I T I O N S    A N D    M A C R O S
45  *----------------------------------------------------------------------------------------
46  */
47
48 /* ACPI table pointers returned by AmdInitLate */
49 VOID *DmiTable    = NULL;
50 VOID *AcpiPstate  = NULL;
51 VOID *AcpiSrat    = NULL;
52 VOID *AcpiSlit    = NULL;
53
54 VOID *AcpiWheaMce = NULL;
55 VOID *AcpiWheaCmc = NULL;
56 VOID *AcpiAlib    = NULL;
57
58
59 /*----------------------------------------------------------------------------------------
60  *                  T Y P E D E F S     A N D     S T R U C T U  R E S
61  *----------------------------------------------------------------------------------------
62  */
63
64 /*----------------------------------------------------------------------------------------
65  *           P R O T O T Y P E S     O F     L O C A L     F U  N C T I O N S
66  *----------------------------------------------------------------------------------------
67  */
68
69 /*----------------------------------------------------------------------------------------
70  *                          E X P O R T E D    F U N C T I O N S
71  *----------------------------------------------------------------------------------------
72  */
73
74 /*---------------------------------------------------------------------------------------
75  *                          L O C A L    F U N C T I O N S
76  *---------------------------------------------------------------------------------------
77  */
78 UINT32
79 ReadAmdSbPmr (
80   IN     UINT8                      IndexValue,
81   OUT    UINT8                      *DataValue
82   );
83
84 UINT32
85 WriteAmdSbPmr (
86   IN     UINT8                      IndexValue,
87   IN     UINT8                      DataValue
88   );
89
90 VOID
91 ClearSBSmiAndWake (
92   IN UINT16             PmBase
93   );
94
95 VOID
96 ClearAllSmiEnableInPmio (
97   VOID
98   );
99
100
101
102 /* Read SB Power Management Area */
103 UINT32
104 ReadAmdSbPmr (
105   IN     UINT8                      IndexValue,
106   OUT    UINT8                      *DataValue
107   )
108 {
109   WriteIo8 (SB_PM_INDEX_PORT, IndexValue);
110   *DataValue = ReadIo8 (SB_PM_DATA_PORT);
111   return 0;
112 }
113
114 /* Write ATI SB Power Management Area */
115 UINT32
116 WriteAmdSbPmr (
117   IN     UINT8                      IndexValue,
118   IN     UINT8                      DataValue
119   )
120 {
121   WriteIo8 (SB_PM_INDEX_PORT, IndexValue);
122   WriteIo8 (SB_PM_DATA_PORT, DataValue);
123   return 0;
124 }
125
126 /* Clear any SMI status or wake status left over from boot. */
127 VOID
128 ClearSBSmiAndWake (
129   IN UINT16             PmBase
130   )
131 {
132   UINT16  Pm1Sts;
133   UINT32  Pm1Cnt;
134   UINT32  Gpe0Sts;
135
136   /*  Read the ACPI registers */
137   Pm1Sts  = ReadIo16 (PmBase + R_SB_ACPI_PM1_STATUS);
138   Pm1Cnt  = ReadIo32 (PmBase + R_SB_ACPI_PM1_STATUS);
139   Gpe0Sts = ReadIo32 (PmBase + R_SB_ACPI_EVENT_STATUS);
140
141   /* Clear any SMI or wake state from the boot */
142   Pm1Sts &= B_PWR_BTN_STATUS + B_WAKEUP_STATUS;
143   Pm1Cnt &= ~(B_SCI_EN);
144
145   /* Write back */
146   WriteIo16 (PmBase + R_SB_ACPI_PM1_STATUS, Pm1Sts);
147   WriteIo32 (PmBase + R_SB_ACPI_PM_CONTROL, Pm1Cnt);
148   WriteIo32 (PmBase + R_SB_ACPI_EVENT_STATUS, Gpe0Sts);
149 }
150
151 /* Clear all SMI enable bit in PMIO register */
152 VOID
153 ClearAllSmiEnableInPmio (
154   VOID
155   )
156 {
157   UINT32  AcpiMmioAddr;
158   UINT32  SmiMmioAddr;
159   UINT8   Data8 = 0 ;
160   UINT16  Data16 = 0;
161
162   /* Get SB900 MMIO Base (AcpiMmioAddr) */
163   ReadAmdSbPmr (SB_PMIOA_REG24 + 3, &Data8);
164   Data16=Data8<<8;
165   ReadAmdSbPmr (SB_PMIOA_REG24 + 2, &Data8);
166   Data16|=Data8;
167   AcpiMmioAddr = (UINT32)Data16 << 16;
168   SmiMmioAddr = AcpiMmioAddr + SMI_BASE;
169
170   Mmio32 (SmiMmioAddr, 0xA0) = 0x0;
171   Mmio32 (SmiMmioAddr, 0xA4) = 0x0;
172   Mmio32 (SmiMmioAddr, 0xA8) = 0x0;
173   Mmio32 (SmiMmioAddr, 0xAC) = 0x0;
174   Mmio32 (SmiMmioAddr, 0xB0) = 0x0;
175   Mmio32 (SmiMmioAddr, 0xB4) = 0x0;
176   Mmio32 (SmiMmioAddr, 0xB8) = 0x0;
177   Mmio32 (SmiMmioAddr, 0xBC) = 0x0;
178   Mmio32 (SmiMmioAddr, 0xC0) = 0x0;
179   Mmio32 (SmiMmioAddr, 0xC4) = 0x0;
180 }
181
182 UINT32
183 agesawrapper_amdinitcpuio (
184   VOID
185   )
186 {
187   AGESA_STATUS                  Status;
188   UINT64                        MsrReg;
189   UINT32                        PciData;
190   PCI_ADDR                      PciAddress;
191   AMD_CONFIG_PARAMS             StdHeader;
192
193   /* Enable MMIO on AMD CPU Address Map Controller */
194
195   /* Start to set MMIO 0000A0000-0000BFFFF to Node0 Link0 */
196   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0x84);
197   PciData = 0x00000B00;
198   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
199   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0x80);
200   PciData = 0x00000A03;
201   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
202
203   /* Set TOM-DFFFFFFF to Node0 Link0. */
204   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0x8C);
205   PciData = 0x00DFFF00;
206   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
207   LibAmdMsrRead (0xC001001A, &MsrReg, &StdHeader);
208   MsrReg = (MsrReg >> 8) | 3;
209   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0x88);
210   PciData = (UINT32)MsrReg;
211   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
212   /* Set E0000000-FFFFFFFF to Node0 Link0 with NP set. */
213   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0xBC);
214   PciData = 0x00FFFF00 | 0x80;
215   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
216   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0xB8);
217   PciData = (PCIE_BASE_ADDRESS >> 8) | 03;
218   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
219   /* Start to set PCIIO 0000-FFFF to Node0 Link0 with ISA&VGA set. */
220   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0xC4);
221 //-  PciData = 0x0000F000;
222   PciData = 0x00FFF000;
223   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
224   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x18, 1, 0xC0);
225   PciData = 0x00000013;
226   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
227   Status = AGESA_SUCCESS;
228   return (UINT32)Status;
229 }
230
231 UINT32
232 agesawrapper_amdinitmmio (
233   VOID
234   )
235 {
236   AGESA_STATUS                  Status;
237   UINT64                        MsrReg;
238   UINT32                        PciData;
239   PCI_ADDR                      PciAddress;
240   AMD_CONFIG_PARAMS             StdHeader;
241
242   /*
243    Set the MMIO Configuration Base Address and Bus Range onto MMIO configuration base
244    Address MSR register.
245   */
246   MsrReg = CONFIG_MMCONF_BASE_ADDRESS | (8 << 2) | 1;
247   LibAmdMsrWrite (0xC0010058, &MsrReg, &StdHeader);
248
249   /*
250    Set the NB_CFG MSR register. Enable CF8 extended configuration cycles.
251   */
252   LibAmdMsrRead (0xC001001F, &MsrReg, &StdHeader);
253   MsrReg = MsrReg | 0x0000400000000000ull;
254   LibAmdMsrWrite (0xC001001F, &MsrReg, &StdHeader);
255
256   /* Set Ontario Link Data */
257 //-  PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0, 0, 0xE0);
258 //-  PciData = 0x01308002;
259 //-  LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
260 //-  PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0, 0, 0xE4);
261 //-  PciData = (AMD_APU_SSID<<0x10)|AMD_APU_SVID;
262 //-  LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
263
264   /* Enable Non-Post Memory in CPU */
265   PciData = ((CONFIG_MMCONF_BASE_ADDRESS >> 8) | 0x3FF80);
266   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x018, 0x01, 0xA4);
267   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
268
269   PciData = ((CONFIG_MMCONF_BASE_ADDRESS >> 8) | 0x03);
270   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0x018, 0x01, 0xA0);
271   LibAmdPciWrite(AccessWidth32, PciAddress, &PciData, &StdHeader);
272
273   /* Enable memory access */
274   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0, 0, 0x04);
275   LibAmdPciRead(AccessWidth8, PciAddress, &PciData, &StdHeader);
276
277   PciData |= BIT1;
278   PciAddress.AddressValue = MAKE_SBDFO (0, 0, 0, 0, 0x04);
279   LibAmdPciWrite(AccessWidth8, PciAddress, &PciData, &StdHeader);
280
281   /* Set ROM cache onto WP to decrease post time */
282   MsrReg = (0x0100000000ull - CONFIG_ROM_SIZE) | 5ull;
283   LibAmdMsrWrite (0x20C, &MsrReg, &StdHeader);
284   MsrReg = (0x1000000000ull - CONFIG_ROM_SIZE) | 0x800ull;
285   LibAmdMsrWrite (0x20D, &MsrReg, &StdHeader);
286
287   /* Clear all pending SMI. On S3 clear power button enable so it wll not generate an SMI */
288 //-  ClearSBSmiAndWake (SB_ACPI_BASE_ADDRESS);
289 //-  ClearAllSmiEnableInPmio ();
290
291   Status = AGESA_SUCCESS;
292   return (UINT32)Status;
293 }
294
295 UINT32
296 agesawrapper_amdinitreset (
297   VOID
298   )
299 {
300   AGESA_STATUS status;
301   AMD_INTERFACE_PARAMS AmdParamStruct;
302   AMD_RESET_PARAMS AmdResetParams;
303
304   LibAmdMemFill (&AmdParamStruct,
305                  0,
306                  sizeof (AMD_INTERFACE_PARAMS),
307                  &(AmdParamStruct.StdHeader));
308
309
310   LibAmdMemFill (&AmdResetParams,
311                  0,
312                  sizeof (AMD_RESET_PARAMS),
313                  &(AmdResetParams.StdHeader));
314
315   AmdParamStruct.AgesaFunctionName = AMD_INIT_RESET;
316   AmdParamStruct.AllocationMethod = ByHost;
317   AmdParamStruct.NewStructSize = sizeof(AMD_RESET_PARAMS);
318   AmdParamStruct.NewStructPtr = &AmdResetParams;
319   AmdParamStruct.StdHeader.AltImageBasePtr = 0;
320   AmdParamStruct.StdHeader.CalloutPtr = NULL;
321   AmdParamStruct.StdHeader.Func = 0;
322   AmdParamStruct.StdHeader.ImageBasePtr = 0;
323   AmdCreateStruct (&AmdParamStruct);
324   AmdResetParams.HtConfig.Depth = 0;
325
326   status = AmdInitReset ((AMD_RESET_PARAMS *)AmdParamStruct.NewStructPtr);
327   if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog();
328   AmdReleaseStruct (&AmdParamStruct);
329   return (UINT32)status;
330  }
331
332 UINT32
333 agesawrapper_amdinitearly (
334   VOID
335   )
336 {
337   AGESA_STATUS status;
338   AMD_INTERFACE_PARAMS AmdParamStruct;
339   AMD_EARLY_PARAMS     *AmdEarlyParamsPtr;
340
341   LibAmdMemFill (&AmdParamStruct,
342                  0,
343                  sizeof (AMD_INTERFACE_PARAMS),
344                  &(AmdParamStruct.StdHeader));
345
346   AmdParamStruct.AgesaFunctionName = AMD_INIT_EARLY;
347   AmdParamStruct.AllocationMethod = PreMemHeap;
348   AmdParamStruct.StdHeader.AltImageBasePtr = 0;
349   AmdParamStruct.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
350   AmdParamStruct.StdHeader.Func = 0;
351   AmdParamStruct.StdHeader.ImageBasePtr = 0;
352   AmdCreateStruct (&AmdParamStruct);
353
354   AmdEarlyParamsPtr = (AMD_EARLY_PARAMS *)AmdParamStruct.NewStructPtr;
355   OemCustomizeInitEarly (AmdEarlyParamsPtr);
356
357   status = AmdInitEarly ((AMD_EARLY_PARAMS *)AmdParamStruct.NewStructPtr);
358   if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog();
359   AmdReleaseStruct (&AmdParamStruct);
360
361   return (UINT32)status;
362 }
363
364 UINT32
365 agesawrapper_amdinitpost (
366   VOID
367   )
368 {
369   AGESA_STATUS status;
370   UINT16                  i;
371   UINT32          *HeadPtr;
372   AMD_INTERFACE_PARAMS  AmdParamStruct;
373   BIOS_HEAP_MANAGER    *BiosManagerPtr;
374
375   LibAmdMemFill (&AmdParamStruct,
376                  0,
377                  sizeof (AMD_INTERFACE_PARAMS),
378                  &(AmdParamStruct.StdHeader));
379
380   AmdParamStruct.AgesaFunctionName = AMD_INIT_POST;
381   AmdParamStruct.AllocationMethod = PreMemHeap;
382   AmdParamStruct.StdHeader.AltImageBasePtr = 0;
383   AmdParamStruct.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
384   AmdParamStruct.StdHeader.Func = 0;
385   AmdParamStruct.StdHeader.ImageBasePtr = 0;
386
387   AmdCreateStruct (&AmdParamStruct);
388   status = AmdInitPost ((AMD_POST_PARAMS *)AmdParamStruct.NewStructPtr);
389   if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog();
390   AmdReleaseStruct (&AmdParamStruct);
391
392   /* Initialize heap space */
393   BiosManagerPtr = (BIOS_HEAP_MANAGER *)BIOS_HEAP_START_ADDRESS;
394
395   HeadPtr = (UINT32 *) ((UINT8 *) BiosManagerPtr + sizeof (BIOS_HEAP_MANAGER));
396   for (i = 0; i < ((BIOS_HEAP_SIZE/4) - (sizeof (BIOS_HEAP_MANAGER)/4)); i++)
397   {
398     *HeadPtr = 0x00000000;
399     HeadPtr++;
400   }
401   BiosManagerPtr->StartOfAllocatedNodes = 0;
402   BiosManagerPtr->StartOfFreedNodes = 0;
403
404   return (UINT32)status;
405 }
406
407 UINT32
408 agesawrapper_amdinitenv (
409   VOID
410   )
411 {
412   AGESA_STATUS status;
413   AMD_INTERFACE_PARAMS AmdParamStruct;
414
415   LibAmdMemFill (&AmdParamStruct,
416                  0,
417                  sizeof (AMD_INTERFACE_PARAMS),
418                  &(AmdParamStruct.StdHeader));
419
420   AmdParamStruct.AgesaFunctionName = AMD_INIT_ENV;
421   AmdParamStruct.AllocationMethod = PostMemDram;
422   AmdParamStruct.StdHeader.AltImageBasePtr = 0;
423   AmdParamStruct.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
424   AmdParamStruct.StdHeader.Func = 0;
425   AmdParamStruct.StdHeader.ImageBasePtr = 0;
426   AmdCreateStruct (&AmdParamStruct);
427   status = AmdInitEnv ((AMD_ENV_PARAMS *)AmdParamStruct.NewStructPtr);
428   if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog();
429   AmdReleaseStruct (&AmdParamStruct);
430
431   return (UINT32)status;
432 }
433
434 VOID *
435 agesawrapper_getlateinitptr (
436   int pick
437   )
438 {
439   switch (pick) {
440     case PICK_DMI:
441       return DmiTable;
442
443     case PICK_PSTATE:
444       return AcpiPstate;
445
446     case PICK_SRAT:
447       return AcpiSrat;
448
449     case PICK_SLIT:
450       return AcpiSlit;
451     case PICK_WHEA_MCE:
452       return AcpiWheaMce;
453     case PICK_WHEA_CMC:
454       return AcpiWheaCmc;
455     case PICK_ALIB:
456       return AcpiAlib;
457     default:
458       return NULL;
459   }
460 }
461
462 UINT32
463 agesawrapper_amdinitmid (
464   VOID
465   )
466 {
467   AGESA_STATUS status;
468   AMD_INTERFACE_PARAMS AmdParamStruct;
469
470   /* Enable MMIO on AMD CPU Address Map Controller */
471   agesawrapper_amdinitcpuio ();
472
473   LibAmdMemFill (&AmdParamStruct,
474                  0,
475                  sizeof (AMD_INTERFACE_PARAMS),
476                  &(AmdParamStruct.StdHeader));
477
478   AmdParamStruct.AgesaFunctionName = AMD_INIT_MID;
479   AmdParamStruct.AllocationMethod = PostMemDram;
480   AmdParamStruct.StdHeader.AltImageBasePtr = 0;
481   AmdParamStruct.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
482   AmdParamStruct.StdHeader.Func = 0;
483   AmdParamStruct.StdHeader.ImageBasePtr = 0;
484
485   AmdCreateStruct (&AmdParamStruct);
486
487   status = AmdInitMid ((AMD_MID_PARAMS *)AmdParamStruct.NewStructPtr);
488   if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog();
489   AmdReleaseStruct (&AmdParamStruct);
490
491   return (UINT32)status;
492 }
493
494 UINT32
495 agesawrapper_amdinitlate (
496   VOID
497   )
498 {
499   AGESA_STATUS Status;
500   AMD_LATE_PARAMS AmdLateParams;
501
502   LibAmdMemFill (&AmdLateParams,
503                  0,
504                  sizeof (AMD_LATE_PARAMS),
505                  &(AmdLateParams.StdHeader));
506
507   AmdLateParams.StdHeader.AltImageBasePtr = 0;
508   AmdLateParams.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
509   AmdLateParams.StdHeader.Func = 0;
510   AmdLateParams.StdHeader.ImageBasePtr = 0;
511
512   Status = AmdInitLate (&AmdLateParams);
513   if (Status != AGESA_SUCCESS) {
514     agesawrapper_amdreadeventlog();
515     ASSERT(Status == AGESA_SUCCESS);
516   }
517
518   DmiTable       = AmdLateParams.DmiTable;
519   AcpiPstate     = AmdLateParams.AcpiPState;
520   AcpiSrat       = AmdLateParams.AcpiSrat;
521   AcpiSlit       = AmdLateParams.AcpiSlit;
522
523   AcpiWheaMce    = AmdLateParams.AcpiWheaMce;
524   AcpiWheaCmc    = AmdLateParams.AcpiWheaCmc;
525   AcpiAlib       = AmdLateParams.AcpiAlib;
526
527   return (UINT32)Status;
528 }
529
530 UINT32
531 agesawrapper_amdlaterunaptask (
532   UINT32 Data,
533   VOID *ConfigPtr
534   )
535 {
536   AGESA_STATUS Status;
537   AP_EXE_PARAMS ApExeParams;
538
539   LibAmdMemFill (&ApExeParams,
540                  0,
541                  sizeof (AP_EXE_PARAMS),
542                  &(ApExeParams.StdHeader));
543
544   ApExeParams.StdHeader.AltImageBasePtr = 0;
545   ApExeParams.StdHeader.CalloutPtr = (CALLOUT_ENTRY) &GetBiosCallout;
546   ApExeParams.StdHeader.Func = 0;
547   ApExeParams.StdHeader.ImageBasePtr = 0;
548
549   Status = AmdLateRunApTask (&ApExeParams);
550   if (Status != AGESA_SUCCESS) {
551     agesawrapper_amdreadeventlog();
552     ASSERT(Status == AGESA_SUCCESS);
553   }
554
555   return (UINT32)Status;
556 }
557
558 UINT32
559 agesawrapper_amdreadeventlog (
560   VOID
561   )
562 {
563   AGESA_STATUS Status;
564   EVENT_PARAMS AmdEventParams;
565
566   LibAmdMemFill (&AmdEventParams,
567                  0,
568                  sizeof (EVENT_PARAMS),
569                  &(AmdEventParams.StdHeader));
570
571   AmdEventParams.StdHeader.AltImageBasePtr = 0;
572   AmdEventParams.StdHeader.CalloutPtr = NULL;
573   AmdEventParams.StdHeader.Func = 0;
574   AmdEventParams.StdHeader.ImageBasePtr = 0;
575   Status = AmdReadEventLog (&AmdEventParams);
576   while (AmdEventParams.EventClass != 0) {
577     printk(BIOS_DEBUG,"\nEventLog:  EventClass = %lx, EventInfo = %lx.\n",AmdEventParams.EventClass,AmdEventParams.EventInfo);
578     printk(BIOS_DEBUG,"  Param1 = %lx, Param2 = %lx.\n",AmdEventParams.DataParam1,AmdEventParams.DataParam2);
579     printk(BIOS_DEBUG,"  Param3 = %lx, Param4 = %lx.\n",AmdEventParams.DataParam3,AmdEventParams.DataParam4);
580     Status = AmdReadEventLog (&AmdEventParams);
581   }
582
583   return (UINT32)Status;
584 }