Commit Graph

642 Commits

Author SHA1 Message Date
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
Raghava Gudla e9bba34867 [CFL] Change default payload sel based on GPIO
This patch changes the default behavior of gpio pin for payload
selection, currently user configured GPIO pin being high boots
to uefi payload, modified code will boot to OS loader when GPIO pin
is high.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-10-14 16:50:48 -07:00
Raghava Gudla 12473c872e [WHL] Fix power button overrride smi storm issue
power button 4 second press will cause power button override
bit to set in PM1 status register, this bit is not cleared on
reset and is causing SMI storm during booting to OS.

Power button override bit if set is cleared now in stage1b and
this fixed the SMI storm issue.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-10-14 16:47:01 -07:00
raghavag a7460bcb91 [WHL] Fix firmware update failure (#374)
Current code set payload id depending on the gpio settings
and user selection from configuration data. When UEFI payload is
selected using GPIO or config data, payload id is being set to
UEFI irrespective of boot mode, which cause notification function
to get called, this locks the spi which inturn fails firmware update

Modified code to set payload id only in non-firmware update boot mode.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-10-14 13:20:38 -07:00
Raghava Gudla 7b222b6c5f Added CSME update driver
This patch added csme wrapper driver for csme update library.
following functionality is added in this patch

1. Boardconfig PCD option ENABLE_CSME_UPDATE is added to
   enable/disable csme update support
2. Boardconfig PCD option BUILD_CSME_UPDATE_DRIVER is added
   to enable/disable building csme update driver
3. If BUILD_CSME_UPDATE_DRIVER is 1, user need to create
   library that inludes csme update library
   this newly created library will get linked to csme update
   wrapper driver providing csme update driver
4. By default ENABLE_CSME_UPDATE is set to 0
5. Revision control for input and output data structure to
   update driver is not implemented and will be avaiable
   in further patches.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-10-14 13:16:38 -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 c0b7918240 [UPX] Use BomID to select memory SPD data
This patch added code to select correct SPD data according to the
UPX BomID detected.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-14 10:08:49 -07:00
Maurice Ma 0302a5e457 [UPX] Add additional SPD data for 4GB memory configuration
This patch added 4GB SPD data for UPX board. It also renamed the
original 8GB SPD data file.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-14 10:08:49 -07:00
Maurice Ma eee6f98fc5 [UPX] Add UPX board BomID detection through GPIOs
UPX board has different memory configurations indicated by GPIO pins.
This patch added GPIO detections for these pins and set it as BomID.
It can be used to decide which SPD data to use later on.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-14 10:08:49 -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
Aiden Park b5c9976bf1 PatchCheck: Skip TAB check in .py files
This patch will skip TAB check in all python files for now.
THis change will be reverted after cleanup all TABs.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-12 21:02:32 -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
raghavag ecc370113d [CFL] Adjust power UPD settings (#360)
This patch adjusted power related UPD settings to BIOS
UPD values are configurable through configuration data
After these changes, CPU maximum operating frequency
increased from 3.7GHZ to 4.2GHZ on WHL.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-10-11 23:19:09 -07:00
Maurice Ma b54d653430 Add support for loading container image from raw partition
Current SBL code assumes the image to load on raw partition follows
IAS format. Since container format is added recently, the code should
support both. This patch added support for container format as well.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-10 13:38:19 -07:00
Aiden Park 450d429225
[WHL] Increase EPAYLOAD_SIZE (#372)
This is to fit the size of the latest Debug UEFI Payload.
Increase the size from 0x00180000 to 0x00190000.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-10 09:46:42 -07:00
Maurice Ma 2cd3739bde Minor fixes for ConfigEditor tool
ConfigEditor can load binary into Table widget. It has a boundary
check issue which results in the last byte left out. This patch
fixed this and also added code to roll back invalid inputs to its
last known good value for Table widget cell.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-10 09:42:03 -07:00
Maurice Ma 0efbd578f2 [APL] Fix IFWI stitiching issue for SPI QUAD mode
StitchIfwi.py supports '-q' parameter to enable SPI QUAD mode.
However, it does not work as expected. When the script tries to
modify the XML file, it used 'yes' and 'no' as option values.
But it is case sensitive, and should use 'Yes' and 'No' instead.
This patch fixed this issue.

Test was done on LeafHill board and it enabled SPI QUAD mode
in IFWI after the fix. It fixed #370.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-10 09:41:40 -07:00
Aiden Park 40e8902c62
Clean-up duplicated header files for SPI registers (#368)
This patch allows APL and WHL(CFL) to use common header file for SPI
register access.
APL and CFL are using common SpiFlashLib and PchSpiLib, but Platform
code still refering to its own SPI registers header file.
- Remove duplicated header file
- Add common one to Silicon/CommonSocPkg
- Use SPI registers from common one in each Platform code

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-09 16:16:27 -07:00
Maurice Ma a4a1b76c3b Fix ConfigEditor with Python3 issue
Current ConfigEditor does not run well with PY3. The generated DLT
file has invalid strings. It was caused by the incompability between
PY2 and PY3. This patch rewrote some code with compatibility for both
PY2 and PY3.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-09 15:52:52 -07:00
Maurice Ma c49be1603e Use Treeview widget to display table in ConfigEditor
Current ConfigEditor uses multiple Entry widgets to build a Table
widget since Tkinter does not support Table widget. However, when
the table is big, the loading performance is very slow because of
large mount of Entry widgets. This patch switched to use Treeview
widget to build a table widget, and it is much more faster than the
original implementation.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-09 15:52:37 -07:00
Aiden Park 6626a18b07
[WHL] Use common PchSpiLib (#365)
This patch allows WHL/CFL to use common PchSpiLib for code re-use
instead of its own PchSpiLib.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-09 13:26:06 -07:00
Maurice Ma e375cf8d07 Add mouse scroll event handler for ConfigEditor
This patch added mouse wheel scroll event handler so that mouse can
be used to scroll the configuration items on the page.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-09 12:04:19 -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
Maurice Ma 0adfc94027 Display multiline help string in ConfigEditor
Current SBL display long help string in single line in ConfigEditor.
If the line is too long, only part of the line is visible on screen.
By change widget from Label to Message, it allows multiple lines
help string display.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-09 09:54:51 -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
Himanshu Sahdev aka CunningLearner 13bdd956e8 CoffeelakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c: Fix minor typo
Signed-off-by: Himanshu Sahdev aka CunningLearner <sahdev.himan@gmail.com>
2019-10-08 17:13:11 -07:00
Himanshu Sahdev aka CunningLearner 7f5715b368 {CoffeelakeBoardPkg}ShellExtension.c: Drop undefined and unused shell command
mShellCommandCse is not defined in CoffeelakeBoardPkg so can't extern.
It is not either used in current context.

Signed-off-by: Himanshu Sahdev aka CunningLearner <sahdev.himan@gmail.com>
2019-10-08 16:28:02 -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 6d72d2426a Use GetTimeStampFrequency API to get CPU TSC frequency
This patch used the common API GetTimeStampFrequency() to get CPU
TSC frequency instead of the original GetCpuTscFreqency(). As part
of it, all SOC specific instances for GetCpuTscFreqency() were
removed.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-07 16:08:33 -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 8f24f5710d Add USB Deinitialization flow into OsLoader
This patch added call to deinitialize USB in the following places:
-  Before OsLoader restarting to run itself
-  Before OsLoader transfer control to OS

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 19:55:25 -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
Maurice Ma b70073d456 Filter out unused region in SPI descriptor for IfwiUtility.py
This patch removes unused regions in SPI descriptor so that the
IFWI layout can be printed correctly even when some region is
disbled.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-05 17:17:31 -07:00
Aiden Park f8842039ef WHL: Use CommonSocPkg SpiFlashLib and CoffeelakePkg PchPciLib
The WHL(and CFL-R) has its own SpiFlashLib, but it's almost identical
to common SpiFlashLib except of silicon specific part.
Therefore, CoffeelakePkg will have its own PchSpiLib and re-use common
SpiFlashLib.
- Remove CoffeelakePkg SpiFlashLib and related files
- Use commmon SpiFlashLib
- Use CoffeelakePkg SpiFlashLib

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Aiden Park 49c9ccdb35 QEMU: Re-use SpiFlashLib.h file from Silicon/CommonSocPkg
QEMU has its own SpiFlashLib and SpiFlashLib.h file.
But, the header file is identical to the one in Silicon/CommonSocPkg.
Therefore, remove QEMU's one and re-use the common header file from
Silicon/CommonSocPkg.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Aiden Park 6ab0e90252 APL: Use CommonSocPkg SpiFlashLib
Use common SpiFlashLib and PchSpiLib of Silicon/CommonSocPkg.
- No more use of SpiFlashLib from BootloaderCommonPkg

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Aiden Park 8278b12c61 Support SPI Platform Device info in both PCI and MMIO formats
Platform Device structure PLT_DEVICE supports both PCI and MMIO formats.
But, SpiConstructor gets SPI device info from Platform Device Table
and it always assumes the info as a PCI format. This patch is to support
both formats.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Aiden Park 671d7d8be7 Use PchSpiLib in CommonSocPkg SpiFlashLib
Remove Silicon specific part from SpiFlashLib and use separate
PchSpiLib for Silicon specific part
- Remove Silicon specific code from SpiFlashLib
- Use PchSpiLib for Silicon specific part
- Remove unnecessary ScSpiCommon.h file

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Aiden Park f17c80f7aa Add PchSpiLib for Silicon specific SPI controller acccess
Most of PCH SPI controller are using same mechanism to access SPI BAR
and to control BiosWriteProtect by using SPI PCI device/function.
But, a certain Silicon may use different way to access them.
ex) SPI BAR from LPC A reg, BiosWriteProtect from LPC B reg

Split SpiFlashLib into two parts.
- SpiFlashLib for common part
- PchSpiLib for silicon dependent part

This patch is to prepare the split.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Aiden Park efb2dac76f Prepare SpiFlashLib into Silicon/CommonSocPkg
This is prerequisite step to clean-up SpiFlashLib.
- Copy from BootloaderCommonPkg to Silicon/CommonSocPkg.
  No code change at all.
- Keep the existing BootloaderCommonPkg SpiFlashLib.
  To avoid build failure on existing boards.

The existing boards will use new one at the final clean-up stage.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-10-04 19:37:24 -07:00
Maurice Ma 2df8755762 [WHL] Remove _L6F GPE handler in ASL code
On WHL after booting to Windows, SCI interrupt storm was seen due
to GPE event 111 (2-tier GPE event). This event needs to be handled
when RTD3 table is implemented. However, current code has _L6F
ASL code without RTD3 table. This causes the SCI event to be enabled
in Windows. Since there is no real handler to clear the SCI event,
SCI interrupt storm will occur. This patch commented out the _L6F ASL
method.

Tested this on WHL. The CPU utilization drop down from original 10%
to close to 0% for system interrupts.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-04 09:48:30 -07:00
Maurice Ma 5571d6d03e Fix logic for open source UEFI payload check
There is an issue in current SBL Stage2 code to check if the UEFI
payload is built from open source. It was done by checking the
1st DWORD using Dst[0]. However, during the FV loading, the value
at Dst[0] might have been changed since LoadFvImage() can move the
FV to a new location. This patch cached Dst[0] before calling
LoadFvImage() so that it can always get the oringal value.

It fixed #343.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-10-03 17:06:38 -07:00
Sai Talamudupula a88c44e792 Enhance GenContainer.py
Container type can be input from command line
from a list of [NORMAL, CLASSIC, MULTIBOOT] while
generating a container using GenContainer.py.
Setting default as NORMAL.

Revert varnames of out dir and key dir for commands
other than create container, as this is breaking stitch.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-10-02 20:28:17 -07:00