vboot2: add verstage

This reverts the revert commit 5780d6f387
and fixes the build issue that cuased it to be reverted.

Verstage will host vboot2 for firmware verification.
It's a stage in the sense that it has its own set of toolchains,
compiler flags,
and includes. This allows us to easily add object files as needed. But
it's directly linked to bootblock. This allows us to avoid code
duplication for stage loading and jumping (e.g. cbfs driver) for the
boards
where bootblock has to run in a different architecture (e.g. Tegra124).
To avoid name space conflict, verstage symbols are prefixed with
verstage_.

TEST=Built with VBOOT2_VERIFY_FIRMWARE on/off. Booted Nyan Blaze.
BUG=None
BRANCH=none

Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Original-Change-Id: Iad57741157ec70426c676e46c5855e6797ac1dac
Original-Reviewed-on: https://chromium-review.googlesource.com/204376
Original-Reviewed-by: Randall Spangler <rspangler@chromium.org>

(cherry picked from commit 27940f891678dae975b68f2fc729ad7348192af3)
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Change-Id: I2a83b87c29d98d97ae316091cf3ed7b024e21daf
Reviewed-on: http://review.coreboot.org/8224
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Stefan Reinauer 2015-01-14 19:51:47 +01:00 committed by Marc Jones
parent 40ce5d90b8
commit 77b1655d9b
61 changed files with 118 additions and 5 deletions

View File

@ -75,7 +75,7 @@ subdirs-y += site-local
####################################################################### #######################################################################
# Add source classes and their build options # Add source classes and their build options
classes-y := ramstage romstage bootblock smm smmstub cpu_microcode classes-y := ramstage romstage bootblock smm smmstub cpu_microcode verstage
# Add dynamic classes for rmodules # Add dynamic classes for rmodules
$(foreach supported_arch,$(ARCH_SUPPORTED), \ $(foreach supported_arch,$(ARCH_SUPPORTED), \
@ -128,6 +128,8 @@ ramstage-postprocess=$(foreach d,$(sort $(dir $(1))), \
$(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(1)); $$(LD_ramstage) -o $$@ -r $$^ ) \ $(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(1)); $$(LD_ramstage) -o $$@ -r $$^ ) \
$(eval ramstage-objs:=$(d)ramstage.o $(filter-out $(call files-in-dir,$(d),$(1)),$(ramstage-objs)))) $(eval ramstage-objs:=$(d)ramstage.o $(filter-out $(call files-in-dir,$(d),$(1)),$(ramstage-objs))))
verstage-c-ccopts:=-D__PRE_RAM__ -D__VER_STAGE__
verstage-S-ccopts:=-D__PRE_RAM__ -D__VER_STAGE__
romstage-c-ccopts:=-D__PRE_RAM__ romstage-c-ccopts:=-D__PRE_RAM__
romstage-S-ccopts:=-D__PRE_RAM__ romstage-S-ccopts:=-D__PRE_RAM__
ifeq ($(CONFIG_TRACE),y) ifeq ($(CONFIG_TRACE),y)
@ -162,6 +164,7 @@ endif
ramstage-c-deps:=$$(OPTION_TABLE_H) ramstage-c-deps:=$$(OPTION_TABLE_H)
romstage-c-deps:=$$(OPTION_TABLE_H) romstage-c-deps:=$$(OPTION_TABLE_H)
verstage-c-deps:=$$(OPTION_TABLE_H)
bootblock-c-deps:=$$(OPTION_TABLE_H) bootblock-c-deps:=$$(OPTION_TABLE_H)
smm-c-deps:=$$(OPTION_TABLE_H) smm-c-deps:=$$(OPTION_TABLE_H)
@ -374,6 +377,10 @@ $(obj)/%.romstage.o $(abspath $(obj))/%.romstage.o: $(obj)/%.c $(obj)/config.h $
@printf " CC $(subst $(obj)/,,$(@))\n" @printf " CC $(subst $(obj)/,,$(@))\n"
$(CC_romstage) -MMD $(CFLAGS_romstage) $(CPPFLAGS_romstage) $(romstage-c-ccopts) -c -o $@ $< $(CC_romstage) -MMD $(CFLAGS_romstage) $(CPPFLAGS_romstage) $(romstage-c-ccopts) -c -o $@ $<
$(obj)/%.verstage.o $(abspath $(obj))/%.verstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
@printf " CC $(subst $(obj)/,,$(@))\n"
$(CC_verstage) -MMD $(CFLAGS_verstage) $(verstage-c-ccopts) -c -o $@ $<
$(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H) $(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
@printf " CC $(subst $(obj)/,,$(@))\n" @printf " CC $(subst $(obj)/,,$(@))\n"
$(CC_bootblock) -MMD $(CFLAGS_bootblock) $(CPPFLAGS_bootblock) $(bootblock-c-ccopts) -c -o $@ $< $(CC_bootblock) -MMD $(CFLAGS_bootblock) $(CPPFLAGS_bootblock) $(bootblock-c-ccopts) -c -o $@ $<

View File

@ -3,6 +3,10 @@ config ARCH_BOOTBLOCK_ARM
default n default n
select ARCH_ARM select ARCH_ARM
config ARCH_VERSTAGE_ARM
bool
default n
config ARCH_ROMSTAGE_ARM config ARCH_ROMSTAGE_ARM
bool bool
default n default n

View File

@ -61,7 +61,7 @@ bootblock-y += memcpy.S
bootblock-y += memmove.S bootblock-y += memmove.S
bootblock-y += div0.c bootblock-y += div0.c
$(objcbfs)/bootblock.debug: $(src)/arch/arm/bootblock.ld $(obj)/ldoptions $$(bootblock-objs) $(objcbfs)/bootblock.debug: $(src)/arch/arm/bootblock.ld $(obj)/ldoptions $$(bootblock-objs) $$(VERSTAGE_LIB)
@printf " LINK $(subst $(obj)/,,$(@))\n" @printf " LINK $(subst $(obj)/,,$(@))\n"
$(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(src)/arch/arm/bootblock.ld $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(src)/arch/arm/bootblock.ld

View File

@ -2,6 +2,10 @@ config ARCH_BOOTBLOCK_ARMV4
def_bool n def_bool n
select ARCH_BOOTBLOCK_ARM select ARCH_BOOTBLOCK_ARM
config ARCH_VERSTAGE_ARMV4
def_bool n
select ARCH_VERSTAGE_ARM
config ARCH_ROMSTAGE_ARMV4 config ARCH_ROMSTAGE_ARMV4
def_bool n def_bool n
select ARCH_ROMSTAGE_ARM select ARCH_ROMSTAGE_ARM

View File

@ -2,6 +2,10 @@ config ARCH_BOOTBLOCK_ARMV7
def_bool n def_bool n
select ARCH_BOOTBLOCK_ARM select ARCH_BOOTBLOCK_ARM
config ARCH_VERSTAGE_ARMV7
def_bool n
select ARCH_VERSTAGE_ARM
config ARCH_ROMSTAGE_ARMV7 config ARCH_ROMSTAGE_ARMV7
def_bool n def_bool n
select ARCH_ROMSTAGE_ARM select ARCH_ROMSTAGE_ARM

View File

@ -3,6 +3,10 @@ config ARCH_BOOTBLOCK_ARM64
default n default n
select ARCH_ARM64 select ARCH_ARM64
config ARCH_VERSTAGE_ARM64
bool
default n
config ARCH_ROMSTAGE_ARM64 config ARCH_ROMSTAGE_ARM64
bool bool
default n default n

View File

@ -2,6 +2,10 @@ config ARCH_BOOTBLOCK_ARMV8_64
def_bool n def_bool n
select ARCH_BOOTBLOCK_ARM64 select ARCH_BOOTBLOCK_ARM64
config ARCH_VERSTAGE_ARMV8_64
def_bool n
select ARCH_VERSTAGE_ARM64
config ARCH_ROMSTAGE_ARMV8_64 config ARCH_ROMSTAGE_ARMV8_64
def_bool n def_bool n
select ARCH_ROMSTAGE_ARM64 select ARCH_ROMSTAGE_ARM64

View File

@ -3,6 +3,10 @@ config ARCH_BOOTBLOCK_RISCV
default n default n
select ARCH_RISCV select ARCH_RISCV
config ARCH_VERSTAGE_RISCV
bool
default n
config ARCH_ROMSTAGE_RISCV config ARCH_ROMSTAGE_RISCV
bool bool
default n default n

View File

@ -3,6 +3,10 @@ config ARCH_BOOTBLOCK_X86_32
default n default n
select ARCH_X86 select ARCH_X86
config ARCH_VERSTAGE_X86_32
bool
default n
config ARCH_ROMSTAGE_X86_32 config ARCH_ROMSTAGE_X86_32
bool bool
default n default n

View File

@ -7,6 +7,7 @@ if CPU_ALLWINNER_A10
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_ARMV7 select ARCH_BOOTBLOCK_ARMV7
select ARCH_VERSTAGE_ARMV7
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
select HAVE_MONOTONIC_TIMER select HAVE_MONOTONIC_TIMER

View File

@ -28,6 +28,7 @@ config CPU_AMD_AGESA
default y if CPU_AMD_AGESA_FAMILY16_KB default y if CPU_AMD_AGESA_FAMILY16_KB
default n default n
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select TSC_SYNC_LFENCE select TSC_SYNC_LFENCE

View File

@ -20,6 +20,7 @@
config CPU_AMD_GEODE_GX2 config CPU_AMD_GEODE_GX2
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32

View File

@ -1,6 +1,7 @@
config CPU_AMD_GEODE_LX config CPU_AMD_GEODE_LX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32

View File

@ -1,6 +1,7 @@
config CPU_AMD_MODEL_10XXX config CPU_AMD_MODEL_10XXX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SSE select SSE

View File

@ -1,6 +1,7 @@
config CPU_AMD_MODEL_FXX config CPU_AMD_MODEL_FXX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select MMX select MMX

View File

@ -22,6 +22,7 @@ config CPU_AMD_PI
default y if CPU_AMD_PI_00730F01 default y if CPU_AMD_PI_00730F01
default n default n
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select TSC_SYNC_LFENCE select TSC_SYNC_LFENCE

View File

@ -1,6 +1,7 @@
config CPU_ARMLTD_CORTEX_A9 config CPU_ARMLTD_CORTEX_A9
bool bool
select ARCH_BOOTBLOCK_ARMV7 select ARCH_BOOTBLOCK_ARMV7
select ARCH_VERSTAGE_ARMV7
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
default n default n

View File

@ -20,6 +20,7 @@
config CPU_DMP_VORTEX86EX config CPU_DMP_VORTEX86EX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select UDELAY_TSC select UDELAY_TSC

View File

@ -1,6 +1,7 @@
config CPU_INTEL_EP80579 config CPU_INTEL_EP80579
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SSE select SSE

View File

@ -30,6 +30,7 @@ config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select PLATFORM_USES_FSP select PLATFORM_USES_FSP
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -26,6 +26,7 @@ config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select PLATFORM_USES_FSP select PLATFORM_USES_FSP
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -7,6 +7,7 @@ if CPU_INTEL_HASWELL
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select BACKUP_DEFAULT_SMM_REGION select BACKUP_DEFAULT_SMM_REGION

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_1067X config CPU_INTEL_MODEL_1067X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_106CX config CPU_INTEL_MODEL_106CX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -6,6 +6,7 @@ if CPU_INTEL_MODEL_2065X
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -9,6 +9,7 @@ if CPU_INTEL_MODEL_206AX || CPU_INTEL_MODEL_306AX
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_65X config CPU_INTEL_MODEL_65X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_67X config CPU_INTEL_MODEL_67X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -21,6 +21,7 @@
config CPU_INTEL_MODEL_68X config CPU_INTEL_MODEL_68X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_69X config CPU_INTEL_MODEL_69X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_6BX config CPU_INTEL_MODEL_6BX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_6DX config CPU_INTEL_MODEL_6DX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_6EX config CPU_INTEL_MODEL_6EX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_6FX config CPU_INTEL_MODEL_6FX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_6XX config CPU_INTEL_MODEL_6XX
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_F0X config CPU_INTEL_MODEL_F0X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_F1X config CPU_INTEL_MODEL_F1X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_F2X config CPU_INTEL_MODEL_F2X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_F3X config CPU_INTEL_MODEL_F3X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -1,6 +1,7 @@
config CPU_INTEL_MODEL_F4X config CPU_INTEL_MODEL_F4X
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select SMP select SMP

View File

@ -20,5 +20,6 @@
config CPU_QEMU_X86 config CPU_QEMU_X86
bool bool
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32

View File

@ -1,5 +1,6 @@
config CPU_TI_AM335X config CPU_TI_AM335X
select ARCH_BOOTBLOCK_ARMV7 select ARCH_BOOTBLOCK_ARMV7
select ARCH_VERSTAGE_ARMV7
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
select HAVE_MONOTONIC_TIMER select HAVE_MONOTONIC_TIMER

View File

@ -6,6 +6,7 @@ if CPU_VIA_C3
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select UDELAY_TSC select UDELAY_TSC

View File

@ -6,6 +6,7 @@ if CPU_VIA_C7
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select UDELAY_TSC select UDELAY_TSC

View File

@ -25,6 +25,7 @@ if CPU_VIA_NANO
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select UDELAY_TSC select UDELAY_TSC

View File

@ -3,6 +3,7 @@ if BOARD_BIFFEROS_BIFFERBOARD
config BOARD_SPECIFIC_OPTIONS config BOARD_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select ROMCC select ROMCC

View File

@ -8,6 +8,7 @@ if SOC_INTEL_BAYTRAIL
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select BACKUP_DEFAULT_SMM_REGION select BACKUP_DEFAULT_SMM_REGION

View File

@ -8,6 +8,7 @@ if SOC_INTEL_BROADWELL
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select ALT_CBFS_LOAD_PAYLOAD select ALT_CBFS_LOAD_PAYLOAD

View File

@ -28,6 +28,7 @@ if SOC_INTEL_FSP_BAYTRAIL
config CPU_SPECIFIC_OPTIONS config CPU_SPECIFIC_OPTIONS
def_bool y def_bool y
select ARCH_BOOTBLOCK_X86_32 select ARCH_BOOTBLOCK_X86_32
select ARCH_VERSTAGE_X86_32
select ARCH_ROMSTAGE_X86_32 select ARCH_ROMSTAGE_X86_32
select ARCH_RAMSTAGE_X86_32 select ARCH_RAMSTAGE_X86_32
select DYNAMIC_CBMEM select DYNAMIC_CBMEM

View File

@ -2,6 +2,7 @@ config SOC_NVIDIA_TEGRA124
bool bool
default n default n
select ARCH_BOOTBLOCK_ARMV4 select ARCH_BOOTBLOCK_ARMV4
select ARCH_VERSTAGE_ARMV4
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
select HAVE_UART_SPECIAL select HAVE_UART_SPECIAL

View File

@ -20,6 +20,8 @@ ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y)
bootblock-$(CONFIG_CONSOLE_SERIAL) += uart.c bootblock-$(CONFIG_CONSOLE_SERIAL) += uart.c
endif endif
verstage-y += verstage.c
romstage-y += cbfs.c romstage-y += cbfs.c
romstage-y += cbmem.c romstage-y += cbmem.c
romstage-y += clock.c romstage-y += clock.c

View File

@ -23,9 +23,9 @@
#include <console/console.h> #include <console/console.h>
#include <soc/clock.h> #include <soc/clock.h>
#include <soc/nvidia/tegra/apbmisc.h> #include <soc/nvidia/tegra/apbmisc.h>
#include "pinmux.h" #include "pinmux.h"
#include "power.h" #include "power.h"
#include "verstage.h"
void main(void) void main(void)
{ {
@ -72,7 +72,10 @@ void main(void)
power_enable_cpu_rail(); power_enable_cpu_rail();
power_ungate_cpu(); power_ungate_cpu();
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/romstage"); if (IS_ENABLED(CONFIG_VBOOT2_VERIFY_FIRMWARE))
entry = (void *)verstage_vboot_main;
else
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/romstage");
if (entry) if (entry)
clock_cpu0_config_and_reset(entry); clock_cpu0_config_and_reset(entry);

View File

@ -0,0 +1,9 @@
#include "verstage.h"
/**
* Stage entry point
*/
void vboot_main(void)
{
for(;;);
}

View File

@ -0,0 +1,2 @@
void vboot_main(void);
void verstage_vboot_main(void);

View File

@ -2,6 +2,7 @@ config SOC_QC_IPQ806X
bool bool
default n default n
select ARCH_BOOTBLOCK_ARMV4 select ARCH_BOOTBLOCK_ARMV4
select ARCH_VERSTAGE_ARMV4
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
select ARM_LPAE select ARM_LPAE

View File

@ -1,5 +1,6 @@
config CPU_SAMSUNG_EXYNOS5250 config CPU_SAMSUNG_EXYNOS5250
select ARCH_BOOTBLOCK_ARMV7 select ARCH_BOOTBLOCK_ARMV7
select ARCH_VERSTAGE_ARMV7
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
select CPU_HAS_BOOTBLOCK_INIT select CPU_HAS_BOOTBLOCK_INIT

View File

@ -1,5 +1,6 @@
config CPU_SAMSUNG_EXYNOS5420 config CPU_SAMSUNG_EXYNOS5420
select ARCH_BOOTBLOCK_ARMV7 select ARCH_BOOTBLOCK_ARMV7
select ARCH_VERSTAGE_ARMV7
select ARCH_ROMSTAGE_ARMV7 select ARCH_ROMSTAGE_ARMV7
select ARCH_RAMSTAGE_ARMV7 select ARCH_RAMSTAGE_ARMV7
select CPU_HAS_BOOTBLOCK_INIT select CPU_HAS_BOOTBLOCK_INIT

View File

@ -1,6 +1,7 @@
config SOC_UCB_RISCV config SOC_UCB_RISCV
select ARCH_RISCV select ARCH_RISCV
select ARCH_BOOTBLOCK_RISCV select ARCH_BOOTBLOCK_RISCV
select ARCH_VERSTAGE_RISCV
select ARCH_ROMSTAGE_RISCV select ARCH_ROMSTAGE_RISCV
select ARCH_RAMSTAGE_RISCV select ARCH_RAMSTAGE_RISCV
select DYNAMIC_CBMEM select DYNAMIC_CBMEM

View File

@ -85,6 +85,14 @@ config VBOOT_VERIFY_FIRMWARE
Enabling VBOOT_VERIFY_FIRMWARE will use vboot to verify the ramstage Enabling VBOOT_VERIFY_FIRMWARE will use vboot to verify the ramstage
and boot loader. and boot loader.
config VBOOT2_VERIFY_FIRMWARE
bool "Firmware Verification with vboot2"
default n
depends on CHROMEOS
help
Enabling VBOOT2_VERIFY_FIRMWARE will use vboot2 to verify the romstage
and boot loader.
config EC_SOFTWARE_SYNC config EC_SOFTWARE_SYNC
bool "Enable EC software sync" bool "Enable EC software sync"
default n default n

View File

@ -93,3 +93,12 @@ $(VB_LIB):
fwlib fwlib
endif endif
ifeq ($(CONFIG_VBOOT2_VERIFY_FIRMWARE),y)
VERSTAGE_LIB = $(obj)/vendorcode/google/chromeos/verstage.a
$(VERSTAGE_LIB): $$(verstage-objs)
@printf " AR $(subst $(obj)/,,$(@))\n"
$(AR_verstage) rc $@.tmp $(verstage-objs)
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
$(OBJCOPY_verstage) --prefix-symbols=verstage_ $@.tmp $@
endif

View File

@ -51,7 +51,7 @@ HOSTCXX:=CCC_CXX="$(HOSTCXX)" $(CXX)
ROMCC=CCC_CC="$(ROMCC_BIN)" $(CC) ROMCC=CCC_CC="$(ROMCC_BIN)" $(CC)
endif endif
COREBOOT_STANDARD_STAGES := bootblock romstage ramstage COREBOOT_STANDARD_STAGES := bootblock verstage romstage ramstage
ARCHDIR-i386 := x86 ARCHDIR-i386 := x86
ARCHDIR-x86_32 := x86 ARCHDIR-x86_32 := x86