Commit Graph

323 Commits

Author SHA1 Message Date
Maurice Ma 6d79b83d1c Print exact address for Shell memory dump command
If dumping address not aligned at 16 boundary, the current Shell
will print the aligned address in the dump. It makes sense for
a memory block display, but it is a little bit confusing for single
memory address display. This patch fixed this issue by printing the
exact address when the display count is 1.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-12-17 10:08:05 -08:00
Subash Lakkimsetti 71c64f40bd IPP Crypto and Secure boot lib to support multiple hashes
Hash and RSA signing parameters were hardcoded in
Crypto wrappers and secure boot libraries. This patch
address support for multiple hash and key sizes.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-12 08:13:04 -07:00
Maurice Ma df15627dd7 Enable updatable hash store component KEYH
Current SBL hash store has many limitations:
- Only support fixed hash size
- Only support 1:1 public key and usage mapping
- Only support build time key enrollment

This patch addressed this issue by introducing:
- Add a updatable KEYH component to hold extra key hash
- Allow append new hash entries from KEYH
- Use variable length entry for hash
- Introduce "Usage" bit mask for a key usage

This will allow using a single key to sign multiple components, or
using multiple keys to sign a single component. The built-in hash
store will only contain hash for STAGE1B, STAGE2, PAYLOAD,
PAYLOAD_FWU and MASTER public key hash. Master key hash will be used
to verify the KEYH component loaded at runtime in Stage1B. Once KEYH
is loaded, it will be appended into global hash store. The combined
hash store will be used to verify other components on the boot flow.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-12-10 19:19:04 -08:00
Subash Lakkimsetti 929bca6807 SecureBoot: Publickey and Signature data structure updates
This patch implements pubKey and signature updates done
in storage. Added info as sigining types, signing algo,
key sizes which could be used in secureboot and crypto
libraries.

Information from IASImage is transformed to updated
crypto and secure boot implementation. Only RSA2048 and sha256
support is updated as IAS image supports only this combination.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-10 11:42:23 -08:00
Maurice Ma b6724f6b10 Merge some APIs into BootloaderCommonLib
This patch moved some library APIs into BootloaderCommonLib, including
GetComponentInfo() and GetComponentHash().

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-12-10 11:41:57 -08:00
Subash Lakkimsetti 53f088f9d5 Hash Store: Restructuring Hash Store definition
HASH_STORE_TABLE is updated and HASH_STORE_DATA is added
to provide info with variable length sizes. Usage bits would
notify for multiple component/key using the same hash.
These data structure would optimize the hash store size
in storage.

PcdHashStoreSize would define the size of Hash store
to allocate in bios bootup.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-06 15:48:53 -07:00
Subash Lakkimsetti 27257925d6 TpmLib: added TpmExtendHash to extend hash provided
Component Hash is passed with TpmExtendHash if available.
Hash Store is getting optimized on storage and this would avoid
setting component hash in hash table. SetComponent Hash API is
removed in bootloaderlib.

Added HashAlg param to TpmExtendHash for future purposes
where TPM PCR bank would be selected based on HashAlg.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-06 15:48:53 -07:00
Aiden Park 66b9a5191d Preserve ebx register in AsmEnableAvx()
System reset occurs after returning from AsmEnableAvx() in Stage1A.c
because ebx register is used for cpuid, but not restored.
- Save/Restore ebx register
- Move AsmEnableAvx () after init idt and serialport

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-05 11:41:00 -08:00
Aiden Park 72262b4722
Misc Klocwork scanning fixes (#484)
This patch fixes klocwork scanning reports in qemu, apl and cfl builds.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-04 15:17:04 -08:00
Maurice Ma b693d9776e [QEMU] Fix QEMU boot issue with new IPP library change
The previoius IPP library updates used UpdateSHA256V8 as default for
SHA256. It works on real platform. However, QEMU's default CPU config
does not support SSE3 instructions and will generate exception. This
patch added the UpdateSHA256Compact as default SHA256 function if no
advanced optimization flags are set. The same is applied for SHA512
functions too.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-12-04 11:20:11 -08:00
Subash Lakkimsetti a3fa16511c Add support for AVX and SSE4 optimizations in IPP SHA384
AVX(G9) and SSE4(W7) is added to IPP crypto lib.
PcdCryptoShaOptEnabled is added to enable optimzations
in IPP SHA256 and SHA384.

Default is set to V8 (SSE3) for SHA256. ENABLE_CRYPTO_SHA_OPT has to
be configured in Platform board config files for optimizations
to be enabled.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-03 21:36:29 -08:00
Maurice Ma 8a0a8984f9 Enable CPU AVX support if available
EnableAvx ASM is included as part ExtraLibs.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-12-03 21:36:29 -08:00
Aiden Park b24fd2759c Cosmetic: Convert LF to CRLF
This will fully support PatchCheck.py.
- Remove all trailing whitespace
- Convert LF to CRLF by default
- Update EFI_D_* to DEBUG_*
- Re-enable CRLF check in PatchCheck.py

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-12-02 16:21:19 -08:00
Maurice Ma 9c50d23a12 Add FSP API reset request handling
Current SBL does not check the FSP Notify API return status. As a
result, if reset is requested, it is ignored by SBL. This patch
added FSP reset request check for FspMemoryInit, FspSiliconInit and
FspNotifyPhase.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-25 09:22:52 -08:00
Aiden Park d362ef39ec Cosmetic: Remove TAB characters (Tab to Space)
No code change. To check TABs in PatchCheck.py.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-21 12:11:37 -08:00
Aiden Park ae9068e80c
Fix no SBL serial output after restart Windows (#459)
SerialPortLib sets UART Scratch Register to a known value at the first
initialization to avoid unnecessary re-initialization afterward. But,
one of Windows driver(SIO) re-configures UART Registers while the Scratch
Register is preserved. As a result, SBL skips serial port initialization
after restarting from Windows.
Therefore, force to initialize Serial Port at Stage1A all the time simply.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-18 19:14:44 -08:00
Aiden Park d2ea80b5c9
Add InsertionSort for Linked List (#454)
This provides basic insertion sort API for Linked List. As part of change,
this insertion sort is used for PCI BAR calculation by its alignment
and for shell commands list by its name.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-14 11:26:31 -08:00
Aiden Park 141d051b8f
OsLoader: Free all allocated memory at failing on a boot option (#453)
While trying to boot all boot options, some allocated memory are not
de-allocated properly. To avoid memory leak while booting next boot
options, OsLoader will track all image data and free the unnecessary
memory at failing to boot current boot option.

Tested and verified with
- Traditional linux image on debug build
- IAS type image
- Container type image
- MultiBoot image
- BootSlot (A/B Boot)
- Trusty image

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-13 09:50:01 -08:00
Aiden Park a340937fbb
Fix invalid addendum update in OsBootOption (#452)
OsBootOption config data provides addendum field to support multiple boot
option config data into a single boot option.
This patch updates a single boot option properly with multiple addendums.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-13 09:49:37 -08:00
Subash Lakkimsetti ae3c5ae9b5 Add SHA384 and SM3 wrapper library support from IPP crypto
Functionality to Crypto Hash function is guarded with an
PcdIppHashLibSupportedMask.

PcdIppHashLibSupportedMask indicates IPP crypto algo supported

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-11-12 09:58:54 +08:00
Maurice Ma 659ede1ff0 Add SortLib support in BootloaderCommonPkg
There are multiple instances of sorting use case in SBL. For example,
memory map sorting and CPU APIC ID sorting. This patch added a generic
quick sort library to provide common sort API. As part of the change,
the quick sort API will be used for memory map and CPU APIC ID sorting.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-12 09:55:00 +08:00
lsubash 792c4ded20 Initial port IPP SHA384 and SM3 algorithms to SlimBootloader (#420)
SHA512_384 and SM3 crypto functions were referenced from
https://github.com/intel/ipp-crypto.git

Selectively taken Ipp Hash methods

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-11-06 13:34:07 -08:00
Aiden Park fd5c402b3b
ShellLib: 'help' lists Shell commands sorted by name (#434)
This lists the supported Shell commands in alphabetical order.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-05 15:48:06 -08:00
Maurice Ma dcc63aba07 Klocwork scanning fixes for SBL common code
This patches fixed Klocwork scanning reports in SBL common code.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-04 21:51:05 +08:00
Aiden Park 40754d582e
CmdFs: Support display console print in 'fs ls' (#428)
This allows 'fs ls' command to print directory or file lists to both serial
and display console according to CONSOLE_OUT_DEVICE_MASK.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-03 21:44:58 -08:00
Kok Tong Ong 442a3efccc uart buffer flush during reboot in osloader 2019-11-02 22:28:41 +08:00
Maurice Ma 1420677fbd Klocwork scanning fixes for IppCryptoLib
This patches fixed Klocwork scanning reports in IppCryptoLib.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-02 06:22:17 +08:00
Maurice Ma e0a19d2814 Additional Klocwork scanning fixes in BootloaderCommonPkg
This patches fixed additional Klocwork scanning reports in
BootloaderCommonPkg.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-02 04:22:43 +08:00
Maurice Ma 0087546e83 Misc Klocwork scanning fixes in BootloaderCommonPkg
This patches fixed several Klocwork scanning reports in
BootloaderCommonPkg.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-01 23:37:43 +08:00
Aiden Park f6a5597397 'fs ls' aligns a filename with 16 chars fixed size
This patch will print a filename with 16 chars aligned size.
- left justified filename with padding up to 16 chars
- length of filename > 16 chars, full filename is printed as it is

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-30 17:13:08 -07:00
Aiden Park 4bc6dd2f02 [ExtLib] Update coding convention in function definition
This patch updates function/APIs definition and comment syntax
with EDK coding convention.
- No functional changes
- Remove unused funtions

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-30 17:13:08 -07:00
Aiden Park 9c3b81a64d Add FS (File System) shell command
This 'fs' shell command can be used for basic file system check.

Usage: fs init [device no.] [hwpart no.] [swpart no.]
       fs close
       fs info
       fs ls [dir or file path]

- 'device no.' is from Platform Device Table.
- all 0s by default if 'fs init' has no parameters
- root dir by default if 'fs ls' has no dir or file path

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-30 17:13:08 -07:00
Maurice Ma 9117f44534 Add PCI configuration space dump with PCI command
"MM" SBL Shell command can be used to dump PCI configuration space
registers. On the other side, "PCI" command can be used to list all
PCI devices. This patch enhanced "PCI" command to support PCI
configuration space dump by redirecting it to "MM" command internally.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-30 02:37:19 +08:00
James Gutbub 63ba5a4912 Update mm command and remove io command
The 'mm' (formely 'mem') command is being
updated to handle PCI device formatted
addresses and also to support IO device
interfacing. Removing the 'io' command too
since it has been intergrated into the 'mm'
command.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-28 12:25:40 -07:00
James Gutbub 4d7a8b58cf Remove global variable in boot cmd
The 'boot' command is making use of a global
variable declared in the OS Loader but it might
not always be available if the Shell lib is
used with other code. This patch removes the
dependency on the global variable.

Also fixes a small issue with not providing a
value at the prompt; instead prompt the user
with a error message when no valid value has
been provided.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-24 09:19:21 -07:00
Maurice Ma d74c294506 Add USB arrow key support
Since SBL shell added support for command line history. It is required
to support it from USB keyboard console as well. This patch added USB
keyboard arrow key handling to convert arrow key scan code into ANSI
escape sequence so that Shell can recognize the arrow key from keyboard.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-23 05:44:48 +08:00
Maurice Ma 03b466e8db Add Shell command line history support (#401)
This patch added command line history upport in SBL Shell. It makes
it easy to run a previous command using Up/Down arrow key.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-17 11:12:55 -07:00
James Gutbub 3f3d48ba24 Remove boot option reset from boot cmd
The 'boot' command is resetting the current
boot option to be option zero any time the
command is invoked which conflicts with the
'c' command which allows a user to select the
next boot option that should be tried. Remove
the resetting to resolve the issue when doing
'c' sub-command in the 'boot' command.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-16 15:08:25 -07:00
James Gutbub 74d9af1e68 Add change current boot option to boot cmd
The 'boot' command has been updated to add
an option to update the current boot option
to be booted next, e.g. mCurrentBoot. To
change the current boot option just need to
run 'boot' and then select 'c' and the
index to change the current boot option to.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-15 19:42:16 -07:00
Maurice Ma 76e03f7d32 Add Shell CLS command to clear screen
This patch added "CLS" command support to SBL Shell. It can be used
to clear the console screen.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-15 15:50:06 -07:00
Maurice Ma f6f42702bc Implement clear screen for GFX console
Current GFX console provides no function to clear the screen. This
patch added this support using the standard ANSI escape sequence
in print string.
2019-10-15 15:50:06 -07:00
James Gutbub 7ebc3279c5 Provide default values to boot command
The OS Loader 'boot' shell command does
not allow a user to skip data entry for
a given input field which can be tedious.
To make it easier allow users to press
enter to re-use the current value for
the boot option being modified to skip
to the options that they actually want
to update.

Also remove the '-a' option, no one will
typically re-enter all of the boot options.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-15 15:35:06 -07:00
Maurice Ma 14ddaab0a7 Allow platform to degrade eMMC from HS400 to HS200
This patch allows platform to degrade eMMC HS400 to HS200 using
static configuration. To do this, please add the following into
BoardConfig.py:
  self.ENABLE_EMMC_HS400 = 0
This is useful when platform has hardware issue to run at eMMC
HS400 mode.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-15 08:23:31 -07:00
Maurice Ma b0d5ef094c Add device deinit support
This patch added basic deinit support in the media DevInit() interface.
It uses a special DevDeinit phase to inform the media driver to do
device de-initialization. This de-initialization flow will be called
before OsLoader restarting and OS booting.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-14 10:10:11 -07:00
Maurice Ma 161271723b Adjust USB KB polling rate
When USB keybaord input console is enabled, current code will keep
sending interrupt transfers to poll the USB keyboard state. However,
according to USB spec, it needs to be polled at certain interval
returned by the device. If the polling rate is too high, sometime,
host will fail to schedule the SPLIT transfer. This patch adjusted
the polling rate to the required interval.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-14 10:06:07 -07:00
Maurice Ma d23d7e07f8 Fix AHCI memory de-allocation issue
This patch fixed the pointer check before de-allocating memory
previously allocated for AHCI controller.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-12 19:57:40 -07:00
James Gutbub 2a28a0d3df Clean up EXT library
The EXT library has some unused code that
we can remove to help reduce the size and
to clean things up some more. Also add a
routine for dumping the group descriptor
table which can be helpful for debugging
issues.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-09 11:56:09 -07:00
James Gutbub 5ca06f0d92 Support 64bit EXT FS & non-512 block sizes
EXT2/3 library has some limiatation to support
hardware block sizes larger than 512 (e.g. 4KB)
and also does not currently support the flag
INCOMPAT_64BIT which indicates larger group
descriptor sizes. This patch adds flexibility
to support 512 and 4KB block sizes as well as
64bit EXT file systems.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-10-08 17:23:59 -07:00
Aiden Park dce1bc359b
Remove Unnecessary SpiFlashLib from BootloaderCommonPkg (#357)
SpiFlashLib has been moved to Silicon/CommonSocPkg.
Remove unnecessary old SpiFlashLib

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-08 09:29:13 -07:00
Maurice Ma 3cdd48750d Use SerialPortLib in BootloaderCommonPkg
This patch switched to use SerialPortLib in BootloaderCommonPkg for
QEMU and CFL platforms.  For APL platform, it can also use this common
library. However, it has an optimized SerialPortLib with FIFO enabled.
So for APL, it still uses its SOC specific library.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-07 20:39:28 -07:00
Maurice Ma 01e302129d Re-implement common SerialPortLib
The common SerialPortLib in BootloaderCommonPkg is not used by anybody.
This patch re-implemented this library to align with the SOC specific
implementation. The intention is to use this common library to replace
SOC specific implementation.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-07 20:39:28 -07:00
Maurice Ma 328c862595 Add common interface for GetTimeStampFrequency
This patch added common API interface for GetTimeStampFrequency.
Since all current IA platforms have standard way to get the TSC
frequency, it is better to move it into common lib.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-07 16:08:33 -07:00
Maurice Ma 347cd9e952 Fix debug message output issue
The latest code has debug message output issue. It is caused by
the following CommitId: 56867c3bc6.
This patch provided proper fixes for this issue. The root cause
is due to incorrect string length.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-06 09:52:48 -07:00
Maurice Ma 3422b34208 Implement USB deinitialization flow
USB sub-system will have host controller scheduling frames on its
own once it is initialized and enabled. Leaving it running while
payload restarting or OS booting could potentially cause memory
corruption since the DMA might still be running on the background
targeting to previously allocated memory. The safer approach is
to stop the USB controller.

It also fixed #351.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 19:55:25 -07:00
Maurice Ma 7b2ca97b97 Rename UsbIoLib to UsbInitLib
This patch renamed UsbIoLib to UsbInitLib to better match its
actual functionality.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 19:55:25 -07:00
Maurice Ma 56867c3bc6 Fix double debug message output on serial port
SBL allows debug message to be redirected to output console besides
the serial port. However, serial port itself could be part of the
output console device as well. In this case the debug message will
be printed twice. This patch added check to this condition and skip
the redundant print.

It fixed #349.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 17:18:38 -07:00
Maurice Ma 5ec7be2c5d Enhance USB keyboard input experience
Current SBL USB keyboard driver cannot handle the key input nicely.
If typing is too fast, some chars will be missing. On the other side,
sometimes singe key press will generate multiple repeated chars.
This patch reimplemented the logic to detect key press/release using
similar flow as EDK2 UsbDxe driver. With this logic, USB keyboard
worked pretty well. It has been tested on APL platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 17:18:06 -07:00
Maurice Ma 88aa68ac1d Skip IAS image verification if VERIFIED_BOOT is disabled
Current SBL code will assert if HAVE_VERIFIED_BOOT is 0. This patch
added check for PcdVerifiedBootEnabled to decide if IAS verification
is required.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 17:17:43 -07:00
Sai Talamudupula 709d7c1470 Support boot image from container
Add support to load the boot image from container.
Container must be signed using the same private key
as the key used to sign IAS (i.e. IAS_PRIVATE_KEY).

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-10-02 12:18:45 -07:00
Aiden Park 12b4201543 Fix a compile error with gcc-4.8
gcc-4.8 reports an error - 'Count' may be used uninitialized

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-09-29 22:26:22 -07:00
Aiden Park b17c6c29b1 Fix compile errors when disabling compile optimization
- 'OpenFile may be used uninitialized' in ExtLib
- 'undefined reference to memcpy' in FatLib
- 'Lasa/Laml may be used uninitialized' in TpmLib
- 'Adjust may be used uninitialized' in Stage2Support

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-09-29 22:26:22 -07:00
Sai Talamudupula 1a7287881b Update ContainerLib
Add GetNextAvailableComponent() and authenticate the
components after registering them in CONTAINER_LIST.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-09-27 14:13:01 -07:00
Maurice Ma d2bd63df12 Allocate page aligned memory for component loading in container (#326)
To assist source level debug, it is better to always load PE/TE images
at page aligned memory address so that the script can locate the image
much easier. This patch changed the AllocatePool to AllocatePages for
component loading inside a container.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-09-23 09:19:27 -07:00
Maurice Ma 866493b926 Fix klocwork scanning issues in BootloaderCommonPkg
Fixed several issues reported by klockwork scanning.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-28 09:33:45 -07:00
Sai Talamudupula 9af34bca9a Remove Core pkg references from Common pkg
By design, BootloaderCommonPkg should not refer to
BootloaderCorePkg. Hence removed those references in
the .inf files in Common pkg.

Moving SmbiosInitLib to Core pkg as it is a core feature.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-08-22 06:26:18 -07:00
Sai Talamudupula f0b5eaf43a Add UEFI Get Variable support
Users might want to have some parameters that can be set
from UEFI environment. UEFI NVRAM variables provide a way
to achieve this functionality. And they require these vars
to be read from bootloader.

This patch provides a library to get read access to the
UEFI variables stored in NV region. The driver was ported
from MdeModulePkg\Universal\Variable\Pei @ EDKII Open Source.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-08-16 07:25:20 -07:00
James Gutbub b0e390f1d3 Fix ContainerLib flash bug
There is a small bug in the ContainerLib
where the check for whether the data is
stored in the flash needs to be adjusted.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-08-15 14:03:46 -07:00
Maurice Ma 19a0890a54 Break Load Linux BzImage into more functions
This patch splitted LoadBzImage() into two functions.  One is just
for kernel loading.  The other one UpdateLinuxBootParams() is for
Linux boot parameter updates. It is required to do so because when
kernel loading in Stage2 is enabled the loading occurs before all
HOBs are finalized. The Linux boot parameters depend on HOBs to fill
correct information, such as frame buffer. With this patch, the boot
parameters can be updated at the very end.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-12 10:40:11 -07:00
Maurice Ma de675ac5af Fix Linux framebuffer boot parameters
Current SBL code depends on PixelInformation to fill kernel
framebuffer parameters. However, this info is only valid if
PixelFormat is PixelBitMask type. Since FSP will only produce
8bit per pixel format, it is better to use PixelFormat to
determine the pixel bit size and position information. This
patch added this logic. It also fixed #260 .

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-12 08:33:42 -07:00
Maurice Ma 4a5af4f8b0 Add Linux Kernel Boot Support in Stage2
OsLoader has the capability to boot a Linux kernel. However, to support
LinuxBoot type of payload, it is required to load kernel in Stage2. This
patch abstracts the standard Linux loading logic into common LinuxLib
class so that it can be linked in Stage2 or Payload such as OsLoader.
A new PcdLinuxPayloadEnabled is introduced to control if this feature
should be enabled or not.

To boot a Linux kernel from Stage2, it is required to put the command
line file and kernel image into the EPAYLOAD container during the build.
And the PayloadId CFGDATA needs to be set to 'LINX'.
For example:
  python BuildLoader.py build qemu
         -p OsLoader.efi::Lz4;vmlinuz:LINX:Dummy;cmdline.txt:CMDL:Dummy
vmlinuz and cmdkube.txt need to be copied to PayloadPkg/PayloadBins
folder. If kernel size cannot fit into EPAYLOAD, EPAYLOAD_SIZE in
BoardConfig.py needs to be adjusted accordingly.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-09 16:48:12 -07:00
Maurice Ma bc8a817e59 Reinitialize Shell command list
Since OsLoader will restart from beginning and all memory will be
reclaimed, it is required for Shell library to re-initialize the
global varaibles, for example, command list. Otherwise, the old
memory pointer will be used and cause issues. This patch added the
link list re-initialization in Shell lib.  It fixed #253.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-07 13:37:05 -07:00
Aiden Park 5103615bfb [ShellLib] Add ShellCommandRegister API
Currently, all shell commands are statically defined in header file.
Add shell command registration API to allow include/exclude shell
commands dynamically.
Later, some debug shell commands will be added according to build
mode or debug mask.
- TBD: Sorting shell commands by name

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-08-05 21:04:27 -07:00
Aiden Park 13bd3d2d26 [Ext23Lib] Fix EXT filesystem booting failure
Currently, Ext23Lib accesses device index 0 only.
It must access proper hardware partition when reading blocks.
- Reproducible with QEMU which has SATA port 5

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-08-02 08:45:07 -07:00
Maurice Ma ef682b19c3 Switch to use container for EPAYLOAD
This patch enabled container use case for EPAYLOAD loading.
It also switched to use LoadComponent() API for Stage2 and
payload loading. It simplified the code flow. An example in
QEMU was added to demonstrate on how to add a container in
build and load it in Stage2 code.

To define a container layout, it is required to provide
GetContainerList() in BoardConfig.py. Then in stage or payload
code, LoadComponent() can be used to load a component from the
container.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-01 15:58:25 -07:00
Maurice Ma 93b2e96d8e Add ContainerLib to support sub-region
This patch added a ContainerLib to support load and location a
component from a specified container. It copies the component
from flash to memory, authenticate it, and then decompress it if
required. It can also be used to support load component from flash
map in SBL stage2 or payload, such as payload or e-payload.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-07-31 09:32:00 -07:00
Markus Schuetterle c1117a2be5 Add support for ELF type: Shared object file
SBL only support ELF type: EXEC (Executable file)
This changes also allow loading ELF type: DYN (Shared object file)

This is required to boot recent ACRN Hypervisor.

Signed-off-by: Markus Schuetterle <markus.schuetterle@intel.com>
2019-07-31 07:56:15 -07:00
Maurice Ma 626a8db20e Add temporary memory management for MemoryAllocationLib
There are cases where temporary memory is required in stages. Since
MemoryAllocationLib instance for stages has no de-allocation function,
it needs special handling. This patch added temporary memory management
into standard MemoryAllocatoinLib interface.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-07-29 14:44:02 -07:00
James Gutbub bc8f743c53 Add EXT2F_INCOMPAT_RECOVER to EXT2F_INCOMPAT_SUPP
Currently there is some limitation with mounting an
EXT4 partition to retrieve a file for booting when
the partition was not properly umounted during the
previous usage (ex. powering off an OS without
using 'poweroff' command, unplugging power, etc.).

There is no recovery support in the Ext23Lib but
as a temporary solution we can ignore the recovery
bit to avoid boot issues when the recovery bit is
flipped due to unexpected power loss.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-07-22 18:34:05 -07:00
Guo Dong a30d2ea913 Enhance SPI Flash Library
1. Add region type FlashRegionAll support
2. Add Hardware sequence check

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-07-18 13:25:01 -07:00
Sai Talamudupula 10fa1fe72a Handle empty and NULL strings in Smbios types
If the platform provides an empty or a NULL string,
Smbios type might end abruptly and the Types are
reported incorrectly.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-06-26 17:13:48 -07:00
James Gutbub c9f5d2e35f Fix EXT4 extent calculations
When determining which extent node to fetch
the filesystem block address from for a file's
data we should count from block 0 of the file
and when we enter into a non-zero extent node
we need to subtract the starting block number
from the file block number we are looking for
so that we don't skip over any blocks.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-06-17 17:04:52 -07:00
Aiden Park 0066eccdb3
Re-implement ElfLib for ELF32 format image (#193)
The previous implementation has a little confusion in license header.
To avoid further annoying, simply re-implement ElfLib.
- 32bits, little-endian, executable elf only supported
- elf32.h/elf_common.h from BaseTools/Source/C/GenFw
- LoadElfImage() interface changed

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-06-17 16:58:08 -07:00
James Gutbub e702622fee Add support for EXT4 partition reading
The current EXT2/3 library does not support EXT4 partition
reading namely due to a limitation with handling extents
instead of block maps within an I_node's I_block data.

There is a todo currently to support 48-bit logical block
addressing, the code currently does not support reading
larger than 32-bit addresses; throw an ASSERT if upper
16-bits are non-zero.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-06-17 12:08:07 -07:00
Maurice Ma 4061d47f30 Add call to board notifications by default
Current SBL does not call board ReadyToBoot & EndOfFirmware phases
in Stage on normal boot flow. Current open source UEFI payload does not
do it either. It caused some security concerns. The patch enforced
these notification calls on normal boot flow in SBL for all payloads
except for those that can handle board and FSP notification on its own.

It fixed #191.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-06-14 16:18:41 -07:00
Maurice Ma 896937483c [WHL] Fix boot performance issue for BP1
On WHL, if using Boot Guard profile 0, booting from BP1 will be
significantly slower than BP0. It is because some code region in BP1
is not covered by MTRR cache settings. This patch adjusted MTRR
settings during PostTempRamInit notification to cover full flash
code region if Boot Guard profile 0 is used.

It fixed #188.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-06-13 15:02:36 -07:00
Guo Dong 5e10bd1e07 Update BSD license to BSD+Patent license
To align with EDK2, update file license
to use BSD+Patent license

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-06-13 10:46:49 -07:00
Maurice Ma 179130751f Fix FAT file path matching issue
In current FAT lib, the file path matching code will just compare
the 1st N chars and ignored the remaining. The end of the string
should be checked to ensure exact matching. As part of this fix,
the GRUB config parsing library needs to be updated since the file
name length field is one less than expected.

It fixed #183.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-06-12 10:59:31 -07:00
Maurice Ma 6f8c44b375 Sync up with EDK2 stable tag edk2-stable201905
Synced up MdePkg, IntelFsp2Pkg and BaseTools to EDK2 stable tag
edk2-stable201905.

There are several changes for MdePkg and BaseTools.
MdePkg:
 - Support light print to reduce SBL size
   MdePkg\Library\BasePrintLib\PrintLibInternal.c
   MdePkg\Include\Library\DebugLib.h
 - TCG TPM2 spec changes and remove dependencies
   MdePkg\Include\IndustryStandard\UefiTcgPlatform.h
   MdePkg\Include\IndustryStandard\Tpm2Acpi.h
 - Use old NVM protocol file
   MdePkg\Include\Protocol\NvmExpressPassthru.h
 - Removed unused files

BaseTools:
 - Added LZ4 support
 - Removed unused files

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-06-12 08:29:06 -07:00
Guo Dong b9ad47848a Move SpiFlashLib into bootloader common package
Cleaned up SpiFlashLib in APL platform, and move it into
BootloaderCommonPkg, so that other platform could reuse
this SpiFlashLib

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-06-06 14:28:31 -07:00
James Gutbub 90b155b3e3 Enable EXT2/3 sub-directory filepath image loading
Currently when providing a filepath with sub-directories
the EXT2/3 library is not able to locate the file. The
code for traversing sub-directories is already present
but was not enabled. This change enables this support.
Ex: 'boot/iasimage.bin'

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-06-04 11:41:41 -07:00
Aiden Park 497e66eadb [FileSystemLib] Added generic filesystem/file access APIs
FileSystemLib provides generic interfaces to access file system and
its files as a abstraction of FatLib/ExtLib.

- Added CloseFileSystem
  If there are opened files in a specific filesystem, those files
  will be de-allocated in CloseFileSystem.
- Added OpenFile/GetFileSize/ReadFile/CloseFile
  The ReadFile() does not allocate any memory for the file content.
  The caller of OpenFile() MUST allocate necessary memory before
  calling ReadFile().

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-05-23 15:53:03 -07:00
Aiden Park 51b69d447b
[PartitionLib] Added ClosePartitions to clean-up partition data (#167)
The FindPartitions() allocates memory for PART_BLOCK_DEVICE instance.
This allocated memory needs to be de-allocated if no more necessary
to avoid memory leak.

TBD: Current partition info needs to be cleared before going to next
boot option.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-05-22 09:03:41 -07:00
Aiden Park 592915c7e7
[MmcAccessLib] Fix SD card single block read failure (#165)
- CMD23(SET_BLOCK_COUNT) is for only MMC.
- CMD17(READ_SINGLE_BLOCK) must be used when reading a single block
  with SD card

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-05-20 09:48:32 -07:00
James Gutbub e75dd48e83 Enhance BMP image splashing
Current implementation of splashing a BMP image to the
display requires the allocation of a temporary buffer
to store the BMP image into a GOP Blt friendly format
that can then be used to splash the image to the display.
Instead of using a buffer for the whole image we can
allocate a smaller buffer to splash one line at a time
since splashing is already performed one line at a time.

Also fix a small print message regarding frame buffer
format.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-05-13 15:55:55 -07:00
Sai Talamudupula 0522b833df Add Smbios support
Initial Smbios support infrastructure

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-04-30 15:22:05 -07:00
Maurice Ma 0d8fad8bbc Allow SATA boot option to boot from any AHCI port
For SATA boot option, the hardware partition is mapped into AHCI
port. Current implementation requires a specific AHCI port in order
to boot from that hard drive. This patch added support to boot
from the first detected AHCI port when the hardware partition is
set to 0xFF.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-04-19 10:43:10 -07:00
Maurice Ma 3dfcd913eb Fix incorrect image base for TE image
TE image has stripped header to reduce the image size. When calculating
the preferred base for TE image, the gap should be added back in order
to match the actual TE image base. This patch fixed #133.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-04-12 10:44:02 -07:00
Maurice Ma 0980e74c12 Remove IPP 7z file from BootloaderCommonPkg
This patch removed the IPP 7z file from the BootloaderCommonPkg.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-04-10 10:26:59 -07:00
Guo Dong 5c041c0fe1 Clean up graphics HOBs
Removing the HOB defined by SBL to use generic HOBs from EDK2.
Update GraphicsLib for above HOB change.
Update osloader and multibootLib for hob change.
update APL and Qemu platform for hob change.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-04-10 10:23:58 -07:00
Maurice Ma f6c1b690c2 Disable deprecated EDKII API interfaces
This patch enabled DISABLE_NEW_DEPRECATED_INTERFACES build option by
default so that the deprecated APIs cannot be used in SBL source tree.
It is to enhance the coding for security.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-14 11:26:03 -07:00
Subash Lakkimsetti db58e2358b Log startup locality only when Boot Guard is not enabled
When Boot guard is enabled, Locality event would be
logged from Boot guard library.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-03-13 08:34:15 -07:00
Maurice Ma a62bd10f63 Add framebuffer info into Multiboot table
Multiboot defined framebuffer structure.  However, it was not
implemented in SBL.  This patch added this support by filling in
the framebuffer information into the multiboot table.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-06 13:28:10 -08:00
Maurice Ma 93d1915742 Add FAT long file name support
This patch enhanced the FAT library to support long file name. The
old driver only supports 8.3 short name. Combined with FAT full path
support, the FAT library now can load any file from the partition.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-04 17:42:11 -08:00
Maurice Ma 072d5f5427 Add full path support for FAT file loading
Current FAT library can only support loading file from the root
directory of FAT file system. This patch enhanced it to support
load file from FAT file system with any give full path. Both unix
and Windows style path are supported. For example, "efi\boot.cfg",
"\efi\boot.cfg", "/efi/boot.cfg", etc, all are valid path string.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-26 08:53:08 -08:00
Maurice Ma 7b37f56ff2 Refactor LiteFvLib/LitePeCoffLib implementation
This patch did some clean up for LiteFvLib and LitePeCoffLib.  It
also moved LoadFvImage() API from Stage2 core code into the LiteFvLib.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-31 14:06:36 -08:00
Guo Dong 095f281023 Enhance UEFI payload support
Previously SBL expects UEFI payload entrypoint and base at
hardcoded address of FV header. With this patch, SBL could
parse FV to get these info.

TEST=Tested on Leafhill and boot UEFI payload success.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-01-28 13:54:11 -08:00
Maurice Ma 1f972af0cd Fix large file read issue on USB device
The current USB block read library trancated the number of blocks
to read from UINT32 to UINT16. It caused read issue for large file
on USB disk. This patch fixed #63. It has been verified on LeahHill
CRB platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-07 13:30:57 -08:00
Huang Jin 3009428255
Fix bug in file system library
When InitFileSystem() API is given EnumFileSystemTypeFat in argument,
the FAT file system is not initialized. This bug is discovered when
firmware update payload fails to load capsule from FAT partition via
shell interface.

Fixed #62 

TEST=Created FwuImage.bin and perform firmware update from SBL shell on
     UP2 board. Verified successful update and booting to Ubuntu 16.04
     from eMMC

Signed-off-by: Huang Jin <huang.jin@intel.com>
2019-01-03 13:18:25 -08:00
Guo Dong 501be46716 Update file system support
The patch gives the platform the configuration capability to only build
required file system into final image.
This helps to have a smaller image for fast boot.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-11-27 15:09:14 -07:00
Aiden Park aabfe786a6
Fix gcc compile errors (#43)
There are 'uninitialized' errors and size exceed error in PAYLOAD
with old gcc versions. This change has been verified with gcc-4.8,
gcc-5, gcc-7 and gcc-8 on Ubuntu 18.04 LTS.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-11-15 09:39:16 -08:00
Guo Dong cd9edfdd8b Add Device table
Update core code to support device table.
Updated boot option to consume device table.
Update firmware update to consume device table.
Update shell command on boot option changes.
Add device table for APL and Qemu.
Remove unnecessary code.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-11-12 09:38:59 -07:00
Maurice Ma dd3c729361 Rename KeyStore to HashStore to reduce confusion
Current code refers hash store as "key store". It is confusing
since there is no key stored in the image at all.  Instead, the
public key hash is stored.  The patch renames the KeyStore
to HashStore.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-11-09 16:49:37 -08:00
Aiden Park 2f2fb8802e Revert '[DebugAgent] Fix image info loading failure in QEMU CAR stage'
This reverts commit 8cba382774.

The original fix still has the issue on Windows UDK Debugger and
a simpler way can resolve the QEMU specific issue. In UDK debugger
configuration, 'NoAccessLimit = 0' is required for QEMU only.
  [Target System]
  NoAccessLimit = 0x0

This change has been verified on both Linux and Windows UDK Debuggers
and user guide will include this information.

Change-Id: I09de713d7a9a892230475cbc4aca70b1a5c11b3c
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-11-06 11:33:53 -08:00
Aiden Park 8cba382774 [DebugAgent] Fix image info loading failure in QEMU CAR stage
QEMU FSP reports that CAR base is 0x0, but DebugAgent cannot access
the memory space since MEMORY_READY is not set.
In order to disable low memory filtering, simply check CAR space and
then trigger MEMORY_READY.

Change-Id: I9e1703215c95fd64e2a0be3afd001c59f736e81b
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-10-30 17:42:04 -07:00
Aiden Park 76db3e9714 Support ELF format payload
In order to support ELF format payload in Stage2, ElfLib is separated
from MultibootLib.

Additionally,
- Load ONLY Executable/Loadable segments
- Keep LoadElfSymtab function for future use
- Mark ELF syms flag as 'not supported' in MultibootInfo

Change-Id: Iec1ca6770ffeff9222b71327216cc6176ea1e925
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-10-30 17:41:41 -07:00
Borgerson, Matthew A 47ffab52ab Add shell command to print contents of log buffer
This patch adds a new shell command `dmesg` to print out the contents of
the boot log buffer.

Signed-off-by: Borgerson, Matthew A <matthew.a.borgerson@intel.com>
2018-10-29 16:39:00 -07:00
Maurice Ma 697c02302f Enable USB keyboard console support for QEMU
Previous USB keyboard console support commit worked fine on APL real
platform, but it has issue on QEMU. This patch further enables USB
keyboard console support for QEMU. A new PcdUsbKeyboardPollingTimeout
is added. It will be used to control the USB keyboard interrupt
transfer polling timeout. For QEMU, it needs a larger number due to
timing issue. As part of it, booting from USB device is also enabled
by this patch. This patch fixes #30.

To test USB keyboard console in QEMU, please first change
CONSOLE_IN _DEVICE_MASK in BoardConfig.py to 3, and then add the
following in the QEMU command line to add XHCI controller and USB KB:
-device qemu-xhci,id=xhci,bus=pcie.0,addr=4 -device usb-kbd,bus=xhci.0

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-29 09:39:27 -07:00
Borgerson, Matthew A 2255bc10b0 Enable basic framebuffer text console output
This patch simplifies the GraphicsLib code and adds an abstraction layer
for printing to a virtual "console," through the familier
ConsoleWrite(buffer, len) style function call.

ConsoleWrite can be configured to output to either the serial port, or
the display framebuffer, or both. This primarily enables the command
shell to be used with a display and keyboard.

Signed-off-by: Borgerson, Matthew A <matthew.a.borgerson@intel.com>
2018-10-25 19:25:44 -07:00
Maurice Ma 97466fac83 Add XHCI controller check during initialization (#21)
Current XHCI library does initialization without checking the
controller PCI class and interface type. It will cause assertion
in late phase if the device is not a real XHCI controller. This
patch added the class and interface type check for XHCI controller.
Also more error handling was added to deal with the initialization
failure.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-16 22:53:43 -07:00
Aiden Park b6697f12a8
Enable DebugAgentLib to support source level debug over serial (#18)
* Enable DebugAgentLib to support source level debug over serial

By default, source level debug is NOT enabled. ENABLE_SOURCE_DEBUG
needs to be set to 1 in BoardConfig.py of each Platforms.
- self.ENABLE_SOURCE_DEBUG  = 1

As an initial drop, there are some limitations on APL platform.
- Stage1A does not include DebugAgentLib due to Stage1A size
  limitation(32KB). Further optimization is required.
- DebugAgentLib supports ONLY POSTMEM debugging on APL currently.

Refer to EDKII Debugging:
- https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Debugging
- https://github.com/tianocore/tianocore.github.io/wiki/SourceLevelDebugPkg

Change-Id: Ia28c5470bc5755768f2b380cc1dabbcb8ee60f0d
Signed-off-by: Aiden Park <aiden.park@intel.com>

* Additional changes for DebugAgent

- Adjust stage size depending on ENABLE_SOURCE_DEBUG Pcd value
- Add PeCoffFindAndReportImageInfo
- Fix debugger hang at Shell

Change-Id: I11b41e5ad610fcb2999e9d43e5dd8f8899e8265a
Signed-off-by: Aiden Park <aiden.park@intel.com>

* Move PeCoffFindAndReportImageInfo() from LitePeCoffLib to DebugAgentLib

Change-Id: I2c4ab4f9561dfd0536da1820048f0e5f2660e2ab
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-10-15 10:45:23 -07:00
Maurice Ma 09f8270825 Add USB input console support
This patch implemented USB keyboard library and added it as an
input console device. It can be enabled by setting BIT1 in
self.CONSOLE_IN_DEVICE_MASK in BoardConfig.py. By default, it
will be disabled for performance and size consideration.

Test has been done on APL Leafhill board. USB keyboard can work
in Shell.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-09 12:56:58 -07:00
Maurice Ma bd1ea24cc1 Add ConsoleInLib to abstract console input (#13)
Current implementation assumes serial port is the only input console
device supported.  But other input console devices can be added later
on. This patch added a ConsoleInLib to abstract the input console
interfaces.  It also added PCDs to control enabled input console
devices.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-05 14:36:29 -07:00
Maurice Ma c6999f497a Initial check-in for Slim Bootloader source 2018-09-13 16:11:07 -07:00