Commit Graph

642 Commits

Author SHA1 Message Date
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
Grandhi ce4346fea6 Add code modifications to match the new Device Table concept.
Signed-off-by: Grandhi <sindhura.grandhi@intel.com>
2018-11-27 09:41:32 -08:00
Raghava Gudla 91c09cee79 Updated FwUpdate to get capsule info from cfg data
This patch updates firmware update code to get capsule location
information from configuration data instead of searching in all the
available boot media.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2018-11-21 10:32:44 -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
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
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 0724f9a170 [APL] Rename VTd to Vtd
Rename VTd to Vtd including directories, files and variables to follow
EDKII coding convention.

Change-Id: I0c88dcc1087eafcefb4f6d99dcd25e7b3d031a71
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-11-09 14:20:07 -08:00
Aiden Park 3f8afb82f8 [APL] Remove hard-code uart2 BAR when VT-d is enabled
This hard-coded uart2 bar was a W/A for a specific board and may cause
a confusion in uart2 mmio space for other boards when VT-d is enabled.

Change-Id: I945a6dffbc1bd5afcb16699bf800826c3744a315
Signed-off-by: Aiden Park <aiden.park@intel.com>
2018-11-09 14:20:07 -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
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
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
Guo Dong a33887e6c6 Enhance SplitFspBin Tools
Enhance FSP split tool to support PE32+ format

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-10-30 17:57:10 -07: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 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
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
Maurice Ma 1502566fe0 Report APL SoC reserved MMIO resources through ACPI
On APL platform, the chipset SoC reserved MMIO resources are not
reported properly to OS through ACPI. It should report it using
_CRS method. This patch fixes #28.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-10-29 08:28:36 -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
Guo Dong 965155634a [APL] Fix size bug when copy BootOption
When copying boot option from configuration data to
internal boot option structure, the code should just
copy exact size required for boot options.

Change-Id: Iede4ede3ad717b6a0245800569a19fe686afb233
Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-10-25 18:00:36 -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 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
Huang Jin 2373df3eb1 Update README.md
Make mailing list more visible on the front page
2018-10-15 10:56:34 -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
EthanHsu a8e8fccd03 There is a compile issue when use Visual studio 2015.
Root-cause is Special characters (comma) exist in the header file.

Silicon\ApollolakePkg\Include\Library/HeciLib.h: warning C4819: The file contains a character that cannot be represented in the current code page (950). Save the file in Unicode format to prevent data loss
2018-10-09 11:25:06 -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
Augustine Chen d77623b063 Resolve the problem that VS toolchain is often set to older version
When there are multi versions of VS installed on the Windows host
system, BuildLoader.py often set up old VS version for the toolchain
variable. Resolve it by changing the structure type of vs_ver_list.

Signed-off-by: Augustine Chen <augustine.chen@intel.com>
2018-10-02 14:40:27 +08:00
Matt Borgerson 1872c36337 Add CODEOWNERS file 2018-09-28 13:09:10 -07:00
Guo Dong 0ce26d3d15 Update Platform package search path
Make sure the build tool only search current SBL folder by default.

TEST=Build APL success.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2018-09-28 11:19:37 -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
Matt Borgerson 9ee73898f9 travis: Build both QEMU and APL targets 2018-09-22 14:27:42 -07:00
Matt Borgerson bc470e02ec Add .travis.yml file to enable CI builds 2018-09-20 17:05:41 -07:00
Matt Borgerson 54d66837be Add fake Git user name/email in Docker container
Necessary due to some build scripts using Git commands to apply patches.
Git will otherwise fail asking user to identify themselves.
2018-09-20 17:05:41 -07:00
Erjan Kalybek 47cd1decb6 Fix typo (#2) 2018-09-19 22:40:44 -07:00
Maurice Ma c6999f497a Initial check-in for Slim Bootloader source 2018-09-13 16:11:07 -07:00
Maurice Ma 20287c9aff Initial commit 2018-09-13 16:09:52 -07:00