Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14608
-gerrit
commit 6fd05f3130a3c699d0f279e9b3fc9f2faa0246b9
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Wed May 4 16:07:15 2016 -0500
util/cbfstool: fix x86 execute-in-place semantics for all fmd regions
A previous patch [1] to make top-aligned addresses work within per
fmap regions caused a significant regression in the semantics of
adding programs that need to be execute-in-place (XIP) on x86
systems. Correct the regression by providing new function,
convert_to_from_absolute_top_aligned(), which top aligns against
the entire boot media.
[1] 9731119b cbfstool: make top-aligned address work per-region
Change-Id: I3b685abadcfc76dab8846eec21e9114a23577578
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
util/cbfstool/cbfstool.c | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 1d1577f..b1b410f 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -106,6 +106,21 @@ static bool region_is_modern_cbfs(const char *region)
/*
* Converts between offsets from the start of the specified image region and
+ * "top-aligned" offsets from the top of the entire boot media. See comment
+ * below for convert_to_from_top_aligned() about forming addresses.
+ */
+static unsigned convert_to_from_absolute_top_aligned(
+ const struct buffer *region, unsigned offset)
+{
+ assert(region);
+
+ size_t image_size = partitioned_file_total_size(param.image_file);
+
+ return image_size - region->offset - offset;
+}
+
+/*
+ * Converts between offsets from the start of the specified image region and
* "top-aligned" offsets from the top of the image region. Works in either
* direction: pass in one type of offset and receive the other type.
* N.B. A top-aligned offset is always a positive number, and should not be
@@ -123,8 +138,7 @@ static unsigned convert_to_from_top_aligned(const struct buffer *region,
return region->size - offset;
}
- size_t image_size = partitioned_file_total_size(param.image_file);
- return image_size - region->offset - offset;
+ return convert_to_from_absolute_top_aligned(region, offset);
}
static int do_cbfs_locate(int32_t *cbfs_addr, size_t metadata_size)
@@ -462,8 +476,8 @@ static int cbfstool_convert_fsp(struct buffer *buffer,
/* Ensure the address is a memory mapped one. */
if (!IS_TOP_ALIGNED_ADDRESS(address))
- address = -convert_to_from_top_aligned(param.image_region,
- address);
+ address = -convert_to_from_absolute_top_aligned(
+ param.image_region, address);
/* Create a copy of the buffer to attempt relocation. */
if (buffer_create(&fsp, buffer_size(buffer), "fsp"))
@@ -498,9 +512,13 @@ static int cbfstool_convert_mkstage(struct buffer *buffer, uint32_t *offset,
return 1;
}
- /* Pass in a top aligned address. */
- address = -convert_to_from_top_aligned(param.image_region,
- address);
+ /*
+ * Ensure the address is a memory mapped one. This assumes
+ * x86 semantics about th boot media being directly mapped
+ * below 4GiB in the CPU address space.
+ **/
+ address = -convert_to_from_absolute_top_aligned(
+ param.image_region, address);
*offset = address;
ret = parse_elf_to_xip_stage(buffer, &output, offset,
the following patch was just integrated into master:
commit 4c3f5dc03ce5fa19cd087a62430239df6d86e54d
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Fri Apr 29 16:36:02 2016 -0700
soc/intel/quark: Add script time delay support
Add time delay support to the scripts.
TEST=Build and run on Galileo Gen2
Change-Id: I2c87977e2a2547e00769e59e1ee81fbbb5dff33f
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
Reviewed-on: https://review.coreboot.org/14555
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/14555 for details.
-gerrit
the following patch was just integrated into master:
commit 63e3dff02f5b66b32b32fd1497f820532af25a07
Author: Lee Leahy <leroy.p.leahy(a)intel.com>
Date: Sat Apr 30 08:48:52 2016 -0700
soc/intel/quark: Add temperature sensor support
Migrate the temperature sensor support from QuarkFspPkg into coreboot.
TEST=Build and run on Galileo Gen2
Change-Id: I6dc68c735375c9d1777693264674521f67397556
Signed-off-by: Lee Leahy <leroy.p.leahy(a)intel.com>
Reviewed-on: https://review.coreboot.org/14565
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/14565 for details.
-gerrit
Aaron Durbin (adurbin(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14625
-gerrit
commit 14c092b4fec1d7a33bdbb9c527fa2eb3b3ee8e70
Author: Aaron Durbin <adurbin(a)chromium.org>
Date: Thu May 5 10:34:22 2016 -0500
cpu/x86: don't treat all chipsets the same regarding XIP_ROM_SIZE
Previously, the XIP_ROM_SIZE Kconfig variable is used globally on
x86 platforms with the assumption that all chipsets utilize this
value. For the chipsets which do not use the variable it can lead
to unnecessary alignment constraints in cbfs for romstage. Therefore,
allow those chipsets a path to not be burdened by not passing
'-P $(XIP_ROM_SIZE)' to cbfstool when adding romstage.
Change-Id: Id8692df5ecec116a72b8e5886d86648ca959c78b
Signed-off-by: Aaron Durbin <adurbin(a)chromium.org>
---
Makefile.inc | 7 ++++++-
src/cpu/x86/Kconfig | 11 +++++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/Makefile.inc b/Makefile.inc
index 94273df..9890e14 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -798,7 +798,12 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
#
# Make sure that segment for .car.data is ignored while adding romstage.
$(CONFIG_CBFS_PREFIX)/romstage-align := 64
-$(CONFIG_CBFS_PREFIX)/romstage-options := --xip -S .car.data -P $(CONFIG_XIP_ROM_SIZE)
+$(CONFIG_CBFS_PREFIX)/romstage-options := --xip -S .car.data
+# If XIP_ROM_SIZE isn't being used don't overly constrain romstage by passing
+# -P with a default value.
+ifneq ($(CONFIG_NO_FIXED_XIP_ROM_SIZE),y)
+$(CONFIG_CBFS_PREFIX)/romstage-options += -P $(CONFIG_XIP_ROM_SIZE)
+endif
endif
cbfs-files-y += $(CONFIG_CBFS_PREFIX)/ramstage
diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig
index e80f02b..74d87e2 100644
--- a/src/cpu/x86/Kconfig
+++ b/src/cpu/x86/Kconfig
@@ -69,8 +69,19 @@ config TSC_SYNC_MFENCE
to execute an mfence instruction in order to synchronize
rdtsc. This is true for all modern Intel CPUs.
+config NO_FIXED_XIP_ROM_SIZE
+ bool
+ default n
+ help
+ The XIP_ROM_SIZE Kconfig variable is used globally on x86
+ with the assumption that all chipsets utilize this value.
+ For the chipsets which do not use the variable it can lead
+ to unnecessary alignment constraints in cbfs for romstage.
+ Therefore, allow those chipsets a path to not be burdened.
+
config XIP_ROM_SIZE
hex
+ depends on !NO_FIXED_XIP_ROM_SIZE
default ROM_SIZE if ROMCC
default 0x10000
Furquan Shaikh (furquan(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14623
-gerrit
commit e6ba54cccd1bea9851c2d29cf01782e1ae9d0478
Author: Furquan Shaikh <furquan(a)google.com>
Date: Wed May 4 23:25:16 2016 -0700
xip: Do not pass --xip for romstage and verstage if CAR supports code
execution
On modern x86 platform like apollolake, pre-RAM stages verstage and
romstage run within the cache-as-ram region. Thus, we do not need to
pass in the --xip parameter to cbfstool while adding these
stages. Introduce a new Kconfig variable XIP_STAGES which is default
true for only those X86 platforms that do not support
C_ENVIRONMENT_BOOTBLOCK.
Change-Id: I2848046472f40f09ce7fc230c258b0389851b2ea
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
Makefile.inc | 9 ++++++++-
src/Kconfig | 8 ++++++++
src/vendorcode/google/chromeos/vboot2/Makefile.inc | 10 ++++++++--
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index 94273df..ba5a63e 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -798,7 +798,14 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32)$(CONFIG_ARCH_ROMSTAGE_X86_64),y)
#
# Make sure that segment for .car.data is ignored while adding romstage.
$(CONFIG_CBFS_PREFIX)/romstage-align := 64
-$(CONFIG_CBFS_PREFIX)/romstage-options := --xip -S .car.data -P $(CONFIG_XIP_ROM_SIZE)
+$(CONFIG_CBFS_PREFIX)/romstage-options := -S ".car.data"
+
+# If CAR does not support execution of code, romstage on x86 is expected to be
+# xip.
+ifeq ($(CONFIG_XIP_STAGES),y)
+$(CONFIG_CBFS_PREFIX)/romstage-options += --xip -P $(CONFIG_XIP_ROM_SIZE)
+endif
+
endif
cbfs-files-y += $(CONFIG_CBFS_PREFIX)/ramstage
diff --git a/src/Kconfig b/src/Kconfig
index f9bd661..965fa98 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -199,6 +199,14 @@ config INCLUDE_CONFIG_FILE
config 0x8d740 raw 3324
(empty) 0x8e480 null 3610440
+config XIP_STAGES
+ bool "Identifies if a platform uses xip stages."
+ default y if (ARCH_X86 && !C_ENVIRONMENT_BOOTBLOCK)
+ default n
+ help
+ Pass in --xip parameter to cbfstool while adding stages that need to
+ execute in place.
+
config EARLY_CBMEM_INIT
def_bool !LATE_CBMEM_INIT
diff --git a/src/vendorcode/google/chromeos/vboot2/Makefile.inc b/src/vendorcode/google/chromeos/vboot2/Makefile.inc
index f934884..3d7dc79 100644
--- a/src/vendorcode/google/chromeos/vboot2/Makefile.inc
+++ b/src/vendorcode/google/chromeos/vboot2/Makefile.inc
@@ -76,9 +76,15 @@ cbfs-files-$(CONFIG_SEPARATE_VERSTAGE) += $(CONFIG_CBFS_PREFIX)/verstage
$(CONFIG_CBFS_PREFIX)/verstage-file := $(objcbfs)/verstage.elf
$(CONFIG_CBFS_PREFIX)/verstage-type := stage
$(CONFIG_CBFS_PREFIX)/verstage-compression := $(CBFS_PRERAM_COMPRESS_FLAG)
-# Verstage on x86 expected to be xip.
+
ifeq ($(CONFIG_ARCH_VERSTAGE_X86_32)$(CONFIG_ARCH_VERSTAGE_X86_64),y)
-$(CONFIG_CBFS_PREFIX)/verstage-options := -a 64 --xip -S ".car.data"
+$(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.
+ifeq ($(CONFIG_XIP_STAGES),y)
+$(CONFIG_CBFS_PREFIX)/verstage-options += --xip
+endif
endif