24 Commits

Author SHA1 Message Date
James Wang
801d003703 BoardModulePkg/BoardBdsHookLib: Fix F7 overwrites Boot0000
Check if mBootMenuOptionNumber is valid or not before
calling RegisterBootOptionHotkey to avoid overwriting Boot0000

Cc: Eric Dong <eric.dong@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: James Wang <jameswang@ami.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-15 17:04:37 -07:00
Isaac Oram
14c9044506 BoardModulePkg/Include: Add include for stage behavior logic
This is a commonly used set of settings modifications based on
the boot stage targeted.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-08-31 18:43:19 -07:00
Benjamin Doron
4060974356 BoardModulePkg/BoardBdsHookLib: Fix mSetupOptionNumber check
If CreateFvBootOption() fails, RegisterFvBootOption() will return
LoadOptionNumberUnassigned, which is non-zero. Therefore, correct the
check when attempting to register hotkeys, to be able to detect if UiApp
is not present.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2021-08-28 18:31:20 -07:00
Benjamin Doron
b401dfd3a1 BoardModulePkg/BoardBdsHookLib: Register UiApp as boot option
BootManagerMenuApp is the default PcdBootManagerMenuFile. It allows
choosing a boot device, but system configuration is performed in UiApp.
Therefore, un-comment and fix UiApp boot option registration.

The F2 hotkey can be used to enter UiApp.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2021-08-26 17:14:28 -07:00
Dandan Bi
7509310f29 Platform/BoardModulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246

MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.

So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
2021-03-31 14:20:16 +08:00
Liu, Zhiguang
abf4c54b21 Intel/BoardModulePkg: sort load option in the first boot
Currently, load option is only sorted when setup is the first priority in boot
option. However, Below change in UefiBootManagerLib puts setup in the end, which
causes the sort function won't be called.
  MdeModulePkg/UefiBootManagerLib: Put BootMenu at the end of BootOrder
  SHA-1: 7f34681c488aee2563eaa2afcc6a2c8aa7c5b912

This patch will set a NV variable in the first boot, and sort the boot option
in first boot.

Reviewed-by: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>

Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2021-03-11 16:26:24 +08:00
Heng Luo
27ba1e1ab4 BoardModulePkg: Early connect PCI Root Bridge in BoardBdsHookLib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3016

Trigger PCI Bus scanning at BdsBeforeConsoleAfterTrustedConsoleCallback().
Move the call to EnumUsbKeyboard() to after PciEnumComplete.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2020-11-02 16:00:17 +08:00
Prince Agyeman
1a0c76896a BoardModulePkg: Add Generic BoardBootManagerLib
This library implements a generic PlatformBootManagerWaitCallback
and PlatformBootManagerUnableToBoot which will be linked Minplatform's
PlatformBootManager library instance.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2020-04-21 13:17:46 -07:00
Prince Agyeman
b8f3c8ca80 BoardModulePkg: Add BDS Hook DXE Driver
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2336

This is a sample/generic DXE driver that registers
all the BDS hook points or callbacks as defined in
BoardBdsHookLib.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2020-04-21 13:17:46 -07:00
Prince Agyeman
fc83398f00 BoardModulePkg: Add BDS Hook Library
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2336

Added a generic board BDS hook library that implements
BDS hook points as defined in the Minimum platform specification.

This library implements callbacks for the three MinPlatformPkg
BDS event groups, namely gBdsEventBeforeConsoleAfterTrustedConsoleGuid,
gBdsEventBeforeConsoleBeforeEndOfDxeGuid and
gBdsEventAfterConsoleReadyBeforeBootOptionGuid.

This Library also implements callbacks for pre-existing event groups:
gEfiEndOfDxeEventGroupGuid, gEfiPciEnumerationCompleteProtocolGuid,
gEfiDxeSmmReadyToLockProtocolGuid.

These callbacks can be registered to their respective event groups,
through other libraries or DXE drivers

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Co-authored-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2020-04-21 13:17:45 -07:00
Prince Agyeman
093e97308c BoardModulePkg: Fix ECC Coding Style Issues
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2453

Fixed coding style issues as reported by the ECC tool

Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2020-01-29 18:08:17 -08:00
Agyeman, Prince
919d0852a9 BoardModulePkg: Remove unused variable
Removed unused variable 'RegEmptied' in BdsPs2KbcLib.c
to avoid gcc 5 build error unused-but-set-variable.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-11 10:26:56 -08:00
Agyeman, Prince
0984a02a66 BoardModulePkg: Add Ps2 Keyboard Library
Added a generic Ps2 keyboard library
that adds ps2 device path to ConIn and ConInDev
Uefi variables.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-06 18:16:20 -08:00
Agyeman, Prince
eb4e08a20e BoardModulePkg: Added Pcds to Super I/O driver
Included PCDs to the Super I/O DXE driver,
to allow the enable/disable of Ps2 keyboard/mouse,
UART1 and UART2 ports.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-06 18:16:10 -08:00
Agyeman, Prince
a55b2db0fb BoardModulePkg: Add fixed at build Pcds
* Added ps2 keyboard and Uart enable PCDs
* Added PCDs to define IO ports for Uart1 and Uart2

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-06 17:53:14 -08:00
Agyeman, Prince
58ee88cc08 BoardModulePkg: Add Super I/O driver
Added a generic Super I/O driver that produces the
Sio protocol. This driver was moved from the
SimicsOpenBoardPkg.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-06 17:53:07 -08:00
Agyeman, Prince
a9b8efa48f BoardModulePkg: Add gBoardModulePkgTokenSpaceGuid
Added gBoardModulePkgTokenSpaceGuid to BoardModulePkg

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-11-06 17:43:59 -08:00
Agyeman, Prince
2d996ab7ee BoardModulePkg: Add BIOS Info HOB
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2210
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2211

Added gBiosInfoGuid to be used in publishing the BIOS information
HOB which is needed in FIT generation.

Also added the BIOS Info header file BiosInfo.h that defines the
BIOS info struct and GUID.

Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Kubacki Michael A <michael.a.kubacki@intel.com>

Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>
2019-10-18 10:18:01 -07:00
Michael Kubacki
f02b8a62d4 BoardModulePkg/FirmwareBootMediaInfoPei: Add module
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2229

Adds a new module that is responsible for publishing the boot
media device information that will be used in the boot flow for
system initialization decisions dependent upon firmware boot
media.

The module depends on a library class to implement the board-
specific details to get the firmware boot media device. This
allows the module to remain consistent in its responsibility
across implementations and the details to be easily substituted.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2019-10-08 09:20:41 -07:00
Michael Kubacki
30960fb56e BoardModulePkg/FirmwareBootMediaInfoLib: Add library
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2229

Introduces a new library class FirmwareBootMediaInfoLib that is
used to report the firmware boot media device. A default library
instance is provided that always returns the firmware boot media
is SPI flash. For platforms with other firmware boot media
options, a board-specific instance of this library should be
used instead to provide the correct firmware boot media device
information.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Eric Dong <eric .dong@intel.com>
2019-10-08 09:20:10 -07:00
Shenglei Zhang
04d49ec908 BoardModulePkg/CmosAccessLib: Update the end of last line
The original end of last line is '/r'. Now update it to '/r/n'.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
2019-09-24 08:17:45 +08:00
Eric Dong
22d5f49913 Platform/Intel/BoardModulePkg: Add BiosId Module
https://bugzilla.tianocore.org/show_bug.cgi?id=1851

Add Bios ID library used to read BIOS ID related info.

This library exports APIs like below:
GetBiosId
GetBiosVersionDateTime

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Oram Isaac W <isaac.w.oram@intel.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-05-29 14:51:52 +08:00
Eric Dong
ffaa0b2bcd Platform/Intel: Add Cmos related modules to BoardModulePkg
https://bugzilla.tianocore.org/show_bug.cgi?id=1552

Add Cmos related libraries to BoardModulePkg. Totally two
library have been added, one is CmosAccessLib and the other
is PlatformCmosAccessLib. PlatformCmosAccessLib will be used
by CmosAccessLib.

These two libraries provide the generic operations for CMOS
access.

APIs exports by PlatformCmosAccessLib include:
  PlatformCmosGetEntry
  PlatformCmosGetNmiState

APIs exports by CmosAccessLib include:
  CmosRead8
  CmosWrite8
  CmosRead16
  CmosWrite16
  CmosRead32
  CmosWrite32
  CmosInit

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Oram Isaac W <isaac.w.oram@intel.com>
Sign-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
2019-05-29 14:50:08 +08:00
Eric Dong
e5ad5d1b6c Maintainers.txt: Add BoardModulePkg in Platform/Intel/ folder.
Add new package BoardModulePkg which used to keep the modules
which is generic for all board.

Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Oram Isaac W <isaac.w.oram@intel.com>
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-05-29 14:50:08 +08:00