Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9984
-gerrit
commit 04baa2bc288911c7782a7d34f973272cb4030ccf
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Fri Apr 10 18:04:04 2015 -0700
cbmem: add and use a function to dump console buffer
The new function can be compiled in only when serial console is
disabled.
When invoked, this function initializes the serial interface and dumps
the contents of the CBMEM console buffer to serial output.
Some .h files' tweaking was required to ensure proper exposure of
external declarations of uart_init().
BRANCH=none
BUG=chromium:475347
TEST=compiled for different platforms with and without serial console
enabled. No actual test of this function yet.
Change-Id: Ia8d16649dc9d09798fa6970f2cfd893438e00dc5
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: a38a8254dd788ad188ba2509b9ae117d6f699579
Original-Change-Id: Ib85759a2727e31ba1ca21da7e6c346e434f83b52
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/265293
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/console/Kconfig | 9 +++++++++
src/include/console/cbmem_console.h | 1 +
src/lib/cbmem_console.c | 17 +++++++++++++++++
src/vendorcode/google/chromeos/vboot.c | 2 ++
src/vendorcode/google/chromeos/vboot_common.c | 2 ++
5 files changed, 31 insertions(+)
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 2807039..9adab6d 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -184,6 +184,15 @@ config CONSOLE_CBMEM_BUFFER_SIZE
value (128K or 0x20000 bytes) is large enough to accommodate
even the BIOS_SPEW level.
+config CONSOLE_CBMEM_DUMP_TO_UART
+ depends on !CONSOLE_SERIAL
+ bool "Dump CBMEM console on resets"
+ default n
+ help
+ Enable this to have CBMEM console buffer contents dumped on the
+ serial output in case serial console is disabled and the device
+ resets itself while trying to boot the payload
+
endif
config CONSOLE_QEMU_DEBUGCON
diff --git a/src/include/console/cbmem_console.h b/src/include/console/cbmem_console.h
index 3431459..8f7fcb2 100644
--- a/src/include/console/cbmem_console.h
+++ b/src/include/console/cbmem_console.h
@@ -43,4 +43,5 @@ static inline void __cbmemc_init(void) {}
static inline void __cbmemc_tx_byte(u8 data) {}
#endif
+void cbmem_dump_console(void);
#endif
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c
index 628d3b9..9d292bf 100644
--- a/src/lib/cbmem_console.c
+++ b/src/lib/cbmem_console.c
@@ -19,6 +19,7 @@
#include <console/console.h>
#include <console/cbmem_console.h>
+#include <console/uart.h>
#include <cbmem.h>
#include <arch/early_variables.h>
#include <symbols.h>
@@ -236,5 +237,21 @@ void cbmemc_reinit(void)
init_console_ptr(cbm_cons_p, size, flags);
}
+#if IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART)
+void cbmem_dump_console(void)
+{
+ struct cbmem_console *cbm_cons_p;
+ int cursor;
+
+ cbm_cons_p = current_console();
+ if (!cbm_cons_p)
+ return;
+
+ uart_init(0);
+ for (cursor = 0; cursor < cbm_cons_p->buffer_cursor; cursor++)
+ uart_tx_byte(0, cbm_cons_p->buffer_body[cursor]);
+}
+#endif
+
/* Call cbmemc_reinit() at CAR migration time. */
CAR_MIGRATE(cbmemc_reinit)
diff --git a/src/vendorcode/google/chromeos/vboot.c b/src/vendorcode/google/chromeos/vboot.c
index 44fe9e3..a151f54 100644
--- a/src/vendorcode/google/chromeos/vboot.c
+++ b/src/vendorcode/google/chromeos/vboot.c
@@ -234,6 +234,8 @@ static void init_vboot(int bootmode)
#if !MOCK_TPM
printk(BIOS_ERR, "TPM: Error code 0x%x. Hard reset!\n", result);
post_code(POST_TPM_FAILURE);
+ if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART))
+ cbmem_dump_console();
hard_reset();
#endif
}
diff --git a/src/vendorcode/google/chromeos/vboot_common.c b/src/vendorcode/google/chromeos/vboot_common.c
index 3c1a9c3..2e38563 100644
--- a/src/vendorcode/google/chromeos/vboot_common.c
+++ b/src/vendorcode/google/chromeos/vboot_common.c
@@ -129,6 +129,8 @@ void *vboot_get_payload(int *len)
void vboot_reboot(void)
{
+ if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART))
+ cbmem_dump_console();
hard_reset();
die("failed to reboot");
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9988
-gerrit
commit 0b11c62ac98333f08fe14770922bd86c0c0f33fb
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Fri Apr 24 13:39:19 2015 +0200
lint: remove test for build dir handling
This test outlives its usefulness and only slows down commits.
We can now be confident that out-of-tree builds work because
some of our automated builders do them regularly.
Change-Id: I7c27e613ddd16f7bacbd4e232596b8a76e0c3301
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
util/lint/lint-stable-002-build-dir-handling | 73 ----------------------------
1 file changed, 73 deletions(-)
diff --git a/util/lint/lint-stable-002-build-dir-handling b/util/lint/lint-stable-002-build-dir-handling
deleted file mode 100755
index 013d84a..0000000
--- a/util/lint/lint-stable-002-build-dir-handling
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-# This file is part of the coreboot project.
-#
-# Copyright (C) 2011 Patrick Georgi <patrick(a)georgi-clan.de>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# DESCR: Check that build directories can be chosen freely
-
-# $1: command to test for GNU make
-search_make() {
-if [ -n "`$1 --version 2>&1 | grep GNU`" ]; then MAKE=$1; fi
-}
-
-# if $1 and $2 differ, exit with failure
-compare_output() {
-if ! [ "$1" = "$2" ]; then
- echo \'$1\' should be \'$2\'
- exit 1
-fi
-}
-
-# $1: object directory
-run_printall() {
-$MAKE CONFIG_USE_BLOBS=n CONFIG_CCACHE=n NOMKDIR=1 \
- DOTCONFIG=$TMPCONFIG obj=$1 printall | \
- sed -e "s,^ *,," -e "s,^r.mstage-objs:=,," \
- -e "s,mainboard/[^/]*/[^/]*/,.../,g" | \
- tr " " "\n" | GREP_OPTIONS= grep "/static.*\.[co]" | sort | \
- tr '\012\015' ' ' | sed -e "s, *, ,g" -e "s, *$,,"
-}
-
-# find GNU make
-MAKE=
-search_make make
-[ -z $MAKE ] && search_make gmake
-[ -z $MAKE ] && search_make gnumake
-
-if [ "$MAKE" = "" ]; then
- echo Could not identify GNU make
- exit 1
-fi
-
-# prepare a config to use
-TMPOBJ=`mktemp .tmpobj.XXXXXX`
-rm $TMPOBJ
-mkdir -p ${TMPOBJ}
-TMPCONFIG=`mktemp .tmpconfig.XXXXXX`
-rm -f $TMPCONFIG
-$MAKE obj=$TMPOBJ DOTCONFIG=$TMPCONFIG allyesconfig >/dev/null
-
-# look up parent directory
-CURRENTDIR=`pwd -P`
-PARENTDIR=`dirname $CURRENTDIR`
-
-compare_output "`run_printall build`" "build/.../static.c build/.../static.c build/.../static.romstage.o"
-compare_output "`run_printall ../obj`" "$PARENTDIR/obj/.../static.c $PARENTDIR/obj/.../static.c $PARENTDIR/obj/.../static.romstage.o"
-compare_output "`run_printall /tmp`" "/tmp/.../static.c /tmp/.../static.c /tmp/.../static.romstage.o"
-compare_output "`run_printall /../tmp`" "/tmp/.../static.c /tmp/.../static.c /tmp/.../static.romstage.o"
-
-rm -rf $TMPCONFIG $TMPOBJ
-
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9986
-gerrit
commit cc3abb62fb4ce1c2b6c3cdd4b227dbfe443d31dd
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Fri Apr 10 19:23:16 2015 -0700
storm: enable CBMEM console dump
This patch enables on storm the recently introduced 'console buffer
dump on reboot' capability.
BRANCH=none
BUG=chromium:475347
TEST=generated storm image with serial console disabled and both rw
firmware A and B sections corrupted. Programmed the new image on
an SP5 device and rebooted it. Observed the device dump cbmem
console buffer to the serial output, terminating with
VB2:vb2_fail() Need recovery, reason: 0x3 / 0xa
Reboot requested (1008000a)
Saving nvdata
SF: Detected S25FL128S_256K with page size 10000, total 2000000
and the LED ring started flashing indicating recovery mode.
Change-Id: Idb50c86f59f393c783ccbc15de8f5564e2a1b38e
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 0ec88001b152bb9f1d7268b83367131b004816f8
Original-Change-Id: I9345eeb4d375f42fb1e4c617495b63b308ce51d9
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/265295
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/mainboard/google/storm/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mainboard/google/storm/Kconfig b/src/mainboard/google/storm/Kconfig
index d2c011b..dfa00cc 100644
--- a/src/mainboard/google/storm/Kconfig
+++ b/src/mainboard/google/storm/Kconfig
@@ -25,7 +25,7 @@ config BOARD_SPECIFIC_OPTIONS
select BOARD_ID_AUTO
select BOARD_ROMSIZE_KB_8192
select COMMON_CBFS_SPI_WRAPPER
- select VBOOT_DISABLE_DEV_ON_RECOVERY
+ select CONSOLE_CBMEM_DUMP_TO_UART
select DRIVERS_I2C_WW_RING
select HAVE_HARD_RESET
select MAINBOARD_HAS_BOOTBLOCK_INIT
@@ -34,6 +34,7 @@ config BOARD_SPECIFIC_OPTIONS
select SPI_FLASH
select SPI_FLASH_SPANSION
select SPI_FLASH_STMICRO
+ select VBOOT_DISABLE_DEV_ON_RECOVERY
select VIRTUAL_DEV_SWITCH
select WIPEOUT_SUPPORTED
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9984
-gerrit
commit 361cc1dd3f59c1bde1d1890b9c2e2feded90ffeb
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Fri Apr 10 18:04:04 2015 -0700
cbmem: add and use a function to dump console buffer
The new function can be compiled in only when serial console is
disabled.
When invoked, this function initializes the serial interface and dumps
the contents of the CBMEM console buffer to serial output.
Some .h files' tweaking was required to ensure proper exposure of
external declarations of uart_init().
BRANCH=none
BUG=chromium:475347
TEST=compiled for different platforms with and without serial console
enabled. No actual test of this function yet.
Change-Id: Ia8d16649dc9d09798fa6970f2cfd893438e00dc5
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: a38a8254dd788ad188ba2509b9ae117d6f699579
Original-Change-Id: Ib85759a2727e31ba1ca21da7e6c346e434f83b52
Original-Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/265293
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/console/Kconfig | 9 +++++++++
src/include/console/cbmem_console.h | 1 +
src/lib/cbmem_console.c | 17 +++++++++++++++++
src/vendorcode/google/chromeos/vboot.c | 2 ++
src/vendorcode/google/chromeos/vboot_common.c | 2 ++
5 files changed, 31 insertions(+)
diff --git a/src/console/Kconfig b/src/console/Kconfig
index 2807039..9adab6d 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -184,6 +184,15 @@ config CONSOLE_CBMEM_BUFFER_SIZE
value (128K or 0x20000 bytes) is large enough to accommodate
even the BIOS_SPEW level.
+config CONSOLE_CBMEM_DUMP_TO_UART
+ depends on !CONSOLE_SERIAL
+ bool "Dump CBMEM console on resets"
+ default n
+ help
+ Enable this to have CBMEM console buffer contents dumped on the
+ serial output in case serial console is disabled and the device
+ resets itself while trying to boot the payload
+
endif
config CONSOLE_QEMU_DEBUGCON
diff --git a/src/include/console/cbmem_console.h b/src/include/console/cbmem_console.h
index 3431459..8f7fcb2 100644
--- a/src/include/console/cbmem_console.h
+++ b/src/include/console/cbmem_console.h
@@ -43,4 +43,5 @@ static inline void __cbmemc_init(void) {}
static inline void __cbmemc_tx_byte(u8 data) {}
#endif
+void cbmem_dump_console(void);
#endif
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c
index 628d3b9..27b4afa 100644
--- a/src/lib/cbmem_console.c
+++ b/src/lib/cbmem_console.c
@@ -19,6 +19,7 @@
#include <console/console.h>
#include <console/cbmem_console.h>
+#include <console/uart.h>
#include <cbmem.h>
#include <arch/early_variables.h>
#include <symbols.h>
@@ -236,5 +237,21 @@ void cbmemc_reinit(void)
init_console_ptr(cbm_cons_p, size, flags);
}
+#if IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART)
+void cbmem_dump_console(void)
+{
+ struct cbmem_console *cbm_cons_p;
+ int cursor;
+
+ cbm_cons_p = current_console();
+ if (!cbm_cons_p)
+ return;
+
+ uart_init();
+ for (cursor = 0; cursor < cbm_cons_p->buffer_cursor; cursor++)
+ uart_tx_byte(cbm_cons_p->buffer_body[cursor]);
+}
+#endif
+
/* Call cbmemc_reinit() at CAR migration time. */
CAR_MIGRATE(cbmemc_reinit)
diff --git a/src/vendorcode/google/chromeos/vboot.c b/src/vendorcode/google/chromeos/vboot.c
index 44fe9e3..a151f54 100644
--- a/src/vendorcode/google/chromeos/vboot.c
+++ b/src/vendorcode/google/chromeos/vboot.c
@@ -234,6 +234,8 @@ static void init_vboot(int bootmode)
#if !MOCK_TPM
printk(BIOS_ERR, "TPM: Error code 0x%x. Hard reset!\n", result);
post_code(POST_TPM_FAILURE);
+ if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART))
+ cbmem_dump_console();
hard_reset();
#endif
}
diff --git a/src/vendorcode/google/chromeos/vboot_common.c b/src/vendorcode/google/chromeos/vboot_common.c
index 3c1a9c3..2e38563 100644
--- a/src/vendorcode/google/chromeos/vboot_common.c
+++ b/src/vendorcode/google/chromeos/vboot_common.c
@@ -129,6 +129,8 @@ void *vboot_get_payload(int *len)
void vboot_reboot(void)
{
+ if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART))
+ cbmem_dump_console();
hard_reset();
die("failed to reboot");
}