Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34791 )
Change subject: soc/intel/cannonlake: Speed up postcar loading using intermediate caching
......................................................................
soc/intel/cannonlake: Speed up postcar loading using intermediate caching
This patch ensures intermediate caching is enabled to speed up
loading and decompression of next stage as we are still in romstage
and car tear down will be handled by next stage at its entry.
TEST=cbmem -t shows ~2-4ms time savings in warm reboot case with this
CL.
Change-Id: I3ba63887acb5c4bdeaf3e21c24fb0e631362962c
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/soc/intel/cannonlake/romstage/romstage.c
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/34791/1
diff --git a/src/soc/intel/cannonlake/romstage/romstage.c b/src/soc/intel/cannonlake/romstage/romstage.c
index 94b9899..04a9d53 100644
--- a/src/soc/intel/cannonlake/romstage/romstage.c
+++ b/src/soc/intel/cannonlake/romstage/romstage.c
@@ -127,6 +127,21 @@
printk(BIOS_DEBUG, "%d DIMMs found\n", mem_info->dimm_cnt);
}
+/*
+ * Make sure we are enabling intermediate caching to speed up next stage
+ * (postcar/romstage) loading and decompression as we are still in romstage
+ * and car tear down will be handled by next stage at its entry.
+ */
+static void enable_ramstage_caching(uintptr_t base, size_t size)
+{
+ int mtrr = get_free_var_mtrr();
+
+ if (mtrr == -1)
+ return;
+
+ set_var_mtrr(mtrr, base, size, MTRR_TYPE_WRPROT);
+}
+
asmlinkage void car_stage_entry(void)
{
bool s3wake;
@@ -160,6 +175,8 @@
printk(BIOS_DEBUG, "top_of_ram = 0x%lx\n", top_of_ram);
top_of_ram -= 16*MiB;
postcar_frame_add_mtrr(&pcf, top_of_ram, 16*MiB, MTRR_TYPE_WRBACK);
+ /* enabling intermediate caching */
+ enable_ramstage_caching(top_of_ram, 16*MiB);
/* Cache the ROM as WP just below 4GiB. */
postcar_frame_add_romcache(&pcf, MTRR_TYPE_WRPROT);
--
To view, visit https://review.coreboot.org/c/coreboot/+/34791
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3ba63887acb5c4bdeaf3e21c24fb0e631362962c
Gerrit-Change-Number: 34791
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34805 )
Change subject: arch/x86: Add postcar_frame_add_ramcache() API
......................................................................
arch/x86: Add postcar_frame_add_ramcache() API
This patch adds new API for intermediate caching top_of_ram
and setting up required MTRR for next stage.
Change-Id: Iddafb573afb4799de64754a94816d7f3f2f4982f
Signed-off-by: Subrata Banik <subrata.banik(a)intel.com>
---
M src/arch/x86/include/arch/cpu.h
M src/arch/x86/postcar_loader.c
2 files changed, 30 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/05/34805/1
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 293ca02..7dc4049 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -329,6 +329,13 @@
void postcar_frame_add_romcache(struct postcar_frame *pcf, int type);
/*
+ * Add variable MTRR covering the Top of RAM with given MTRR type.
+ */
+void postcar_frame_add_ramcache(struct postcar_frame *pcf,
+ uintptr_t addr, size_t size, int type);
+
+
+/*
* Push used MTRR and Max MTRRs on to the stack
* and return pointer to stack top.
*/
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index 35e139f..8a1f6cb 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -120,6 +120,29 @@
postcar_frame_add_mtrr(pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, type);
}
+/*
+ * Make sure we are enabling intermediate caching to speed up next stage
+ * (postcar/romstage) loading and decompression as we are still in romstage
+ * and CAR tear down will be handled by next stage at its entry.
+ */
+static void enable_top_of_ram_cache(uintptr_t base, size_t size)
+{
+ int mtrr = get_free_var_mtrr();
+
+ if (mtrr == -1)
+ return;
+
+ set_var_mtrr(mtrr, base, size, MTRR_TYPE_WRPROT);
+}
+
+void postcar_frame_add_ramcache(struct postcar_frame *pcf,
+ uintptr_t addr, size_t size, int type)
+{
+ /* enable intermediate caching for Top of RAM */
+ enable_top_of_ram_cache(addr, size);
+ postcar_frame_add_mtrr(pcf, addr, size, type);
+}
+
void *postcar_commit_mtrrs(struct postcar_frame *pcf)
{
/*
--
To view, visit https://review.coreboot.org/c/coreboot/+/34805
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iddafb573afb4799de64754a94816d7f3f2f4982f
Gerrit-Change-Number: 34805
Gerrit-PatchSet: 1
Gerrit-Owner: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-MessageType: newchange
Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30747
Change subject: cpu/amd/microcode: Search all containers
......................................................................
cpu/amd/microcode: Search all containers
Currently, it’s aborted if the first file is not found.
The commit was only tested with all microcode containers present in
CBFS.
If only one microcode update container is present, which is not the
first, it is skipped.
Change the return to continue to traverse all elements.
Fixes: 83e4c5613 (cpu/amd/microcode: Update parser to use stock microcode blobs)
Change-Id: I5195ff0334cf49cadc25de31822a9f2f2cd90490
Signed-off-by: Paul Menzel <pmenzel(a)molgen.mpg.de>
---
M src/cpu/amd/microcode/microcode.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/47/30747/1
diff --git a/src/cpu/amd/microcode/microcode.c b/src/cpu/amd/microcode/microcode.c
index e8ab175..622c6db 100644
--- a/src/cpu/amd/microcode/microcode.c
+++ b/src/cpu/amd/microcode/microcode.c
@@ -214,7 +214,7 @@
spin_unlock(romstage_microcode_cbfs_lock());
#endif
#endif
- return;
+ continue;
}
amd_update_microcode(ucode, ucode_len, equivalent_processor_rev_id);
--
To view, visit https://review.coreboot.org/c/coreboot/+/30747
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5195ff0334cf49cadc25de31822a9f2f2cd90490
Gerrit-Change-Number: 30747
Gerrit-PatchSet: 1
Gerrit-Owner: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newchange
Pavel Sayekat has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35011 )
Change subject: Doc/mb/asus: Add H110M-E/M.2 Documentation
......................................................................
Doc/mb/asus: Add H110M-E/M.2 Documentation
Followed and adapted from the ASRock H110M-DVS Documentation
Signed-off-by: Pavel Sayekat <pavelsayekat(a)gmail.com>
Change-Id: I6c5aad50b513935eab70b502df1d95fb3413fa6b
---
A Documentation/mainboard/asus/h110m-e_m2.md
1 file changed, 136 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/35011/1
diff --git a/Documentation/mainboard/asus/h110m-e_m2.md b/Documentation/mainboard/asus/h110m-e_m2.md
new file mode 100644
index 0000000..134dca8
--- /dev/null
+++ b/Documentation/mainboard/asus/h110m-e_m2.md
@@ -0,0 +1,136 @@
+# ASUS H110M-E/M.2
+
+This page describes how to run coreboot on the [ASUS H110M-E/M.2].
+
+## Required proprietary blobs
+
+Mainboard is based on Intel Skylake/Kaby Lake processor and H110 Chipset.
+Intel company provides [Firmware Support Package (2.0)](../../soc/intel/fsp/index.md)
+(intel FSP 2.0) to initialize this generation silicon. Please see this
+[document](../../soc/intel/code_development_model/code_development_model.md).
+
+FSP Information:
+
+```eval_rst
++-----------------------------+-------------------+-------------------+
+| FSP Project Name | Directory | Specification |
++-----------------------------+-------------------+-------------------+
+| 7th Generation Intel® Core™ | KabylakeFspBinPkg | 2.0 |
+| processors and chipsets | | |
+| (formerly Kaby Lake) | | |
++-----------------------------+-------------------+-------------------+
+```
+
+## Building coreboot
+
+The following steps set the default parameters for this board to build a
+fully working image:
+
+```bash
+make distclean
+touch .config
+./util/scripts/config --enable VENDOR_ASUS
+./util/scripts/config --enable BOARD_ASUS_H110M_E_M2
+./util/scripts/config --enable CONFIG_ADD_FSP_BINARIES
+./util/scripts/config --enable CONFIG_FSP_USE_REPO
+./util/scripts/config --set-str REALTEK_8168_MACADDRESS "xx:xx:xx:xx:xx:xx"
+make olddefconfig
+```
+
+However, it is strongly advised to use `make menuconfig` afterwards
+(or instead), so that you can see all of the settings.
+
+Use the following command to disable the serial console if debugging
+output is not required:
+
+```bash
+./util/scripts/config --disable CONSOLE_SERIAL
+```
+
+However, a more flexible method is to change the console log level from
+within an OS using `util/nvramtool`, or with the `nvramcui` payload.
+
+Now, run `make` to build the coreboot image.
+
+## Flashing coreboot
+
+### Internal programming
+
+The main SPI flash can be accessed using [flashrom]. By default, only
+the BIOS region of the flash is writable. If you wish to change any
+other region, such as the Management Engine or firmware descriptor, then
+an external programmer is required (unless you find a clever way around
+the flash protection). More information about this [here](../../flash_tutorial/index.md).
+
+### External programming
+
+The flash chip is a 16 MiB socketed DIP-8 chip. Specifically, it's a
+GIgaDevice GD25B128CPIG, whose datasheet can be found [here][GD25B128CPIG].
+The chip is located to the bottom right-hand side of the board. For
+a precise location, refer to section 1.3 (Motherboard Layout) of the
+[H110M-E/M.2 manual], where the chip is labelled "128Mb BIOS". Take note of
+the chip's orientation, remove it from its socket, and flash it with
+an external programmer. For reference, the notch in the chip should be
+facing towards the bottom of the board.
+
+## Known issues
+
+- The VGA port doesn't work. Discrete graphic card is used as primary
+ device for display output (if CONFIG_ONBOARD_VGA_IS_PRIMARY is not
+ set). Dynamic switching between iGPU and PEG is not yet supported.
+
+- SuperIO GPIO pin is used to reset Realtek chip. However, since the
+ Logical Device 7 (GPIO7, GPIO8) is not initialized, the network
+ chip is in a reset state all the time.
+
+## Untested
+
+- parallel port
+- PS/2 keyboard
+- PS/2 mouse
+- EHCI debug
+- TPM
+- infrared module
+- chassis intrusion header
+- chassis speaker header
+
+## Working
+
+- integrated graphics init with libgfxinit (see [Known issues](#known-issues))
+- PCIe x1
+- PEG x16 Gen3
+- SATA
+- USB
+- serial port
+- onboard audio
+- using `me_cleaner`
+- using `flashrom`
+
+## TODO
+
+- NCT5539D GPIOs
+- onboard network (see [Known issues](#known-issues))
+- S3 suspend/resume
+- Wake-on-LAN
+- hardware monitor
+
+## Technology
+
+```eval_rst
++------------------+--------------------------------------------------+
+| CPU | Intel Skylake/Kaby Lake (LGA1151) |
++------------------+--------------------------------------------------+
+| PCH | Intel Sunrise Point H110 |
++------------------+--------------------------------------------------+
+| Super I/O | Nuvoton NCT5539D |
++------------------+--------------------------------------------------+
+| EC | None |
++------------------+--------------------------------------------------+
+| Coprocessor | Intel Management Engine |
++------------------+--------------------------------------------------+
+```
+
+[ASUS H110M-E/M.2]: https://www.asus.com/Motherboards/H110M-E-M-2/overview/
+[GD25B128CPIG]: https://www.gigadevice.com/datasheet/gd25b127d/ [The closest match found]
+[flashrom]: https://flashrom.org/Flashrom
+[ASUS H110M-E/M.2 manual]: https://dlcdnets.asus.com/pub/ASUS/mb/LGA1151/H110M-E_M2/E11622_H110M-E_M2_…
--
To view, visit https://review.coreboot.org/c/coreboot/+/35011
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I6c5aad50b513935eab70b502df1d95fb3413fa6b
Gerrit-Change-Number: 35011
Gerrit-PatchSet: 1
Gerrit-Owner: Pavel Sayekat
Gerrit-MessageType: newchange
Varshit B Pandya has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34657 )
Change subject: Documentation/soc/intel: Add documentation for MCU update
......................................................................
Documentation/soc/intel: Add documentation for MCU update
Change-Id: I3deb24550c1f1cd4c7b8082af75115ca174c295a
Signed-off-by: Pandya, Varshit B <varshit.b.pandya(a)intel.com>
---
A Documentation/soc/intel/ucode_update/Flash_Layout.PNG
A Documentation/soc/intel/ucode_update/microcode_update_model.md
2 files changed, 43 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/34657/1
diff --git a/Documentation/soc/intel/ucode_update/Flash_Layout.PNG b/Documentation/soc/intel/ucode_update/Flash_Layout.PNG
new file mode 100644
index 0000000..ac18977
--- /dev/null
+++ b/Documentation/soc/intel/ucode_update/Flash_Layout.PNG
Binary files differ
diff --git a/Documentation/soc/intel/ucode_update/microcode_update_model.md b/Documentation/soc/intel/ucode_update/microcode_update_model.md
new file mode 100644
index 0000000..e2d7f35
--- /dev/null
+++ b/Documentation/soc/intel/ucode_update/microcode_update_model.md
@@ -0,0 +1,43 @@
+# Microcode update mechanism for devices in field
+
+## Introduction
+
+Processor microcode (MCU) is akin to processor firmware. Processors may need updates to their microcode to operate correctly. These updates fix bugs/errata that can cause anything from incorrect processing, to code and data corruption, and system lockups.
+
+##Problem Statement
+
+As per chrome design, any field updatable FW has to be first verified by vboot (chrome root of trust - CROT) before it is allowed to run on the system. CROT executes on the CPU, hence FW such as MCU loaded before the CPU reset cannot be verified before it actually gets loaded. As a result today Chromebooks are not able to apply MCU in the field. This proposal tries to address the issue
+
+Prior to CPU reset, the CPU HW locates the FIT table from the storage, walks over the FIT table and picks-up the MCU that matches the CPU Family, Model, Stepping and PLATFORM ID with the highest revision ID. CPU verifies that MCU is signed by Intel and once verification is successful, it attempts to load the MCU.
+
+However FIT does not contain any fall back mechanism. If one MCU loading fails for whatever reason, it drops the further loading process and moves on to CPU reset. While it is fairly a remote chance, in case of any failure to load MCU which cause hang like situations before CPU reset, a platform based mechanism can be put in place to enter recovery mode. As detailed below, if we are using BUC register based top swap implementation, then an RTC reset may be required to clear top swap bit.
+
+## Design Proposal
+
+The proposal relies on the following Intel SoC features:
+
+1. Top swap, which enables the BIOS to have 2 bootblocks and bot from either using a RTC backed Top swap control bit in BUC register.
+2. Firmware Interface Table (FIT) based MCU loading.
+
+The idea is to have 2 bootblocks, each having its own FIT table. The FIT in one of them will be configured to point to an MCU in RO firmware, and the FIT in other one will point to a fixed flash region (aka MCU staging area), which will contain an MCU from RW firmware.
+
+Top-swap feature of Intel CPUs, will be used to switch between 2 bootblocks, based on the bootmode i.e., recovery or normal/developer mode.
+
+Coreboot will keep the MCU staging area updated with the MCU from the currently selected RW firmware.
+
+## Implementation Details
+
+1. Create 2 BBs (bb_ro_ucode and bb_staged_ucode) each containing their own FIT tables. Both bootblocks will be in the RO section.
+ a. bb_ro_ucode contains a FIT which has pointer to MCU (microcode_blob.bin) which resides in RO section. This is will be used in the recovery scenario.
+ b. bb_staged_ucode is identical to bb_ro_ucode but contains a FIT which has pointer to a MCU that will reside in a staging area.
+2. Create a MCU staging area
+ a. Reserve a region in the FMAP which is equal to or greater than the MCU size specified in the BWG for that SoC. This is a RW region just lke the RW_MRC_CACHE.
+ b. MCU from RW-A/RW-B will be copied to this region during boot.
+ c. A Flash Protected Range (FPR) should be configured to write protect this MCU Staging area.
+ d. bb_staged_ucode FIT points to the MCU in this staging area.
+3. The resulting flash layout is shown below,
+**Flash Layout**
+![Flash Layout][flash_layout]
+[flash_layout]: Flash_Layout.PNG
+
+4. The proposed design uses the PCR register based control for top-swap
--
To view, visit https://review.coreboot.org/c/coreboot/+/34657
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I3deb24550c1f1cd4c7b8082af75115ca174c295a
Gerrit-Change-Number: 34657
Gerrit-PatchSet: 1
Gerrit-Owner: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-MessageType: newchange
Hello Marco Chen,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/33661
to review the following change.
Change subject: vendorcode/google: load sar config from CBFS first then VPD
......................................................................
vendorcode/google: load sar config from CBFS first then VPD
SAR config provisioned in RO VPD can be done in the factory only. Once
it is wrong, we can override the SAR config by updating FW RW which can
carry new SAR config in CBFS. As a result, we should check CBFS first
then VPD.
Change-Id: I5aa6235fb7a6d0b2ed52893a42f7bd57806af6c1
Signed-off-by: Marco Chen <marcochen(a)chromium.org>
---
M src/vendorcode/google/chromeos/sar.c
1 file changed, 23 insertions(+), 22 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/33661/1
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index bbcb211..a5a2c3b 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -82,36 +82,37 @@
sizeof(struct wifi_sar_delta_table);
}
- /* Try to read the SAR limit entry from VPD */
- if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
- buffer_size, VPD_ANY)) {
- printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n",
- wifi_sar_limit_key);
-
- if (!CONFIG(WIFI_SAR_CBFS))
- return -1;
-
+ if (CONFIG(WIFI_SAR_CBFS)) {
printk(BIOS_DEBUG, "Checking CBFS for default SAR values\n");
sar_cbfs_len = load_sar_file_from_cbfs(
(void *) wifi_sar_limit_str,
sar_expected_len);
- if (sar_cbfs_len != sar_expected_len) {
- printk(BIOS_ERR, "%s has bad len in CBFS\n",
- WIFI_SAR_CBFS_FILENAME);
- return -1;
- }
- } else {
- /* VPD key "wifi_sar" found. strlen is checked with addition of
- * 1 as we have created buffer size 1 char larger for the reason
- * mentioned at start of this function itself */
- if (strlen(wifi_sar_limit_str) + 1 != sar_expected_len) {
- printk(BIOS_ERR, "WIFI SAR key has bad len in VPD\n");
- return -1;
- }
+ if (sar_cbfs_len == sar_expected_len)
+ goto done;
+
+ printk(BIOS_ERR, "%s has bad len in CBFS\n",
+ WIFI_SAR_CBFS_FILENAME);
}
+ /* Try to read the SAR limit entry from VPD */
+ if (!vpd_gets(wifi_sar_limit_key, wifi_sar_limit_str,
+ buffer_size, VPD_ANY)) {
+ printk(BIOS_ERR, "Error: Could not locate '%s' in VPD.\n",
+ wifi_sar_limit_key);
+ return -1;
+ }
+
+ /* VPD key "wifi_sar" found. strlen is checked with addition of
+ * 1 as we have created buffer size 1 char larger for the reason
+ * mentioned at start of this function itself */
+ if (strlen(wifi_sar_limit_str) + 1 != sar_expected_len) {
+ printk(BIOS_ERR, "WIFI SAR key has bad len in VPD\n");
+ return -1;
+ }
+
+done:
/* Decode the heximal encoded string to binary values */
if (hexstrtobin(wifi_sar_limit_str, bin_buffer, bin_buff_adjusted_size)
< bin_buff_adjusted_size) {
--
To view, visit https://review.coreboot.org/c/coreboot/+/33661
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I5aa6235fb7a6d0b2ed52893a42f7bd57806af6c1
Gerrit-Change-Number: 33661
Gerrit-PatchSet: 1
Gerrit-Owner: Marco Chen <marcochen(a)google.com>
Gerrit-Reviewer: Marco Chen <marcochen(a)chromium.org>
Gerrit-MessageType: newchange