Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37683 )
Change subject: arch/x86: Fix S3 resume without stage cache
......................................................................
arch/x86: Fix S3 resume without stage cache
It is possible to have NO_STAGE_CACHE=n and at the same time have
TSEG_STAGE_CACHE=n and CBMEB_STAGE_CACHE=n. This resulted with a
failing attempt to load STAGE_POSTCAR from the stage cache, but not
loading it from CBFS either.
Change-Id: I0da3e1cf4c92817ffabbb02eda3476ecdfdfa278
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
M src/arch/x86/postcar_loader.c
1 file changed, 19 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/37683/1
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index b53cbf8..46a62e8 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -19,6 +19,7 @@
#include <cpu/x86/mtrr.h>
#include <cpu/x86/smm.h>
#include <program_loading.h>
+#include <reset.h>
#include <rmodule.h>
#include <romstage_handoff.h>
#include <stage_cache.h>
@@ -208,6 +209,15 @@
MTRR_TYPE_WRBACK);
}
+static void postcar_cache_invalid(void)
+{
+ if (!CONFIG(TSEG_STAGE_CACHE) && !CONFIG(CBMEM_STAGE_CACHE))
+ return;
+
+ printk(BIOS_ERR, "postcar cache invalid.\n");
+ board_reset();
+}
+
void run_postcar_phase(struct postcar_frame *pcf)
{
struct prog prog =
@@ -215,14 +225,19 @@
postcar_commit_mtrrs(pcf);
- if (!CONFIG(NO_STAGE_CACHE) &&
- romstage_handoff_is_resume()) {
+ if (romstage_handoff_is_resume()) {
stage_cache_load_stage(STAGE_POSTCAR, &prog);
+
/* This is here to allow platforms to pass different stack
parameters between S3 resume and normal boot. On the
platforms where the values are the same it's a nop. */
- finalize_load(prog.arg, pcf->stack);
- } else
+ if (prog_entry(&prog) != NULL)
+ finalize_load(prog.arg, pcf->stack);
+ else
+ postcar_cache_invalid();
+ }
+
+ if (prog_entry(&prog) == NULL)
load_postcar_cbfs(&prog, pcf);
/* As postcar exist, it's end of romstage here */
--
To view, visit https://review.coreboot.org/c/coreboot/+/37683
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I0da3e1cf4c92817ffabbb02eda3476ecdfdfa278
Gerrit-Change-Number: 37683
Gerrit-PatchSet: 1
Gerrit-Owner: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39151 )
Change subject: Documentation: Add VBOOT on Lenovo devices
......................................................................
Documentation: Add VBOOT on Lenovo devices
Describe VBOOT implementation details for retrofitted Lenovo devices.
Change-Id: Ibabcc939d9d01f00a93fd42adc48057966ad877e
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M Documentation/mainboard/index.md
A Documentation/mainboard/lenovo/vboot.md
2 files changed, 36 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/39151/1
diff --git a/Documentation/mainboard/index.md b/Documentation/mainboard/index.md
index 126a8fb..6e833cf 100644
--- a/Documentation/mainboard/index.md
+++ b/Documentation/mainboard/index.md
@@ -70,6 +70,7 @@
- [R60](lenovo/r60.md)
- [T4xx common](lenovo/t4xx_series.md)
- [X2xx common](lenovo/x2xx_series.md)
+- [VBOOT](lenovo/vboot.md)
### Nehalem series
diff --git a/Documentation/mainboard/lenovo/vboot.md b/Documentation/mainboard/lenovo/vboot.md
new file mode 100644
index 0000000..559ea53
--- /dev/null
+++ b/Documentation/mainboard/lenovo/vboot.md
@@ -0,0 +1,35 @@
+# Using coreboot's verified boot on Lenovo devices
+
+By default a single instance of coreboot is present in the firmware flash,
+no verification is done and it doesn't write protect the flash to allow
+firmware updates from the OS.
+The verified boot mechanism also called [VBOOT] allows secure firmware
+updates using an A/B partitioning scheme once enabled.
+
+## Enabling VBOOT
+You can enable [VBOOT] in the *security menu*. Besides a verified boot you
+can also enable a measured boot by setting `CONFIG_VBOOT_MEASURED_BOOT`.
+Both options need a working TPM, which is present on all recent Lenovo
+devices.
+
+## Updating and recovery
+As the A/B partition is writeable you can still update them from the OS.
+By using the [VBOOT] mechanism you store a copy of coreboot in the `RO`
+partition that acts as failsaife in case the regular firmware update, that
+goes the `A` or `B` partition fails.
+
+On *Lenovo* devices you can enable the *Fn* key as recovery mode switch, by
+enabling `CONFIG_H8_FN_KEY_AS_VBOOT_RECOVERY_SW`.
+Holding the *Fn* at boot will then switch to the recovery image, allowing
+to boot and flash a working image to the A/B partition.
+
+## 8MiB ROM limitation
+*Lenovo* devices with 8MiB ROM only have a `RO`+`A` partition enabled in the
+default FMAP. They are missing the `B` partition, due to size contrains.
+You can still provide your own FMAP if you need `RO`+`A`+`B` partitions.
+
+## CMOS
+[VBOOT] on *Lenovo* devices uses the CMOS to store configuration data, like
+boot failures and the last successfully booted partition.
+
+[VBOOT]: ../../security/vboot/index.md
--
To view, visit https://review.coreboot.org/c/coreboot/+/39151
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ibabcc939d9d01f00a93fd42adc48057966ad877e
Gerrit-Change-Number: 39151
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Hung-Te Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/36251 )
Change subject: soc/mediatek/mt8183: Force retraining memory if requested
......................................................................
soc/mediatek/mt8183: Force retraining memory if requested
To allow retraining memory without hotkey (for example in manufacturing
process), we want to enforce re-training when the recovery reason is set
to VB2_RECOVERY_TRAIN_AND_REBOOT (which can be done by running
"crossystem recovery_request=0xc4").
On x86 (MRC cache) this is primarily used for ensuring RO calibration
data is filled; and on MT8183 we have only RW calibration, but it seems
totally fine to extend that to RW.
BRANCH=kukui
BUG=None
TEST=boots; crossystem recovery_reason=0xc4; reboot
Change-Id: Iaa5275f0e0eb90f6ab3a7d4579977a6655d59bd9
Signed-off-by: Hung-Te Lin <hungte(a)chromium.org>
---
M src/soc/mediatek/mt8183/memory.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/36251/1
diff --git a/src/soc/mediatek/mt8183/memory.c b/src/soc/mediatek/mt8183/memory.c
index 2a4ebbd..b9ed619 100644
--- a/src/soc/mediatek/mt8183/memory.c
+++ b/src/soc/mediatek/mt8183/memory.c
@@ -169,7 +169,8 @@
/* Load calibration params from flash and run fast calibration */
if (recovery_mode) {
printk(BIOS_WARNING, "Skip loading cached calibration data\n");
- if (vboot_recovery_mode_memory_retrain()) {
+ if (vboot_recovery_mode_memory_retrain() ||
+ vboot_check_recovery_request() == VB2_RECOVERY_TRAIN_AND_REBOOT) {
printk(BIOS_WARNING, "Retrain memory in next boot\n");
/* Use 0xFF as erased flash data. */
memset(dparam, 0xff, sizeof(*dparam));
--
To view, visit https://review.coreboot.org/c/coreboot/+/36251
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Iaa5275f0e0eb90f6ab3a7d4579977a6655d59bd9
Gerrit-Change-Number: 36251
Gerrit-PatchSet: 1
Gerrit-Owner: Hung-Te Lin <hungte(a)chromium.org>
Gerrit-MessageType: newchange
Mike Banon has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38472 )
Change subject: amd/agesa: Make BottomIo position configurable
......................................................................
amd/agesa: Make BottomIo position configurable
Some PCI peripherals, such as discrete VGA adapters, require a great
amount of memory mapped IO. This patch allows the user to select at
build time the bottom IO to leave enough space for such devices.
We cannot calculate this value at runtime because it has to be set
before the PCI devices are enumerated. 0x40000000 has been successfully
boot-tested on A88XM-E (fam15tn), G505S (fam15tn) and AM1I-A (fam16kb).
Signed-off-by: Mike Banon <mikebdp2(a)gmail.com>
Change-Id: Ie235631231bcb4aeebaff2e0026da2ea9d82f9d0
---
M src/northbridge/amd/agesa/Kconfig
M src/northbridge/amd/agesa/family14/state_machine.c
M src/northbridge/amd/agesa/family15tn/state_machine.c
M src/northbridge/amd/agesa/family16kb/state_machine.c
4 files changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/72/38472/1
diff --git a/src/northbridge/amd/agesa/Kconfig b/src/northbridge/amd/agesa/Kconfig
index e1e129a..346e2c3 100644
--- a/src/northbridge/amd/agesa/Kconfig
+++ b/src/northbridge/amd/agesa/Kconfig
@@ -20,6 +20,18 @@
if NORTHBRIDGE_AMD_AGESA
+config BOTTOMIO_POSITION
+ hex "Bottom of 32-bit IO space"
+ default 0x40000000
+ help
+ If PCI peripherals with big BARs are connected to the system
+ the bottom of the IO must be decreased to allocate such
+ devices.
+
+ Declare the beginning of the 128MB-aligned MMIO region. This
+ option is useful when PCI peripherals requesting large address
+ ranges are present.
+
config CONSOLE_VGA_MULTI
bool
default n
diff --git a/src/northbridge/amd/agesa/family14/state_machine.c b/src/northbridge/amd/agesa/family14/state_machine.c
index b49dac0..345f36a 100644
--- a/src/northbridge/amd/agesa/family14/state_machine.c
+++ b/src/northbridge/amd/agesa/family14/state_machine.c
@@ -60,6 +60,7 @@
void platform_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post)
{
+ Post->MemConfig.BottomIo = (UINT16)(CONFIG_BOTTOMIO_POSITION >> 24);
}
void platform_AfterInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post)
diff --git a/src/northbridge/amd/agesa/family15tn/state_machine.c b/src/northbridge/amd/agesa/family15tn/state_machine.c
index dafb64c..092c781 100644
--- a/src/northbridge/amd/agesa/family15tn/state_machine.c
+++ b/src/northbridge/amd/agesa/family15tn/state_machine.c
@@ -30,6 +30,7 @@
void platform_BeforeInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post)
{
+ Post->MemConfig.BottomIo = (UINT16)(CONFIG_BOTTOMIO_POSITION >> 24);
}
void platform_AfterInitPost(struct sysinfo *cb, AMD_POST_PARAMS *Post)
diff --git a/src/northbridge/amd/agesa/family16kb/state_machine.c b/src/northbridge/amd/agesa/family16kb/state_machine.c
index 7794f2d..0ffa5d5 100644
--- a/src/northbridge/amd/agesa/family16kb/state_machine.c
+++ b/src/northbridge/amd/agesa/family16kb/state_machine.c
@@ -32,6 +32,8 @@
{
AGESA_STATUS status;
+ Post->MemConfig.BottomIo = (UINT16)(CONFIG_BOTTOMIO_POSITION >> 24);
+
if (CONFIG(ENABLE_MRC_CACHE)) {
status = OemInitResume(&Post->MemConfig.MemContext);
if (status == AGESA_SUCCESS)
--
To view, visit https://review.coreboot.org/c/coreboot/+/38472
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie235631231bcb4aeebaff2e0026da2ea9d82f9d0
Gerrit-Change-Number: 38472
Gerrit-PatchSet: 1
Gerrit-Owner: Mike Banon <mikebdp2(a)gmail.com>
Gerrit-MessageType: newchange
Hello Nico Huber,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/31351
to review the following change.
Change subject: soc/intel/apl: Add chip.h setting for PCIe ASPM
......................................................................
soc/intel/apl: Add chip.h setting for PCIe ASPM
We don't use a direct mapping to the UPD values so we don't have to set
it to the default `auto` in all devicetrees.
Change-Id: I169722c3c63be66772cb57a429ec7b83230fa234
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
M src/soc/intel/apollolake/chip.c
M src/soc/intel/apollolake/chip.h
2 files changed, 18 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/31351/1
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index 3634509..cfe8d4a 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -669,6 +669,7 @@
{
FSP_S_CONFIG *silconfig = &silupd->FspsConfig;
static struct soc_intel_apollolake_config *cfg;
+ int i;
/* Load VBT before devicetree-specific config. */
silconfig->GraphicsConfigPtr = (uintptr_t)vbt_get();
@@ -693,6 +694,11 @@
memcpy(silconfig->PcieRpHotPlug, cfg->pcie_rp_hotplug_enable,
sizeof(silconfig->PcieRpHotPlug));
+ for (i = 0; i < ARRAY_SIZE(silconfig->PcieRpAspm); ++i) {
+ if (cfg->pcie_rp_aspm[i] != ASPM_IGNORE)
+ silconfig->PcieRpAspm[i] = cfg->pcie_rp_aspm[i] - 1;
+ }
+
switch (cfg->serirq_mode) {
case SERIRQ_QUIET:
silconfig->SirqEnable = 1;
diff --git a/src/soc/intel/apollolake/chip.h b/src/soc/intel/apollolake/chip.h
index b9e368c..b8f9f8c 100644
--- a/src/soc/intel/apollolake/chip.h
+++ b/src/soc/intel/apollolake/chip.h
@@ -57,6 +57,18 @@
/* De-emphasis enable configuration for each PCIe root port */
uint8_t pcie_rp_deemphasis_enable[MAX_PCIE_PORTS];
+ /* ASPM enable setting for each PCIe root port */
+ enum {
+ ASPM_IGNORE = 0,
+ /* Enumeration values below are off-by-one compared to the
+ UPD to have the default 0 ignore the devicetree setting: */
+ ASPM_DISABLED,
+ ASPM_L0S,
+ ASPM_L1,
+ ASPM_L0SL1,
+ ASPM_AUTO,
+ } pcie_rp_aspm[MAX_PCIE_PORTS];
+
/* [14:8] DDR mode Number of dealy elements.Each = 125pSec.
* [6:0] SDR mode Number of dealy elements.Each = 125pSec.
*/
--
To view, visit https://review.coreboot.org/c/coreboot/+/31351
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I169722c3c63be66772cb57a429ec7b83230fa234
Gerrit-Change-Number: 31351
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-MessageType: newchange