]> git.proxmox.com Git - mirror_edk2.git/blame - QuarkPlatformPkg/Platform/Pei/PlatformInit/PlatformEarlyInit.c
QuarkPlatformPkg: Add new package for Galileo boards
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Pei / PlatformInit / PlatformEarlyInit.c
CommitLineData
b303605e
MK
1/** @file\r
2This PEIM initialize platform for MRC, following action is performed,\r
31. Initizluize GMCH\r
42. Detect boot mode\r
53. Detect video adapter to determine whether we need pre allocated memory\r
64. Calls MRC to initialize memory and install a PPI notify to do post memory initialization.\r
7This file contains the main entrypoint of the PEIM.\r
8\r
9Copyright (c) 2013 Intel Corporation.\r
10\r
11This program and the accompanying materials\r
12are licensed and made available under the terms and conditions of the BSD License\r
13which accompanies this distribution. The full text of the license may be found at\r
14http://opensource.org/licenses/bsd-license.php\r
15\r
16THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
17WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
18\r
19**/\r
20\r
21\r
22#include "CommonHeader.h"\r
23#include "PlatformEarlyInit.h"\r
24#include "PeiFvSecurity.h"\r
25\r
26EFI_STATUS\r
27EFIAPI\r
28EndOfPeiSignalPpiNotifyCallback (\r
29 IN EFI_PEI_SERVICES **PeiServices,\r
30 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
31 IN VOID *Ppi\r
32 );\r
33\r
34//\r
35// Function prototypes to routines implemented in other source modules\r
36// within this component.\r
37//\r
38\r
39EFI_STATUS\r
40EFIAPI\r
41PlatformErratasPostMrc (\r
42 VOID\r
43 );\r
44\r
45//\r
46// The global indicator, the FvFileLoader callback will modify it to TRUE after loading PEIM into memory\r
47//\r
48BOOLEAN ImageInMemory = FALSE;\r
49\r
50BOARD_LEGACY_GPIO_CONFIG mBoardLegacyGpioConfigTable[] = { PLATFORM_LEGACY_GPIO_TABLE_DEFINITION };\r
51UINTN mBoardLegacyGpioConfigTableLen = (sizeof(mBoardLegacyGpioConfigTable) / sizeof(BOARD_LEGACY_GPIO_CONFIG));\r
52BOARD_GPIO_CONTROLLER_CONFIG mBoardGpioControllerConfigTable[] = { PLATFORM_GPIO_CONTROLLER_CONFIG_DEFINITION };\r
53UINTN mBoardGpioControllerConfigTableLen = (sizeof(mBoardGpioControllerConfigTable) / sizeof(BOARD_GPIO_CONTROLLER_CONFIG));\r
54UINT8 ChipsetDefaultMac [6] = {0xff,0xff,0xff,0xff,0xff,0xff};\r
55\r
56EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[1] = {\r
57 {\r
58 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
59 &gEfiPeiMasterBootModePpiGuid,\r
60 NULL\r
61 }\r
62};\r
63\r
64EFI_PEI_NOTIFY_DESCRIPTOR mMemoryDiscoveredNotifyList[1] = {\r
65 {\r
66 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
67 &gEfiPeiMemoryDiscoveredPpiGuid,\r
68 MemoryDiscoveredPpiNotifyCallback\r
69 }\r
70};\r
71\r
72EFI_PEI_NOTIFY_DESCRIPTOR mEndOfPeiSignalPpiNotifyList[1] = {\r
73 {\r
74 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
75 &gEfiEndOfPeiSignalPpiGuid,\r
76 EndOfPeiSignalPpiNotifyCallback\r
77 }\r
78};\r
79\r
80EFI_PEI_STALL_PPI mStallPpi = {\r
81 PEI_STALL_RESOLUTION,\r
82 Stall\r
83};\r
84\r
85EFI_PEI_PPI_DESCRIPTOR mPpiStall[1] = {\r
86 {\r
87 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
88 &gEfiPeiStallPpiGuid,\r
89 &mStallPpi\r
90 }\r
91};\r
92\r
93/**\r
94 Set Mac address on chipset ethernet device.\r
95\r
96 @param Bus PCI Bus number of chipset ethernet device.\r
97 @param Device Device number of chipset ethernet device.\r
98 @param Func PCI Function number of chipset ethernet device.\r
99 @param MacAddr MAC Address to set.\r
100\r
101**/\r
102VOID\r
103EFIAPI\r
104SetLanControllerMacAddr (\r
105 IN CONST UINT8 Bus,\r
106 IN CONST UINT8 Device,\r
107 IN CONST UINT8 Func,\r
108 IN CONST UINT8 *MacAddr,\r
109 IN CONST UINT32 Bar0\r
110 )\r
111{\r
112 UINT32 Data32;\r
113 UINT16 PciVid;\r
114 UINT16 PciDid;\r
115 UINT32 Addr;\r
116 UINT32 MacVer;\r
117 volatile UINT8 *Wrote;\r
118 UINT32 DevPcieAddr;\r
119 UINT16 SaveCmdReg;\r
120 UINT32 SaveBarReg;\r
121\r
122 DevPcieAddr = PCI_LIB_ADDRESS (\r
123 Bus,\r
124 Device,\r
125 Func,\r
126 0\r
127 );\r
128\r
129 //\r
130 // Do nothing if not a supported device.\r
131 //\r
132 PciVid = PciRead16 (DevPcieAddr + PCI_VENDOR_ID_OFFSET);\r
133 PciDid = PciRead16 (DevPcieAddr + PCI_DEVICE_ID_OFFSET);\r
134 if((PciVid != V_IOH_MAC_VENDOR_ID) || (PciDid != V_IOH_MAC_DEVICE_ID)) {\r
135 return;\r
136 }\r
137\r
138 //\r
139 // Save current settings for PCI CMD/BAR registers\r
140 //\r
141 SaveCmdReg = PciRead16 (DevPcieAddr + PCI_COMMAND_OFFSET);\r
142 SaveBarReg = PciRead32 (DevPcieAddr + R_IOH_MAC_MEMBAR);\r
143\r
144 //\r
145 // Use predefined tempory memory resource\r
146 //\r
147 PciWrite32 ( DevPcieAddr + R_IOH_MAC_MEMBAR, Bar0);\r
148 PciWrite8 ( DevPcieAddr + PCI_COMMAND_OFFSET, EFI_PCI_COMMAND_MEMORY_SPACE);\r
149\r
150 Addr = Bar0 + R_IOH_MAC_GMAC_REG_8;\r
151 MacVer = *((volatile UINT32 *) (UINTN)(Addr));\r
152\r
153 DEBUG ((EFI_D_INFO, "Ioh MAC [B:%d, D:%d, F:%d] VER:%04x ADDR:",\r
154 (UINTN) Bus,\r
155 (UINTN) Device,\r
156 (UINTN) Func,\r
157 (UINTN) MacVer\r
158 ));\r
159\r
160 //\r
161 // Set MAC Address0 Low Register (GMAC_REG_17) ADDRLO bits.\r
162 //\r
163 Addr = Bar0 + R_IOH_MAC_GMAC_REG_17;\r
164 Data32 = *((UINT32 *) (UINTN)(&MacAddr[0]));\r
165 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
166 Wrote = (volatile UINT8 *) (UINTN)(Addr);\r
167 DEBUG ((EFI_D_INFO, "%02x-%02x-%02x-%02x-",\r
168 (UINTN) Wrote[0],\r
169 (UINTN) Wrote[1],\r
170 (UINTN) Wrote[2],\r
171 (UINTN) Wrote[3]\r
172 ));\r
173\r
174 //\r
175 // Set MAC Address0 High Register (GMAC_REG_16) ADDRHI bits\r
176 // and Address Enable (AE) bit.\r
177 //\r
178 Addr = Bar0 + R_IOH_MAC_GMAC_REG_16;\r
179 Data32 =\r
180 ((UINT32) MacAddr[4]) |\r
181 (((UINT32)MacAddr[5]) << 8) |\r
182 B_IOH_MAC_AE;\r
183 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
184 Wrote = (volatile UINT8 *) (UINTN)(Addr);\r
185\r
186 DEBUG ((EFI_D_INFO, "%02x-%02x\n", (UINTN) Wrote[0], (UINTN) Wrote[1]));\r
187\r
188 //\r
189 // Restore settings for PCI CMD/BAR registers\r
190 //\r
191 PciWrite32 ((DevPcieAddr + R_IOH_MAC_MEMBAR), SaveBarReg);\r
192 PciWrite16 (DevPcieAddr + PCI_COMMAND_OFFSET, SaveCmdReg);\r
193}\r
194\r
195/**\r
196 This is the entrypoint of PEIM\r
197\r
198 @param FileHandle Handle of the file being invoked.\r
199 @param PeiServices Describes the list of possible PEI Services.\r
200\r
201 @retval EFI_SUCCESS if it completed successfully.\r
202**/\r
203EFI_STATUS\r
204EFIAPI\r
205PeiInitPlatform (\r
206 IN EFI_PEI_FILE_HANDLE FileHandle,\r
207 IN CONST EFI_PEI_SERVICES **PeiServices\r
208 )\r
209{\r
210 EFI_STATUS Status;\r
211 EFI_BOOT_MODE BootMode;\r
212 EFI_PEI_STALL_PPI *StallPpi;\r
213 EFI_PEI_PPI_DESCRIPTOR *StallPeiPpiDescriptor;\r
214 EFI_FV_FILE_INFO FileInfo;\r
215 EFI_PLATFORM_TYPE PlatformType;\r
216\r
217 PlatformType = (EFI_PLATFORM_TYPE)PcdGet16 (PcdPlatformType);\r
218\r
219 //\r
220 // Initialize Firmware Volume security.\r
221 // This must be done before any firmware volume accesses (excl. BFV)\r
222 //\r
223 Status = PeiInitializeFvSecurity();\r
224 ASSERT_EFI_ERROR (Status);\r
225\r
226 //\r
227 // Do any early platform specific initialization.\r
228 //\r
229 EarlyPlatformInit ();\r
230\r
231 //\r
232 // This is a second path on entry, in recovery boot path the Stall PPI need to be memory-based\r
233 // to improve recovery performance.\r
234 //\r
235 Status = PeiServicesFfsGetFileInfo (FileHandle, &FileInfo);\r
236 ASSERT_EFI_ERROR (Status);\r
237 //\r
238 // The follow conditional check only works for memory-mapped FFS,\r
239 // so we ASSERT that the file is really a MM FFS.\r
240 //\r
241 ASSERT (FileInfo.Buffer != NULL);\r
242 if (!(((UINTN) FileInfo.Buffer <= (UINTN) PeiInitPlatform) &&\r
243 ((UINTN) PeiInitPlatform <= (UINTN) FileInfo.Buffer + FileInfo.BufferSize))) {\r
244 //\r
245 // Now that module in memory, update the\r
246 // PPI that describes the Stall to other modules\r
247 //\r
248 Status = PeiServicesLocatePpi (\r
249 &gEfiPeiStallPpiGuid,\r
250 0,\r
251 &StallPeiPpiDescriptor,\r
252 (VOID **) &StallPpi\r
253 );\r
254\r
255 if (!EFI_ERROR (Status)) {\r
256\r
257 Status = PeiServicesReInstallPpi (\r
258 StallPeiPpiDescriptor,\r
259 &mPpiStall[0]\r
260 );\r
261 } else {\r
262\r
263 Status = PeiServicesInstallPpi (&mPpiStall[0]);\r
264 }\r
265 return Status;\r
266 }\r
267\r
268 //\r
269 // Initialize System Phys\r
270 //\r
271\r
272 // Program USB Phy\r
273 InitializeUSBPhy();\r
274\r
275 //\r
276 // Do platform specific logic to create a boot mode\r
277 //\r
278 Status = UpdateBootMode ((EFI_PEI_SERVICES**)PeiServices, &BootMode);\r
279 ASSERT_EFI_ERROR (Status);\r
280\r
281 //\r
282 // Signal possible dependent modules that there has been a\r
283 // final boot mode determination\r
284 //\r
285 if (!EFI_ERROR(Status)) {\r
286 Status = PeiServicesInstallPpi (&mPpiBootMode[0]);\r
287 ASSERT_EFI_ERROR (Status);\r
288 }\r
289\r
290 if (BootMode != BOOT_ON_S3_RESUME) {\r
291 QNCClearSmiAndWake ();\r
292 }\r
293\r
294 DEBUG ((EFI_D_INFO, "MRC Entry\n"));\r
295 MemoryInit ((EFI_PEI_SERVICES**)PeiServices);\r
296\r
297 //\r
298 // Do Early PCIe init.\r
299 //\r
300 DEBUG ((EFI_D_INFO, "Early PCIe controller initialization\n"));\r
301 PlatformPciExpressEarlyInit (PlatformType);\r
302\r
303\r
304 DEBUG ((EFI_D_INFO, "Platform Erratas After MRC\n"));\r
305 PlatformErratasPostMrc ();\r
306\r
307 //\r
308 // Now that all of the pre-permanent memory activities have\r
309 // been taken care of, post a call-back for the permanent-memory\r
310 // resident services, such as HOB construction.\r
311 // PEI Core will switch stack after this PEIM exit. After that the MTRR\r
312 // can be set.\r
313 //\r
314 Status = PeiServicesNotifyPpi (&mMemoryDiscoveredNotifyList[0]);\r
315 ASSERT_EFI_ERROR (Status);\r
316/*\r
317\r
318 if (BootMode != BOOT_ON_S3_RESUME) {\r
319 Status = PeiServicesNotifyPpi (mEndOfPeiSignalPpiNotifyList);\r
320 ASSERT_EFI_ERROR (Status);\r
321 }\r
322*/\r
323 if (BootMode == BOOT_IN_RECOVERY_MODE) {\r
324 PeiServicesRegisterForShadow (FileHandle);\r
325 }\r
326\r
327 return Status;\r
328}\r
329\r
330EFI_STATUS\r
331EFIAPI\r
332EndOfPeiSignalPpiNotifyCallback (\r
333 IN EFI_PEI_SERVICES **PeiServices,\r
334 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
335 IN VOID *Ppi\r
336 )\r
337{\r
338 EFI_STATUS Status;\r
339\r
340 DEBUG ((EFI_D_INFO, "End of PEI Signal Callback\n"));\r
341\r
342 //\r
343 // Restore the flash region to be UC\r
344 // for both normal boot as we build a Resource Hob to\r
345 // describe this region as UC to DXE core.\r
346 //\r
347 WriteBackInvalidateDataCacheRange (\r
348 (VOID *) (UINTN) PcdGet32 (PcdFlashAreaBaseAddress),\r
349 PcdGet32 (PcdFlashAreaSize)\r
350 );\r
351\r
352 Status = MtrrSetMemoryAttribute (PcdGet32 (PcdFlashAreaBaseAddress), PcdGet32 (PcdFlashAreaSize), CacheUncacheable);\r
353 ASSERT_EFI_ERROR (Status);\r
354\r
355 return EFI_SUCCESS;\r
356}\r
357\r
358/**\r
359 This function will initialize USB Phy registers associated with QuarkSouthCluster.\r
360\r
361 @param VOID No Argument\r
362\r
363 @retval EFI_SUCCESS All registers have been initialized\r
364**/\r
365VOID\r
366EFIAPI\r
367InitializeUSBPhy (\r
368 VOID\r
369 )\r
370{\r
371 UINT32 RegData32;\r
372\r
373 /** In order to configure the PHY to use clk120 (ickusbcoreclk) as PLL reference clock\r
374 * and Port2 as a USB device port, the following sequence must be followed\r
375 *\r
376 **/\r
377\r
378 // Sideband register write to USB AFE (Phy)\r
379 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_GLOBAL_PORT);\r
380 RegData32 &= ~(BIT1);\r
381 //\r
382 // Sighting #4930631 PDNRESCFG [8:7] of USB2_GLOBAL_PORT = 11b.\r
383 // For port 0 & 1 as host and port 2 as device.\r
384 //\r
385 RegData32 |= (BIT8 | BIT7);\r
386 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_GLOBAL_PORT, RegData32);\r
387\r
388 //\r
389 // Sighting #4930653 Required BIOS change on Disconnect vref to change to 600mV.\r
390 //\r
391 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_COMPBG);\r
392 RegData32 &= ~(BIT10 | BIT9 | BIT8 | BIT7);\r
393 RegData32 |= (BIT10 | BIT7);\r
394 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_COMPBG, RegData32);\r
395\r
396 // Sideband register write to USB AFE (Phy)\r
397 // (pllbypass) to bypass/Disable PLL before switch\r
398 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL2);\r
399 RegData32 |= BIT29;\r
400 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL2, RegData32);\r
401\r
402 // Sideband register write to USB AFE (Phy)\r
403 // (coreclksel) to select 120MHz (ickusbcoreclk) clk source.\r
404 // (Default 0 to select 96MHz (ickusbclk96_npad/ppad))\r
405 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL1);\r
406 RegData32 |= BIT1;\r
407 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL1, RegData32);\r
408\r
409 // Sideband register write to USB AFE (Phy)\r
410 // (divide by 8) to achieve internal 480MHz clock\r
411 // for 120MHz input refclk. (Default: 4'b1000 (divide by 10) for 96MHz)\r
412 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL1);\r
413 RegData32 &= ~(BIT5 | BIT4 | BIT3);\r
414 RegData32 |= BIT6;\r
415 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL1, RegData32);\r
416\r
417 // Sideband register write to USB AFE (Phy)\r
418 // Clear (pllbypass)\r
419 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL2);\r
420 RegData32 &= ~BIT29;\r
421 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL2, RegData32);\r
422\r
423 // Sideband register write to USB AFE (Phy)\r
424 // Set (startlock) to force the PLL FSM to restart the lock\r
425 // sequence due to input clock/freq switch.\r
426 RegData32 = QNCAltPortRead (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL2);\r
427 RegData32 |= BIT24;\r
428 QNCAltPortWrite (QUARK_SC_USB_AFE_SB_PORT_ID, USB2_PLL2, RegData32);\r
429\r
430 // At this point the PLL FSM and COMP FSM will complete\r
431\r
432}\r
433\r
434/**\r
435 This function provides early platform Thermal sensor initialisation.\r
436**/\r
437VOID\r
438EFIAPI\r
439EarlyPlatformThermalSensorInit (\r
440 VOID\r
441 )\r
442{\r
443 DEBUG ((EFI_D_INFO, "Early Platform Thermal Sensor Init\n"));\r
444\r
445 //\r
446 // Set Thermal sensor mode.\r
447 //\r
448 QNCThermalSensorSetRatiometricMode ();\r
449\r
450 //\r
451 // Enable RMU Thermal sensor with a Catastrophic Trip point.\r
452 //\r
453 QNCThermalSensorEnableWithCatastrophicTrip (PLATFORM_CATASTROPHIC_TRIP_CELSIUS);\r
454\r
455 //\r
456 // Lock all RMU Thermal sensor control & trip point registers.\r
457 //\r
458 QNCThermalSensorLockAllRegisters ();\r
459}\r
460\r
461/**\r
462 Print early platform info messages includeing the Stage1 module that's\r
463 running, MFH item list and platform data item list.\r
464**/\r
465VOID\r
466EFIAPI\r
467EarlyPlatformInfoMessages (\r
468 VOID\r
469 )\r
470{\r
471 DEBUG_CODE_BEGIN ();\r
472 QUARK_EDKII_STAGE1_HEADER *Edk2ImageHeader;\r
473\r
474 //\r
475 // Find which 'Stage1' image we are running and print the details\r
476 //\r
477 Edk2ImageHeader = (QUARK_EDKII_STAGE1_HEADER *) PcdGet32 (PcdEsramStage1Base);\r
478 DEBUG ((EFI_D_INFO, "\n************************************************************\n"));\r
479\r
480 switch ((UINT8)Edk2ImageHeader->ImageIndex & QUARK_STAGE1_IMAGE_TYPE_MASK) {\r
481 case QUARK_STAGE1_BOOT_IMAGE_TYPE:\r
482 DEBUG ((EFI_D_INFO, "**** Quark EDKII Stage 1 Boot Image %d ****\n", ((UINT8)Edk2ImageHeader->ImageIndex & ~(QUARK_STAGE1_IMAGE_TYPE_MASK))));\r
483 break;\r
484\r
485 case QUARK_STAGE1_RECOVERY_IMAGE_TYPE:\r
486 DEBUG ((EFI_D_INFO, "**** Quark EDKII Stage 1 Recovery Image %d ****\n", ((UINT8)Edk2ImageHeader->ImageIndex & ~(QUARK_STAGE1_IMAGE_TYPE_MASK))));\r
487 break;\r
488\r
489 default:\r
490 DEBUG ((EFI_D_INFO, "**** Quark EDKII Unknown Stage 1 Image !!!! ****\n"));\r
491 break;\r
492 }\r
493 DEBUG (\r
494 (EFI_D_INFO,\r
495 "**** Quark EDKII Stage 2 Image 0x%08X:0x%08X ****\n" ,\r
496 (UINTN) PcdGet32 (PcdFlashFvMainBase),\r
497 (UINTN) PcdGet32 (PcdFlashFvMainSize)\r
498 ));\r
499\r
500 DEBUG (\r
501 (EFI_D_INFO,\r
502 "**** Quark EDKII Payload Image 0x%08X:0x%08X ****\n" ,\r
503 (UINTN) PcdGet32 (PcdFlashFvPayloadBase),\r
504 (UINTN) PcdGet32 (PcdFlashFvPayloadSize)\r
505 ));\r
506\r
507 DEBUG ((EFI_D_INFO, "************************************************************\n\n"));\r
508\r
509 DEBUG_CODE_END ();\r
510}\r
511\r
512/**\r
513 Check if system reset due to error condition.\r
514\r
515 @param ClearErrorBits If TRUE clear error flags and value bits.\r
516\r
517 @retval TRUE if system reset due to error condition.\r
518 @retval FALSE if NO reset error conditions.\r
519**/\r
520BOOLEAN\r
521CheckForResetDueToErrors (\r
522 IN BOOLEAN ClearErrorBits\r
523 )\r
524{\r
525 UINT32 RegValue;\r
526 BOOLEAN ResetDueToError;\r
527\r
528 ResetDueToError = FALSE;\r
529\r
530 //\r
531 // Check if RMU reset system due to access violations.\r
532 // RMU updates a SOC Unit register before reseting the system.\r
533 //\r
534 RegValue = QNCAltPortRead (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW);\r
535 if ((RegValue & B_CFG_STICKY_RW_VIOLATION) != 0) {\r
536 ResetDueToError = TRUE;\r
537\r
538 DEBUG (\r
539 (EFI_D_ERROR,\r
540 "\nReset due to access violation: %s %s %s %s\n",\r
541 ((RegValue & B_CFG_STICKY_RW_IMR_VIOLATION) != 0) ? L"'IMR'" : L".",\r
542 ((RegValue & B_CFG_STICKY_RW_DECC_VIOLATION) != 0) ? L"'DECC'" : L".",\r
543 ((RegValue & B_CFG_STICKY_RW_SMM_VIOLATION) != 0) ? L"'SMM'" : L".",\r
544 ((RegValue & B_CFG_STICKY_RW_HMB_VIOLATION) != 0) ? L"'HMB'" : L"."\r
545 ));\r
546\r
547 //\r
548 // Clear error bits.\r
549 //\r
550 if (ClearErrorBits) {\r
551 RegValue &= ~(B_CFG_STICKY_RW_VIOLATION);\r
552 QNCAltPortWrite (QUARK_SCSS_SOC_UNIT_SB_PORT_ID, QUARK_SCSS_SOC_UNIT_CFG_STICKY_RW, RegValue);\r
553 }\r
554 }\r
555\r
556 return ResetDueToError;\r
557}\r
558\r
559/**\r
560 This function provides early platform initialization.\r
561\r
562 @param PlatformInfo Pointer to platform Info structure.\r
563\r
564**/\r
565VOID\r
566EFIAPI\r
567EarlyPlatformInit (\r
568 VOID\r
569 )\r
570{\r
571 EFI_PLATFORM_TYPE PlatformType;\r
572\r
573 PlatformType = (EFI_PLATFORM_TYPE) PcdGet16 (PcdPlatformType);\r
574\r
575 DEBUG ((EFI_D_INFO, "EarlyPlatformInit for PlatType=0x%02x\n", (UINTN) PlatformType));\r
576\r
577 //\r
578 // Check if system reset due to error condition.\r
579 //\r
580 if (CheckForResetDueToErrors (TRUE)) {\r
581 if(FeaturePcdGet (WaitIfResetDueToError)) {\r
582 DEBUG ((EFI_D_ERROR, "Press any key to continue.\n"));\r
583 PlatformDebugPortGetChar8 ();\r
584 }\r
585 }\r
586\r
587 //\r
588 // Display platform info messages.\r
589 //\r
590 EarlyPlatformInfoMessages ();\r
591\r
592 //\r
593 // Early Legacy Gpio Init.\r
594 //\r
595 EarlyPlatformLegacyGpioInit (PlatformType);\r
596\r
597 //\r
598 // Early platform Legacy GPIO manipulation depending on GPIOs\r
599 // setup by EarlyPlatformLegacyGpioInit.\r
600 //\r
601 EarlyPlatformLegacyGpioManipulation (PlatformType);\r
602\r
603 //\r
604 // Early platform specific GPIO Controller init & manipulation.\r
605 // Combined for sharing of temp. memory bar.\r
606 //\r
607 EarlyPlatformGpioCtrlerInitAndManipulation (PlatformType);\r
608\r
609 //\r
610 // Early Thermal Sensor Init.\r
611 //\r
612 EarlyPlatformThermalSensorInit ();\r
613\r
614 //\r
615 // Early Lan Ethernet Mac Init.\r
616 //\r
617 EarlyPlatformMacInit (\r
618 PcdGetPtr (PcdIohEthernetMac0),\r
619 PcdGetPtr (PcdIohEthernetMac1)\r
620 );\r
621}\r
622\r
623/**\r
624 This function provides early platform Legacy GPIO initialisation.\r
625\r
626 @param PlatformType Platform type for GPIO init.\r
627\r
628**/\r
629VOID\r
630EFIAPI\r
631EarlyPlatformLegacyGpioInit (\r
632 IN CONST EFI_PLATFORM_TYPE PlatformType\r
633 )\r
634{\r
635 BOARD_LEGACY_GPIO_CONFIG *LegacyGpioConfig;\r
636 UINT32 NewValue;\r
637 UINT32 GpioBaseAddress;\r
638\r
639 //\r
640 // Assert if platform type outside table range.\r
641 //\r
642 ASSERT ((UINTN) PlatformType < mBoardLegacyGpioConfigTableLen);\r
643 LegacyGpioConfig = &mBoardLegacyGpioConfigTable[(UINTN) PlatformType];\r
644\r
645 GpioBaseAddress = (UINT32)PcdGet16 (PcdGbaIoBaseAddress);\r
646\r
647 NewValue = 0x0;\r
648 //\r
649 // Program QNC GPIO Registers.\r
650 //\r
651 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGEN_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellEnable;\r
652 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGEN_CORE_WELL, NewValue );\r
653 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGIO_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellIoSelect;\r
654 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGIO_CORE_WELL, NewValue);\r
655 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGLVL_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellLvlForInputOrOutput;\r
656 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGLVL_CORE_WELL, NewValue);\r
657 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGTPE_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellTriggerPositiveEdge;\r
658 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGTPE_CORE_WELL, NewValue );\r
659 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGTNE_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellTriggerNegativeEdge;\r
660 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGTNE_CORE_WELL, NewValue);\r
661 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGGPE_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellGPEEnable;\r
662 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGGPE_CORE_WELL, NewValue);\r
663 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGSMI_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellSMIEnable;\r
664 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGSMI_CORE_WELL, NewValue );\r
665 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CGTS_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellTriggerStatus;\r
666 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CGTS_CORE_WELL, NewValue);\r
667 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_CNMIEN_CORE_WELL) & 0xFFFFFFFC) | LegacyGpioConfig->CoreWellNMIEnable;\r
668 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_CNMIEN_CORE_WELL, NewValue);\r
669\r
670 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGEN_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellEnable;\r
671 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGEN_RESUME_WELL, NewValue );\r
672 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGIO_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellIoSelect;\r
673 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGIO_RESUME_WELL, NewValue) ;\r
674 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGLVL_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellLvlForInputOrOutput;\r
675 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGLVL_RESUME_WELL, NewValue);\r
676 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGTPE_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellTriggerPositiveEdge;\r
677 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGTPE_RESUME_WELL, NewValue );\r
678 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGTNE_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellTriggerNegativeEdge;\r
679 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGTNE_RESUME_WELL, NewValue) ;\r
680 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGGPE_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellGPEEnable;\r
681 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGGPE_RESUME_WELL, NewValue);\r
682 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGSMI_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellSMIEnable;\r
683 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGSMI_RESUME_WELL, NewValue );\r
684 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RGTS_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellTriggerStatus;\r
685 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RGTS_RESUME_WELL, NewValue) ;\r
686 NewValue = (IoRead32 (GpioBaseAddress + R_QNC_GPIO_RNMIEN_RESUME_WELL) & 0xFFFFFFC0) | LegacyGpioConfig->ResumeWellNMIEnable;\r
687 IoWrite32 (GpioBaseAddress + R_QNC_GPIO_RNMIEN_RESUME_WELL, NewValue);\r
688}\r
689\r
690/**\r
691 Performs any early platform specific Legacy GPIO manipulation.\r
692\r
693 @param PlatformType Platform type GPIO manipulation.\r
694\r
695**/\r
696VOID\r
697EFIAPI\r
698EarlyPlatformLegacyGpioManipulation (\r
699 IN CONST EFI_PLATFORM_TYPE PlatformType\r
700 )\r
701{\r
702 if (PlatformType == CrossHill) {\r
703\r
704 //\r
705 // Pull TPM reset low for 80us (equivalent to cold reset, Table 39\r
706 // Infineon SLB9645 Databook), then pull TPM reset high and wait for\r
707 // 150ms to give time for TPM to stabilise (Section 4.7.1 Infineon\r
708 // SLB9645 Databook states TPM is ready to receive command after 30ms\r
709 // but section 4.7 states some TPM commands may take longer to execute\r
710 // upto 150ms after test).\r
711 //\r
712\r
713 PlatformLegacyGpioSetLevel (\r
714 R_QNC_GPIO_RGLVL_RESUME_WELL,\r
715 PLATFORM_RESUMEWELL_TPM_RST_GPIO,\r
716 FALSE\r
717 );\r
718 MicroSecondDelay (80);\r
719\r
720 PlatformLegacyGpioSetLevel (\r
721 R_QNC_GPIO_RGLVL_RESUME_WELL,\r
722 PLATFORM_RESUMEWELL_TPM_RST_GPIO,\r
723 TRUE\r
724 );\r
725 MicroSecondDelay (150000);\r
726 }\r
727\r
728}\r
729\r
730/**\r
731 Performs any early platform specific GPIO Controller init & manipulation.\r
732\r
733 @param PlatformType Platform type for GPIO init & manipulation.\r
734\r
735**/\r
736VOID\r
737EFIAPI\r
738EarlyPlatformGpioCtrlerInitAndManipulation (\r
739 IN CONST EFI_PLATFORM_TYPE PlatformType\r
740 )\r
741{\r
742 UINT32 IohGpioBase;\r
743 UINT32 Data32;\r
744 UINT32 Addr;\r
745 BOARD_GPIO_CONTROLLER_CONFIG *GpioConfig;\r
746 UINT32 DevPcieAddr;\r
747 UINT16 SaveCmdReg;\r
748 UINT32 SaveBarReg;\r
749 UINT16 PciVid;\r
750 UINT16 PciDid;\r
751\r
752 ASSERT ((UINTN) PlatformType < mBoardGpioControllerConfigTableLen);\r
753 GpioConfig = &mBoardGpioControllerConfigTable[(UINTN) PlatformType];\r
754\r
755 IohGpioBase = (UINT32) PcdGet64 (PcdIohGpioMmioBase);\r
756\r
757 DevPcieAddr = PCI_LIB_ADDRESS (\r
758 PcdGet8 (PcdIohGpioBusNumber),\r
759 PcdGet8 (PcdIohGpioDevNumber),\r
760 PcdGet8 (PcdIohGpioFunctionNumber),\r
761 0\r
762 );\r
763\r
764 //\r
765 // Do nothing if not a supported device.\r
766 //\r
767 PciVid = PciRead16 (DevPcieAddr + PCI_VENDOR_ID_OFFSET);\r
768 PciDid = PciRead16 (DevPcieAddr + PCI_DEVICE_ID_OFFSET);\r
769 if((PciVid != V_IOH_I2C_GPIO_VENDOR_ID) || (PciDid != V_IOH_I2C_GPIO_DEVICE_ID)) {\r
770 return;\r
771 }\r
772\r
773 //\r
774 // Save current settings for PCI CMD/BAR registers.\r
775 //\r
776 SaveCmdReg = PciRead16 (DevPcieAddr + PCI_COMMAND_OFFSET);\r
777 SaveBarReg = PciRead32 (DevPcieAddr + PcdGet8 (PcdIohGpioBarRegister));\r
778\r
779 //\r
780 // Use predefined tempory memory resource.\r
781 //\r
782 PciWrite32 ( DevPcieAddr + PcdGet8 (PcdIohGpioBarRegister), IohGpioBase);\r
783 PciWrite8 ( DevPcieAddr + PCI_COMMAND_OFFSET, EFI_PCI_COMMAND_MEMORY_SPACE);\r
784\r
785 //\r
786 // Gpio Controller Init Tasks.\r
787 //\r
788\r
789 //\r
790 // IEN- Interrupt Enable Register\r
791 //\r
792 Addr = IohGpioBase + GPIO_INTEN;\r
793 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
794 Data32 |= (GpioConfig->IntEn & 0x000FFFFF);\r
795 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
796\r
797 //\r
798 // ISTATUS- Interrupt Status Register\r
799 //\r
800 Addr = IohGpioBase + GPIO_INTSTATUS;\r
801 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
802 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
803\r
804 //\r
805 // GPIO SWPORTA Direction Register - GPIO_SWPORTA_DR\r
806 //\r
807 Addr = IohGpioBase + GPIO_SWPORTA_DR;\r
808 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
809 Data32 |= (GpioConfig->PortADR & 0x000FFFFF);\r
810 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
811\r
812 //\r
813 // GPIO SWPORTA Data Direction Register - GPIO_SWPORTA_DDR - default input\r
814 //\r
815 Addr = IohGpioBase + GPIO_SWPORTA_DDR;\r
816 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
817 Data32 |= (GpioConfig->PortADir & 0x000FFFFF);\r
818 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
819\r
820 //\r
821 // Interrupt Mask Register - GPIO_INTMASK - default interrupts unmasked\r
822 //\r
823 Addr = IohGpioBase + GPIO_INTMASK;\r
824 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
825 Data32 |= (GpioConfig->IntMask & 0x000FFFFF);\r
826 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
827\r
828 //\r
829 // Interrupt Level Type Register - GPIO_INTTYPE_LEVEL - default is level sensitive\r
830 //\r
831 Addr = IohGpioBase + GPIO_INTTYPE_LEVEL;\r
832 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
833 Data32 |= (GpioConfig->IntType & 0x000FFFFF);\r
834 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
835\r
836 //\r
837 // Interrupt Polarity Type Register - GPIO_INT_POLARITY - default is active low\r
838 //\r
839 Addr = IohGpioBase + GPIO_INT_POLARITY;\r
840 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
841 Data32 |= (GpioConfig->IntPolarity & 0x000FFFFF);\r
842 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
843\r
844 //\r
845 // Interrupt Debounce Type Register - GPIO_DEBOUNCE - default no debounce\r
846 //\r
847 Addr = IohGpioBase + GPIO_DEBOUNCE;\r
848 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
849 Data32 |= (GpioConfig->Debounce & 0x000FFFFF);\r
850 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
851\r
852 //\r
853 // Interrupt Clock Synchronisation Register - GPIO_LS_SYNC - default no sync with pclk_intr(APB bus clk)\r
854 //\r
855 Addr = IohGpioBase + GPIO_LS_SYNC;\r
856 Data32 = *((volatile UINT32 *) (UINTN)(Addr)) & 0xFFFFFF00; // Keep reserved bits [31:8]\r
857 Data32 |= (GpioConfig->LsSync & 0x000FFFFF);\r
858 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
859\r
860 //\r
861 // Gpio Controller Manipulation Tasks.\r
862 //\r
863\r
864 if (PlatformType == (EFI_PLATFORM_TYPE) Galileo) {\r
865 //\r
866 // Reset Cypress Expander on Galileo Platform\r
867 //\r
868 Addr = IohGpioBase + GPIO_SWPORTA_DR;\r
869 Data32 = *((volatile UINT32 *) (UINTN)(Addr));\r
870 Data32 |= BIT4; // Cypress Reset line controlled by GPIO<4>\r
871 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
872\r
873 Data32 = *((volatile UINT32 *) (UINTN)(Addr));\r
874 Data32 &= ~BIT4; // Cypress Reset line controlled by GPIO<4>\r
875 *((volatile UINT32 *) (UINTN)(Addr)) = Data32;\r
876\r
877 }\r
878\r
879 //\r
880 // Restore settings for PCI CMD/BAR registers\r
881 //\r
882 PciWrite32 ((DevPcieAddr + PcdGet8 (PcdIohGpioBarRegister)), SaveBarReg);\r
883 PciWrite16 (DevPcieAddr + PCI_COMMAND_OFFSET, SaveCmdReg);\r
884}\r
885\r
886/**\r
887 Performs any early platform init of SoC Ethernet Mac devices.\r
888\r
889 @param IohMac0Address Mac address to program into Mac0 device.\r
890 @param IohMac1Address Mac address to program into Mac1 device.\r
891\r
892**/\r
893VOID\r
894EFIAPI\r
895EarlyPlatformMacInit (\r
896 IN CONST UINT8 *IohMac0Address,\r
897 IN CONST UINT8 *IohMac1Address\r
898 )\r
899{\r
900 BOOLEAN SetMacAddr;\r
901\r
902 //\r
903 // Set chipset MAC0 address if configured.\r
904 //\r
905 SetMacAddr =\r
906 (CompareMem (ChipsetDefaultMac, IohMac0Address, sizeof (ChipsetDefaultMac))) != 0;\r
907 if (SetMacAddr) {\r
908 if ((*(IohMac0Address) & BIT0) != 0) {\r
909 DEBUG ((EFI_D_ERROR, "HALT: Multicast Mac Address configured for Ioh MAC [B:%d, D:%d, F:%d]\n",\r
910 (UINTN) IOH_MAC0_BUS_NUMBER,\r
911 (UINTN) IOH_MAC0_DEVICE_NUMBER,\r
912 (UINTN) IOH_MAC0_FUNCTION_NUMBER\r
913 ));\r
914 ASSERT (FALSE);\r
915 } else {\r
916 SetLanControllerMacAddr (\r
917 IOH_MAC0_BUS_NUMBER,\r
918 IOH_MAC0_DEVICE_NUMBER,\r
919 IOH_MAC0_FUNCTION_NUMBER,\r
920 IohMac0Address,\r
921 (UINT32) PcdGet64(PcdIohMac0MmioBase)\r
922 );\r
923 }\r
924 } else {\r
925 DEBUG ((EFI_D_WARN, "WARNING: Ioh MAC [B:%d, D:%d, F:%d] NO HW ADDR CONFIGURED!!!\n",\r
926 (UINTN) IOH_MAC0_BUS_NUMBER,\r
927 (UINTN) IOH_MAC0_DEVICE_NUMBER,\r
928 (UINTN) IOH_MAC0_FUNCTION_NUMBER\r
929 ));\r
930 }\r
931\r
932 //\r
933 // Set chipset MAC1 address if configured.\r
934 //\r
935 SetMacAddr =\r
936 (CompareMem (ChipsetDefaultMac, IohMac1Address, sizeof (ChipsetDefaultMac))) != 0;\r
937 if (SetMacAddr) {\r
938 if ((*(IohMac1Address) & BIT0) != 0) {\r
939 DEBUG ((EFI_D_ERROR, "HALT: Multicast Mac Address configured for Ioh MAC [B:%d, D:%d, F:%d]\n",\r
940 (UINTN) IOH_MAC1_BUS_NUMBER,\r
941 (UINTN) IOH_MAC1_DEVICE_NUMBER,\r
942 (UINTN) IOH_MAC1_FUNCTION_NUMBER\r
943 ));\r
944 ASSERT (FALSE);\r
945 } else {\r
946 SetLanControllerMacAddr (\r
947 IOH_MAC1_BUS_NUMBER,\r
948 IOH_MAC1_DEVICE_NUMBER,\r
949 IOH_MAC1_FUNCTION_NUMBER,\r
950 IohMac1Address,\r
951 (UINT32) PcdGet64(PcdIohMac1MmioBase)\r
952 );\r
953 }\r
954 } else {\r
955 DEBUG ((EFI_D_WARN, "WARNING: Ioh MAC [B:%d, D:%d, F:%d] NO HW ADDR CONFIGURED!!!\n",\r
956 (UINTN) IOH_MAC1_BUS_NUMBER,\r
957 (UINTN) IOH_MAC1_DEVICE_NUMBER,\r
958 (UINTN) IOH_MAC1_FUNCTION_NUMBER\r
959 ));\r
960 }\r
961}\r
962\r