Commit Graph

642 Commits

Author SHA1 Message Date
Maurice Ma 62aa4407d5 Re-arrange CPU info entry order so MpInitLib
This patch sorts the CPU info entry according to their thread distances.
It is required to list CPU thread with furthest distance first in MADT
so as to better utilize CPU resources.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-12 03:31:44 +08:00
Maurice Ma 1870fb4fdf Remove HAVE_FLASH_MAP config option and PCD
SBL depends on flash map to locate all component info. It is
mandatory to keep flash map. HAVE_FLASH_MAP config option should
be removed. This patch removed this config option and the related
PcdFlashMapEnabled PCD.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-12 02:37:57 +08:00
Subash Lakkimsetti eba6c56241 Update TPM Physical Presence asl for SMM Dispatch usage in payload
UEFIPayload uses SMM dispatch for Physical Presence (Tcg2SMM) SMI.
Updated SMI port usage in asl to trigger SMI registered for
Physical Presence operation

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-11-09 12:37:12 +08:00
stalamudupula a2c75b2faa Add GenGpioData.py tool (#432)
GenGpioData.py is a utility that converts
GPIO pin data from one format to other.

The formats currently supported are [h, csv, txt, dsc, dlt].
[h, csv, txt] formats are external to SBL and [dsc, dlt] formats
are known to SBL. So, this tool provides a way to convert one
of the [h, csv, txt] to [dsc, dlt] and vice-versa.

Example usage:

    python GenGpioData.py -if GpioInput.csv -of dsc

    python GenGpioData.py -if GpioInput.dsc -of txt

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-11-07 12:21:51 -08:00
Aiden Park 210bd02c47 Fix invalid PatchCheck commit ranges in travis
PatchCheck was using 'TRAVIS_COMMIT_RANGE' travis variable to get commit
range, but it lost tracks when doing force push or rebase. There are many
issue reports about this variable.
To avoid potential issue, let's get the range from git command directly
instead of TRAVIS_COMMIT_RANGE variable.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-08 03:31:35 +08:00
Ravi Rangarajan 13974ee2d4 Fixed condition check based on klocwork scan (#442)
Fixed condition check based on KW report

Signed-off-by: Ravi Rangarajan <ravi.p.rangarajan@intel.com>
2019-11-06 16:51:02 -08:00
Ravi Rangarajan a218222928 Klocwork cleanup for PayloadPkg
Signed-off-by: Ravi Rangarajan <ravi.p.rangarajan@intel.com>
2019-11-07 06:47:56 +08:00
Aiden Park 5e8a18251b Enable PatchCheck in travis
This will run PatchCheck.py in travis before building a target.
If the format is invalid, travis will exit immediately.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-11-07 05:57:31 +08:00
Sai Talamudupula eef73934bf [WHL] Handle Gpio Int Config warning
ConfigEditor.py tool reports a warning regarding the
incorrect Interrupt Configuration for pins on Upx boards.

Certain board's default PAD CFG values may have none of
NMI/SMI/SCI/IOAPIC set and also RXEVCFG set to Disable,
so add a corresponding option in the drop-down for IntConfig.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-11-07 05:57:16 +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
Guo Dong 5de02e118d Fix KW issue
It should use local variable ResetReason instead of OsBootOptionList
in case of OS boot option is not available.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-11-05 08:37:31 -07:00
Ravi Rangarajan ba38c1bd6f
Klocwork cleanup for PayloadPkg (#436) 2019-11-05 08:06:37 -07: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
Ravi Rangarajan cffc6cdfe1
Fix comments to SBL core MemAllocLib to relfect code behavior (#426) 2019-11-01 17:52:57 -07: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
Maurice Ma e74fb33a25 Misc Klocwork scanning fixes in BootloaderCorePkg
This patches fixed several Klocwork scanning reports in
BootloaderCorePkg.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-11-01 08:16:34 +08:00
Maurice Ma d233c78427 Redefine CR macro to address Klocwork scanning issue
Klocwork has issue to handle the CR macro in SBL code and it reported
false positives such as unused variables, uninitialized variables, etc.
This patch added special handling to resolve the issues reported by
Klocwork scanning.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-31 12:47:57 +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 d18a96e856 Replace ASSERT macro in DebugLib for klocwork scanning
This patch replace the standard ASSERT macro with klocwork specific
implementation as indicated on:
  https://docs.roguewave.com/en/klocwork/current/tuningccanalysis
This can provide hints to klocwork scanning on the ASSERT() statement
so as to avoid false positives.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-30 03:32:54 +08: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
Aiden Park 913b4b4e9d
[WHL] Allow relative path in StitchIfwi.py (#415)
Currently, only absolute path is allowed in '-w' stitch_dir and '-s'
stitch_zip file. In addition, if stitch_dir is not absolute path, the
stitch tool looks for 'SBL_SOURCE' which does not exist in OS environment.

This patch allows the StitchIfwi.py tool to use relative path as well.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-25 09:49:44 -07:00
stalamudupula fc1d53d387 Set default Container type to CLASSIC (#413)
Container parse logic cannot handle NORMAL (default) case
currently. So, if -t option is not used while generating a
Container, unsupported image type is reported during runtime.

Change the default type to CLASSIC, and end-user can use
-t option to switch to MULTIBOOT if needed.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-10-24 13:20:56 -07:00
lsubash d7b6378e75 [CFL] TPM selection type support to StitchIfwi (#410)
Added a option in CFL StitchIfwi script to pass the TPM type to
be selected for Intel FIT tool stitching.

[TEST] = Run StitchIfwi.py with -tpm=dtpm for WHL
         and verify use of dTPM.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-10-24 09:59:32 -07:00
Maurice Ma 72774a9841 Clean up OsLoader main boot flow (#412)
Current OsLoader used many "goto" to enforce the flow, and it also
used RestartOsLoader() to allow OsLoader re-entry. This patch cleaned
these and produce a linear boot flow for PayloadMain().

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-24 09:44:03 -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
Aiden Park 28c0039763
[OsLoader] OsLoader lifecycle change (#396)
This patch allows OsLoader to handle all Boot Options without restarting.

Currently, OsLoader restarts to handle next Boot Option from the beginning.
This behavior does not preserve allocated memories from Payload heap,
so it makes hardware/software states hard to be maintained.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-23 09:37:57 -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
Sachin Agrawal 94a477902b [APL] Oemkm and Bpm are not a MUST (#393) (#408)
BootPolicyManifest are required when a IFWI is
stitched with Intel BootGuard enabled. FlashMap maintains a pointer to
it so that SBL code can reach to them during execution.

This patch removes the check for its presence from IFWI images.

Test : Stitches Ok. Boots Ok.

Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
2019-10-22 09:36:48 -07:00
Aiden Park 33e18bc1bc
Silicon init with eMMC HS400 mode config (#407)
This patch is a follow-up patch of #380. If a platform disables HS400 mode,
silicon init code will configure eMMC in HS200. Other modes not in scope.

This will also fix #406.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-21 09:30:51 -07:00
Aiden Park 2b753e922b [APL] Add config option for XDCI mode
This patch allows a board to configure XDCI mode.
By default, keep XDCI mode as PCI mode which is default value in FSP.
The mode can be controlled by Config Data.
- Silicon Setting > Device Enable/Disable > Control 2 > Enable XDCI

If XDCI mode needs to be overrided, put new value in .dlt(delta) file.
- DEV_EN_CFG_DATA.DevEnControl2.XdciEnable | 0x0 (Disabled)
- DEV_EN_CFG_DATA.DevEnControl2.XdciEnable | 0x2 (ACPI mode)

It will fix #397 with the override value in a delta file.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-18 17:19:42 +08:00
Ursula Maplehurst 4cc3d4df57 [APL] Update FSP to MR6 (#392) (#404)
There is an issue with Vbt.bin in MR5; MR6 has this fixed.

Test: compiles OK, boots Linux OK.

Signed-off-by: Ursula Maplehurst <ursula@kangatronix.co.uk>
2019-10-17 15:58:50 -07:00
Aiden Park b7df78d41f
[APL] Expose IPC1 device to OS (#402)
This patch adds IPC1 device to DSDT and exposes it to OS.
The behavior can be controlled by Config Data.
- Silicon Setting > Device Enable/Disable > Control 1 > IPC1 Enable/Disable

It also fixed #390.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-17 15:58:24 -07: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
Aiden Park 7759f83a63 Fix build failure in PreOsChecker on Windows
Fix type cast error from pointer to function pointer

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-16 18:28:43 -07:00
Aiden Park 70b5afb6b3 [OsLoader] Clean-up PreOsChecker
Split PreOsChecker in a separate file and add minimum APIs
- IsPreOsCheckerLoaded ()
- LoadPreOsChecker ()
- StartPreOsChecker ()

Token space has been changed for PcdPreOsCheckerEnabled
- gPlatformModuleTokenSpaceGuid to gPlatformCommonLibTokenSpaceGuid
- Include/Excluded PreOsChecker according to FeaturePcd

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-16 16:45:53 -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
Maurice Ma 9a10781d0f Limit debug output devices in stages
DEBUG_OUTPUT_DEVICE_MASK can be used to control debug output devices.
When frame buffer is enabled as debug output devices, it will only
work after GFX init. However, the code will still be linked into Stage
1A/1B/2 binary and increase the size. GFX debug device should only be
enabled in payloads. This patch used separated PCD values for stages and
payloads to optimize the binary size.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-16 09:45:49 -07:00
Maurice Ma 66c133b987 Allow restarting OsLoader after trying out all boot options (#387)
After trying out all boot options, if it still fails to boot,
current SBL code will do CpuHalt(). A better approach is to boot
into Shell and reset the current boot option to 0. In this way,
it allows user to try boot option again after modifying boot
option parameters. However, for release build, it does not change
the original behavior. System will still halt in this condition.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-16 09:28:20 -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