Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16224
-gerrit
commit be6975e3b03f99d3e8ea047f7cb813fcedaacfe2
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Mon Aug 15 20:43:58 2016 +0530
soc/intel/skylake: restore MCHBAR and DMIBAR programming
Program MCHBAR, DMIBAR, EPBAR, EDRAMBAR and GDXCBAR.
Also program the PAM registers. The system agent was being
programmed in romstage during pre-console initialization, after
moving to C_ENVIRONMENT bootblock this was missing, restoring
the same.
TEST=Build and Boot Kunimitsu
Change-Id: Iaf310cfb83e58eb8d5affb481dfc343f5d45961b
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/soc/intel/skylake/romstage/romstage.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/soc/intel/skylake/romstage/romstage.c b/src/soc/intel/skylake/romstage/romstage.c
index 56a5a92..fda6087 100644
--- a/src/soc/intel/skylake/romstage/romstage.c
+++ b/src/soc/intel/skylake/romstage/romstage.c
@@ -45,6 +45,9 @@
/* SOC initialization before RAM is enabled */
void soc_pre_ram_init(struct romstage_params *params)
{
+ /* Program MCHBAR and DMIBAR */
+ systemagent_early_init();
+
/* Prepare to initialize memory */
soc_fill_pei_data(params->pei_data);
}
Julius Werner (jwerner(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16230
-gerrit
commit 60b91099fa57fc70522a078c49bf4575d83f9872
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Aug 15 16:14:15 2016 -0700
console: Change CONFIG_CHROMEOS requirement from do_printk_va_list()
CONFIG_VBOOT was recently moved to be independent from CONFIG_CHROMEOS.
Change the code guard for do_printk_va_list() accordingly, since it's
used by vboot (not Chrome OS) code.
Change-Id: I44e868d2fd8e1368eeda2f10a35d0a2bd7259759
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
---
src/include/console/console.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/console/console.h b/src/include/console/console.h
index f0ab031..202d474 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -60,7 +60,7 @@ static inline void printk(int LEVEL, const char *fmt, ...) {}
static inline void do_putchar(unsigned char byte) {}
#endif
-#if CONFIG_CHROMEOS
+#if IS_ENABLED(CONFIG_VBOOT)
/* FIXME: Collision of varargs with AMD headers without guard. */
#include <console/vtxprintf.h>
#if __CONSOLE_ENABLE__
Julius Werner (jwerner(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16230
-gerrit
commit be14df63d298071857bc3647f9fd4209fc5f7bd7
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Aug 15 16:14:15 2016 -0700
console: Remove CONFIG_CHROMEOS requirement from do_printk_va_list()
This function is a generic function with a lot of possible uses, and
should not be tied to CONFIG_CHROMEOS (especially since it's called from
vboot code which is now trying to be independent of CONFIG_CHROMEOS).
There is a cryptic comment about a clash with certain AMD headers, but
no extra information to follow up... I'll let Jenkins judge whether it
still has any merit today.
Change-Id: I44e868d2fd8e1368eeda2f10a35d0a2bd7259759
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
---
src/include/console/console.h | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/include/console/console.h b/src/include/console/console.h
index f0ab031..09137a9 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -20,6 +20,7 @@
#include <rules.h>
#include <arch/cpu.h>
#include <console/post_codes.h>
+#include <console/vtxprintf.h>
#include <commonlib/loglevel.h>
#ifndef __ROMCC__
@@ -48,6 +49,7 @@ void __attribute__ ((noreturn)) die(const char *msg);
asmlinkage void console_init(void);
int console_log_level(int msg_level);
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
+void do_printk_va_list(int msg_level, const char *fmt, va_list args);
void do_putchar(unsigned char byte);
#define printk(LEVEL, fmt, args...) \
@@ -57,17 +59,8 @@ void do_putchar(unsigned char byte);
static inline void console_init(void) {}
static inline int console_log_level(int msg_level) { return 0; }
static inline void printk(int LEVEL, const char *fmt, ...) {}
-static inline void do_putchar(unsigned char byte) {}
-#endif
-
-#if CONFIG_CHROMEOS
-/* FIXME: Collision of varargs with AMD headers without guard. */
-#include <console/vtxprintf.h>
-#if __CONSOLE_ENABLE__
-void do_printk_va_list(int msg_level, const char *fmt, va_list args);
-#else
static inline void do_printk_va_list(int l, const char *fmt, va_list args) {}
-#endif
+static inline void do_putchar(unsigned char byte) {}
#endif
#endif /* !__ROMCC__ */
Julius Werner (jwerner(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16229
-gerrit
commit 125aa49ee8eddb1597c3b8353dc062e38c17854a
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Aug 15 16:10:27 2016 -0700
vboot: Move TPM-related Kconfig selects from CHROMEOS to VBOOT
CONFIG_VBOOT was recently moved to be independent from CONFIG_CHROMEOS.
However, the latter still has some 'select' clauses to ensure that
required TPM libraries are built. The TPM is an essential part of vboot,
and without these libraries the vboot code cannot compile... therefore,
they should be moved under CONFIG_VBOOT.
Change-Id: I0145558e5127c65c6a82d62f25b5a39e24cb8726
Signed-off-by: Julius Werner <jwerner(a)chromium.org>
---
src/vboot/Kconfig | 4 ++++
src/vendorcode/google/chromeos/Kconfig | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/vboot/Kconfig b/src/vboot/Kconfig
index a008208..0838167 100644
--- a/src/vboot/Kconfig
+++ b/src/vboot/Kconfig
@@ -136,6 +136,10 @@ config VBOOT_OPROM_MATTERS
config VBOOT
bool "Verify firmware with vboot."
default n
+ select TPM if !MAINBOARD_HAS_TPM2
+ select TPM2 if MAINBOARD_HAS_TPM2
+ select TPM_INIT_FAILURE_IS_FATAL if PC80_SYSTEM && LPC_TPM
+ select SKIP_TPM_STARTUP_ON_NORMAL_BOOT if PC80_SYSTEM && LPC_TPM
depends on HAVE_HARD_RESET
help
Enabling VBOOT will use vboot to verify the components of the firmware
diff --git a/src/vendorcode/google/chromeos/Kconfig b/src/vendorcode/google/chromeos/Kconfig
index 5134731..063a5a5 100644
--- a/src/vendorcode/google/chromeos/Kconfig
+++ b/src/vendorcode/google/chromeos/Kconfig
@@ -21,10 +21,6 @@ menu "ChromeOS"
config CHROMEOS
bool "Build for ChromeOS"
default n
- select TPM if !MAINBOARD_HAS_TPM2
- select TPM2 if MAINBOARD_HAS_TPM2
- select TPM_INIT_FAILURE_IS_FATAL if PC80_SYSTEM && LPC_TPM
- select SKIP_TPM_STARTUP_ON_NORMAL_BOOT if PC80_SYSTEM && LPC_TPM
select ELOG if SPI_FLASH
select COLLECT_TIMESTAMPS
select VBOOT
the following patch was just integrated into master:
commit e4cc4733ebd4c6fc77de5f0a9963e9a938e57e5d
Author: Furquan Shaikh <furquan(a)google.com>
Date: Thu Aug 11 12:39:54 2016 -0700
reef: Increase TSR2 threshold to 100
This is a temporary work-around since the current threshold of 70 on
TSR2 results in thermal trip and shutdown while the kernel is
booting. Changing this threshold to 100 allows kernel to boot up to
userspace. Following values were read:
$ cat /sys/class/thermal/thermal_zone4/temp
81800
$ cat /sys/class/thermal/thermal_zone4/type
TSR2
BUG=chrome-os-partner:56155
BRANCH=None
TEST=Boots to OS.
Change-Id: I951553ed4c93b02239a51a0d3036e4a750eea04b
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
Reviewed-on: https://review.coreboot.org/16156
Reviewed-by: Duncan Laurie <dlaurie(a)chromium.org>
Reviewed-by: Shaunak Saha <shaunak.saha(a)intel.com>
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Tested-by: build bot (Jenkins)
See https://review.coreboot.org/16156 for details.
-gerrit
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16206
-gerrit
commit a5bddfd54f893af4823b0e3435233bd50adf2113
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Aug 12 12:48:58 2016 -0500
vboot/vbnv_flash: make I/O connection agnostic
There's no need to be SPI specific w.r.t. how the flash is
connected. Therefore, use the RW boot device to write the
contents of VBNV. The erasable check was dropped because that
information isn't available. All regions should be aligned
accordingly on the platform for the underlying hardware
implementation. And once the VBNV region fills the erase
will fail.
BUG=chrome-os-partner:56151
Change-Id: I07fdc8613e0b3884e132a2f158ffeabeaa6da6ce
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/vboot/Kconfig | 3 +-
src/vboot/vbnv_flash.c | 82 +++++++++-----------------------------------------
2 files changed, 16 insertions(+), 69 deletions(-)
diff --git a/src/vboot/Kconfig b/src/vboot/Kconfig
index a008208..30d322e 100644
--- a/src/vboot/Kconfig
+++ b/src/vboot/Kconfig
@@ -29,7 +29,7 @@ config VBOOT_VBNV_CMOS
config VBOOT_VBNV_CMOS_BACKUP_TO_FLASH
bool "Back up Vboot non-volatile storage from CMOS to flash."
default n
- depends on VBOOT_VBNV_CMOS
+ depends on VBOOT_VBNV_CMOS && BOOT_DEVICE_SUPPORTS_WRITES
help
Vboot non-volatile storage data will be backed up from CMOS to flash
and restored from flash if the CMOS is invalid due to power loss.
@@ -42,6 +42,7 @@ config VBOOT_VBNV_EC
config VBOOT_VBNV_FLASH
def_bool n
+ depends on BOOT_DEVICE_SUPPORTS_WRITES
help
VBNV is stored in flash storage
diff --git a/src/vboot/vbnv_flash.c b/src/vboot/vbnv_flash.c
index 717ff23..d061228 100644
--- a/src/vboot/vbnv_flash.c
+++ b/src/vboot/vbnv_flash.c
@@ -17,7 +17,6 @@
#include <assert.h>
#include <commonlib/region.h>
#include <console/console.h>
-#include <spi_flash.h>
#include <string.h>
#include <vb2_api.h>
#include <vboot_nvstorage.h>
@@ -31,17 +30,14 @@ struct vbnv_flash_ctx {
/* VBNV flash is initialized */
int initialized;
- /* Offset of the current nvdata in SPI flash */
+ /* Offset of the current nvdata in flash */
int blob_offset;
- /* Offset of the topmost nvdata blob in SPI flash */
+ /* Offset of the topmost nvdata blob in flash */
int top_offset;
- /* SPI flash handler used when saving data */
- struct spi_flash *flash;
-
- /* FMAP descriptor of the NVRAM area */
- struct region_device region;
+ /* Region to store and retrieve the VBNV contents. */
+ struct region_device vbnv_dev;
/* Cache of the current nvdata */
uint8_t cache[BLOB_SIZE];
@@ -66,13 +62,14 @@ static inline int can_overwrite(uint8_t current, uint8_t new)
static int init_vbnv(void)
{
struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
+ struct region_device *rdev = &ctx->vbnv_dev;
uint8_t buf[BLOB_SIZE];
uint8_t empty_blob[BLOB_SIZE];
int offset;
int i;
- if (vboot_named_region_device("RW_NVRAM", &ctx->region) ||
- region_device_sz(&ctx->region) < BLOB_SIZE) {
+ if (vboot_named_region_device_rw("RW_NVRAM", rdev) ||
+ region_device_sz(rdev) < BLOB_SIZE) {
printk(BIOS_ERR, "%s: failed to locate NVRAM\n", __func__);
return 1;
}
@@ -82,7 +79,7 @@ static int init_vbnv(void)
empty_blob[i] = erase_value();
offset = 0;
- ctx->top_offset = region_device_sz(&ctx->region) - BLOB_SIZE;
+ ctx->top_offset = region_device_sz(rdev) - BLOB_SIZE;
/*
* after the loop, offset is supposed to point the blob right before
@@ -91,7 +88,7 @@ static int init_vbnv(void)
* used.
*/
for (i = 0; i <= ctx->top_offset; i += BLOB_SIZE) {
- if (rdev_readat(&ctx->region, buf, i, BLOB_SIZE) < 0) {
+ if (rdev_readat(rdev, buf, i, BLOB_SIZE) < 0) {
printk(BIOS_ERR, "failed to read nvdata\n");
return 1;
}
@@ -101,7 +98,7 @@ static int init_vbnv(void)
}
/* reread the nvdata and write it to the cache */
- if (rdev_readat(&ctx->region, ctx->cache, offset, BLOB_SIZE) < 0) {
+ if (rdev_readat(rdev, ctx->cache, offset, BLOB_SIZE) < 0) {
printk(BIOS_ERR, "failed to read nvdata\n");
return 1;
}
@@ -112,61 +109,12 @@ static int init_vbnv(void)
return 0;
}
-static void vbnv_is_erasable(void)
-{
- /*
- * We check whether the region is aligned or not in advance to ensure
- * we can erase the region when it's all used up.
- *
- * The region offset & size are determined by fmap.dts yet the check can
- * be confidently done only by the spi flash driver. We use the same
- * check as the one used by spi_flash_cmd_erase, which happens to be
- * common to all the spi flash parts we support.
- *
- * TODO: Check by calling can_erase implemented by each spi flash driver
- */
- struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
-
- assert(!(region_device_offset(&ctx->region) % ctx->flash->sector_size));
- assert(!(region_device_sz(&ctx->region) % ctx->flash->sector_size));
-}
-
-static int vbnv_flash_probe(void)
-{
- struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
-
- if (!ctx->flash) {
- ctx->flash =
- spi_flash_probe(CONFIG_BOOT_DEVICE_SPI_FLASH_BUS, 0);
- if (!ctx->flash) {
- printk(BIOS_ERR, "failed to probe spi flash\n");
- return 1;
- }
- /*
- * Called here instead of init_vbnv to reduce impact on boot
- * speed.
- */
- vbnv_is_erasable();
- }
-
- /*
- * Handle the case where spi_flash_probe returns a CAR_GLOBAL
- * in early execution on x86 but then later is moved to RAM.
- */
- ctx->flash = car_get_var_ptr(ctx->flash);
-
- return 0;
-}
-
static int erase_nvram(void)
{
struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
+ const struct region_device *rdev = &ctx->vbnv_dev;
- if (vbnv_flash_probe())
- return 1;
-
- if (ctx->flash->erase(ctx->flash, region_device_offset(&ctx->region),
- region_device_sz(&ctx->region))) {
+ if (rdev_eraseat(rdev, 0, region_device_sz(rdev)) < 0) {
printk(BIOS_ERR, "failed to erase nvram\n");
return 1;
}
@@ -191,6 +139,7 @@ void save_vbnv_flash(const uint8_t *vbnv_copy)
struct vbnv_flash_ctx *ctx = car_get_var_ptr(&vbnv_flash);
int new_offset;
int i;
+ const struct region_device *rdev = &ctx->vbnv_dev;
if (!ctx->initialized)
if (init_vbnv())
@@ -216,10 +165,7 @@ void save_vbnv_flash(const uint8_t *vbnv_copy)
}
}
- if (!vbnv_flash_probe() &&
- !ctx->flash->write(ctx->flash,
- region_device_offset(&ctx->region) + new_offset,
- BLOB_SIZE, vbnv_copy)) {
+ if (rdev_writeat(rdev, vbnv_copy, new_offset, BLOB_SIZE) < 0) {
/* write was successful. safely move pointer forward */
ctx->blob_offset = new_offset;
memcpy(ctx->cache, vbnv_copy, BLOB_SIZE);
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/16205
-gerrit
commit f921f36247453b5796d284a3d6f7889c586acccd
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Fri Aug 12 12:46:07 2016 -0500
vboot: provide RW region device support
Explicitly provide a RW view of an vboot FMAP region. This is
required for platforms which have separate implementations of
a RO boot device and a RW boot device.
BUG=chrome-os-partner:56151
Change-Id: If8bf2e1c7ca9bff536fc5c578fe0cf92ccbd2ebc
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/vboot/vboot_common.c | 5 +++++
src/vboot/vboot_common.h | 3 +++
2 files changed, 8 insertions(+)
diff --git a/src/vboot/vboot_common.c b/src/vboot/vboot_common.c
index 319e0de..7e1ca9d 100644
--- a/src/vboot/vboot_common.c
+++ b/src/vboot/vboot_common.c
@@ -30,6 +30,11 @@ int vboot_named_region_device(const char *name, struct region_device *rdev)
return fmap_locate_area_as_rdev(name, rdev);
}
+int vboot_named_region_device_rw(const char *name, struct region_device *rdev)
+{
+ return fmap_locate_area_as_rdev(name, rdev);
+}
+
/* ========================== VBOOT HANDOFF APIs =========================== */
int vboot_get_handoff_info(void **addr, uint32_t *size)
{
diff --git a/src/vboot/vboot_common.h b/src/vboot/vboot_common.h
index d64b5bb..59fd44c 100644
--- a/src/vboot/vboot_common.h
+++ b/src/vboot/vboot_common.h
@@ -23,6 +23,9 @@
/* Locate vboot area by name. Returns 0 on success and -1 on error. */
int vboot_named_region_device(const char *name, struct region_device *rdev);
+/* Like vboot_named_region_device() but provides a RW region device. */
+int vboot_named_region_device_rw(const char *name, struct region_device *rdev);
+
/*
* Function to check if there is a request to enter recovery mode. Returns
* reason code if request to enter recovery mode is present, otherwise 0.