Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10008
-gerrit
commit 6ea751910631e604f92d0d15f94b5c9fff5d568a
Author: Daisuke Nojiri <dnojiri(a)chromium.org>
Date: Wed Dec 3 12:09:58 2014 -0800
marvell/bg4cd: merge verstage into bootblock
If verified boot is enabled, merge verstage into bootblock. This also
requires custom bootblock code to actually call into verstage.
[pg: modified to match upstream]
BUG=chrome-os-partner:32631
BRANCH=ToT
TEST=booted on cosmos development board.
Change-Id: I53251aac966ee15da24232c23fefa636de8b253b
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 2b8ada263017b46afa755b5acb759574184dba06
Original-Signed-off-by: Daisuke Nojiri <dnojiri(a)chromium.org>
Original-Change-Id: Ia0e1236357aa32bf553fb8cc98f3a8d29de17f45
Original-Reviewed-on: https://chromium-review.googlesource.com/229795
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/mainboard/google/cosmos/Kconfig | 1 -
src/soc/marvell/bg4cd/Kconfig | 2 +
src/soc/marvell/bg4cd/Makefile.inc | 3 ++
src/soc/marvell/bg4cd/bootblock.c | 27 +++++++++++++
src/soc/marvell/bg4cd/bootblock_asm.S | 54 ++++++++++++++++++++++++++
src/soc/marvell/bg4cd/include/soc/memlayout.ld | 30 ++++++++------
6 files changed, 104 insertions(+), 13 deletions(-)
diff --git a/src/mainboard/google/cosmos/Kconfig b/src/mainboard/google/cosmos/Kconfig
index 49d3172..8cd9983 100644
--- a/src/mainboard/google/cosmos/Kconfig
+++ b/src/mainboard/google/cosmos/Kconfig
@@ -28,7 +28,6 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_HARD_RESET
select MAINBOARD_HAS_BOOTBLOCK_INIT
select MAINBOARD_HAS_CHROMEOS
- select RETURN_FROM_VERSTAGE
select SOC_MARVELL_BG4CD
select SPI_FLASH
select SPI_FLASH_SPANSION
diff --git a/src/soc/marvell/bg4cd/Kconfig b/src/soc/marvell/bg4cd/Kconfig
index b1fabb7..725f561 100644
--- a/src/soc/marvell/bg4cd/Kconfig
+++ b/src/soc/marvell/bg4cd/Kconfig
@@ -24,6 +24,7 @@ config SOC_MARVELL_BG4CD
select ARCH_RAMSTAGE_ARMV7
select ARCH_ROMSTAGE_ARMV7
select ARCH_VERSTAGE_ARMV7_M
+ select ARM_BOOTBLOCK_CUSTOM if VBOOT2_VERIFY_FIRMWARE
select BOOTBLOCK_CONSOLE
select CPU_HAS_BOOTBLOCK_INIT
select DYNAMIC_CBMEM
@@ -31,6 +32,7 @@ config SOC_MARVELL_BG4CD
select GENERIC_UDELAY
select HAVE_MONOTONIC_TIMER
select GENERIC_GPIO_LIB
+ select VERSTAGE_IN_BOOTBLOCK
if SOC_MARVELL_BG4CD
diff --git a/src/soc/marvell/bg4cd/Makefile.inc b/src/soc/marvell/bg4cd/Makefile.inc
index 4cbca00..a540250 100644
--- a/src/soc/marvell/bg4cd/Makefile.inc
+++ b/src/soc/marvell/bg4cd/Makefile.inc
@@ -17,6 +17,9 @@
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
+bootblock-$(CONFIG_VBOOT2_VERIFY_FIRMWARE) += bootblock_asm.S
+bootblock-$(CONFIG_VBOOT2_VERIFY_FIRMWARE) += bootblock.c
+
bootblock-y += cbmem.c
bootblock-y += i2c.c
bootblock-y += monotonic_timer.c
diff --git a/src/soc/marvell/bg4cd/bootblock.c b/src/soc/marvell/bg4cd/bootblock.c
new file mode 100644
index 0000000..4913a1c
--- /dev/null
+++ b/src/soc/marvell/bg4cd/bootblock.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2014 Google Inc.
+ *
+ * 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
+ */
+
+#include <console/console.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+void main(void)
+{
+ console_init();
+ vboot2_verify_firmware();
+}
diff --git a/src/soc/marvell/bg4cd/bootblock_asm.S b/src/soc/marvell/bg4cd/bootblock_asm.S
new file mode 100644
index 0000000..73ca46b
--- /dev/null
+++ b/src/soc/marvell/bg4cd/bootblock_asm.S
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2014 Google Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ */
+
+#include <arch/asm.h>
+
+ENTRY(_start)
+ /*
+ * Initialize the stack to a known value. This is used to check for
+ * stack overflow later in the boot process.
+ */
+ ldr r0, =_stack
+ ldr r1, =_estack
+ ldr r2, =0xdeadbeef
+init_stack_loop:
+ str r2, [r0]
+ add r0, #4
+ cmp r0, r1
+ bne init_stack_loop
+
+call_verstage:
+ ldr sp, =_estack /* Set up stack pointer */
+ /*
+ * we don't bl here to preserve lr so that we can return to the caller
+ * of the bootblock
+ */
+ b main
+ENDPROC(_start)
diff --git a/src/soc/marvell/bg4cd/include/soc/memlayout.ld b/src/soc/marvell/bg4cd/include/soc/memlayout.ld
index 45cf395..d6244b3 100644
--- a/src/soc/marvell/bg4cd/include/soc/memlayout.ld
+++ b/src/soc/marvell/bg4cd/include/soc/memlayout.ld
@@ -24,16 +24,22 @@
SECTIONS
{
- DRAM_START(0x00000000)
- RAMSTAGE(0x00200000, 128K)
- POSTRAM_CBFS_CACHE(0x01000000, 1M)
-
- SRAM_START(0x80000000)
- TTB(0x80000000, 16K)
- BOOTBLOCK(0x80004004, 16K - 4)
- VBOOT2_WORK(0x80008000, 16K)
- OVERLAP_VERSTAGE_ROMSTAGE(0x8000C000, 40K)
- PRERAM_CBFS_CACHE(0x80016000, 4K)
- STACK(0x80017000, 4K)
- SRAM_END(0x80018000)
+ SRAM_START(0x20000)
+
+ BOOTBLOCK(0x20000, 40K)
+ /* there is no VERSTAGE because it's built into bootblock */
+
+ PRERAM_CBFS_CACHE(0x2A000, 8K)
+ STACK(0x2C000, 8K)
+ VBOOT2_WORK(0x2E000, 16K)
+
+ SRAM_END(0x40000)
+
+ DRAM_START(0x40000)
+
+ RAMSTAGE(0x40000, 128K)
+ POSTRAM_CBFS_CACHE(0x60000, 1M)
+
+ ROMSTAGE(0xF7A40000, 32K)
+ TTB(0xF7A48000, 16K)
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10007
-gerrit
commit a4cf6684a8b78eeaf4e878f2f8399eee3db4f798
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Apr 27 18:13:50 2015 +0200
vboot2: Allow merging verstage into bootblock
Change-Id: I31cd7f84db8b7176c8854f33421aab5c176cd5ce
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
src/vendorcode/google/chromeos/vboot2/Kconfig | 10 ++++++++++
src/vendorcode/google/chromeos/vboot2/Makefile.inc | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/src/vendorcode/google/chromeos/vboot2/Kconfig b/src/vendorcode/google/chromeos/vboot2/Kconfig
index cfa22b6..01011f8 100644
--- a/src/vendorcode/google/chromeos/vboot2/Kconfig
+++ b/src/vendorcode/google/chromeos/vboot2/Kconfig
@@ -62,3 +62,13 @@ config VBOOT_DISABLE_DEV_ON_RECOVERY
When this option is enabled, the Chrome OS device leaves the
developer mode as soon as recovery request is detected. This is
handy on embedded devices with limited input capabilities.
+
+config VERSTAGE_IN_BOOTBLOCK
+ bool
+ default n
+ depends on VBOOT2_VERIFY_FIRMWARE
+
+config SEPARATE_VERSTAGE
+ bool
+ default !VERSTAGE_IN_BOOTBLOCK
+ depends on VBOOT2_VERIFY_FIRMWARE
diff --git a/src/vendorcode/google/chromeos/vboot2/Makefile.inc b/src/vendorcode/google/chromeos/vboot2/Makefile.inc
index 14bf31e..b2d2dc1 100644
--- a/src/vendorcode/google/chromeos/vboot2/Makefile.inc
+++ b/src/vendorcode/google/chromeos/vboot2/Makefile.inc
@@ -57,7 +57,11 @@ $(VB2_LIB): $(obj)/config.h
verstage-srcs += $(VB2_LIB)
+ifeq ($(CONFIG_SEPARATE_VERSTAGE),y)
cbfs-files-y += $(call strip_quotes,$(CONFIG_CBFS_PREFIX))/verstage
fallback/verstage-file = $(objcbfs)/verstage.elf
fallback/verstage-type = stage
fallback/verstage-compression = none
+else
+bootblock-srcs += $(objgenerated)/libverstage.a
+endif
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10006
-gerrit
commit 962036d6556e987fae7017972373c80a1cd6a4e9
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Apr 27 18:13:15 2015 +0200
vboot2: Always enable timestamps
The vboot2 code requires them.
Change-Id: I9afaf9b373297b0eebce9ffd7cc05766dee7d6fd
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
src/vendorcode/google/chromeos/vboot2/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/vendorcode/google/chromeos/vboot2/Kconfig b/src/vendorcode/google/chromeos/vboot2/Kconfig
index 16b8110..cfa22b6 100644
--- a/src/vendorcode/google/chromeos/vboot2/Kconfig
+++ b/src/vendorcode/google/chromeos/vboot2/Kconfig
@@ -20,6 +20,7 @@ config VBOOT2_VERIFY_FIRMWARE
bool "Firmware Verification with vboot2"
default n
depends on CHROMEOS && HAVE_HARD_RESET
+ select COLLECT_TIMESTAMPS
help
Enabling VBOOT2_VERIFY_FIRMWARE will use vboot2 to verify the romstage
and boot loader.
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10005
-gerrit
commit 8e20aebbb13d0d39f7cd6e60b57f8701e586e663
Author: Patrick Georgi <pgeorgi(a)chromium.org>
Date: Mon Apr 27 18:10:34 2015 +0200
vboot2: get rid of global variable that is used locally and only once
Change-Id: Iaf6d6a8857451fb16916aaae97a6fd5c51bc8cc4
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
---
src/vendorcode/google/chromeos/vboot2/Makefile.inc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/vendorcode/google/chromeos/vboot2/Makefile.inc b/src/vendorcode/google/chromeos/vboot2/Makefile.inc
index 5e24788..14bf31e 100644
--- a/src/vendorcode/google/chromeos/vboot2/Makefile.inc
+++ b/src/vendorcode/google/chromeos/vboot2/Makefile.inc
@@ -55,10 +55,9 @@ $(VB2_LIB): $(obj)/config.h
V=$(V) \
fwlib20
-VERSTAGE_ELF = $(objcbfs)/verstage.elf
verstage-srcs += $(VB2_LIB)
cbfs-files-y += $(call strip_quotes,$(CONFIG_CBFS_PREFIX))/verstage
-fallback/verstage-file = $(VERSTAGE_ELF)
+fallback/verstage-file = $(objcbfs)/verstage.elf
fallback/verstage-type = stage
fallback/verstage-compression = none
Vadim Bendebury (vbendeb(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9994
-gerrit
commit fc9c030711a362a5d1d68b5eece834faf30b4dae
Author: Vadim Bendebury <vbendeb(a)chromium.org>
Date: Sat Apr 25 11:34:35 2015 -0700
make: avoid problems with mv aliases
Make fails to update .xcompile in case there is an mv alias preventing
silent overwrites of existing files. To avoid ambiguity, invoke mv
from standard location.
While we are at it, drop the code creating a unique .xcompile instance
before copying it into destination: this was done for the case of
running multiple independent make processes in parallel, but there is
a problem with this approach with multiple processes copying their
unique copies into the same destination file.
The tool running multiple make invocations in parallel should
explicitly invoke xcompile first.
Change-Id: Iedc5e288fbcc5dfc18ce39de5c067bb869a13275
Signed-off-by: Vadim Bendebury <vbendeb(a)chromium.org>
---
Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 14e1598..2ff4ebe 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,8 @@
$(if $(wildcard .xcompile),,$(eval $(shell util/xcompile/xcompile $(XGCCPATH) > .xcompile)))
.xcompile: util/xcompile/xcompile
- A=`mktemp $@.XXXXXX`; $< $(XGCCPATH) > $$A && mv $$A $@ 2> /dev/null
+ $< $(XGCCPATH) > $@.tmp
+ \mv -f $@.tmp $@ 2> /dev/null
include .xcompile
the following patch was just integrated into master:
commit 326a037612faa344cf01426d9f50142d628b12b7
Author: David Imhoff <dimhoff_devel(a)xs4all.nl>
Date: Wed Apr 22 17:24:26 2015 +0200
intel/fsp_baytrail: Fix default SMM_TSEG_SIZE value
The value of SMM_TSEG_SIZE was equal to SMM_RESERVED_SIZE. This caused
the install_permanent_handler() function to fail. Changed the value to
0x800000, which is already used as default in smm_region_size() in case
SMM_TSEG_SIZE is 0.
Change-Id: I4ff3568aefd4729a98c1777a2cae2a4715afbc2f
Signed-off-by: David Imhoff <dimhoff_devel(a)xs4all.nl>
Reviewed-on: http://review.coreboot.org/9961
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Reviewed-by: Werner Zeh <werner.zeh(a)siemens.com>
See http://review.coreboot.org/9961 for details.
-gerrit