Commit Graph

549 Commits

Author SHA1 Message Date
Maurice Ma ff2f614917 Allow searching payload file in build FV folder
When specify a payload file in the build command line, the current
searching folder is: PayloadPkg/PayloadBins, Platform/$(PlatformBoardPkg)
/Binaries. This patch added another searching folder in the Build FV
if the payload file cannot be found in the listed folders above. This
is useful when the payload image itself is generated from the build
process.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-04-12 10:44:21 -07:00
Guo Dong ef4dbd9177 Fix debug message display issue
The message was displayed before the value was copied.
So adjust the sequence to correct it.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-04-10 12:18:06 -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 1253b19c14 [QEMU] Adjust SPI image layout to have fixed size
Current QEMU build will produce many different SPI layouts due to
different build feature flags, such as source level debug support.
Since QEMU is a virtual platform, it is better to relax the size
so as to have consistent SPI layout. It will make it easier for
debug. This patch produces fixed QEMU image size (2MB).

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-04-08 11:59:10 -07:00
James Gutbub f022d093ba Add SBL logos for community usage
Slim Bootloader has its own set of approved logos. Add them to
the repo for community usage along with guidelines on logo usage.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-04-03 13:33:09 -07:00
Maurice Ma ca6b6d56c4 Update SBL to use the approved SBL logo
Slim Bootloader has its own approved logo. Updated the original logo
to use this new one.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-26 09:05:09 -07:00
Maurice Ma 9f3b9f2a3b Add command line loading CFGDATA support in ConfigEditor
This patch added support to load CFGDATA directly from command line
interface. Minor clean-up work is also done to remove unused and
duplicated functions.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-20 16:30:05 -07:00
Raghava Gudla f514ba35b7 Added support for FWST OEM ACPI table
This patch added support for FWST ACPI table. This table
contains generic address structure which has pointer to the
EFI System Resource Table.

ESRT table for now supports only system firmware. This table
will provide the operating system and tools knowledge of what
is the last attempt status and version of the system firmare
update.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-03-20 16:03:57 -07:00
Raghava Gudla ed4f7d1aad This patch add code to handle fsp requested reset
after silicon init API call. Also added code after
memory init to differentitate warm and cold reset requests.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-03-20 15:59:19 -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
Matt Borgerson 90e61539bb Add basic pre-build check for OpenSSL/NASM
Signed-off-by: Matt Borgerson <matthew.a.borgerson@intel.com>
2019-03-06 13:27:44 -08:00
Sai Talamudupula 5f09e82c10 Enhance SMMBASE_INFO communication structure
Match the strcture definition with payload

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-03-01 21:10:12 -08:00
Maurice Ma d397299797 Add GRUB config file support to boot Ubuntu
This patch added a simple parser for grub.cfg to make it easy to boot
Ubuntu ISO image using OsLoader payload. Without it, it is required to
copy vmlinuz/initrd to root directory and create a config.cfg to list
the kernel boot command line in order to boot the ISO image. This patch
makes it possible to boot the original Ubuntu ISO (16.04 or 18.04)
directly. It provides better user experience for people who wants to
try out SBL.

Please note, same as before, when verified boot is enabled, only debug
build will support this feature. Release build will disable this feature
due to security concern, please use IAS image boot mechnism instead.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-28 12:42:44 -08:00
Sai Talamudupula 14c3862005 Relocate SMM bases on S3 resume path
Smm bases for all the procs need to be relocated on the
S3 resume path (as payload is not run) for Windows boot.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-02-26 11:23:29 -07:00
Guo Dong d6c1ea6964 Add ACPI Firmware Performance Data Table (FPDT) support
This patch adds FPDT table into ACPI table, and updates all
the performance data for S3 path.
It also update basic boot performance data for reset end.
Other boot performance data could be updated by UEFI payload.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-02-25 10:03:46 -07:00
Maurice Ma a11fbf0538 Add multiple VBT table support
Current SBL can only support on VBT file. However, different board
might need different VBT table. It is better to have the capability
to embed multiple VBT table into the image.  This patch implemented
this feature and enabled it on QEMU. By default, it will take the
original behavior. if _MULTI_VBT_FILE in BoardConfig.py is specified,
multiple VBT files can be used.

If multiple VBT table support is required, list them as:
  {VbtImageId1 :VbtFileName1, VbtImageId2 : VbtFileName2, ...}
VbtImageId is ID to identify a VBT image. It is a UINT32 number to
  match the ImageId field in the VBT container.
VbtFileName is the VBT file name. It needs to be located under platform
  VbtBin folder.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-13 17:15:33 -08:00
Maurice Ma 66aa54a5fa Remove Debug/Release field from VerInfo.txt file
In current implementation, FspDebug/BldDebug flag is saved into
VerInfo.txt. But it should be always determined by the build flags
instead of the VerInfo.txt file. This patch fixed #84 .

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-07 09:51:05 -08:00
Maurice Ma f9397b39a4 Add duplicated CFGDATA check in GenCfgData.py
CFGDATA name should be unique in the whole CFGDATA database. Current
tool does not check this and will keep silent for this error. This
brings issue into later development stage. The build process should
be enhanced to check this and error out if duplicated CFGDATA item is
found. This patch added this check.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-06 08:04:16 -08:00
Sai Talamudupula 635645705f Adding print for EXT CFG data and payload ID
Print a debug message if EXT CFG Data fails to append
in the config database. ALso, print the Payload ID in
stage2.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-01-31 14:47:33 -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
Maurice Ma a6efeb29eb Enable payload loading to high memory by default
This patch enabled payload loading into high memory by default. It
is a more flexible way to allocate memory for payload image instead
of hard-coded base address.  However, in some special cases, such
as UEFI payload, it still needs to be executed at pre-compiled address.
This patch also handled this special case in the flow.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-31 08:04:57 -08:00
Maurice Ma da11283b51 Allow payload binaries to be located in platform folder
This patch added support to allow payload binaries in platform folder
instead of PayloadPkg/PayloadBins. Sometimes platform might have its
own customized payload specifically for this platform. In this case,
it is better to put the payload binaries in its platform folder.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-28 13:54:25 -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
Raghava Gudla d6d0e92a80 Fix firmware update failure
When UEFI payload or epayload is enabled and firmware update mode
is enabled, current code in prepare payload function will consider
firmware update payload as multi payload. This is causing failure
and end up as halting cpu.

This patch will add an additional check for firmware update mode
and do hash verification

TEST=Verified that firmware update is working when UEFI payload
	 is enabled.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-01-25 17:01:37 -08:00
Guo Dong ee4b3f812f Add SMM support to UEFI payload
Build a new SMM info HOB to payload to report SMM info.
Add UEFI payload variable region into flash map.

TEST=Tested on LeafHill with UEFI payload.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-01-22 17:11:54 -07:00
Maurice Ma 650fcf1cb7 Retrieve version info from proper platform repo
SBL supports putting platform packages in a separate repo tree
defined by environment variable PLT_SOURCE. Current build process
will always retrieve the latest commit id info from open source
repo as version even when the platform uses a separate repo tree.
This patch corrected this behavior. When a platform package is in
a separate repo, the git commit id info will be retrieved from that
platform repo instead.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-17 13:55:42 -08:00
stalamudupula e48f46236d Enhance BuildUtlity tool (#58)
Updated BuildUtility.py to allow IAS file to use relative file path
from platform directory.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2018-12-19 09:17:38 -08:00
Aiden Park 397f25b853
Remove Python cx-freeze dependency (#51)
Ported the patch from EDKII repository and added following up changes

<Original commit info in EDKII>
commit 7b500c606ad101fad52327318af37889048cd45e
Author: Liming Gao <liming.gao@intel.com>
Date:   Tue Oct 16 23:08:46 2018 +0800

    BaseTools: Remove the step to freeze python tool

    https://bugzilla.tianocore.org/show_bug.cgi?id=1257
    Binary python tool is not supported anymore. So, the freeze python tool
    step is not required.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-12-03 15:05:24 -08:00
Guo Dong a005c979eb Update GenCfgData tool (#48)
Remove SBL_SOURCE env dependency when searching DSC file, instead it
uses GenCfgData tool path to find the slim boot source root.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-11-28 17:37:35 -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
Vijay B S b83bf23a93 Retain the state of cache disable bit
This patch retains the cache disable bit status
at reset vector. Needed for secure boot.

Signed-off-by: Vijay B S <vijay.ballagere.siddalingaiah@intel.com>
2018-11-19 08:08:04 -07: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
Guo Dong 193eb17192 Update file Guid and name in BootloaderCoreLib
BootloaderCoreLib use same File_GUID and Base_NAME
with BootloaderLib, this patch updates INF to fix
this issue.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-11-09 16:30:22 -08:00
Aiden Park e690373d7b [APL] Fix a compile error when VTD is disabled on APL
When VTD_ENABLE sets to '0', a compile error occurs because some .inf
files refer to VtdLib. Therefore, VtdLib is included to default
libraries - dsc_libs['IA32'].

Additionaly, VTD_ENABLED is renamed to ENABLE_VTD to make feature
enabling name consistent

Change-Id: I74c12bdc2805ebd0a5774780f029a460b33d19d5
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-11-09 14:20:07 -08:00
Maurice Ma e8d879ebb5 Convert ASM opcode to instructions in MpFuncs (#37)
Current MpFuncs.nasm used hard coded opcodes to support 16bit ASM.
It makes it difficult to maintain. Per suggestion, this patch
convered the 16bit opcodes into instruction directly.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-11-02 09:09:46 -07:00
Maurice Ma f768137b66 Add basic SMM rebasing support
SBL has no intention to support SMI. However, on many hardware
platforms, there is no reliable way to prevent SMI from generating
through SMI IPI.  In case it occurs, CPU will jump to the default
0x38000 location for execution, which exposes huge security issues.

The recommended solution is to do basic SMM base relocation and put
a dummy SMI handler (RSM) there for platform does not support SMI
disabling. In this way, the SMI will be ignored, and it also closes
the security concerns. This patch implemented basic SMM relocation.

It is under the control of a new PCD PcdSmmRebaseEnabled. By default,
it is disabled.  To enable it, please set ENABLE_SMM_REBASE in
BoardConfig.py. As part of it, platform library needs to set
PcdSmramTsegBase and PcdSmramTsegSize properly in PreSiliconInit board
hook. Please take APL platform for reference.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-11-01 20:00:13 -07:00
Aiden Park 5c19d4a9aa Fix a build failure on Windows with Visual Studio
Explicitly type cast from a data pointer to a function pointer.

Change-Id: Ia060bc7ac2c9176fe19d289c484285918b9befe8
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-10-30 17:41:41 -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
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
Guo Dong 3fe37921b1 Enhance GenCfgData tool
Currently GenCfgData.py tool could open generated
CfgDataDef.dsc, but could not open CfgDataDef.dsc
in the source code since it includes other DSC files
in CommonBoardPkg. The files could not be found by
default if SBL_SOURCE is not defined.
This patch would search DSC in CommonBoardPkg, so
even SBL_SOURCE is not defined, it could still open
CfgDataDef.dsc.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-10-26 13:17:01 -07:00
Maurice Ma 03385ca8a7 Enable graphics framebuffer as WriteCombining
On APL platform, all PCI MMIO range is set to UC in current
implementation. It includes graphics framebuffer MMIO. It
caused the system performance issue due to large mount of
framebuffer write access. This patch set framebuffer as
WC (WriteCombining) per recommendation to enhance system
performance.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-26 11:03:09 -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
Aiden Park e74b4e5ce5 Start DebugAgent from the beginning of Stage1B
Hardware Breakpoints must be used during CAR execution until
memory has been initiailzed for APL platform.

In order to use Hareware Breakpoints in UDK debugger, add
FlashRange in UDK config file and force to cover CAR area.
In SoftDebugger.ini of Windows UDK Debugger
Or In /etc/udkdebugger.conf of Linux UDK Debugger
  [Target System]
  FlashRange        = 0xFEF00000:0x1100000

Additionally,
  added Stage1BBase in STAGE1A_HOB
  fixed Stage1A module base report

Change-Id: I717f87bf141168de0b0987eb309fd4c5d48d3c14
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-10-16 14:47:13 -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
Guo, Dong fb8d75f08e Retire windows build script
Update build tool to use Buildloader.py to build SBL
in both Linux and Windows.
Update tools to support multiple workspaces, so platform
packages could be in another place.

TEST=Build qemu and APL platform success.

Change-Id: I2482037ba605218c947b6de28abe8e3eeacdc17f
Signed-off-by: Guo, Dong <guo.dong@intel.com>
2018-09-28 08:18:23 -07:00
Maurice Ma c6999f497a Initial check-in for Slim Bootloader source 2018-09-13 16:11:07 -07:00