2014-10-10 19:51:06 +02:00
|
|
|
##
|
|
|
|
## This file is part of the coreboot project.
|
|
|
|
##
|
|
|
|
## Copyright (C) 2014 The ChromiumOS Authors. All rights reserved.
|
|
|
|
##
|
|
|
|
## 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.
|
|
|
|
##
|
|
|
|
|
2016-07-25 22:02:36 +02:00
|
|
|
bootblock-y += bootmode.c
|
|
|
|
romstage-y += bootmode.c
|
|
|
|
ramstage-y += bootmode.c
|
|
|
|
verstage-y += bootmode.c
|
|
|
|
postcar-y += bootmode.c
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_VBOOT),y)
|
|
|
|
|
2015-04-30 14:25:14 +02:00
|
|
|
libverstage-generic-ccopts += -D__PRE_RAM__ -D__VERSTAGE__
|
2015-05-01 23:48:54 +02:00
|
|
|
verstage-generic-ccopts += -D__PRE_RAM__ -D__VERSTAGE__
|
2014-10-10 19:51:06 +02:00
|
|
|
|
2016-07-25 20:48:03 +02:00
|
|
|
bootblock-y += vbnv.c
|
|
|
|
verstage-y += vbnv.c
|
|
|
|
romstage-y += vbnv.c
|
|
|
|
ramstage-y += vbnv.c
|
|
|
|
|
|
|
|
bootblock-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
|
|
|
|
verstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
|
|
|
|
romstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
|
|
|
|
ramstage-$(CONFIG_VBOOT_VBNV_CMOS) += vbnv_cmos.c
|
|
|
|
|
|
|
|
bootblock-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
|
|
|
|
verstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
|
|
|
|
romstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
|
|
|
|
ramstage-$(CONFIG_VBOOT_VBNV_CMOS_BACKUP_TO_FLASH) += vbnv_flash.c
|
|
|
|
|
|
|
|
bootblock-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
|
|
|
|
verstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
|
|
|
|
romstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
|
|
|
|
ramstage-$(CONFIG_VBOOT_VBNV_EC) += vbnv_ec.c
|
|
|
|
|
|
|
|
bootblock-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
|
|
|
|
verstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
|
|
|
|
romstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
|
|
|
|
ramstage-$(CONFIG_VBOOT_VBNV_FLASH) += vbnv_flash.c
|
|
|
|
|
2015-05-01 23:48:54 +02:00
|
|
|
bootblock-y += vboot_loader.c
|
|
|
|
romstage-y += vboot_loader.c
|
|
|
|
ramstage-y += vboot_loader.c
|
|
|
|
verstage-y += vboot_loader.c
|
2016-04-14 23:12:47 +02:00
|
|
|
postcar-y += vboot_loader.c
|
2015-05-01 23:48:54 +02:00
|
|
|
|
2016-07-25 20:48:03 +02:00
|
|
|
bootblock-y += vboot_common.c
|
|
|
|
verstage-y += vboot_common.c
|
|
|
|
romstage-y += vboot_common.c
|
|
|
|
ramstage-y += vboot_common.c
|
|
|
|
postcar-y += vboot_common.c
|
2014-10-10 19:51:06 +02:00
|
|
|
|
2014-11-04 21:32:29 +01:00
|
|
|
bootblock-y += common.c
|
2015-09-30 00:56:59 +02:00
|
|
|
libverstage-y += vboot_logic.c
|
2015-04-09 17:18:22 +02:00
|
|
|
verstage-y += common.c
|
2015-09-30 00:56:59 +02:00
|
|
|
verstage-y += verstage.c
|
2016-07-25 20:48:03 +02:00
|
|
|
ifeq (${CONFIG_VBOOT_MOCK_SECDATA},y)
|
2015-04-30 14:25:14 +02:00
|
|
|
libverstage-y += secdata_mock.c
|
2015-04-09 17:18:22 +02:00
|
|
|
else
|
2016-07-25 20:48:03 +02:00
|
|
|
libverstage-y += secdata_tpm.c
|
2015-04-09 17:18:22 +02:00
|
|
|
endif
|
2014-10-10 19:51:06 +02:00
|
|
|
romstage-y += vboot_handoff.c common.c
|
|
|
|
|
2015-05-01 23:48:54 +02:00
|
|
|
ramstage-y += common.c
|
2016-04-14 23:12:47 +02:00
|
|
|
postcar-y += common.c
|
2015-05-01 23:48:54 +02:00
|
|
|
|
2015-05-08 22:58:06 +02:00
|
|
|
ifeq ($(CONFIG_SEPARATE_VERSTAGE),y)
|
|
|
|
VB_FIRMWARE_ARCH := $(ARCHDIR-$(ARCH-verstage-y))
|
|
|
|
else
|
|
|
|
ifeq ($(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK),y)
|
|
|
|
VB_FIRMWARE_ARCH := $(ARCHDIR-$(ARCH-bootblock-y))
|
|
|
|
else
|
|
|
|
VB_FIRMWARE_ARCH := $(ARCHDIR-$(ARCH-romstage-y))
|
|
|
|
endif
|
|
|
|
endif # CONFIG_SEPARATE_VERSTAGE
|
|
|
|
|
2015-01-28 02:28:18 +01:00
|
|
|
VB2_LIB = $(obj)/external/vboot_reference/vboot_fw20.a
|
2015-08-03 23:03:27 +02:00
|
|
|
VBOOT_CFLAGS += $(patsubst -I%,-I$(top)/%, $(filter-out -I$(obj), $(filter-out -include $(src)/include/kconfig.h, $(CPPFLAGS_libverstage))))
|
2015-05-11 19:25:21 +02:00
|
|
|
VBOOT_CFLAGS += $(CFLAGS_libverstage)
|
2015-04-30 14:25:14 +02:00
|
|
|
VBOOT_CFLAGS += $(libverstage-c-ccopts)
|
2015-08-03 23:03:27 +02:00
|
|
|
VBOOT_CFLAGS += -I$(abspath $(obj)) -include $(top)/src/include/kconfig.h -Wno-missing-prototypes
|
2014-10-10 19:51:06 +02:00
|
|
|
VBOOT_CFLAGS += -DVBOOT_DEBUG
|
|
|
|
|
|
|
|
$(VB2_LIB): $(obj)/config.h
|
|
|
|
@printf " MAKE $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(Q)FIRMWARE_ARCH=$(VB_FIRMWARE_ARCH) \
|
|
|
|
CC="$(CC_verstage)" \
|
|
|
|
CFLAGS="$(VBOOT_CFLAGS)" VBOOT2="y" \
|
2016-07-24 12:10:38 +02:00
|
|
|
$(MAKE) -C $(VBOOT_SOURCE) \
|
2015-08-03 23:03:27 +02:00
|
|
|
BUILD=$(abspath $(dir $(VB2_LIB))) \
|
2014-10-10 19:51:06 +02:00
|
|
|
V=$(V) \
|
2015-01-28 02:28:18 +01:00
|
|
|
fwlib20
|
2014-10-10 19:51:06 +02:00
|
|
|
|
2015-04-30 14:25:14 +02:00
|
|
|
libverstage-srcs += $(VB2_LIB)
|
2015-04-27 18:09:22 +02:00
|
|
|
|
2015-04-27 18:13:50 +02:00
|
|
|
ifeq ($(CONFIG_SEPARATE_VERSTAGE),y)
|
2015-11-26 16:39:23 +01:00
|
|
|
cbfs-files-$(CONFIG_SEPARATE_VERSTAGE) += $(CONFIG_CBFS_PREFIX)/verstage
|
|
|
|
$(CONFIG_CBFS_PREFIX)/verstage-file := $(objcbfs)/verstage.elf
|
|
|
|
$(CONFIG_CBFS_PREFIX)/verstage-type := stage
|
2015-09-29 22:51:35 +02:00
|
|
|
$(CONFIG_CBFS_PREFIX)/verstage-compression := $(CBFS_PRERAM_COMPRESS_FLAG)
|
2016-05-05 08:25:16 +02:00
|
|
|
|
2015-11-26 16:39:23 +01:00
|
|
|
ifeq ($(CONFIG_ARCH_VERSTAGE_X86_32)$(CONFIG_ARCH_VERSTAGE_X86_64),y)
|
2016-05-05 08:25:16 +02:00
|
|
|
$(CONFIG_CBFS_PREFIX)/verstage-options := -a 64 -S ".car.data"
|
|
|
|
|
|
|
|
# If CAR does not support execution of code, verstage on x86 is expected to be
|
|
|
|
# xip.
|
|
|
|
ifneq ($(CONFIG_NO_XIP_EARLY_STAGES),y)
|
|
|
|
$(CONFIG_CBFS_PREFIX)/verstage-options += --xip
|
|
|
|
endif
|
2015-11-26 16:39:23 +01:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2015-04-27 18:13:50 +02:00
|
|
|
else
|
2015-05-08 22:58:06 +02:00
|
|
|
ifeq ($(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK),y)
|
2015-04-27 18:13:50 +02:00
|
|
|
bootblock-srcs += $(objgenerated)/libverstage.a
|
2015-04-28 23:17:25 +02:00
|
|
|
else
|
|
|
|
romstage-srcs += $(objgenerated)/libverstage.a
|
2015-04-27 18:13:50 +02:00
|
|
|
endif
|
2015-04-28 23:17:25 +02:00
|
|
|
endif # CONFIG_SEPARATE_VERSTAGE
|
2016-01-20 15:54:31 +01:00
|
|
|
|
|
|
|
# Define a list of files that need to be in RO only.
|
|
|
|
# All other files will be installed into RO and RW regions
|
|
|
|
# Use $(sort) to cut down on extra spaces that would be translated to commas
|
|
|
|
regions-for-file = $(subst $(spc),$(comma),$(sort \
|
|
|
|
$(if $(filter \
|
|
|
|
$(if $(filter y,$(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)),, \
|
|
|
|
%/romstage) \
|
|
|
|
mts \
|
|
|
|
%/verstage \
|
2016-02-05 11:01:24 +01:00
|
|
|
locales \
|
|
|
|
locale_%.bin \
|
|
|
|
font.bin \
|
|
|
|
vbgfx.bin \
|
2016-01-20 15:54:31 +01:00
|
|
|
,$(1)),COREBOOT,COREBOOT FW_MAIN_A FW_MAIN_B)))
|
2016-07-25 22:02:36 +02:00
|
|
|
|
|
|
|
endif # CONFIG_VBOOT
|