]> git.proxmox.com Git - mirror_edk2.git/blob - QuarkPlatformPkg/Platform/Dxe/Setup/SetupPlatform.c
7e36fdfcef04bd7bd1d158caf983895feb530d90
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / Setup / SetupPlatform.c
1 /** @file
2 Platform Initialization Driver.
3
4 Copyright (c) 2013-2015 Intel Corporation.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #include "CommonHeader.h"
11
12 #include "SetupPlatform.h"
13 #include <Library/HobLib.h>
14
15 EFI_HANDLE mImageHandle = NULL;
16
17 EFI_HII_DATABASE_PROTOCOL *mHiiDataBase = NULL;
18 EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL;
19
20 UINT8 mSmbusRsvdAddresses[PLATFORM_NUM_SMBUS_RSVD_ADDRESSES] = {
21 SMBUS_ADDR_CH_A_1,
22 SMBUS_ADDR_CK505,
23 SMBUS_ADDR_THERMAL_SENSOR1,
24 SMBUS_ADDR_THERMAL_SENSOR2
25 };
26
27 EFI_PLATFORM_POLICY_PROTOCOL mPlatformPolicyData = {
28 PLATFORM_NUM_SMBUS_RSVD_ADDRESSES,
29 mSmbusRsvdAddresses
30 };
31
32 EFI_STATUS
33 DxePlatformDriverEntry (
34 IN EFI_HANDLE ImageHandle,
35 IN EFI_SYSTEM_TABLE *SystemTable
36 )
37 /*++
38
39 Routine Description:
40 This is the standard EFI driver point for the D845GRgPlatform Driver. This
41 driver is responsible for setting up any platform specific policy or
42 initialization information.
43
44 Arguments:
45 ImageHandle - Handle for the image of this driver
46 SystemTable - Pointer to the EFI System Table
47
48 Returns:
49 EFI_SUCCESS - Policy decisions set
50
51 --*/
52 {
53 EFI_STATUS Status;
54 EFI_HANDLE Handle;
55
56 S3BootScriptSaveInformationAsciiString (
57 "SetupDxeEntryBegin"
58 );
59
60 mImageHandle = ImageHandle;
61
62 Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID**)&mHiiDataBase);
63 ASSERT_EFI_ERROR (Status);
64
65 Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID**)&mHiiConfigRouting);
66 ASSERT_EFI_ERROR (Status);
67
68 //
69 // Initialize keyboard layout
70 //
71 Status = InitKeyboardLayout ();
72
73 //
74 // Initialize ICH registers
75 //
76 PlatformInitQNCRegs();
77
78 ProducePlatformCpuData ();
79
80 //
81 // Install protocol to to allow access to this Policy.
82 //
83 Handle = NULL;
84 Status = gBS->InstallMultipleProtocolInterfaces (
85 &Handle,
86 &gEfiPlatformPolicyProtocolGuid, &mPlatformPolicyData,
87 NULL
88 );
89 ASSERT_EFI_ERROR(Status);
90
91 S3BootScriptSaveInformationAsciiString (
92 "SetupDxeEntryEnd"
93 );
94
95 return EFI_SUCCESS;
96 }
97