Hello Patrick Rudolph, Aaron Durbin, dhaval v sharma, Subrata Banik, Patrick Rudolph, Paul Menzel, Duncan Laurie, build bot (Jenkins), Patrick Georgi, Furquan Shaikh, Varshit B Pandya, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/27369
to look at the new patch set (#44).
Change subject: soc/intel/basecode: Add support for updating ucode loaded via FIT
......................................................................
soc/intel/basecode: Add support for updating ucode loaded via FIT
Intel’s FIT (Firmware Interface Table) based MCU (microcode/pcode patch)
loading mechanism patches the microcode before CPU reset. In the current
Chromebooks field updatable FW has to be first verified by vboot. Since
the MCU is loaded before reset vboot cannot verify the same and hence we
end up restricting FIT based MCU update only from RO.
This patch implements a scheme which will allow chromebooks to update
MCU in the field.
Create 2 bootblocks (use INTEL_ADD_TOP_SWAP_BOOTBLOCK) each containing their
own FIT table. First bootblock FIT has pointers to MCUs (in microcode_blob.bin)
which resides in RO section. This is will be used in the recovery scenario.
Second bootblock (Normal mode) is identical to the first one except the FIT.
Insert an additional pointer to a MCU that will reside in a staging area.
Use the CONFIG_INTEL_TOP_SWAP_FIT_ENTRY_FMAP_REG config to insert the address
of the staging area into FIT.
Top swap control bit in RTC BUC register (0x3414) is used to switch between
the two bootblocks.
Reserve a region in the FMAP which is equal to or greater than the MCU size
specified in the BWG for a particular SoC (e.g., for Skylake/Kaby Lake it is
192K). This is a RW region just like the RW_MRC_CACHE. MCU from RW-A/RW-B will
be copied to this region during boot. Protect this staging area with a FPR.
Basic update flow:
In non-recovery mode, Once a slot has been selected and loaded, check if the
current slot MCU and RW staging MCU are same. If so, update the staging area
with the MCU found in the current slot and reset the system.
Also, make sure that the top is enabled in normal/developer mode and disabled
in recovery mode.
In order to enable the update feature:
* The mainboard chromeos.fmd should include a new region for staging MCU
e.g, RW_UCODE_STAGED.
* Select config TOP_SWAP_BASED_VBOOT_UCODE_UPDATE.
* Implement a call to check_and_update_ucode() and handle the failure
appropriately.
Add documentation to describing the MCU update procedure.
TEST=Create an FW image for soraka and flash, create a chromeos-firmwareupdate
shellball with a newer MCU and perform an update. Make sue that the
currently loaded microcode version matches the one in firmwareupdate.
Change-Id: Iab6ba36a2eb587f331fe522c778e2c430c8eb655
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Signed-off-by: dhaval v sharma <dhaval.v.sharma(a)intel.com>
Signed-off-by: Pandya, Varshit B <varshit.b.pandya(a)intel.com>
---
M Documentation/soc/intel/index.md
A Documentation/soc/intel/ucode_update/flash_layout.svg
A Documentation/soc/intel/ucode_update/microcode_update_model.md
A src/soc/intel/common/basecode/fw_update/Kconfig
A src/soc/intel/common/basecode/fw_update/Makefile.inc
A src/soc/intel/common/basecode/fw_update/ucode_update.c
A src/soc/intel/common/basecode/include/intelbasecode/ucode_update.h
7 files changed, 644 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/27369/44
--
To view, visit https://review.coreboot.org/c/coreboot/+/27369
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iab6ba36a2eb587f331fe522c778e2c430c8eb655
Gerrit-Change-Number: 27369
Gerrit-PatchSet: 44
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma(a)intel.com>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Dhaval Sharma <dhaval.v.sharma(a)intel.corp-partner.google.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: rushikesh s kadam <rushikesh.s.kadam(a)intel.com>
Gerrit-MessageType: newpatchset
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/28647 )
Change subject: selfboot: remove bounce buffers
......................................................................
Patch Set 28:
(1 comment)
https://review.coreboot.org/c/coreboot/+/28647/28/src/lib/selfboot.c
File src/lib/selfboot.c:
https://review.coreboot.org/c/coreboot/+/28647/28/src/lib/selfboot.c@152
PS28, Line 152: for (first_segment = seg = cbfssegs;; ++seg) {
I happened to see this CL. Do we still need this for loop after this change?
--
To view, visit https://review.coreboot.org/c/coreboot/+/28647
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I602feb32f35e8af1d0dc4ea9f25464872c9b824c
Gerrit-Change-Number: 28647
Gerrit-PatchSet: 28
Gerrit-Owner: ron minnich <rminnich(a)gmail.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Julius Werner <jwerner(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Piotr Król <piotr.krol(a)3mdeb.com>
Gerrit-Reviewer: Werner Zeh <werner.zeh(a)siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: ron minnich <rminnich(a)gmail.com>
Gerrit-CC: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-CC: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-CC: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-CC: Yu-Ping Wu <yupingso(a)google.com>
Gerrit-Comment-Date: Tue, 10 Sep 2019 09:19:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Rizwan Qureshi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/27369 )
Change subject: soc/intel/basecode: Add support for updating ucode loaded via FIT
......................................................................
Patch Set 43:
> Patch Set 43:
>
> > Patch Set 43:
> >
> > If a patchset doesn't build don't expect somebody to review it.
> > Why is the documentation in a different patch set?
>
> the errors don't seem to be related to this change, will have a look anyways.
> Will squash the documentation in to this one as well.
>
> i386-elf-ld.bfd: /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/microcode/microcode.o: in function `intel_microcode_load_unlocked':
> /home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:80: multiple definition of `intel_microcode_load_unlocked'; /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/haswell/bootblock.o:/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:80: first defined here
> i386-elf-ld.bfd: /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/microcode/microcode.o: in function `get_current_microcode_rev':
> /home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:128: multiple definition of `get_current_microcode_rev'; /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/haswell/bootblock.o:/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:128: first defined here
> i386-elf-ld.bfd: /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/microcode/microcode.o: in function `get_microcode_rev':
> /home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:133: multiple definition of `get_microcode_rev'; /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/haswell/bootblock.o:/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:133: first defined here
Aah, they are because of the previous patch in the train
--
To view, visit https://review.coreboot.org/c/coreboot/+/27369
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iab6ba36a2eb587f331fe522c778e2c430c8eb655
Gerrit-Change-Number: 27369
Gerrit-PatchSet: 43
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma(a)intel.com>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Dhaval Sharma <dhaval.v.sharma(a)intel.corp-partner.google.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: rushikesh s kadam <rushikesh.s.kadam(a)intel.com>
Gerrit-Comment-Date: Tue, 10 Sep 2019 08:14:48 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Rizwan Qureshi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/27369 )
Change subject: soc/intel/basecode: Add support for updating ucode loaded via FIT
......................................................................
Patch Set 43:
> Patch Set 43:
>
> If a patchset doesn't build don't expect somebody to review it.
> Why is the documentation in a different patch set?
the errors don't seem to be related to this change, will have a look anyways.
Will squash the documentation in to this one as well.
i386-elf-ld.bfd: /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/microcode/microcode.o: in function `intel_microcode_load_unlocked':
/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:80: multiple definition of `intel_microcode_load_unlocked'; /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/haswell/bootblock.o:/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:80: first defined here
i386-elf-ld.bfd: /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/microcode/microcode.o: in function `get_current_microcode_rev':
/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:128: multiple definition of `get_current_microcode_rev'; /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/haswell/bootblock.o:/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:128: first defined here
i386-elf-ld.bfd: /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/microcode/microcode.o: in function `get_microcode_rev':
/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:133: multiple definition of `get_microcode_rev'; /cb-build/coreboot-gerrit.0/chromeos/GOOGLE_FALCO/bootblock/cpu/intel/haswell/bootblock.o:/home/coreboot/slave-root/workspace/coreboot-gerrit/src/cpu/intel/microcode/microcode.c:133: first defined here
--
To view, visit https://review.coreboot.org/c/coreboot/+/27369
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iab6ba36a2eb587f331fe522c778e2c430c8eb655
Gerrit-Change-Number: 27369
Gerrit-PatchSet: 43
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma(a)intel.com>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Dhaval Sharma <dhaval.v.sharma(a)intel.corp-partner.google.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: rushikesh s kadam <rushikesh.s.kadam(a)intel.com>
Gerrit-Comment-Date: Tue, 10 Sep 2019 08:12:53 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/27369 )
Change subject: soc/intel/basecode: Add support for updating ucode loaded via FIT
......................................................................
Patch Set 43:
If a patchset doesn't build don't expect somebody to review it.
Why is the documentation in a different patch set?
--
To view, visit https://review.coreboot.org/c/coreboot/+/27369
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iab6ba36a2eb587f331fe522c778e2c430c8eb655
Gerrit-Change-Number: 27369
Gerrit-PatchSet: 43
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Duncan Laurie <dlaurie(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Varshit B Pandya <varshit.b.pandya(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Reviewer: dhaval v sharma <dhaval.v.sharma(a)intel.com>
Gerrit-CC: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-CC: Dhaval Sharma <dhaval.v.sharma(a)intel.corp-partner.google.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: rushikesh s kadam <rushikesh.s.kadam(a)intel.com>
Gerrit-Comment-Date: Tue, 10 Sep 2019 06:58:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Hello Kyösti Mälkki, Aaron Durbin, Patrick Rudolph, Nathaniel L Desimone, Subrata Banik, Marshall Dawson, Tim Wawrzynczak, Shelley Chen, build bot (Jenkins), Furquan Shaikh,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/35324
to review the following change.
Change subject: Revert "intel/fsp2_0: Move temporary RAM to .bss with FSP_USES_CB_STACK"
......................................................................
Revert "intel/fsp2_0: Move temporary RAM to .bss with FSP_USES_CB_STACK"
This reverts commit c9871505f115f0e5722bf23b13f4390c8d76d0da.
Reason for revert: <INSERT REASONING HERE>
Change-Id: I46889a3860a0704f9011c8227005207dcb740d0e
---
M src/drivers/intel/fsp2_0/Kconfig
M src/drivers/intel/fsp2_0/memory_init.c
2 files changed, 12 insertions(+), 20 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/35324/1
diff --git a/src/drivers/intel/fsp2_0/Kconfig b/src/drivers/intel/fsp2_0/Kconfig
index 541ec47..3fb39d5 100644
--- a/src/drivers/intel/fsp2_0/Kconfig
+++ b/src/drivers/intel/fsp2_0/Kconfig
@@ -152,11 +152,6 @@
without reinitializing stack pointer. This feature is
supported Icelake onwards.
-config FSP_TEMP_RAM_SIZE
- hex
- default 0x10000
- depends on FSP_USES_CB_STACK
-
config VERIFY_HOBS
bool "Verify the FSP hand-off-blocks"
default n
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c
index 9789c96..0797c2e 100644
--- a/src/drivers/intel/fsp2_0/memory_init.c
+++ b/src/drivers/intel/fsp2_0/memory_init.c
@@ -34,8 +34,6 @@
#include <fsp/memory_init.h>
#include <types.h>
-static uint8_t temp_ram[CONFIG_FSP_TEMP_RAM_SIZE] __aligned(sizeof(uint64_t));
-
/* TPM MRC hash functionality depends on vboot starting before memory init. */
_Static_assert(!CONFIG(FSP2_0_USES_TPM_MRC_HASH) ||
CONFIG(VBOOT_STARTS_IN_BOOTBLOCK),
@@ -163,7 +161,6 @@
return CB_SUCCESS;
}
-
static enum cb_err setup_fsp_stack_frame(FSPM_ARCH_UPD *arch_upd,
const struct memranges *memmap)
{
@@ -171,6 +168,17 @@
uintptr_t stack_end;
/*
+ * FSP 2.1 version would use same stack as coreboot instead of
+ * setting up seprate stack frame. FSP 2.1 would not relocate stack
+ * top and does not reinitialize stack pointer.
+ */
+ if (CONFIG(FSP_USES_CB_STACK)) {
+ arch_upd->StackBase = (void *)_car_stack_start;
+ arch_upd->StackSize = CONFIG_DCACHE_BSP_STACK_SIZE;
+ return CB_SUCCESS;
+ }
+
+ /*
* FSPM_UPD passed here is populated with default values
* provided by the blob itself. We let FSPM use top of CAR
* region of the size it requests.
@@ -189,19 +197,8 @@
bool s3wake, uint32_t fsp_version,
const struct memranges *memmap)
{
- /*
- * FSP 2.1 version would use same stack as coreboot instead of
- * setting up separate stack frame. FSP 2.1 would not relocate stack
- * top and does not reinitialize stack pointer. The parameters passed
- * as StackBase and StackSize are actually for temporary RAM and HOBs
- * and are not related to FSP stack at all.
- */
- if (CONFIG(FSP_USES_CB_STACK)) {
- arch_upd->StackBase = temp_ram;
- arch_upd->StackSize = sizeof(temp_ram);
- } else if (setup_fsp_stack_frame(arch_upd, memmap)) {
+ if (setup_fsp_stack_frame(arch_upd, memmap))
return CB_ERR;
- }
fsp_fill_mrc_cache(arch_upd, fsp_version);
--
To view, visit https://review.coreboot.org/c/coreboot/+/35324
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I46889a3860a0704f9011c8227005207dcb740d0e
Gerrit-Change-Number: 35324
Gerrit-PatchSet: 1
Gerrit-Owner: Lean Sheng Tan <lean.sheng.tan(a)intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Nathaniel L Desimone <nathaniel.l.desimone(a)intel.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Shelley Chen <shchen(a)google.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newchange
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35233 )
Change subject: intel/fsp2_0: Move temporary RAM to .bss with FSP_USES_CB_STACK
......................................................................
intel/fsp2_0: Move temporary RAM to .bss with FSP_USES_CB_STACK
The documentation for StackBase and StackSize in FSPM_ARCH_UPD is
confusing. Previously the region was shared for heap and stack,
starting with FSP2.1 only for heap (or 'temporary RAM') for HOBs.
Moving the allocation outside DCACHE_BSP_STACK_SIZE allows use of
stack guards and reduces amount of reserved CAR for bootblock and
verstage, as the new allocation in .bss is only taken in romstage.
Change-Id: I4cffcc73a89cb97ab7759dd373196ce9753a6307
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/drivers/intel/fsp2_0/memory_init.c
M src/soc/intel/cannonlake/Kconfig
M src/soc/intel/icelake/Kconfig
3 files changed, 15 insertions(+), 14 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35233/1
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c
index 0797c2e..dbaecdb 100644
--- a/src/drivers/intel/fsp2_0/memory_init.c
+++ b/src/drivers/intel/fsp2_0/memory_init.c
@@ -34,6 +34,8 @@
#include <fsp/memory_init.h>
#include <types.h>
+static char temp_ram[0x20000];
+
/* TPM MRC hash functionality depends on vboot starting before memory init. */
_Static_assert(!CONFIG(FSP2_0_USES_TPM_MRC_HASH) ||
CONFIG(VBOOT_STARTS_IN_BOOTBLOCK),
@@ -161,6 +163,7 @@
return CB_SUCCESS;
}
+
static enum cb_err setup_fsp_stack_frame(FSPM_ARCH_UPD *arch_upd,
const struct memranges *memmap)
{
@@ -168,17 +171,6 @@
uintptr_t stack_end;
/*
- * FSP 2.1 version would use same stack as coreboot instead of
- * setting up seprate stack frame. FSP 2.1 would not relocate stack
- * top and does not reinitialize stack pointer.
- */
- if (CONFIG(FSP_USES_CB_STACK)) {
- arch_upd->StackBase = (void *)_car_stack_start;
- arch_upd->StackSize = CONFIG_DCACHE_BSP_STACK_SIZE;
- return CB_SUCCESS;
- }
-
- /*
* FSPM_UPD passed here is populated with default values
* provided by the blob itself. We let FSPM use top of CAR
* region of the size it requests.
@@ -197,8 +189,19 @@
bool s3wake, uint32_t fsp_version,
const struct memranges *memmap)
{
- if (setup_fsp_stack_frame(arch_upd, memmap))
+ /*
+ * FSP 2.1 version would use same stack as coreboot instead of
+ * setting up separate stack frame. FSP 2.1 would not relocate stack
+ * top and does not reinitialize stack pointer. The parameters passed
+ * as StackBase and StackSize are actually for temporary RAM and HOBs
+ * and are not related to FSP stack at all.
+ */
+ if (CONFIG(FSP_USES_CB_STACK)) {
+ arch_upd->StackBase = temp_ram;
+ arch_upd->StackSize = sizeof(temp_ram);
+ } else if (setup_fsp_stack_frame(arch_upd, memmap)) {
return CB_ERR;
+ }
fsp_fill_mrc_cache(arch_upd, fsp_version);
diff --git a/src/soc/intel/cannonlake/Kconfig b/src/soc/intel/cannonlake/Kconfig
index d949fff..2c5a884 100644
--- a/src/soc/intel/cannonlake/Kconfig
+++ b/src/soc/intel/cannonlake/Kconfig
@@ -119,7 +119,6 @@
config DCACHE_BSP_STACK_SIZE
hex
- default 0x20000 if FSP_USES_CB_STACK
default 0x4000
help
The amount of anticipated stack usage in CAR by bootblock and
diff --git a/src/soc/intel/icelake/Kconfig b/src/soc/intel/icelake/Kconfig
index 1bd478c..399a59c 100644
--- a/src/soc/intel/icelake/Kconfig
+++ b/src/soc/intel/icelake/Kconfig
@@ -70,7 +70,6 @@
config DCACHE_BSP_STACK_SIZE
hex
- default 0x20000 if FSP_USES_CB_STACK
default 0x4000
help
The amount of anticipated stack usage in CAR by bootblock and
--
To view, visit https://review.coreboot.org/c/coreboot/+/35233
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I4cffcc73a89cb97ab7759dd373196ce9753a6307
Gerrit-Change-Number: 35233
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newchange
Richard Spiegel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33770 )
Change subject: soc/amd/picasso: Update southbridge
......................................................................
Patch Set 14:
(1 comment)
https://review.coreboot.org/c/coreboot/+/33770/13/src/soc/amd/picasso/inclu…
File src/soc/amd/picasso/include/soc/southbridge.h:
https://review.coreboot.org/c/coreboot/+/33770/13/src/soc/amd/picasso/inclu…
PS13, Line 229: 0x5b
> You're right. […]
LOL... last code was mine... Initial code was AMD's, one AOAC at a time. I made it all together to save wait time, though maintained registers definitions as per AMD. I like your new way.
--
To view, visit https://review.coreboot.org/c/coreboot/+/33770
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I69dfc4a875006639aa330385680d150331840e40
Gerrit-Change-Number: 33770
Gerrit-PatchSet: 14
Gerrit-Owner: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 10 Sep 2019 00:01:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Marshall Dawson <marshalldawson3rd(a)gmail.com>
Comment-In-Reply-To: Richard Spiegel <richard.spiegel(a)silverbackltd.com>
Gerrit-MessageType: comment