• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2 Platform Initialization Driver.
3 
4 Copyright (c) 2013-2015 Intel Corporation.
5 
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution.  The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10 
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 
14 **/
15 
16 #include "CommonHeader.h"
17 
18 #include "SetupPlatform.h"
19 #include <Library/HobLib.h>
20 
21 EFI_HANDLE            mImageHandle = NULL;
22 
23 EFI_HII_DATABASE_PROTOCOL        *mHiiDataBase = NULL;
24 EFI_HII_CONFIG_ROUTING_PROTOCOL  *mHiiConfigRouting = NULL;
25 
26 UINT8                    mSmbusRsvdAddresses[PLATFORM_NUM_SMBUS_RSVD_ADDRESSES] = {
27   SMBUS_ADDR_CH_A_1,
28   SMBUS_ADDR_CK505,
29   SMBUS_ADDR_THERMAL_SENSOR1,
30   SMBUS_ADDR_THERMAL_SENSOR2
31 };
32 
33 EFI_PLATFORM_POLICY_PROTOCOL    mPlatformPolicyData = {
34   PLATFORM_NUM_SMBUS_RSVD_ADDRESSES,
35   mSmbusRsvdAddresses
36 };
37 
38 EFI_STATUS
DxePlatformDriverEntry(IN EFI_HANDLE ImageHandle,IN EFI_SYSTEM_TABLE * SystemTable)39 DxePlatformDriverEntry (
40   IN EFI_HANDLE         ImageHandle,
41   IN EFI_SYSTEM_TABLE   *SystemTable
42   )
43 /*++
44 
45   Routine Description:
46     This is the standard EFI driver point for the D845GRgPlatform Driver. This
47     driver is responsible for setting up any platform specific policy or
48     initialization information.
49 
50   Arguments:
51     ImageHandle     - Handle for the image of this driver
52     SystemTable     - Pointer to the EFI System Table
53 
54   Returns:
55     EFI_SUCCESS     - Policy decisions set
56 
57 --*/
58 {
59   EFI_STATUS                  Status;
60   EFI_HANDLE                  Handle;
61 
62   S3BootScriptSaveInformationAsciiString (
63     "SetupDxeEntryBegin"
64     );
65 
66   mImageHandle = ImageHandle;
67 
68   Status = gBS->LocateProtocol (&gEfiHiiDatabaseProtocolGuid, NULL, (VOID**)&mHiiDataBase);
69   ASSERT_EFI_ERROR (Status);
70 
71   Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID**)&mHiiConfigRouting);
72   ASSERT_EFI_ERROR (Status);
73 
74   //
75   // Initialize keyboard layout
76   //
77   Status = InitKeyboardLayout ();
78 
79   //
80   // Initialize ICH registers
81   //
82   PlatformInitQNCRegs();
83 
84   ProducePlatformCpuData ();
85 
86   //
87   // Install protocol to to allow access to this Policy.
88   //
89   Handle = NULL;
90   Status = gBS->InstallMultipleProtocolInterfaces (
91                   &Handle,
92                   &gEfiPlatformPolicyProtocolGuid, &mPlatformPolicyData,
93                   NULL
94                   );
95   ASSERT_EFI_ERROR(Status);
96 
97   S3BootScriptSaveInformationAsciiString (
98     "SetupDxeEntryEnd"
99     );
100 
101   return EFI_SUCCESS;
102 }
103 
104