From ff27178d696aeb9da54d7681a83e3c9ab20855bf Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 20 May 2016 10:48:44 -0500 Subject: [PATCH] UPSTREAM: soc/intel/apollolake: add support for writing logical boot partition 2 On apollolake the boot media layout is different in that the traditional "BIOS" region contains another data structure with the boot assets such as CSE firmware, PMC microcode, CPU microcode, and boot firmware to name a few. There's also a sort of recovery mechanism where there is a second data structure with similar contents halfway through the "BIOS" region. This second structure is referred as the logical boot partition 2 (LBP2), and it's optionally employed. Add support for writing the LBP2 to a specified FMAP region to accommodate platforms which require it. BUG=None BRANCH=None TEST=None Change-Id: I1959a790f763b409238dea6b62408b42122e590e Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://review.coreboot.org/14924 Original-Tested-by: build bot (Jenkins) Original-Reviewed-by: Furquan Shaikh Original-Reviewed-by: Andrey Petrov Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/346994 Commit-Ready: Martin Roth Tested-by: Martin Roth Reviewed-by: Martin Roth --- src/soc/intel/apollolake/Kconfig | 21 +++++++++++++++++++++ src/soc/intel/apollolake/Makefile.inc | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig index b893885ce0..ad7ce18fbb 100644 --- a/src/soc/intel/apollolake/Kconfig +++ b/src/soc/intel/apollolake/Kconfig @@ -130,4 +130,25 @@ config FSP_M_ADDR help The address FSP-M will be relocated to during build time +config NEED_LBP2 + bool "Write contents for logical boot partition 2." + default n + help + Write the contents from a file into the logical boot partition 2 + region defined by LBP2_FMAP_NAME. + +config LBP2_FMAP_NAME + string "Name of FMAP region to put logical boot partition 2" + depends on NEED_LBP2 + default "SIGN_CSE" + help + Name of FMAP region to write logical boot partition 2 data. + +config LBP2_FILE_NAME + string "Path of file to write to logical boot partition 2 region" + depends on NEED_LBP2 + default "3rdparty/blobs/mainboard/$(CONFIG_MAINBOARD_DIR)/lbp2.bin" + help + Name of file to store in the logical boot partition 2 region. + endif diff --git a/src/soc/intel/apollolake/Makefile.inc b/src/soc/intel/apollolake/Makefile.inc index 63732b1b80..607ad136e0 100644 --- a/src/soc/intel/apollolake/Makefile.inc +++ b/src/soc/intel/apollolake/Makefile.inc @@ -63,4 +63,9 @@ CPPFLAGS_common += -I$(src)/soc/intel/apollolake/include # Since FSP-M runs in CAR we need to relocate it to a specific address $(CONFIG_FSP_M_CBFS)-options := -b $(CONFIG_FSP_M_ADDR) +ifeq ($(CONFIG_NEED_LBP2),y) +files_added:: + $(CBFSTOOL) $(obj)/coreboot.rom write -r $(CONFIG_LBP2_FMAP_NAME) -f $(CONFIG_LBP2_FILE_NAME) --fill-upward +endif + endif