1 /** @file
2   This file include all platform action which can be customized by IBV/OEM.
3 
4 Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #include "BdsPlatform.h"
16 
17 //
18 // BDS Platform Functions
19 //
20 /**
21   Platform Bds init. Include the platform firmware vendor, revision
22   and so crc check.
23 
24 **/
25 VOID
26 EFIAPI
PlatformBdsInit(VOID)27 PlatformBdsInit (
28   VOID
29   )
30 {
31 }
32 
33 /**
34   Connect the predefined platform default console device. Always try to find
35   and enable the vga device if have.
36 
37   @param PlatformConsole          Predefined platform default console device array.
38 
39   @retval EFI_SUCCESS             Success connect at least one ConIn and ConOut
40                                   device, there must have one ConOut device is
41                                   active vga device.
42   @return Return the status of BdsLibConnectAllDefaultConsoles ()
43 
44 **/
45 EFI_STATUS
PlatformBdsConnectConsole(IN BDS_CONSOLE_CONNECT_ENTRY * PlatformConsole)46 PlatformBdsConnectConsole (
47   IN BDS_CONSOLE_CONNECT_ENTRY   *PlatformConsole
48   )
49 {
50   return EFI_SUCCESS;
51 }
52 
53 /**
54   Connect with predefined platform connect sequence,
55   the OEM/IBV can customize with their own connect sequence.
56 **/
57 VOID
PlatformBdsConnectSequence(VOID)58 PlatformBdsConnectSequence (
59   VOID
60   )
61 {
62 }
63 
64 /**
65   Load the predefined driver option, OEM/IBV can customize this
66   to load their own drivers
67 
68   @param BdsDriverLists  - The header of the driver option link list.
69 
70 **/
71 VOID
PlatformBdsGetDriverOption(IN OUT LIST_ENTRY * BdsDriverLists)72 PlatformBdsGetDriverOption (
73   IN OUT LIST_ENTRY              *BdsDriverLists
74   )
75 {
76 }
77 
78 /**
79   Perform the platform diagnostic, such like test memory. OEM/IBV also
80   can customize this function to support specific platform diagnostic.
81 
82   @param MemoryTestLevel  The memory test intensive level
83   @param QuietBoot        Indicate if need to enable the quiet boot
84   @param BaseMemoryTest   A pointer to BdsMemoryTest()
85 
86 **/
87 VOID
PlatformBdsDiagnostics(IN EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel,IN BOOLEAN QuietBoot,IN BASEM_MEMORY_TEST BaseMemoryTest)88 PlatformBdsDiagnostics (
89   IN EXTENDMEM_COVERAGE_LEVEL    MemoryTestLevel,
90   IN BOOLEAN                     QuietBoot,
91   IN BASEM_MEMORY_TEST           BaseMemoryTest
92   )
93 {
94 }
95 
96 /**
97   The function will execute with as the platform policy, current policy
98   is driven by boot mode. IBV/OEM can customize this code for their specific
99   policy action.
100 
101   @param  DriverOptionList        The header of the driver option link list
102   @param  BootOptionList          The header of the boot option link list
103   @param  ProcessCapsules         A pointer to ProcessCapsules()
104   @param  BaseMemoryTest          A pointer to BaseMemoryTest()
105 
106 **/
107 VOID
108 EFIAPI
PlatformBdsPolicyBehavior(IN LIST_ENTRY * DriverOptionList,IN LIST_ENTRY * BootOptionList,IN PROCESS_CAPSULES ProcessCapsules,IN BASEM_MEMORY_TEST BaseMemoryTest)109 PlatformBdsPolicyBehavior (
110   IN LIST_ENTRY                      *DriverOptionList,
111   IN LIST_ENTRY                      *BootOptionList,
112   IN PROCESS_CAPSULES                ProcessCapsules,
113   IN BASEM_MEMORY_TEST               BaseMemoryTest
114   )
115 {
116 }
117 
118 /**
119   Hook point after a boot attempt succeeds. We don't expect a boot option to
120   return, so the UEFI 2.0 specification defines that you will default to an
121   interactive mode and stop processing the BootOrder list in this case. This
122   is also a platform implementation and can be customized by IBV/OEM.
123 
124   @param  Option                  Pointer to Boot Option that succeeded to boot.
125 
126 **/
127 VOID
128 EFIAPI
PlatformBdsBootSuccess(IN BDS_COMMON_OPTION * Option)129 PlatformBdsBootSuccess (
130   IN  BDS_COMMON_OPTION *Option
131   )
132 {
133 }
134 
135 /**
136   Hook point after a boot attempt fails.
137 
138   @param  Option                  Pointer to Boot Option that failed to boot.
139   @param  Status                  Status returned from failed boot.
140   @param  ExitData                Exit data returned from failed boot.
141   @param  ExitDataSize            Exit data size returned from failed boot.
142 
143 **/
144 VOID
145 EFIAPI
PlatformBdsBootFail(IN BDS_COMMON_OPTION * Option,IN EFI_STATUS Status,IN CHAR16 * ExitData,IN UINTN ExitDataSize)146 PlatformBdsBootFail (
147   IN  BDS_COMMON_OPTION  *Option,
148   IN  EFI_STATUS         Status,
149   IN  CHAR16             *ExitData,
150   IN  UINTN              ExitDataSize
151   )
152 {
153 }
154 
155 /**
156   This function locks platform flash that is not allowed to be updated during normal boot path.
157   The flash layout is platform specific.
158 **/
159 VOID
160 EFIAPI
PlatformBdsLockNonUpdatableFlash(VOID)161 PlatformBdsLockNonUpdatableFlash (
162   VOID
163   )
164 {
165   return ;
166 }
167 
168 
169 /**
170   Lock the ConsoleIn device in system table. All key
171   presses will be ignored until the Password is typed in. The only way to
172   disable the password is to type it in to a ConIn device.
173 
174   @param  Password        Password used to lock ConIn device.
175 
176   @retval EFI_SUCCESS     lock the Console In Spliter virtual handle successfully.
177   @retval EFI_UNSUPPORTED Password not found
178 
179 **/
180 EFI_STATUS
181 EFIAPI
LockKeyboards(IN CHAR16 * Password)182 LockKeyboards (
183   IN  CHAR16    *Password
184   )
185 {
186     return EFI_UNSUPPORTED;
187 }
188